[PATCH] drm/radeon: Use mode h/vdisplay fields to hide out of bounds HW cursor

Alex Deucher alexdeucher at gmail.com
Wed Feb 15 02:47:50 UTC 2017


On Tue, Feb 14, 2017 at 9:30 PM, Michel Dänzer <michel at daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> 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: 6b16cf7785a4 ("drm/radeon: Hide the HW cursor while it's out of bounds")
> Cc: stable at vger.kernel.org
> Reported-by: Ashutosh Kumar <ashutosh.kumar at amd.com>
> Tested-by: Sonny Jiang <sonny.jiang at amd.com>
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  drivers/gpu/drm/radeon/radeon_cursor.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_cursor.c b/drivers/gpu/drm/radeon/radeon_cursor.c
> index fb16070b266e..4a4f9533c53b 100644
> --- a/drivers/gpu/drm/radeon/radeon_cursor.c
> +++ b/drivers/gpu/drm/radeon/radeon_cursor.c
> @@ -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;
> --
> 2.11.0
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list