提交 7abcf6b5 编写于 作者: A Andrey Grodzovsky 提交者: 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: NAndrey Grodzovsky <Andrey.Grodzovsky@amd.com>
Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 bf5cda33
......@@ -367,27 +367,39 @@ 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);
list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
aconnector = to_amdgpu_connector(connector);
if (aconnector->dc_link->type == dc_connection_mst_branch) {
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) {
DRM_ERROR("DM_MST: Failed to start MST\n");
((struct dc_link *)aconnector->dc_link)->type = dc_connection_single;
if (aconnector->dc_link->type == dc_connection_mst_branch) {
DRM_INFO("DM_MST: starting TM on aconnector: %p [id: %d]\n",
aconnector, aconnector->base.base.id);
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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册