xf86-video-ati: Branch 'r6xx-r7xx-support'

Alex Deucher agd5f at kemper.freedesktop.org
Thu Feb 5 14:34:05 PST 2009


 src/r600_exa.c |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

New commits:
commit bf74055f543e7f0664741620fb1fe827ebc12711
Author: Alex Deucher <alexdeucher at gmail.com>
Date:   Thu Feb 5 17:31:43 2009 -0500

    r6xx/r7xx EXA: fix corruption when doing sw access
    
    need to wait until the engine is idle.  Ideally we wait
    on a timestamp shadowed in memory, but polling the
    GRBM_STATUS reg will do for now.

diff --git a/src/r600_exa.c b/src/r600_exa.c
index 4d37804..cca82cb 100644
--- a/src/r600_exa.c
+++ b/src/r600_exa.c
@@ -2003,6 +2003,23 @@ static void R600DoneComposite(PixmapPtr pDst)
     R600CPFlushIndirect(pScrn, accel_state->ib);
 }
 
+/* really would be better to wait on a timestamp shadowed in memory,
+ * but this will do for now.
+ */
+static Bool
+R600WaitforIdlePoll(ScrnInfoPtr pScrn)
+{
+    RADEONInfoPtr info = RADEONPTR(pScrn);
+    unsigned char *RADEONMMIO = info->MMIO;
+    uint32_t i;
+
+    for (i = 0; i < 1000000; i++) {
+	if ((INREG(GRBM_STATUS) & GUI_ACTIVE_bit) == 0)
+	    return TRUE;
+    }
+    return FALSE;
+}
+
 static Bool
 R600UploadToScreen(PixmapPtr pDst, int x, int y, int w, int h,
 		   char *src, int src_pitch)
@@ -3398,6 +3415,8 @@ R600PrepareAccess(PixmapPtr pPix, int index)
     RADEONInfoPtr info = RADEONPTR(pScrn);
     unsigned char *RADEONMMIO = info->MMIO;
 
+    R600WaitforIdlePoll(pScrn);
+
     //flush HDP read/write caches
     OUTREG(HDP_MEM_COHERENCY_FLUSH_CNTL, 0x1);
 


More information about the xorg-commit mailing list