drm/amd/display: Fix NULL pointer on MST chained mode
authorJerry Zuo <Jerry.Zuo@amd.com>
Fri, 8 Sep 2017 20:40:34 +0000 (16:40 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Sat, 21 Oct 2017 20:41:15 +0000 (16:41 -0400)
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 <Jerry.Zuo@amd.com>
Reviewed-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index dfea04fed695bcd75989ffb579aa439b7d568623..f2724713ddd08da4f3f929214877db36060e0fb7 100644 (file)
@@ -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;