Commit 98bf2f52 authored by Julian Parkin's avatar Julian Parkin Committed by Alex Deucher

drm/amd/display: Separate hardware initialization from creation

[Why]
Separating the hardware initialization from the creation of the
dc structures gives greater flexibility to the dm to override
options for debugging.

[How]
Move the hardware initialization call to a new function,
dc_hardware_init. No functional change is intended.
Signed-off-by: default avatarJulian Parkin <julian.parkin@amd.com>
Reviewed-by: default avatarTony Cheng <Tony.Cheng@amd.com>
Acked-by: default avatarLeo Li <sunpeng.li@amd.com>
Acked-by: default avatarNicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 0594ffee
......@@ -713,6 +713,8 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
goto error;
}
dc_hardware_init(adev->dm.dc);
adev->dm.freesync_module = mod_freesync_create(adev->dm.dc);
if (!adev->dm.freesync_module) {
DRM_ERROR(
......
......@@ -790,9 +790,6 @@ struct dc *dc_create(const struct dc_init_data *init_params)
if (false == construct(dc, init_params))
goto construct_fail;
/*TODO: separate HW and SW initialization*/
dc->hwss.init_hw(dc);
full_pipe_count = dc->res_pool->pipe_count;
if (dc->res_pool->underlay_pipe_index != NO_UNDERLAY_PIPE)
full_pipe_count--;
......@@ -825,6 +822,11 @@ struct dc *dc_create(const struct dc_init_data *init_params)
return NULL;
}
void dc_hardware_init(struct dc *dc)
{
dc->hwss.init_hw(dc);
}
void dc_init_callbacks(struct dc *dc,
const struct dc_callback_init *init_params)
{
......
......@@ -556,6 +556,8 @@ struct dc_callback_init {
};
struct dc *dc_create(const struct dc_init_data *init_params);
void dc_hardware_init(struct dc *dc);
int dc_get_vmid_use_vector(struct dc *dc);
#ifdef CONFIG_DRM_AMD_DC_DCN2_0
void dc_setup_vm_context(struct dc *dc, struct dc_virtual_addr_space_config *va_config, int vmid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment