summaryrefslogtreecommitdiff
path: root/src/radeon_present.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2015-03-31 15:14:52 +0900
committerMichel Dänzer <michel@daenzer.net>2015-04-03 11:02:03 +0900
commit5921ba4ca705a0d919515626088f3948cc4848c1 (patch)
tree4120419f22db1503af61186ba2cc139169341687 /src/radeon_present.c
parent428e416e7cb04a1e0527da39cfebf70218879a77 (diff)
present: Don't flip between BOs with different tiling parameters
The kernel driver doesn't handle that correctly yet. Fixes or at least avoids issues with OpenGL fullscreen apps with DRI3 enabled and using PRIME or with (2D) tiling disabled. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89720 Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/radeon_present.c')
-rw-r--r--src/radeon_present.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/radeon_present.c b/src/radeon_present.c
index b4021107..52ca03eb 100644
--- a/src/radeon_present.c
+++ b/src/radeon_present.c
@@ -218,6 +218,21 @@ get_drmmode_crtc(ScrnInfoPtr scrn, RRCrtcPtr crtc)
return NULL;
}
+static uint32_t
+radeon_present_get_pixmap_tiling_flags(RADEONInfoPtr info, PixmapPtr pixmap)
+{
+ uint32_t tiling_flags = radeon_get_pixmap_tiling_flags(pixmap);
+
+ /* Micro tiling is always enabled with macro tiling on >= R600, so we
+ * can ignore the micro tiling bit in that case
+ */
+ if ((tiling_flags & RADEON_TILING_MACRO) &&
+ info->ChipFamily >= CHIP_FAMILY_R600)
+ tiling_flags &= ~RADEON_TILING_MICRO;
+
+ return tiling_flags;
+}
+
/*
* Test to see if page flipping is possible on the target crtc
*/
@@ -228,6 +243,7 @@ radeon_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap,
ScreenPtr screen = window->drawable.pScreen;
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
RADEONInfoPtr info = RADEONPTR(scrn);
+ PixmapPtr screen_pixmap;
if (!scrn->vtSema)
return FALSE;
@@ -235,6 +251,14 @@ radeon_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap,
if (!info->allowPageFlip)
return FALSE;
+ /* 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;
+
if (crtc) {
drmmode_crtc_private_ptr drmmode_crtc = get_drmmode_crtc(scrn, crtc);