[PATCH 2/2] present: Don't flip between BOs with different tiling parameters
Michel Dänzer
michel at daenzer.net
Wed Apr 1 18:36:48 PDT 2015
From: Michel Dänzer <michel.daenzer at amd.com>
The kernel driver doesn't handle that correctly yet.
Fixes or at least avoids issues with PRIME and DRI3 enabled.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89720
Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
src/radeon_present.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/src/radeon_present.c b/src/radeon_present.c
index 1cdc995..5b1d5ab 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);
--
2.1.4
More information about the xorg-driver-ati
mailing list