Commit 7abcf6b5 authored by Andrey Grodzovsky's avatar Andrey Grodzovsky Committed by Alex Deucher

drm/amd/display: [MST] Fix startup sequence v3.

Problem: MST topology discovery was started before fbdev
init causing kernel panic on boot.
Fix: Defer MST to late init hook, after fbdev strucutres
already initilized.

v2: Add explicit late_init hook function in DAL.
v3:
Change signature of detect_mst_link_for_all_connectors
from void* to drm_dev*
Signed-off-by: default avatarAndrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent bf5cda33
......@@ -367,10 +367,11 @@ static int dm_sw_fini(void *handle)
return 0;
}
static void detect_link_for_all_connectors(struct drm_device *dev)
static int detect_mst_link_for_all_connectors(struct drm_device *dev)
{
struct amdgpu_connector *aconnector;
struct drm_connector *connector;
int ret = 0;
drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
......@@ -380,14 +381,25 @@ static void detect_link_for_all_connectors(struct drm_device *dev)
DRM_INFO("DM_MST: starting TM on aconnector: %p [id: %d]\n",
aconnector, aconnector->base.base.id);
if (drm_dp_mst_topology_mgr_set_mst(&aconnector->mst_mgr, true) < 0) {
ret = drm_dp_mst_topology_mgr_set_mst(&aconnector->mst_mgr, true);
if (ret < 0) {
DRM_ERROR("DM_MST: Failed to start MST\n");
((struct dc_link *)aconnector->dc_link)->type = dc_connection_single;
return ret;
}
}
}
drm_modeset_unlock(&dev->mode_config.connection_mutex);
return ret;
}
static int dm_late_init(void *handle)
{
struct drm_device *dev = ((struct amdgpu_device *)handle)->ddev;
int r = detect_mst_link_for_all_connectors(dev);
return r;
}
static void s3_handle_mst(struct drm_device *dev, bool suspend)
......@@ -417,11 +429,8 @@ static int dm_hw_init(void *handle)
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
/* Create DAL display manager */
amdgpu_dm_init(adev);
amdgpu_dm_hpd_init(adev);
detect_link_for_all_connectors(adev->ddev);
return 0;
}
......@@ -680,7 +689,7 @@ int amdgpu_dm_display_resume(struct amdgpu_device *adev )
static const struct amd_ip_funcs amdgpu_dm_funcs = {
.name = "dm",
.early_init = dm_early_init,
.late_init = NULL,
.late_init = dm_late_init,
.sw_init = dm_sw_init,
.sw_fini = dm_sw_fini,
.hw_init = dm_hw_init,
......
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