summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Grodzovsky <Andrey.Grodzovsky@amd.com>2016-12-29 13:21:31 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-09-26 17:08:30 -0400
commit7abcf6b5043a94e850d8f38b625fd022492e8303 (patch)
tree02f888e6dc683dc3f0117e2700def6298062ec3b
parentbf5cda339d3609408624afcb6f533f4eabc7d142 (diff)
downloadlinux-stable-7abcf6b5043a94e850d8f38b625fd022492e8303.tar.gz
linux-stable-7abcf6b5043a94e850d8f38b625fd022492e8303.tar.bz2
linux-stable-7abcf6b5043a94e850d8f38b625fd022492e8303.zip
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: Andrey Grodzovsky <Andrey.Grodzovsky@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c35
1 files changed, 22 insertions, 13 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 2a7802c67eae..2af4ac0bffcb 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -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,