drm/amd/display: Handle get crtc position error
authorDavid Francis <David.Francis@amd.com>
Mon, 25 Mar 2019 13:44:04 +0000 (09:44 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 15 Apr 2019 05:20:03 +0000 (00:20 -0500)
[Why]
dc_stream_get_crtc_position can return false.
This was unhandled in delay_cursor_until_vupdate

[How]
If dc_stream_get_crtc_position returns false, something
is weird.  Don't delay.

Signed-off-by: David Francis <David.Francis@amd.com>
Reviewed-by: Sun peng Li <Sunpeng.Li@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc_stream.c

index f7a2939022347730877b272c87ed745999ed5c29..e10479d58c11ecae0c988044f4d1258690a62e4b 100644 (file)
@@ -211,7 +211,8 @@ static void delay_cursor_until_vupdate(struct pipe_ctx *pipe_ctx, struct dc *dc)
                        ASIC_REV_IS_RAVEN(stream->ctx->asic_id.hw_internal_rev)) {
 
                vupdate_line = get_vupdate_offset_from_vsync(pipe_ctx);
-               dc_stream_get_crtc_position(dc, &stream, 1, &vpos, &nvpos);
+               if (!dc_stream_get_crtc_position(dc, &stream, 1, &vpos, &nvpos))
+                       return;
 
                if (vpos >= vupdate_line)
                        return;