drm/amd/display: Fix a logic defect in cursor move
authorJerry Zuo <Jerry.Zuo@amd.com>
Thu, 5 Oct 2017 19:37:46 +0000 (15:37 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Sat, 21 Oct 2017 20:49:23 +0000 (16:49 -0400)
Regression caused by: Ib98354194d7

Need to check crtc->stream before updating cursor attributes
and position.

Signed-off-by: Jerry Zuo <Jerry.Zuo@amd.com>
Reviewed-by: Roman Li <Roman.Li@amd.com>
Acked-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 8653453566b8e00205ab19c567cf119e5aefc17c..17fb636648f4abd0079b3176f9fa542faf87f197 100644 (file)
@@ -3736,14 +3736,15 @@ static void handle_cursor_update(struct drm_plane *plane,
 
        attributes.pitch = attributes.width;
 
-       if (!dc_stream_set_cursor_attributes(crtc_state->stream,
-                                            &attributes))
-               DRM_ERROR("DC failed to set cursor attributes\n");
+       if (crtc_state->stream) {
+               if (!dc_stream_set_cursor_attributes(crtc_state->stream,
+                                                        &attributes))
+                       DRM_ERROR("DC failed to set cursor attributes\n");
 
-       if (crtc_state->stream)
                if (!dc_stream_set_cursor_position(crtc_state->stream,
                                                   &position))
                        DRM_ERROR("DC failed to set cursor position\n");
+       }
 }
 
 static void prepare_flip_isr(struct amdgpu_crtc *acrtc)