http://bugs.freedesktop.org/show_bug.cgi?id=10561





------- Comment #26 from [EMAIL PROTECTED]  2007-04-10 02:03 PST -------
The following patch fixed SecondLife for me by giving
up after a few retries.

The client uploads this 1024x1024 texture several times
per second (but not every frame, I think).  So to get
a decent frame rate  I actually lowered the retry count
to 1 and removed the usleep() in my copy of mesa.

Despite missing such a big texture, the game looks fine
except for a tiny line of garbled pixels over the button
bar.

Of course this isn't a suggested fix.  Maybe the retry thing
should go in for robustness, but the real bug is obviously
somewhere else.


diff --git a/src/mesa/drivers/dri/r300/r300_texmem.c
b/src/mesa/drivers/dri/r300/r300_texmem.c
index c527677..241ec1f 100644
--- a/src/mesa/drivers/dri/r300/r300_texmem.c
+++ b/src/mesa/drivers/dri/r300/r300_texmem.c
@@ -43,7 +43,6 @@ SOFTWARE.
 #include "colormac.h"
 #include "macros.h"
 #include "simple_list.h"
-#include "radeon_reg.h"                /* gets definition for usleep */
 #include "r300_context.h"
 #include "r300_state.h"
 #include "r300_cmdbuf.h"
@@ -464,18 +463,22 @@ static void uploadSubImage( r300ContextPtr rmesa,
r300TexObjPtr t,
        }

        LOCK_HARDWARE( &rmesa->radeon );
+       int retries = 3;
        do {
                ret = drmCommandWriteRead( rmesa->radeon.dri.fd,
DRM_RADEON_TEXTURE,
                                           &tex, sizeof(drm_radeon_texture_t)
);
                if (ret) {
-               if (RADEON_DEBUG & DEBUG_IOCTL)
-               fprintf(stderr, "DRM_RADEON_TEXTURE:  again!\n");
-               usleep(1);
+                       if (RADEON_DEBUG & DEBUG_IOCTL)
+                               fprintf(stderr, "DRM_RADEON_TEXTURE: 
again!\n");
+                       usleep(1);
                }
-       } while ( ret == -EAGAIN );
+       } while (ret == -EAGAIN && --retries);

        UNLOCK_HARDWARE( &rmesa->radeon );

+       if (ret == -EAGAIN)
+               return;
+
        if ( ret ) {
                fprintf( stderr, "DRM_RADEON_TEXTURE: return = %d\n", ret );
                fprintf( stderr, "   offset=0x%08x\n",


-- 
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to