drm/amd/display: Separate hardware initialization from creation
authorJulian Parkin <julian.parkin@amd.com>
Mon, 12 Aug 2019 22:47:50 +0000 (18:47 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 17 Sep 2019 13:06:54 +0000 (08:06 -0500)
[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>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/dc/core/dc.c
drivers/gpu/drm/amd/display/dc/dc.h

index b5ff7cf696c5128483fd08df5ef86eb0818c7f08..d73afa0835aad0e124eedb343cbebe8be746a641 100644 (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(
index d54f5b956809abb56202829eb1860417941fc277..a31c514235295fa96bcf9f26c7fbf19efe675a8a 100644 (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 @@ alloc_fail:
        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)
 {
index d21e8fc0179ea658dda75c15ed3b9688669a6cbc..30ef31a788f823ecd8a167eae9cd52903b0c9140 100644 (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);