diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/common/memops.h | 17 | ||||
-rw-r--r-- | src/mesa/drivers/dri/mga/server/mga_dri.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r128/server/r128_dri.c | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/server/radeon_dri.c | 5 |
4 files changed, 26 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/common/memops.h b/src/mesa/drivers/dri/common/memops.h new file mode 100644 index 0000000000..4952d788e8 --- /dev/null +++ b/src/mesa/drivers/dri/common/memops.h @@ -0,0 +1,17 @@ +#ifndef DRIMEMSETIO_H +#define DRIMEMSETIO_H +/* +* memset an area in I/O space +* We need to be careful about this on some archs +*/ +static __inline__ 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 +} +#endif diff --git a/src/mesa/drivers/dri/mga/server/mga_dri.c b/src/mesa/drivers/dri/mga/server/mga_dri.c index 958252b3e4..35e28fec4b 100644 --- a/src/mesa/drivers/dri/mga/server/mga_dri.c +++ b/src/mesa/drivers/dri/mga/server/mga_dri.c @@ -36,6 +36,7 @@ #include "driver.h" #include "drm.h" +#include "memops.h" #include "mga_reg.h" #include "mga.h" @@ -805,11 +806,11 @@ static int MGAScreenInit( struct DRIDriverContextRec *ctx, MGAPtr pMga ) * 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 ); diff --git a/src/mesa/drivers/dri/r128/server/r128_dri.c b/src/mesa/drivers/dri/r128/server/r128_dri.c index a2b717b0ea..4cc3c23098 100644 --- a/src/mesa/drivers/dri/r128/server/r128_dri.c +++ b/src/mesa/drivers/dri/r128/server/r128_dri.c @@ -47,6 +47,7 @@ #include "driver.h" #include "drm.h" +#include "memops.h" #include "r128.h" #include "r128_dri.h" @@ -826,11 +827,11 @@ static GLboolean R128DRIScreenInit(DRIDriverContext *ctx) * 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 ); diff --git a/src/mesa/drivers/dri/radeon/server/radeon_dri.c b/src/mesa/drivers/dri/radeon/server/radeon_dri.c index e497221643..78ae30beb2 100644 --- a/src/mesa/drivers/dri/radeon/server/radeon_dri.c +++ b/src/mesa/drivers/dri/radeon/server/radeon_dri.c @@ -16,6 +16,7 @@ #include "driver.h" #include "drm.h" +#include "memops.h" #include "radeon.h" #include "radeon_dri.h" @@ -981,11 +982,11 @@ static int RADEONScreenInit( DRIDriverContext *ctx, RADEONInfoPtr info ) * 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 ); |