Commit 7920af26 authored by Aurabindo Pillai's avatar Aurabindo Pillai Committed by Alex Deucher

drm/amd/display: Move some init routines to dm_sw_init()

Move creation of CGS device node and the DAL allocation list from
amdgpu_dm_init() to dm_sw_init() which runs before dmub's sw init hook.

This is required for communicating with the VBIOS DMUB image from the
VBIOS that was loaded for early pre-os boot.
Signed-off-by: default avatarAurabindo Pillai <aurabindo.pillai@amd.com>
Acked-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d0a6d850
...@@ -1662,13 +1662,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) ...@@ -1662,13 +1662,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
init_data.driver = adev; init_data.driver = adev;
adev->dm.cgs_device = amdgpu_cgs_create_device(adev); /* cgs_device was created in dm_sw_init() */
if (!adev->dm.cgs_device) {
DRM_ERROR("amdgpu: failed to create cgs device.\n");
goto error;
}
init_data.cgs_device = adev->dm.cgs_device; init_data.cgs_device = adev->dm.cgs_device;
init_data.dce_environment = DCE_ENV_PRODUCTION_DRV; init_data.dce_environment = DCE_ENV_PRODUCTION_DRV;
...@@ -1752,8 +1746,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) ...@@ -1752,8 +1746,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)
if (amdgpu_ip_version(adev, DCE_HWIP, 0) >= IP_VERSION(3, 0, 0)) if (amdgpu_ip_version(adev, DCE_HWIP, 0) >= IP_VERSION(3, 0, 0))
init_data.num_virtual_links = 1; init_data.num_virtual_links = 1;
INIT_LIST_HEAD(&adev->dm.da_list);
retrieve_dmi_info(&adev->dm); retrieve_dmi_info(&adev->dm);
/* Display Core create. */ /* Display Core create. */
...@@ -2321,6 +2313,16 @@ static int dm_sw_init(void *handle) ...@@ -2321,6 +2313,16 @@ static int dm_sw_init(void *handle)
struct amdgpu_device *adev = (struct amdgpu_device *)handle; struct amdgpu_device *adev = (struct amdgpu_device *)handle;
int r; int r;
adev->dm.cgs_device = amdgpu_cgs_create_device(adev);
if (!adev->dm.cgs_device) {
DRM_ERROR("amdgpu: failed to create cgs device.\n");
return -EINVAL;
}
/* Moved from dm init since we need to use allocations for storing bounding box data */
INIT_LIST_HEAD(&adev->dm.da_list);
r = dm_dmub_sw_init(adev); r = dm_dmub_sw_init(adev);
if (r) if (r)
return r; return r;
......
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