summaryrefslogtreecommitdiff
path: root/src/radeon.h
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-03-30 11:44:09 +0900
committerMichel Dänzer <michel@daenzer.net>2016-03-31 16:24:45 +0900
commit83734317e6bdaeebb4462a63f541e73a1d7c2f77 (patch)
tree25aed7328049bc345cf28e4b35903c4e4ff80c1f /src/radeon.h
parent0b3aac1de9db42bfca545fa331e4985836682ec7 (diff)
Update pixmap pitch in radeon_set_pixmap_bo
Stop second guessing it in drmmode_crtc_scanout_create. Fixes display corruption in some cases with TearFree enabled. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94751 Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/radeon.h')
-rw-r--r--src/radeon.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/radeon.h b/src/radeon.h
index 37d5fb60..011b66b6 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -656,6 +656,8 @@ uint32_t radeon_get_pixmap_tiling(PixmapPtr pPix);
static inline void radeon_set_pixmap_bo(PixmapPtr pPix, struct radeon_bo *bo)
{
+ ScreenPtr pScreen = pPix->drawable.pScreen;
+
#ifdef USE_GLAMOR
RADEONInfoPtr info = RADEONPTR(xf86ScreenToScrn(pPix->drawable.pScreen));
@@ -691,7 +693,9 @@ static inline void radeon_set_pixmap_bo(PixmapPtr pPix, struct radeon_bo *bo)
radeon_bo_ref(bo);
priv->bo = bo;
- radeon_bo_get_tiling(bo, &priv->tiling_flags, &pitch);
+ if (radeon_bo_get_tiling(bo, &priv->tiling_flags, &pitch) == 0 &&
+ pitch != pPix->devKind)
+ pScreen->ModifyPixmapHeader(pPix, -1, -1, -1, -1, pitch, NULL);
}
out:
radeon_set_pixmap_private(pPix, priv);
@@ -710,7 +714,9 @@ out:
radeon_bo_ref(bo);
driver_priv->bo = bo;
- radeon_bo_get_tiling(bo, &driver_priv->tiling_flags, &pitch);
+ if (radeon_bo_get_tiling(bo, &driver_priv->tiling_flags, &pitch) == 0 &&
+ pitch != pPix->devKind)
+ pScreen->ModifyPixmapHeader(pPix, -1, -1, -1, -1, pitch, NULL);
}
}
}