Skip to content

Commit

Permalink
drm/radeon: Use mode h/vdisplay fields to hide out of bounds HW cursor
Browse files Browse the repository at this point in the history
The crtc_h/vdisplay fields may not match the CRTC viewport dimensions
with special modes such as interlaced ones.

Fixes the HW cursor disappearing in the bottom half of the screen with
interlaced modes.

Fixes: 6b16cf7 ("drm/radeon: Hide the HW cursor while it's out of bounds")
Cc: stable@vger.kernel.org
Reported-by: Ashutosh Kumar <ashutosh.kumar@amd.com>
Tested-by: Sonny Jiang <sonny.jiang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Michel Dänzer authored and alexdeucher committed Feb 16, 2017
1 parent 697d3a2 commit d74c67d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gpu/drm/radeon/radeon_cursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ static int radeon_cursor_move_locked(struct drm_crtc *crtc, int x, int y)
}

if (x <= (crtc->x - w) || y <= (crtc->y - radeon_crtc->cursor_height) ||
x >= (crtc->x + crtc->mode.crtc_hdisplay) ||
y >= (crtc->y + crtc->mode.crtc_vdisplay))
x >= (crtc->x + crtc->mode.hdisplay) ||
y >= (crtc->y + crtc->mode.vdisplay))
goto out_of_bounds;

x += xorigin;
Expand Down

0 comments on commit d74c67d

Please sign in to comment.