summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2019-03-01 18:23:30 +0100
committerMichel Dänzer <michel.daenzer@amd.com>2019-03-01 18:23:30 +0100
commit705020b6247eaa062edc9c88e6ad52f8c5468051 (patch)
tree04203c3dca9fbdcb0f6c936e1407f41cb2278a7f
parent15697ee242c30b9ea6775624e8282e0171a113a7 (diff)
present: Check that flip and screen pixmap pitches match
If they don't, flipping will result in corrupted display. Test case: * Run Xorg at 1920x1080 with no window manager * glxgears -geometry 2048x1080 The Present extension code in xserver 1.21 will check for this. (Ported from amdgpu commit a636f42b496b0604ca00a144690ece61d1a88a27) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/radeon_present.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/radeon_present.c b/src/radeon_present.c
index 0b55117e..38a9a6b7 100644
--- a/src/radeon_present.c
+++ b/src/radeon_present.c
@@ -256,7 +256,7 @@ radeon_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap,
ScrnInfoPtr scrn = xf86_crtc->scrn;
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
RADEONInfoPtr info = RADEONPTR(scrn);
- PixmapPtr screen_pixmap;
+ PixmapPtr screen_pixmap = screen->GetScreenPixmap(screen);
int num_crtcs_on;
int i;
@@ -272,10 +272,14 @@ radeon_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap,
if (info->drmmode.dri2_flipping)
return FALSE;
+#if XORG_VERSION_CURRENT <= XORG_VERSION_NUMERIC(1, 20, 99, 1, 0)
+ if (pixmap->devKind != screen_pixmap->devKind)
+ return FALSE;
+#endif
+
/* The kernel driver doesn't handle flipping between BOs with different
* tiling parameters correctly yet
*/
- screen_pixmap = screen->GetScreenPixmap(screen);
if (radeon_present_get_pixmap_tiling_flags(info, pixmap) !=
radeon_present_get_pixmap_tiling_flags(info, screen_pixmap))
return FALSE;