summaryrefslogtreecommitdiff
path: root/src/evergreen_exa.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2011-02-01 19:20:00 -0500
committerAlex Deucher <alexdeucher@gmail.com>2011-02-01 19:20:00 -0500
commitbb16dd77321e5a64a3cb2d2ca9982117799ac1a8 (patch)
tree742f2abd972ecd85221af142317a9ea245f425b5 /src/evergreen_exa.c
parent9c124f781049ef11a8b19894a29b7f62975b3011 (diff)
kms/r6xx+: fix tiling and pageflipping harder
Thanks for Michel for final fix. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=33738 for r6xx+ asics. A similar approach for pre-r6xx asics is pending. Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Diffstat (limited to 'src/evergreen_exa.c')
-rw-r--r--src/evergreen_exa.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/src/evergreen_exa.c b/src/evergreen_exa.c
index 93fa2675..2eb698da 100644
--- a/src/evergreen_exa.c
+++ b/src/evergreen_exa.c
@@ -1534,19 +1534,28 @@ EVERGREENUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h,
Bool r;
int i;
struct r600_accel_object src_obj, dst_obj;
+ uint32_t tiling_flags = 0, pitch = 0;
if (bpp < 8)
return FALSE;
driver_priv = exaGetPixmapDriverPrivate(pDst);
+ if (!driver_priv || !driver_priv->bo)
+ return FALSE;
+
+ ret = radeon_bo_get_tiling(driver_priv->bo, &tiling_flags, &pitch);
+ if (ret)
+ ErrorF("radeon_bo_get_tiling failed\n");
/* If we know the BO won't be busy, don't bother with a scratch */
copy_dst = driver_priv->bo;
copy_pitch = pDst->devKind;
- if (!radeon_bo_is_referenced_by_cs(driver_priv->bo, info->cs)) {
- flush = FALSE;
- if (!radeon_bo_is_busy(driver_priv->bo, &dst_domain))
- goto copy;
+ if (!(tiling_flags & (RADEON_TILING_MACRO | RADEON_TILING_MICRO))) {
+ if (!radeon_bo_is_referenced_by_cs(driver_priv->bo, info->cs)) {
+ flush = FALSE;
+ if (!radeon_bo_is_busy(driver_priv->bo, &dst_domain))
+ goto copy;
+ }
}
size = scratch_pitch * h;
@@ -1646,6 +1655,8 @@ EVERGREENDownloadFromScreen(PixmapPtr pSrc, int x, int y, int w,
return FALSE;
driver_priv = exaGetPixmapDriverPrivate(pSrc);
+ if (!driver_priv || !driver_priv->bo)
+ return FALSE;
ret = radeon_bo_get_tiling(driver_priv->bo, &tiling_flags, &pitch);
if (ret)
@@ -1663,13 +1674,14 @@ EVERGREENDownloadFromScreen(PixmapPtr pSrc, int x, int y, int w,
else /* A write may be scheduled */
flush = TRUE;
}
- }
- if (!src_domain)
- radeon_bo_is_busy(driver_priv->bo, &src_domain);
+ if (!src_domain)
+ radeon_bo_is_busy(driver_priv->bo, &src_domain);
- if (src_domain & ~(uint32_t)RADEON_GEM_DOMAIN_VRAM)
- goto copy;
+ if (src_domain & ~(uint32_t)RADEON_GEM_DOMAIN_VRAM)
+ goto copy;
+
+ }
if (info->ChipFamily == CHIP_FAMILY_PALM)
goto copy;