From 6d91fb4fc701895473ff675f440a8eef655e80ca Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Tue, 12 Jul 2016 15:57:28 +0900 Subject: Don't enable micro-tiling for scanout buffers on pre-R600 The display engine didn't support it. Fixes display corruption with options "TearFree" and "ShadowPrimary" (and rotation or transforms with current xserver) on pre-R600. Reviewed-by: Alex Deucher --- src/drmmode_display.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 7d2ce1fb..b39651cc 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -543,10 +543,11 @@ drmmode_crtc_scanout_allocate(xf86CrtcPtr crtc, int width, int height) { ScrnInfoPtr pScrn = crtc->scrn; + RADEONInfoPtr info = RADEONPTR(pScrn); drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; drmmode_ptr drmmode = drmmode_crtc->drmmode; struct radeon_surface surface; - uint32_t tiling; + uint32_t tiling = RADEON_CREATE_PIXMAP_TILING_MACRO; int ret; int pitch; @@ -557,11 +558,11 @@ drmmode_crtc_scanout_allocate(xf86CrtcPtr crtc, drmmode_crtc_scanout_destroy(drmmode, scanout); } + if (info->ChipFamily >= CHIP_FAMILY_R600) + tiling |= RADEON_CREATE_PIXMAP_TILING_MICRO; scanout->bo = radeon_alloc_pixmap_bo(pScrn, width, height, pScrn->depth, - RADEON_CREATE_PIXMAP_TILING_MACRO | - RADEON_CREATE_PIXMAP_TILING_MICRO, - pScrn->bitsPerPixel, &pitch, - &surface, &tiling); + tiling, pScrn->bitsPerPixel, + &pitch, &surface, &tiling); if (scanout->bo == NULL) return NULL; -- cgit v1.2.3