Hi,

The attached patch fixes this bug :
https://bugs.freedesktop.org/show_bug.cgi?id=2419

You also have to add the file, memops.h, to src/mesa/drivers/dri/comon

I've added powerpc & ia64 for now. Let me now if other archs need this too.

Stephane

Index: mga/server/mga_dri.c
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/mga/server/mga_dri.c,v
retrieving revision 1.6
diff -u -r1.6 mga_dri.c
--- mga/server/mga_dri.c        5 Jul 2004 23:42:03 -0000       1.6
+++ mga/server/mga_dri.c        5 Mar 2005 04:13:02 -0000
@@ -36,6 +36,7 @@
 
 #include "driver.h"
 #include "drm.h"
+#include "memops.h"
 
 #include "mga_reg.h"
 #include "mga.h"
@@ -805,11 +806,11 @@
     * the clear ioctl to do this, but would need to setup hw state
     * first.
     */
-   memset((char *)ctx->FBAddress + pMga->frontOffset,
+   drimemsetio((char *)ctx->FBAddress + pMga->frontOffset,
          0,
          pMga->frontPitch * ctx->shared.virtualHeight );
 
-   memset((char *)ctx->FBAddress + pMga->backOffset,
+   drimemsetio((char *)ctx->FBAddress + pMga->backOffset,
          0,
          pMga->backPitch * ctx->shared.virtualHeight );
 
Index: r128/server/r128_dri.c
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/r128/server/r128_dri.c,v
retrieving revision 1.12
diff -u -r1.12 r128_dri.c
--- r128/server/r128_dri.c      14 Dec 2004 09:11:53 -0000      1.12
+++ r128/server/r128_dri.c      5 Mar 2005 04:13:02 -0000
@@ -47,6 +47,7 @@
 
 #include "driver.h"
 #include "drm.h"
+#include "memops.h"
 
 #include "r128.h"
 #include "r128_dri.h"
@@ -826,11 +827,11 @@
     * the clear ioctl to do this, but would need to setup hw state
     * first.
     */
-   memset((char *)ctx->FBAddress + info->frontOffset,
+   drimemsetio((char *)ctx->FBAddress + info->frontOffset,
          0,
          info->frontPitch * ctx->cpp * ctx->shared.virtualHeight );
 
-   memset((char *)ctx->FBAddress + info->backOffset,
+   drimemsetio((char *)ctx->FBAddress + info->backOffset,
          0,
          info->backPitch * ctx->cpp * ctx->shared.virtualHeight );
     
Index: radeon/server/radeon_dri.c
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/drivers/dri/radeon/server/radeon_dri.c,v
retrieving revision 1.15
diff -u -r1.15 radeon_dri.c
--- radeon/server/radeon_dri.c  9 Dec 2004 00:18:59 -0000       1.15
+++ radeon/server/radeon_dri.c  5 Mar 2005 04:13:08 -0000
@@ -16,6 +16,7 @@
 
 #include "driver.h"
 #include "drm.h"
+#include "memops.h"
 
 #include "radeon.h"
 #include "radeon_dri.h"
@@ -981,11 +982,11 @@
     * the clear ioctl to do this, but would need to setup hw state
     * first.
     */
-   memset((char *)ctx->FBAddress + info->frontOffset,
+   drimemsetio((char *)ctx->FBAddress + info->frontOffset,
          0,
          info->frontPitch * ctx->cpp * ctx->shared.virtualHeight );
 
-   memset((char *)ctx->FBAddress + info->backOffset,
+   drimemsetio((char *)ctx->FBAddress + info->backOffset,
          0,
          info->backPitch * ctx->cpp * ctx->shared.virtualHeight );
 

/* 
 * memset an area in I/O space
 * We need to be careful about this on some archs
 */
static void drimemsetio(void* address, int c, int size)
{
#if defined(__powerpc__) || defined(__ia64__)
      int i;
      for(i=0;i<size;i++)
         *((char *)address + i)=c;
#else
      memset(address,c,size);
#endif
}



Reply via email to