aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Zuo <[email protected]>2017-09-08 16:40:34 -0400
committerAlex Deucher <[email protected]>2017-10-21 16:41:15 -0400
commitfc17235fe65b0179969e0793a086cba93afcc078 (patch)
treefc3db2188b84cb7a3aa13ff9788c97a3aa4299aa
parentf4ac176e62fdc74e52ee58461fb7c8912322fc1c (diff)
drm/amd/display: Fix NULL pointer on MST chained mode
Prevent NULL pointer on new_stream being added to ctx when added MST connectors cannot be found in existing crtc_state in the chained mode Signed-off-by: Jerry Zuo <[email protected]> Reviewed-by: Harry Wentland <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c7
1 files changed, 7 insertions, 0 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 dfea04fed695..f2724713ddd0 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -4462,6 +4462,13 @@ static int dm_update_crtcs_state(struct dc *dc,
*lock_and_validation_needed = true;
} else {/* Add stream for any updated/enabled CRTC */
+ /*
+ * Quick fix to prevent NULL pointer on new_stream when
+ * added MST connectors not found in existing crtc_state in the chained mode
+ * TODO: need to dig out the root cause of that
+ */
+ if (!aconnector || (!aconnector->dc_sink && aconnector->mst_port))
+ continue;
if (modereset_required(new_crtc_state))
goto next_crtc;