]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
drm/radeon: Use mode h/vdisplay fields to hide out of bounds HW cursor
authorMichel Dänzer <michel.daenzer@amd.com>
Wed, 15 Feb 2017 02:28:45 +0000 (11:28 +0900)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 16 Feb 2017 16:03:03 +0000 (11:03 -0500)
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@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>
drivers/gpu/drm/radeon/radeon_cursor.c

index fb16070b266e3f2de51243ba478f57d8fd956420..4a4f9533c53b888ab10fb0f4839fc4a5df852bd8 100644 (file)
@@ -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;