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: Julian Parkin <julian.parkin@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Leo Li <sunpeng.li@amd.com>
Acked-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Julian Parkin 2019-08-12 18:47:50 -04:00 committed by Alex Deucher
parent 0594ffee90
commit 98bf2f5262
3 changed files with 9 additions and 3 deletions

View File

@ -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(

View File

@ -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)
{

View File

@ -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);