From: Dave Airlie Date: Sat, 5 Mar 2005 06:38:59 +0000 (+0000) Subject: Fixing memset on ia64 & other archs X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=07561c6b32d55128222283a7450c65c95d21df59;p=mesa.git Fixing memset on ia64 & other archs From: Stephane Marchesin --- diff --git a/src/mesa/drivers/dri/common/memops.h b/src/mesa/drivers/dri/common/memops.h new file mode 100644 index 00000000000..4952d788e81 --- /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;iFBAddress + 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 a2b717b0ea3..4cc3c23098f 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 e4972216437..78ae30beb22 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 );