xf86-video-ati: Branch 'master'

Alex Deucher agd5f at kemper.freedesktop.org
Tue Feb 1 16:22:22 PST 2011


 src/evergreen_exa.c |   30 +++++++++++++++++++++---------
 src/r600_exa.c      |   29 ++++++++++++++++++++---------
 2 files changed, 41 insertions(+), 18 deletions(-)

New commits:
commit bb16dd77321e5a64a3cb2d2ca9982117799ac1a8
Author: Alex Deucher <alexdeucher at gmail.com>
Date:   Tue Feb 1 19:20:00 2011 -0500

    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 at gmail.com>

diff --git a/src/evergreen_exa.c b/src/evergreen_exa.c
index 93fa267..2eb698d 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;
diff --git a/src/r600_exa.c b/src/r600_exa.c
index f652ab6..5fc41ad 100644
--- a/src/r600_exa.c
+++ b/src/r600_exa.c
@@ -1785,19 +1785,28 @@ R600UploadToScreenCS(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;
@@ -1897,6 +1906,8 @@ R600DownloadFromScreenCS(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)
@@ -1914,13 +1925,13 @@ R600DownloadFromScreenCS(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;
+    }
 
     size = scratch_pitch * h;
     scratch = radeon_bo_open(info->bufmgr, 0, size, 0, RADEON_GEM_DOMAIN_GTT, 0);


More information about the xorg-commit mailing list