xf86-video-ati: Branch 'master'

Michel Daenzer daenzer at kemper.freedesktop.org
Sat Jun 24 17:03:18 EEST 2006


 src/radeon_exa_funcs.c |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

New commits:
diff-tree c5d8c8db3e75976687bfb364f0a7b235c7ae8793 (from f25ba3dc0e7850f0b1b78f54c0e7211bf2e81b3a)
Author: Michel Dänzer <michel at tungstengraphics.com>
Date:   Sat Jun 24 16:01:19 2006 +0200

    Bug #7274: Fix corruption with 'small' accelerated DownloadFromScreen transfers.

diff --git a/src/radeon_exa_funcs.c b/src/radeon_exa_funcs.c
index bc22147..a86e148 100644
--- a/src/radeon_exa_funcs.c
+++ b/src/radeon_exa_funcs.c
@@ -51,6 +51,7 @@
 #endif
 #endif
 
+#include <errno.h>
 #include <string.h>
 
 #include "radeon.h"
@@ -379,7 +380,7 @@ FUNC_NAME(RADEONDownloadFromScreen)(Pixm
 #endif
 
 	while (h) {
-	    int oldhpass = hpass;
+	    int oldhpass = hpass, i = 0;
 
 	    src = (CARD8*)scratch->address + scratch_off;
 
@@ -394,8 +395,19 @@ FUNC_NAME(RADEONDownloadFromScreen)(Pixm
 				x, y, 0, 0, w, hpass);
 	    }
 
-	    /* Wait for previous blit to complete */
-	    RADEONWaitForIdleMMIO(pScrn);
+	    /*
+	     * Wait for previous blit to complete.
+	     *
+	     * XXX: Doing here essentially the same things this ioctl does in
+	     * the DRM results in corruption with 'small' transfers, apparently
+	     * because the data doesn't actually land in system RAM before the
+	     * memcpy. I suspect the ioctl helps mostly due to its latency; what
+	     * we'd really need is a way to reliably wait for the host interface
+	     * to be done with pushing the data to the host.
+	     */
+	    while ((drmCommandNone(info->drmFD, DRM_RADEON_CP_IDLE) == -EBUSY)
+		   && (i++ < RADEON_TIMEOUT))
+		;
 
 	    /* Kick next blit */
 	    if (hpass)



More information about the xorg-commit mailing list