[PATCH:xf86-video-xgi] Reduce custom type usage

Matthieu Herrb matthieu at herrb.eu
Wed Aug 12 01:17:05 PDT 2015


On Tue, Aug 11, 2015 at 10:13:38PM -0400, Connor Behan wrote:
> Bring this more in line with the maintained drivers.

Thanks for doing it. I don't have hardware to test it, but
> 
> Signed-off-by: Connor Behan <connor.behan at gmail.com>

Reviewed-by: Matthieu Herrb <matthieu at herrb.eu>
> ---
>  src/init.c        |   2 +-
>  src/vb_i2c.h      |  18 +--
>  src/vgatypes.h    |  48 +++----
>  src/xgi.h         |  18 +--
>  src/xgi_accel.c   |  30 ++---
>  src/xgi_accel.h   | 368 +++++++++++++++++++++++++++---------------------------
>  src/xgi_cursor.c  |   4 +-
>  src/xgi_cursor.h  |   8 +-
>  src/xgi_dac.c     |   8 +-
>  src/xgi_dga.c     |   2 +-
>  src/xgi_dri.c     |   8 +-
>  src/xgi_dri.h     |   2 +-
>  src/xgi_driver.h  |   8 +-
>  src/xgi_setup.c   |   2 +-
>  src/xgi_video.c   |  26 ++--
>  src/xgi_video.h   |   8 +-
>  src/xgi_videohw.c |  72 +++++------
>  src/xgi_videohw.h |  44 +++----
>  18 files changed, 335 insertions(+), 341 deletions(-)
> 
> diff --git a/src/init.c b/src/init.c
> index 47b8ea0..1e36296 100755
> --- a/src/init.c
> +++ b/src/init.c
> @@ -292,7 +292,7 @@ XGI_New_DisplayOff(VB_DEVICE_INFO *XGI_Pr)
>  static void
>  XGIInitPCIetc(VB_DEVICE_INFO *XGI_Pr, PXGI_HW_DEVICE_INFO HwInfo)
>  {
> -   CARD8  bForce=0x00; /* Jong 01/07/2008; force to disable 2D */
> +   uint8_t  bForce=0x00; /* Jong 01/07/2008; force to disable 2D */
>  
>     switch(HwInfo->jChipType) {
>     case XG40:
> diff --git a/src/vb_i2c.h b/src/vb_i2c.h
> index 1284e9d..4510c7d 100755
> --- a/src/vb_i2c.h
> +++ b/src/vb_i2c.h
> @@ -5,12 +5,6 @@
>  /* Jong at 08052009 */
>  // #include <linux/delay.h> /* udelay */
>  #endif 
> -#ifndef u32
> -#define u32 unsigned long
> -#endif
> -#ifndef u8
> -#define u8 uint8_t
> -#endif
>  
>  /* Jong at 08052009 */
>  //#ifndef DelayUS
> @@ -95,9 +89,9 @@
>  
>  typedef struct _I2CControl {
>          ULONG Command;          /*  I2C_COMMAND_* */
> -        u32   dwCookie;         /* Context identifier returned on Open */
> -        u8    Data;             /* Data to write, or returned UCHAR */
> -        u8    Reserved[3];      /* Filler */
> +        uint32_t   dwCookie;         /* Context identifier returned on Open */
> +        uint8_t    Data;             /* Data to write, or returned UCHAR */
> +        uint8_t    Reserved[3];      /* Filler */
>          ULONG Flags;            /*  I2C_FLAGS_* */
>          ULONG Status;           /* I2C_STATUS_*  */
>          ULONG ClockRate;        /* Bus clockrate in Hz. */
> @@ -105,9 +99,9 @@ typedef struct _I2CControl {
>  
>  typedef struct _I2CContext
>  {
> -    u32 dwI2CPortAcquired;            /* port busy between start and stop */
> -    u32 dwCookie;                  /* cookie image for this instance */
> -    u32 dwCurCookie;                  /* cookie of current I2C channel owner */
> +    uint32_t dwI2CPortAcquired;            /* port busy between start and stop */
> +    uint32_t dwCookie;                     /* cookie image for this instance */
> +    uint32_t dwCurCookie;                  /* cookie of current I2C channel owner */
>  } I2C_CONTEXT, *PI2C_CONTEXT;
>  
>  
> diff --git a/src/vgatypes.h b/src/vgatypes.h
> index d0a65bf..e7c07a2 100755
> --- a/src/vgatypes.h
> +++ b/src/vgatypes.h
> @@ -319,44 +319,44 @@ struct _XGI_HW_DEVICE_INFO
>  typedef struct _XGIFB_INFO xgifb_info, *pxgifb_info;
>  
>  struct _XGIFB_INFO {
> -	CARD32 	xgifb_id;         	/* for identifying xgifb */
> +	uint32_t 	xgifb_id;         	/* for identifying xgifb */
>  #ifndef XGIFB_ID
>  #define XGIFB_ID	  0x53495346    /* Identify myself with 'XGIF' */
>  #endif
> - 	CARD32 	chip_id;		/* PCI ID of detected chip */
> -	CARD32	memory;			/* video memory in KB which xgifb manages */
> -	CARD32	heapstart;             	/* heap start (= xgifb "mem" argument) in KB */
> -	CARD8 	fbvidmode;		/* current xgifb mode */
> +	uint32_t 	chip_id;		/* PCI ID of detected chip */
> +	uint32_t	memory;			/* video memory in KB which xgifb manages */
> +	uint32_t	heapstart;             	/* heap start (= xgifb "mem" argument) in KB */
> +	uint8_t 	fbvidmode;		/* current xgifb mode */
>  
> -	CARD8 	xgifb_version;
> -	CARD8	xgifb_revision;
> -	CARD8 	xgifb_patchlevel;
> +	uint8_t 	xgifb_version;
> +	uint8_t	xgifb_revision;
> +	uint8_t 	xgifb_patchlevel;
>  
> -	CARD8 	xgifb_caps;		/* xgifb's capabilities */
> +	uint8_t 	xgifb_caps;		/* xgifb's capabilities */
>  
> -	CARD32 	xgifb_tqlen;		/* turbo queue length (in KB) */
> +	uint32_t 	xgifb_tqlen;		/* turbo queue length (in KB) */
>  
> -	CARD32 	xgifb_pcibus;      	/* The card's PCI ID */
> -	CARD32 	xgifb_pcislot;
> -	CARD32 	xgifb_pcifunc;
> +	uint32_t 	xgifb_pcibus;      	/* The card's PCI ID */
> +	uint32_t 	xgifb_pcislot;
> +	uint32_t 	xgifb_pcifunc;
>  
> -	CARD8 	xgifb_lcdpdc;
> +	uint8_t 	xgifb_lcdpdc;
>  
> -	CARD8	xgifb_lcda;
> +	uint8_t	xgifb_lcda;
>  
> -	CARD32	xgifb_vbflags;
> -	CARD32	xgifb_currentvbflags;
> +	uint32_t	xgifb_vbflags;
> +	uint32_t	xgifb_currentvbflags;
>  
> -	CARD32 	xgifb_scalelcd;
> -	CARD32 	xgifb_specialtiming;
> +	uint32_t 	xgifb_scalelcd;
> +	uint32_t 	xgifb_specialtiming;
>  
> -	CARD8 	xgifb_haveemi;
> -	CARD8 	xgifb_emi30,xgifb_emi31,xgifb_emi32,xgifb_emi33;
> -	CARD8 	xgifb_haveemilcd;
> +	uint8_t 	xgifb_haveemi;
> +	uint8_t 	xgifb_emi30,xgifb_emi31,xgifb_emi32,xgifb_emi33;
> +	uint8_t 	xgifb_haveemilcd;
>  
> -	CARD8 	xgifb_lcdpdca;
> +	uint8_t 	xgifb_lcdpdca;
>  
> -	CARD8 reserved[212]; 		/* for future use */
> +	uint8_t reserved[212]; 		/* for future use */
>  };
>  #endif
>  
> diff --git a/src/xgi.h b/src/xgi.h
> index 4a0a431..870c180 100755
> --- a/src/xgi.h
> +++ b/src/xgi.h
> @@ -618,7 +618,7 @@ typedef struct {
>      unsigned long       FbAddress;      /* VRAM physical address (in DHM: for each Fb!) */
>      unsigned long       realFbAddress;  /* For DHM/PCI mem mapping: store global FBAddress */
>      unsigned char *     FbBase;         /* VRAM virtual linear address */
> -    CARD32              IOAddress;      /* MMIO physical address */
> +    uint32_t              IOAddress;    /* MMIO physical address */
>      unsigned char *     IOBase;         /* MMIO linear address */
>      unsigned long           IODBase;        /* Base of PIO memory area */
>  #ifdef __alpha__
> @@ -659,7 +659,7 @@ typedef struct {
>      int                 CommandReg;
>  
>      Bool                HWCursor;
> -    CARD16		        CursorSize;  		/* Size of HWCursor area (bytes) */
> +    uint16_t		CursorSize;  		/* Size of HWCursor area (bytes) */
>      xf86CursorInfoPtr   CursorInfoPtr;
>      unsigned            CursorOffset;
>  
> @@ -677,10 +677,10 @@ typedef struct {
>  #ifdef XGI_USE_EXA /* Jong 01/13/2009; support EXA */
>      ExaDriverPtr		EXADriverPtr;
>      int			fillPitch, fillBpp;
> -    CARD32		fillDstBase;
> +    uint32_t		fillDstBase;
>      int			copyBpp;
>      int			copySPitch, copyDPitch;
> -    CARD32		copySrcBase, copyDstBase;
> +    uint32_t		copySrcBase, copyDstBase;
>      int			copyXdir, copyYdir;
>      ExaOffscreenArea*	exa_scratch;
>      unsigned int 		exa_scratch_next;
> @@ -793,8 +793,8 @@ typedef struct {
>      unsigned char 	LCDon;
>      Bool 		Blank;
>      int 		CRT1off;		/* 1=CRT1 off, 0=CRT1 on */
> -    CARD16 		LCDheight;		/* Vertical resolution of LCD panel */
> -    CARD16 		LCDwidth;		/* Horizontal resolution of LCD panel */
> +    uint16_t 		LCDheight;		/* Vertical resolution of LCD panel */
> +    uint16_t 		LCDwidth;		/* Horizontal resolution of LCD panel */
>      vbeInfoPtr 		pVbe;			/* For VESA mode switching */
>      UCHAR ScratchSet[16];
>      MonitorRangeRec CRT1Range,CRT2Range;
> @@ -842,10 +842,10 @@ typedef struct {
>      BOOLEAN		XvDefDisableGfx, XvDefDisableGfxLR;
>      BOOLEAN		XvUseMemcpy;
>      int			XvGammaRed, XvGammaGreen, XvGammaBlue;
> -    CARD8		XvGammaRampRed[256], XvGammaRampGreen[256], XvGammaRampBlue[256];
> +    uint8_t		XvGammaRampRed[256], XvGammaRampGreen[256], XvGammaRampBlue[256];
>      BOOLEAN		disablecolorkeycurrent;
> -    CARD32		colorKey;
> -    CARD32		MiscFlags;
> +    uint32_t		colorKey;
> +    uint32_t		MiscFlags;
>  
>  #ifdef XGI_USE_XAA
>      FBLinearPtr		AccelLinearScratch;
> diff --git a/src/xgi_accel.c b/src/xgi_accel.c
> index 736368f..0e7760b 100755
> --- a/src/xgi_accel.c
> +++ b/src/xgi_accel.c
> @@ -183,7 +183,7 @@ extern int FbDevExist;
>  	{ \
>  		/* Jong - Good method for performance evaluation */ \
>  		/*-----------------------------------------------*/ \
> -		CARD8   CR37=0x00; /* Jong 09/11/2008; [7] for disable/enable NULL function dynamically */ \
> +		uint8_t   CR37=0x00; /* Jong 09/11/2008; [7] for disable/enable NULL function dynamically */ \
>  		/* Jong 09/12/2008; disable NULL function of HW acceleration dynamically by CR37[7] */ \
>  		/* After test, this extra IO doesn't have significant loading */ \
>  		CR37=XGI_GetReg(pXGI->XGI_Pr->P3d4, 0x37); \
> @@ -201,7 +201,7 @@ extern int FbDevExist;
>  #if X_BYTE_ORDER == X_BIG_ENDIAN
>  #define BE_SWAP32(x) lswapl(x)
>  #else 
> -static CARD32 BE_SWAP32 (CARD32 val)
> +static uint32_t BE_SWAP32 (uint32_t val)
>  {
>  	PACCELDEBUG(ErrorF("X_LITTLE_ENDIAN...\n"));
>  	return val;
> @@ -558,13 +558,13 @@ Volari_DisableDualPipe(ScrnInfoPtr pScrn)
>  
>      ulTemp = Volari_GetSwWP() ;
>  
> -    *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = (CARD32)BE_SWAP32(GR_SKPC_HEADER + 0x8240) ;
> -    *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) = (CARD32)BE_SWAP32(ulValue) ;
> +    *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = (uint32_t)BE_SWAP32(GR_SKPC_HEADER + 0x8240) ;
> +    *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) = (uint32_t)BE_SWAP32(ulValue) ;
>  
>      if( pXGI->Chipset == PCI_CHIP_XGIXG40 )
>      {
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = (CARD32)BE_SWAP32(GR_NIL_CMD) ;
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = (CARD32)BE_SWAP32(GR_NIL_CMD) ;
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = (uint32_t)BE_SWAP32(GR_NIL_CMD) ;
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = (uint32_t)BE_SWAP32(GR_NIL_CMD) ;
>  
>          ulTemp += 0x10 ;
>      }
> @@ -1231,7 +1231,7 @@ XGIPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg)
>  {
>  	ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
>  	XGIPtr pXGI = XGIPTR(pScrn);
> -	CARD16 pitch;
> +	uint16_t pitch;
>  
>  	PACCELDEBUG(ErrorF("XGIPrepareSolid...\n"));
>  	/* DisableDrawingFunctionDynamically(TRUE); */
> @@ -1265,7 +1265,7 @@ XGIPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg)
>  	Volari_SetupROP(xgiG2_PatALUConv[alu])
>  	Volari_SetupCMDFlag(PATFG | BITBLT)
>  
> -	pXGI->fillDstBase = (CARD32)exaGetPixmapOffset(pPixmap); /* FBOFFSET is not used for Z-series */
> +	pXGI->fillDstBase = (uint32_t)exaGetPixmapOffset(pPixmap); /* FBOFFSET is not used for Z-series */
>  	PACCELDEBUG(ErrorF("pXGI->fillDstBase=0x%x...\n", pXGI->fillDstBase));
>  
>  	return TRUE;
> @@ -1276,7 +1276,7 @@ XGISolid(PixmapPtr pPixmap, int x1, int y1, int x2, int y2)
>  {
>  	ScrnInfoPtr pScrn = xf86ScreenToScrn(pPixmap->drawable.pScreen);
>  	XGIPtr pXGI = XGIPTR(pScrn);
> -	CARD32  Command;
> +	uint32_t  Command;
>  
>  	PACCELDEBUG(ErrorF("XGISolid...\n"));
>  	PACCELDEBUG(ErrorF("pXGI->CommandReg = 0x%x...\n", pXGI->CommandReg));
> @@ -1300,8 +1300,8 @@ XGIPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir, int ydir,
>  {
>  	ScrnInfoPtr pScrn = xf86ScreenToScrn(pDstPixmap->drawable.pScreen);
>  	XGIPtr pXGI = XGIPTR(pScrn);
> -	CARD32 srcbase, dstbase;
> -	CARD16 srcpitch, dstpitch;
> +	uint32_t srcbase, dstbase;
> +	uint16_t srcpitch, dstpitch;
>  
>  	PACCELDEBUG(ErrorF("XGIPrepareCopy()...\n"));
>  	PACCELDEBUG(ErrorF("pSrcPixmap->devPrivate.ptr=0x%x, pDstPixmap->devPrivate.ptr=0x%x...\n", 
> @@ -1330,9 +1330,9 @@ XGIPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir, int ydir,
>  	if((dstpitch = exaGetPixmapPitch(pDstPixmap)) & 3)
>  	   return FALSE;
>  
> -	srcbase = (CARD32)exaGetPixmapOffset(pSrcPixmap); /* FBOFFSET is not used for Z-series */;
> +	srcbase = (uint32_t)exaGetPixmapOffset(pSrcPixmap); /* FBOFFSET is not used for Z-series */;
>  
> -	dstbase = (CARD32)exaGetPixmapOffset(pDstPixmap); /* FBOFFSET is not used for Z-series */
> +	dstbase = (uint32_t)exaGetPixmapOffset(pDstPixmap); /* FBOFFSET is not used for Z-series */
>  
>  	/* TODO: Will there eventually be overlapping blits?
>  	 * If so, good night. Then we must calculate new base addresses
> @@ -1360,7 +1360,7 @@ XGICopy(PixmapPtr pDstPixmap, int srcX, int srcY, int dstX, int dstY, int width,
>  {
>  	ScrnInfoPtr pScrn = xf86ScreenToScrn(pDstPixmap->drawable.pScreen);
>  	XGIPtr pXGI = XGIPTR(pScrn);
> -	CARD32  Command;
> +	uint32_t  Command;
>  
>  	PACCELDEBUG(ErrorF("XGICopy()...\n"));
>  	PACCELDEBUG(ErrorF("srcX=%d, srcY=%d, dstX=%d, dstY=%d...\n", srcX, srcY, dstX, dstY));
> @@ -1621,7 +1621,7 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn)
>  	for( i = 0 ; i < SwWP ; i+=0x04 )
>  	{
>  		ErrorF("[%04X]: %08lX\n",i,
> -		    (unsigned long)*(CARD32 *)(pXGI->cmdQueueBase+i));
> +		    (unsigned long)*(uint32_t *)(pXGI->cmdQueueBase+i));
>  	}
>  }
>  
> diff --git a/src/xgi_accel.h b/src/xgi_accel.h
> index cd2c6e3..c475514 100755
> --- a/src/xgi_accel.h
> +++ b/src/xgi_accel.h
> @@ -239,16 +239,16 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn);
>          \
>          ulTemp = Volari_GetSwWP() ;\
>          \
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = \
> -            (CARD32)BE_SWAP32(GR_SKPC_HEADER + 0x823C) ;\
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) =\
> -            (CARD32)BE_SWAP32(pXGI->CommandReg) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = \
> +            (uint32_t)BE_SWAP32(GR_SKPC_HEADER + 0x823C) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) =\
> +            (uint32_t)BE_SWAP32(pXGI->CommandReg) ;\
>          if( pXGI->Chipset == PCI_CHIP_XGIXG40 ) \
>          { \
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
>              ulTemp += 0x10 ;\
>          } \
>          else if(( pXGI->Chipset == PCI_CHIP_XGIXG20 )||( pXGI->Chipset == PCI_CHIP_XGIXG21 )||( pXGI->Chipset == PCI_CHIP_XGIXG27 )) \
> @@ -274,16 +274,16 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn);
>  			g_srcbase = base; \
>          ulTemp = Volari_GetSwWP() ;\
>          \
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = \
> -            (CARD32)BE_SWAP32(GR_SKPC_HEADER + 0x8200) ;\
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) =\
> -            (CARD32)BE_SWAP32(base) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = \
> +            (uint32_t)BE_SWAP32(GR_SKPC_HEADER + 0x8200) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) =\
> +            (uint32_t)BE_SWAP32(base) ;\
>          if( pXGI->Chipset == PCI_CHIP_XGIXG40 ) \
>          { \
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
>              ulTemp += 0x10 ;\
>          } \
>          else if(( pXGI->Chipset == PCI_CHIP_XGIXG20 )||( pXGI->Chipset == PCI_CHIP_XGIXG21 )||( pXGI->Chipset == PCI_CHIP_XGIXG27 )) \
> @@ -311,16 +311,16 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn);
>          \
>          ulTemp = Volari_GetSwWP() ;\
>          \
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = \
> -            (CARD32)BE_SWAP32(GR_SKPC_HEADER + 0x8204) ;\
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) =\
> -            (CARD32)BE_SWAP32(pitch) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = \
> +            (uint32_t)BE_SWAP32(GR_SKPC_HEADER + 0x8204) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) =\
> +            (uint32_t)BE_SWAP32(pitch) ;\
>          if( pXGI->Chipset == PCI_CHIP_XGIXG40 ) \
>          { \
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
>              ulTemp += 0x10 ;\
>          } \
>          else if(( pXGI->Chipset == PCI_CHIP_XGIXG20 )||( pXGI->Chipset == PCI_CHIP_XGIXG21 )||( pXGI->Chipset == PCI_CHIP_XGIXG27 )) \
> @@ -348,16 +348,16 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn);
>  				g_src_y = y; \
>          ulTemp = Volari_GetSwWP() ;\
>          \
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = \
> -            (CARD32)BE_SWAP32(GR_SKPC_HEADER + 0x8208) ;\
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) =\
> -            (CARD32)BE_SWAP32((x<<16)+(y&0xFFFF)) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = \
> +            (uint32_t)BE_SWAP32(GR_SKPC_HEADER + 0x8208) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) =\
> +            (uint32_t)BE_SWAP32((x<<16)+(y&0xFFFF)) ;\
>          if( pXGI->Chipset == PCI_CHIP_XGIXG40 ) \
>          { \
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
>              ulTemp += 0x10 ;\
>          } \
>          else if(( pXGI->Chipset == PCI_CHIP_XGIXG20 )||( pXGI->Chipset == PCI_CHIP_XGIXG21 )||( pXGI->Chipset == PCI_CHIP_XGIXG27 )) \
> @@ -384,16 +384,16 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn);
>  				g_dstbase=base; \
>          ulTemp = Volari_GetSwWP() ;\
>          \
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = \
> -            (CARD32)BE_SWAP32(GR_SKPC_HEADER + 0x8210) ;\
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) =\
> -            (CARD32)BE_SWAP32(base) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = \
> +            (uint32_t)BE_SWAP32(GR_SKPC_HEADER + 0x8210) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) =\
> +            (uint32_t)BE_SWAP32(base) ;\
>          if( pXGI->Chipset == PCI_CHIP_XGIXG40 ) \
>          { \
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
>              ulTemp += 0x10 ;\
>          } \
>          else if(( pXGI->Chipset == PCI_CHIP_XGIXG20 )||( pXGI->Chipset == PCI_CHIP_XGIXG21 )||( pXGI->Chipset == PCI_CHIP_XGIXG27 )) \
> @@ -421,16 +421,16 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn);
>  				g_dst_y = y; \
>          ulTemp = Volari_GetSwWP() ;\
>          \
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = \
> -            (CARD32)BE_SWAP32(GR_SKPC_HEADER + 0x820C) ;\
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) =\
> -            (CARD32)BE_SWAP32(((x)<<16)+((y)&0xFFFF)) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = \
> +            (uint32_t)BE_SWAP32(GR_SKPC_HEADER + 0x820C) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) =\
> +            (uint32_t)BE_SWAP32(((x)<<16)+((y)&0xFFFF)) ;\
>          if( pXGI->Chipset == PCI_CHIP_XGIXG40 ) \
>          { \
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
>              ulTemp += 0x10 ;\
>          } \
>          else if(( pXGI->Chipset == PCI_CHIP_XGIXG20 )||( pXGI->Chipset == PCI_CHIP_XGIXG21 )||( pXGI->Chipset == PCI_CHIP_XGIXG27 )) \
> @@ -458,16 +458,16 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn);
>  		g_DstRectY = y; \
>          ulTemp = Volari_GetSwWP() ;\
>          \
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = \
> -            (CARD32)BE_SWAP32(GR_SKPC_HEADER + 0x8214) ;\
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) =\
> -            (CARD32)BE_SWAP32(((y)<<16)|((x)&0xFFFF)) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = \
> +            (uint32_t)BE_SWAP32(GR_SKPC_HEADER + 0x8214) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) =\
> +            (uint32_t)BE_SWAP32(((y)<<16)|((x)&0xFFFF)) ;\
>          if( pXGI->Chipset == PCI_CHIP_XGIXG40 ) \
>          { \
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
>              ulTemp += 0x10 ;\
>          } \
>          else if(( pXGI->Chipset == PCI_CHIP_XGIXG20 )||( pXGI->Chipset == PCI_CHIP_XGIXG21 )||( pXGI->Chipset == PCI_CHIP_XGIXG27 )) \
> @@ -506,16 +506,16 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn);
>  			g_height = h; \
>          ulTemp = Volari_GetSwWP() ;\
>          \
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = \
> -            (CARD32)BE_SWAP32(GR_SKPC_HEADER + 0x8218) ;\
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) =\
> -            (CARD32)BE_SWAP32(((h)<<16)|((w)&0xffff)) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = \
> +            (uint32_t)BE_SWAP32(GR_SKPC_HEADER + 0x8218) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) =\
> +            (uint32_t)BE_SWAP32(((h)<<16)|((w)&0xffff)) ;\
>          if( pXGI->Chipset == PCI_CHIP_XGIXG40 ) \
>          { \
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
>              ulTemp += 0x10 ;\
>          } \
>          else if(( pXGI->Chipset == PCI_CHIP_XGIXG20 )||( pXGI->Chipset == PCI_CHIP_XGIXG21 )||( pXGI->Chipset == PCI_CHIP_XGIXG27 )) \
> @@ -559,16 +559,16 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn);
>  		g_MonoPatFgColor = color; \
>          ulTemp = Volari_GetSwWP() ;\
>          \
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = \
> -            (CARD32)BE_SWAP32(GR_SKPC_HEADER + BR(7)) ;\
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) =\
> -            (CARD32)BE_SWAP32(color) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = \
> +            (uint32_t)BE_SWAP32(GR_SKPC_HEADER + BR(7)) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) =\
> +            (uint32_t)BE_SWAP32(color) ;\
>          if( pXGI->Chipset == PCI_CHIP_XGIXG40 ) \
>          { \
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
>              ulTemp += 0x10 ;\
>          } \
>          else if(( pXGI->Chipset == PCI_CHIP_XGIXG20 )||( pXGI->Chipset == PCI_CHIP_XGIXG21 )||( pXGI->Chipset == PCI_CHIP_XGIXG27 )) \
> @@ -589,16 +589,16 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn);
>  		g_MonoPatBgColor = color; \
>          ulTemp = Volari_GetSwWP() ;\
>          \
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = \
> -            (CARD32)BE_SWAP32(GR_SKPC_HEADER + BR(8)) ;\
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) =\
> -            (CARD32)BE_SWAP32(color) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = \
> +            (uint32_t)BE_SWAP32(GR_SKPC_HEADER + BR(8)) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) =\
> +            (uint32_t)BE_SWAP32(color) ;\
>          if( pXGI->Chipset == PCI_CHIP_XGIXG40 ) \
>          { \
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
>              ulTemp += 0x10 ;\
>          } \
>          else if(( pXGI->Chipset == PCI_CHIP_XGIXG20 )||( pXGI->Chipset == PCI_CHIP_XGIXG21 )||( pXGI->Chipset == PCI_CHIP_XGIXG27 )) \
> @@ -615,16 +615,16 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn);
>          \
>          ulTemp = Volari_GetSwWP() ;\
>          \
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = \
> -            (CARD32)BE_SWAP32(GR_SKPC_HEADER + BR(9)) ;\
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) =\
> -            (CARD32)BE_SWAP32(color) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = \
> +            (uint32_t)BE_SWAP32(GR_SKPC_HEADER + BR(9)) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) =\
> +            (uint32_t)BE_SWAP32(color) ;\
>          if( pXGI->Chipset == PCI_CHIP_XGIXG40 ) \
>          { \
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
>              ulTemp += 0x10 ;\
>          } \
>          else if(( pXGI->Chipset == PCI_CHIP_XGIXG20 )||( pXGI->Chipset == PCI_CHIP_XGIXG21 )||( pXGI->Chipset == PCI_CHIP_XGIXG27 )) \
> @@ -640,16 +640,16 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn);
>          \
>          ulTemp = Volari_GetSwWP() ;\
>          \
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = \
> -            (CARD32)BE_SWAP32(GR_SKPC_HEADER + BR(10)) ;\
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) =\
> -            (CARD32)BE_SWAP32(color) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = \
> +            (uint32_t)BE_SWAP32(GR_SKPC_HEADER + BR(10)) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) =\
> +            (uint32_t)BE_SWAP32(color) ;\
>          if( pXGI->Chipset == PCI_CHIP_XGIXG40 ) \
>          { \
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
>              ulTemp += 0x10 ;\
>          } \
>          else if(( pXGI->Chipset == PCI_CHIP_XGIXG20 )||( pXGI->Chipset == PCI_CHIP_XGIXG21 )||( pXGI->Chipset == PCI_CHIP_XGIXG27 )) \
> @@ -673,16 +673,16 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn);
>          \
>          ulTemp = Volari_GetSwWP() ;\
>          \
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = \
> -            (CARD32)BE_SWAP32(GR_SKPC_HEADER + 0x822C) ;\
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) =\
> -            (CARD32)BE_SWAP32(p0) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = \
> +            (uint32_t)BE_SWAP32(GR_SKPC_HEADER + 0x822C) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) =\
> +            (uint32_t)BE_SWAP32(p0) ;\
>          if( pXGI->Chipset == PCI_CHIP_XGIXG40 ) \
>          { \
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
>              ulTemp += 0x10 ;\
>          } \
>          else if(( pXGI->Chipset == PCI_CHIP_XGIXG20 )||( pXGI->Chipset == PCI_CHIP_XGIXG21 )||( pXGI->Chipset == PCI_CHIP_XGIXG27 )) \
> @@ -698,16 +698,16 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn);
>          \
>          ulTemp = Volari_GetSwWP() ;\
>          \
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = \
> -            (CARD32)BE_SWAP32(GR_SKPC_HEADER + 0x8230) ;\
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) =\
> -            (CARD32)BE_SWAP32(p1) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = \
> +            (uint32_t)BE_SWAP32(GR_SKPC_HEADER + 0x8230) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) =\
> +            (uint32_t)BE_SWAP32(p1) ;\
>          if( pXGI->Chipset == PCI_CHIP_XGIXG40 ) \
>          { \
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
>              ulTemp += 0x10 ;\
>          } \
>          else if(( pXGI->Chipset == PCI_CHIP_XGIXG20 )||( pXGI->Chipset == PCI_CHIP_XGIXG21 )||( pXGI->Chipset == PCI_CHIP_XGIXG27 )) \
> @@ -735,16 +735,16 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn);
>          \
>          ulTemp = Volari_GetSwWP() ;\
>          \
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = \
> -            (CARD32)BE_SWAP32(GR_SKPC_HEADER + BR(13)) ;\
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) =\
> -            (CARD32)BE_SWAP32(((top)<<16)|((left)&0xffff)) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = \
> +            (uint32_t)BE_SWAP32(GR_SKPC_HEADER + BR(13)) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) =\
> +            (uint32_t)BE_SWAP32(((top)<<16)|((left)&0xffff)) ;\
>          if( pXGI->Chipset == PCI_CHIP_XGIXG40 ) \
>          { \
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
>              ulTemp += 0x10 ;\
>          } \
>          else if(( pXGI->Chipset == PCI_CHIP_XGIXG20 )||( pXGI->Chipset == PCI_CHIP_XGIXG21 )||( pXGI->Chipset == PCI_CHIP_XGIXG27 )) \
> @@ -760,16 +760,16 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn);
>          \
>          ulTemp = Volari_GetSwWP() ;\
>          \
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = \
> -            (CARD32)BE_SWAP32(GR_SKPC_HEADER + BR(13)) ;\
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) =\
> -            (CARD32)BE_SWAP32(((top)<<16)|((left)&0xffff)) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = \
> +            (uint32_t)BE_SWAP32(GR_SKPC_HEADER + BR(13)) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) =\
> +            (uint32_t)BE_SWAP32(((top)<<16)|((left)&0xffff)) ;\
>          if( pXGI->Chipset == PCI_CHIP_XGIXG40 ) \
>          { \
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
>              ulTemp += 0x10 ;\
>          } \
>          else if(( pXGI->Chipset == PCI_CHIP_XGIXG20 )||( pXGI->Chipset == PCI_CHIP_XGIXG21 )||( pXGI->Chipset == PCI_CHIP_XGIXG27 )) \
> @@ -785,16 +785,16 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn);
>          \
>          ulTemp = Volari_GetSwWP() ;\
>          \
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = \
> -            (CARD32)BE_SWAP32(GR_SKPC_HEADER + BR(14)) ;\
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) =\
> -            (CARD32)BE_SWAP32(((right) & 0xFFFF) | ((bottom)<<16))) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = \
> +            (uint32_t)BE_SWAP32(GR_SKPC_HEADER + BR(14)) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) =\
> +            (uint32_t)BE_SWAP32(((right) & 0xFFFF) | ((bottom)<<16))) ;\
>          if( pXGI->Chipset == PCI_CHIP_XGIXG40 ) \
>          { \
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
>              ulTemp += 0x10 ;\
>          } \
>          else if(( pXGI->Chipset == PCI_CHIP_XGIXG20 )||( pXGI->Chipset == PCI_CHIP_XGIXG21 )||( pXGI->Chipset == PCI_CHIP_XGIXG27 )) \
> @@ -860,16 +860,16 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn);
>  			g_src_y = x; \
>          ulTemp = Volari_GetSwWP() ;\
>          \
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = \
> -            (CARD32)BE_SWAP32(GR_SKPC_HEADER + BR(2)) ;\
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) =\
> -            (CARD32)BE_SWAP32(((y)<<16) | ((x)&0xFFFF) ) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = \
> +            (uint32_t)BE_SWAP32(GR_SKPC_HEADER + BR(2)) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) =\
> +            (uint32_t)BE_SWAP32(((y)<<16) | ((x)&0xFFFF) ) ;\
>          if( pXGI->Chipset == PCI_CHIP_XGIXG40 ) \
>          { \
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
>              ulTemp += 0x10 ;\
>          } \
>          else if(( pXGI->Chipset == PCI_CHIP_XGIXG20 )||( pXGI->Chipset == PCI_CHIP_XGIXG21 )||( pXGI->Chipset == PCI_CHIP_XGIXG27 )) \
> @@ -889,16 +889,16 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn);
>  			g_dst_y = x; \
>          ulTemp = Volari_GetSwWP() ;\
>          \
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = \
> -            (CARD32)BE_SWAP32(GR_SKPC_HEADER + BR(3)) ;\
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) =\
> -            (CARD32)BE_SWAP32(((y)<<16) | ((x)&0xFFFF) ) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = \
> +            (uint32_t)BE_SWAP32(GR_SKPC_HEADER + BR(3)) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) =\
> +            (uint32_t)BE_SWAP32(((y)<<16) | ((x)&0xFFFF) ) ;\
>          if( pXGI->Chipset == PCI_CHIP_XGIXG40 ) \
>          { \
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
>              ulTemp += 0x10 ;\
>          } \
>          else if(( pXGI->Chipset == PCI_CHIP_XGIXG20 )||( pXGI->Chipset == PCI_CHIP_XGIXG21 )||( pXGI->Chipset == PCI_CHIP_XGIXG27 )) \
> @@ -917,16 +917,16 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn);
>  		if(c != g_width) \
>  		{ \
>  			g_width = c; \
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = \
> -            (CARD32)BE_SWAP32(GR_SKPC_HEADER + BR(6) + 0x30000 ) ;\
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) =\
> -            (CARD32)BE_SWAP32(((c)&0xffff)) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = \
> +            (uint32_t)BE_SWAP32(GR_SKPC_HEADER + BR(6) + 0x30000 ) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) =\
> +            (uint32_t)BE_SWAP32(((c)&0xffff)) ;\
>          if( pXGI->Chipset == PCI_CHIP_XGIXG40 ) \
>          { \
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
>              ulTemp += 0x10 ;\
>          } \
>          else if(( pXGI->Chipset == PCI_CHIP_XGIXG20 )||( pXGI->Chipset == PCI_CHIP_XGIXG21 )||( pXGI->Chipset == PCI_CHIP_XGIXG27 )) \
> @@ -945,16 +945,16 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn);
>  			g_height = c; \
>          ulTemp = Volari_GetSwWP() ;\
>          \
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = \
> -            (CARD32)BE_SWAP32(GR_SKPC_HEADER + BR(6) + 0xC0000 ) ;\
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) =\
> -            (CARD32)BE_SWAP32(((p)<<16)) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = \
> +            (uint32_t)BE_SWAP32(GR_SKPC_HEADER + BR(6) + 0xC0000 ) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) =\
> +            (uint32_t)BE_SWAP32(((p)<<16)) ;\
>          if( pXGI->Chipset == PCI_CHIP_XGIXG40 ) \
>          { \
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
>              ulTemp += 0x10 ;\
>          } \
>          else if(( pXGI->Chipset == PCI_CHIP_XGIXG20 )||( pXGI->Chipset == PCI_CHIP_XGIXG21 )||( pXGI->Chipset == PCI_CHIP_XGIXG27 )) \
> @@ -974,16 +974,16 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn);
>  			g_height = p; \
>          ulTemp = Volari_GetSwWP() ;\
>          \
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = \
> -            (CARD32)BE_SWAP32(GR_SKPC_HEADER + BR(6)) ;\
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) =\
> -            (CARD32)BE_SWAP32(((p)<<16)|((c)&0xffff)) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = \
> +            (uint32_t)BE_SWAP32(GR_SKPC_HEADER + BR(6)) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) =\
> +            (uint32_t)BE_SWAP32(((p)<<16)|((c)&0xffff)) ;\
>          if( pXGI->Chipset == PCI_CHIP_XGIXG40 ) \
>          { \
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
>              ulTemp += 0x10 ;\
>          } \
>          else if(( pXGI->Chipset == PCI_CHIP_XGIXG20 )||( pXGI->Chipset == PCI_CHIP_XGIXG21 )||( pXGI->Chipset == PCI_CHIP_XGIXG27 )) \
> @@ -999,16 +999,16 @@ void XGIDumpCMDQueue(ScrnInfoPtr pScrn);
>          \
>          ulTemp = Volari_GetSwWP() ;\
>          \
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp) = \
> -            (CARD32)BE_SWAP32(GR_SKPC_HEADER + BR(11)) ;\
> -        *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+4) =\
> -            (CARD32)BE_SWAP32(ls) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp) = \
> +            (uint32_t)BE_SWAP32(GR_SKPC_HEADER + BR(11)) ;\
> +        *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+4) =\
> +            (uint32_t)BE_SWAP32(ls) ;\
>          if( pXGI->Chipset == PCI_CHIP_XGIXG40 ) \
>          { \
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+8) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> -            *(CARD32 *)(pXGI->cmdQueueBase+ulTemp+12) = \
> -                (CARD32)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+8) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
> +            *(uint32_t *)(pXGI->cmdQueueBase+ulTemp+12) = \
> +                (uint32_t)BE_SWAP32(GR_NIL_CMD) ;\
>              ulTemp += 0x10 ;\
>          } \
>          else if(( pXGI->Chipset == PCI_CHIP_XGIXG20 )||( pXGI->Chipset == PCI_CHIP_XGIXG21 )||( pXGI->Chipset == PCI_CHIP_XGIXG27 )) \
> diff --git a/src/xgi_cursor.c b/src/xgi_cursor.c
> index 55890d4..50f1d24 100755
> --- a/src/xgi_cursor.c
> +++ b/src/xgi_cursor.c
> @@ -208,7 +208,7 @@ Volari_LoadCursorARGB(ScrnInfoPtr pScrn, CursorPtr pCursor)
>      unsigned long cursor_addr = pXGI->CursorOffset ;
>      unsigned long cursor_base = pXGI->CursorOffset/1024 ;
>      unsigned char *pCursorShape ;
> -	int i , j ; CARD32 *pDest,*pSrc ;
> +	int i , j ; uint32_t *pDest,*pSrc ;
>  	CursorBitsPtr pCursorBits = pCursor->bits ;
>  
>  
> @@ -223,7 +223,7 @@ Volari_LoadCursorARGB(ScrnInfoPtr pScrn, CursorPtr pCursor)
>  
>  	for( i = 64 - pCursorBits->height ; i< 64 ; i++ )
>  	{
> -		pDest = (CARD32 *)(pCursorShape + i*64*4 ) ;
> +		pDest = (uint32_t *)(pCursorShape + i*64*4 ) ;
>  		for( j = 64-pCursorBits->width ; j < 64 ; j++, pSrc++ )
>  		{
>  			pDest[j] = *pSrc ;
> diff --git a/src/xgi_cursor.h b/src/xgi_cursor.h
> index 5b963dc..231b99e 100755
> --- a/src/xgi_cursor.h
> +++ b/src/xgi_cursor.h
> @@ -162,7 +162,7 @@
>  /* Jill, read MMIO need swap, 2006/6/22*/
>  #define xgiG2CRT1_EnableHWCursor(cursor_base,pat_id)\
>  	{\
> -	    CARD32 ulTemp ;\
> +	    uint32_t ulTemp ;\
>  		ulTemp = XGIMMIOLONG(0x8500) ;\
>  		ulTemp = BE_SWAP32(ulTemp) ;\
>  		ulTemp &= 0x00FC0000 ;\
> @@ -180,7 +180,7 @@
>  /* Jill, read MMIO need swap, 2006/6/22*/
>  #define xgiG2CRT2_EnableHWCursor(cursor_base,pat_id)\
>  	{\
> -	    CARD32 ulTemp ;\
> +	    uint32_t ulTemp ;\
>  		ulTemp = XGIMMIOLONG(0x8520) ;\
>  		ulTemp = BE_SWAP32(ulTemp) ;\
>  		ulTemp &= 0x00FC0000 ;\
> @@ -193,7 +193,7 @@
>  /* Jong 09/19/2007; added for ??? */
>  #define xgiG2CRT1_EnableARGBHWCursor(cursor_base,pat_id)\
>  	{\
> -	    CARD32 ulTemp ;\
> +	    uint32_t ulTemp ;\
>  		ulTemp = XGIMMIOLONG(0x8500) ;\
>  		ulTemp &= 0x00FC0000 ;\
>  		ulTemp |= 0xE<<28 ;\
> @@ -204,7 +204,7 @@
>  
>  #define xgiG2CRT2_EnableARGBHWCursor(cursor_base,pat_id)\
>  	{\
> -	    CARD32 ulTemp ;\
> +	    uint32_t ulTemp ;\
>  		ulTemp = XGIMMIOLONG(0x8500) ;\
>  		ulTemp &= 0x00FC0000 ;\
>  		ulTemp |= 0xE<<28 ;\
> diff --git a/src/xgi_dac.c b/src/xgi_dac.c
> index 6c525af..e2f2b05 100755
> --- a/src/xgi_dac.c
> +++ b/src/xgi_dac.c
> @@ -577,17 +577,17 @@ void XGIAdjustGamma(ScrnInfoPtr pScrn, unsigned int gammaRed, unsigned int gamma
>  	double red = 1.0 / (double)((double)gammaRed / 1000);
>      double green = 1.0 / (double)((double)gammaGreen / 1000);
>      double blue = 1.0 / (double)((double)gammaBlue / 1000);
> -	CARD8  GammaRampRed[256], GammaRampGreen[256], GammaRampBlue[256];
> +	uint8_t  GammaRampRed[256], GammaRampGreen[256], GammaRampBlue[256];
>  
>      for(i = 0; i <= num; i++) {
>          GammaRampRed[i] =
> -	    (red == 1.0) ? i : (CARD8)(pow((double)i / (double)num, red) * (double)num + 0.5);
> +	    (red == 1.0) ? i : (uint8_t)(pow((double)i / (double)num, red) * (double)num + 0.5);
>  
>  		GammaRampGreen[i] =
> -	    (green == 1.0) ? i : (CARD8)(pow((double)i / (double)num, green) * (double)num + 0.5);
> +	    (green == 1.0) ? i : (uint8_t)(pow((double)i / (double)num, green) * (double)num + 0.5);
>  
>  		GammaRampBlue[i] =
> -	    (blue == 1.0) ? i : (CARD8)(pow((double)i / (double)num, blue) * (double)num + 0.5);
> +	    (blue == 1.0) ? i : (uint8_t)(pow((double)i / (double)num, blue) * (double)num + 0.5);
>      }
>  
>  	/* set gamma ramp to HW */
> diff --git a/src/xgi_dga.c b/src/xgi_dga.c
> index 3b798d7..4101fb3 100755
> --- a/src/xgi_dga.c
> +++ b/src/xgi_dga.c
> @@ -345,7 +345,7 @@ XGI_BlitRect(
>        int ydir = (srcy < dsty) ? -1 : 1;
>  
>        (*pXGI->AccelInfoPtr->SetupForScreenToScreenCopy)(
> -          pScrn, xdir, ydir, GXcopy, (CARD32)~0, -1);
> +          pScrn, xdir, ydir, GXcopy, (uint32_t)~0, -1);
>        (*pXGI->AccelInfoPtr->SubsequentScreenToScreenCopy)(
>            pScrn, srcx, srcy, dstx, dsty, w, h);
>        SET_SYNC_FLAG(pXGI->AccelInfoPtr);
> diff --git a/src/xgi_dri.c b/src/xgi_dri.c
> index fcfab89..3a77a93 100755
> --- a/src/xgi_dri.c
> +++ b/src/xgi_dri.c
> @@ -100,9 +100,9 @@ static void XGIDRISwapContext(ScreenPtr pScreen, DRISyncType syncType,
>  			       void *readContextStore,
>  			       DRIContextType writeContextType,
>  			       void *writeContextStore);
> -static void XGIDRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index);
> +static void XGIDRIInitBuffers(WindowPtr pWin, RegionPtr prgn, uint32_t index);
>  static void XGIDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
> -			       RegionPtr prgnSrc, CARD32 index);
> +			       RegionPtr prgnSrc, uint32_t index);
>  
>  void xgiLostContext(ScreenPtr pScreen);
>  
> @@ -641,7 +641,7 @@ XGIDRISwapContext(ScreenPtr pScreen, DRISyncType syncType,
>  }
>  
>  static void
> -XGIDRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index)
> +XGIDRIInitBuffers(WindowPtr pWin, RegionPtr prgn, uint32_t index)
>  {
>    ScreenPtr pScreen = pWin->drawable.pScreen;
>    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
> @@ -652,7 +652,7 @@ XGIDRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index)
>  
>  static void
>  XGIDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
> -		   RegionPtr prgnSrc, CARD32 index)
> +		   RegionPtr prgnSrc, uint32_t index)
>  {
>    ScreenPtr pScreen = pParent->drawable.pScreen;
>    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
> diff --git a/src/xgi_dri.h b/src/xgi_dri.h
> index 771d054..e32e797 100755
> --- a/src/xgi_dri.h
> +++ b/src/xgi_dri.h
> @@ -49,7 +49,7 @@ typedef struct {
>    unsigned int FrameCount;
>    
>    unsigned long shareWPoffset;
> -  /*CARD16*/
> +  /*uint16_t*/
>    /*unsigned short RelIO;*/
>  
>    /* 2001/12/16 added by jjtseng for some bala reasons .... */
> diff --git a/src/xgi_driver.h b/src/xgi_driver.h
> index fe8a8c1..216a410 100755
> --- a/src/xgi_driver.h
> +++ b/src/xgi_driver.h
> @@ -32,10 +32,10 @@
>  
>  /* For calculating refresh rate index (CR33) */
>  static const struct _xgi_vrate {
> -    CARD16 idx;
> -    CARD16 xres;
> -    CARD16 yres;
> -    CARD16 refresh;
> +    uint16_t idx;
> +    uint16_t xres;
> +    uint16_t yres;
> +    uint16_t refresh;
>      BOOLEAN XGI730valid32bpp;
>  } xgix_vrate[] = {
>  	{1,  320,  200,  70,  TRUE},
> diff --git a/src/xgi_setup.c b/src/xgi_setup.c
> index 310ea83..ee725c8 100755
> --- a/src/xgi_setup.c
> +++ b/src/xgi_setup.c
> @@ -533,7 +533,7 @@ Bool ForceToDisable2DEngine(ScrnInfoPtr pScrn)
>  {
>      XGIPtr pXGI ;
>  	Bool   bReturn=FALSE;
> -    CARD8  bForce;
> +    uint8_t  bForce;
>  
>      pXGI = XGIPTR(pScrn); 
>  
> diff --git a/src/xgi_video.c b/src/xgi_video.c
> index 420ba07..6f90d3d 100755
> --- a/src/xgi_video.c
> +++ b/src/xgi_video.c
> @@ -120,7 +120,7 @@ static int XGIOpenV4l(XGIPortPrivPtr pPriv);
>  static void XGICloseV4l(XGIPortPrivPtr pPriv);           
>  #endif //VC    
>  
> -extern void SetSRRegMask(XGIPtr, CARD8, CARD8, CARD8);
> +extern void SetSRRegMask(XGIPtr, uint8_t, uint8_t, uint8_t);
>  extern void XGIUpdateXvGamma(XGIPtr, XGIPortPrivPtr);
>  #define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
>  
> @@ -708,7 +708,7 @@ set_scale_factor(XGIOverlayPtr pOverlay)
>    float  f_temp;
>    int   NewPitch, srcPitch;
>  
> -  CARD32 I=0;
> +  uint32_t I=0;
>  
>    int dstW = pOverlay->dstBox.x2 - pOverlay->dstBox.x1;
>    int dstH = pOverlay->dstBox.y2 - pOverlay->dstBox.y1;
> @@ -752,7 +752,7 @@ set_scale_factor(XGIOverlayPtr pOverlay)
>  	           I++;
>  	     }
>  
> -	     pOverlay->wHPre = (CARD8)(I - 1);
> +	     pOverlay->wHPre = (uint8_t)(I - 1);
>  	     dstW <<= (I - 1);
>  
>  	     f_temp = srcW/dstW;
> @@ -788,7 +788,7 @@ set_scale_factor(XGIOverlayPtr pOverlay)
>  	/* downscale in vertical */
>  	else {
>  
> -	        CARD32 realI;
> +	        uint32_t realI;
>  
>  	        I = realI = srcH / dstH;
>  	        pOverlay->IntBit |= 0x02;
> @@ -819,20 +819,20 @@ set_scale_factor(XGIOverlayPtr pOverlay)
>  	        }
>  	}
>  
> -	pOverlay->pitch = (CARD16)(NewPitch);
> +	pOverlay->pitch = (uint16_t)(NewPitch);
>   }
>  
>  void
>  set_contrast_factor(XGIPtr pXGI, XGIOverlayPtr pOverlay)
>  {
>     ScrnInfoPtr    pScrn = pXGI->pScrn;
> -   CARD16         screenX = pScrn->currentMode->HDisplay;
> -   CARD16         screenY = pScrn->currentMode->VDisplay;
> +   uint16_t         screenX = pScrn->currentMode->HDisplay;
> +   uint16_t         screenY = pScrn->currentMode->VDisplay;
>  
> -   CARD32         value, SamplePixel, dwTotalPixel;
> +   uint32_t         value, SamplePixel, dwTotalPixel;
>  
> -   CARD16         top, left;
> -   CARD16         bottom, right;
> +   uint16_t         top, left;
> +   uint16_t         bottom, right;
>  
>      top    = pOverlay->dstBox.y1;
>      bottom = pOverlay->dstBox.y2;
> @@ -872,9 +872,9 @@ set_contrast_factor(XGIPtr pXGI, XGIOverlayPtr pOverlay)
>  static void
>  set_line_buf_size(XGIOverlayPtr pOverlay)
>  {
> -    CARD8   preHIDF;
> -    CARD32 dwI;
> -    CARD32 dwSrcWidth = pOverlay->srcW;
> +    uint8_t   preHIDF;
> +    uint32_t dwI;
> +    uint32_t dwSrcWidth = pOverlay->srcW;
>      int	   pixelFormat = pOverlay->pixelFormat;
>  
>      if ((pixelFormat == PIXEL_FMT_YV12) ||
> diff --git a/src/xgi_video.h b/src/xgi_video.h
> index 7ff7d55..7e49566 100755
> --- a/src/xgi_video.h
> +++ b/src/xgi_video.h
> @@ -65,7 +65,7 @@ typedef struct {
>  #endif
>  
>      int             fbSize;
> -    CARD32          bufAddr[2];
> +    uint32_t          bufAddr[2];
>  
>      unsigned char   currentBuf;
>  
> @@ -80,15 +80,15 @@ typedef struct {
>      INT32   hue;
>  
>      RegionRec       clip;
> -    CARD32          colorKey;
> +    uint32_t          colorKey;
>  
> -    CARD32          videoStatus;
> +    uint32_t          videoStatus;
>      Time            offTime;
>      Time            freeTime;
>  	
>  	short	 linebufMergeLimit;
>  
> -    CARD32                  displayMode;
> +    uint32_t                  displayMode;
>  
>  	Bool            grabbedByV4L;  /*V4L stuff*/
>  	int             pitch;
> diff --git a/src/xgi_videohw.c b/src/xgi_videohw.c
> index 92e21a7..db1e630 100755
> --- a/src/xgi_videohw.c
> +++ b/src/xgi_videohw.c
> @@ -43,31 +43,31 @@
>  
>  #define  CAPTURE_340A1
>  /*
> -static CARD32 _XGIRead(XGIPtr pXGI, CARD32 reg)
> +static uint32_t _XGIRead(XGIPtr pXGI, uint32_t reg)
>  {
>      return *(pXGI->IOBase + reg);
>  }
>  
> -static void _XGIWrite(XGIPtr pXGI, CARD32 reg, CARD32 data)
> +static void _XGIWrite(XGIPtr pXGI, uint32_t reg, uint32_t data)
>  {
>      *(pXGI->IOBase + reg) = data;
>  }
>  */
> -static CARD8 GetVideoReg(XGIPtr pXGI, CARD8 reg)
> +static uint8_t GetVideoReg(XGIPtr pXGI, uint8_t reg)
>  {
>      outb (pXGI->RelIO + vi_index_offset, reg);
>      return inb(pXGI->RelIO + vi_data_offset);
>  }
>  
> -static void SetVideoReg(XGIPtr pXGI, CARD8 reg, CARD8 data)
> +static void SetVideoReg(XGIPtr pXGI, uint8_t reg, uint8_t data)
>  {
>      outb (pXGI->RelIO + vi_index_offset, reg);
>      outb (pXGI->RelIO + vi_data_offset, data);
>  }
>  
> -static void SetVideoRegMask(XGIPtr pXGI, CARD8 reg, CARD8 data, CARD8 mask)
> +static void SetVideoRegMask(XGIPtr pXGI, uint8_t reg, uint8_t data, uint8_t mask)
>  {
> -    CARD8   old;
> +    uint8_t   old;
>  
>      outb (pXGI->RelIO + vi_index_offset, reg);
>      old = inb(pXGI->RelIO + vi_data_offset);
> @@ -75,7 +75,7 @@ static void SetVideoRegMask(XGIPtr pXGI, CARD8 reg, CARD8 data, CARD8 mask)
>      outb (pXGI->RelIO + vi_data_offset, data);
>  }
>  
> -static CARD8 GetSRReg(XGIPtr pXGI, CARD8 reg)
> +static uint8_t GetSRReg(XGIPtr pXGI, uint8_t reg)
>  {
>      outb (pXGI->RelIO + sr_index_offset, 0x05);
>      if (inb (pXGI->RelIO + sr_data_offset) != 0xa1)
> @@ -84,7 +84,7 @@ static CARD8 GetSRReg(XGIPtr pXGI, CARD8 reg)
>      return inb(pXGI->RelIO + sr_data_offset);
>  }
>  
> -static void SetSRReg(XGIPtr pXGI, CARD8 reg, CARD8 data)
> +static void SetSRReg(XGIPtr pXGI, uint8_t reg, uint8_t data)
>  {
>      outb (pXGI->RelIO + sr_index_offset, 0x05);
>      if (inb (pXGI->RelIO + sr_data_offset) != 0xa1)
> @@ -93,9 +93,9 @@ static void SetSRReg(XGIPtr pXGI, CARD8 reg, CARD8 data)
>      outb (pXGI->RelIO + sr_data_offset, data);
>  }
>  
> -void SetSRRegMask(XGIPtr pXGI, CARD8 reg, CARD8 data, CARD8 mask)
> +void SetSRRegMask(XGIPtr pXGI, uint8_t reg, uint8_t data, uint8_t mask)
>  {
> -    CARD8   old;
> +    uint8_t   old;
>  
>      outb (pXGI->RelIO + sr_index_offset, 0x05);
>      if (inb (pXGI->RelIO + sr_data_offset) != 0xa1)
> @@ -106,15 +106,15 @@ void SetSRRegMask(XGIPtr pXGI, CARD8 reg, CARD8 data, CARD8 mask)
>      outb (pXGI->RelIO + sr_data_offset, data);
>  }
>  /*
> -static void SetVCReg(XGIPtr pXGI, CARD8 reg, CARD8 data)
> +static void SetVCReg(XGIPtr pXGI, uint8_t reg, uint8_t data)
>  {
>      outb (pXGI->RelIO + vc_index_offset, reg);
>      outb (pXGI->RelIO + vc_data_offset, data);
>  }
>  */
> -static void SetVCRegMask(XGIPtr pXGI, CARD8 reg, CARD8 data, CARD8 mask)
> +static void SetVCRegMask(XGIPtr pXGI, uint8_t reg, uint8_t data, uint8_t mask)
>  {
> -    CARD8   old;
> +    uint8_t   old;
>  
>      outb (pXGI->RelIO + vc_index_offset, reg);
>      old = inb(pXGI->RelIO + vc_data_offset);
> @@ -122,13 +122,13 @@ static void SetVCRegMask(XGIPtr pXGI, CARD8 reg, CARD8 data, CARD8 mask)
>      outb (pXGI->RelIO + vc_data_offset, data);
>  }
>  /*
> -static CARD8 GetXGIReg(XGIPtr pXGI, CARD8 index_offset, CARD8 reg)
> +static uint8_t GetXGIReg(XGIPtr pXGI, uint8_t index_offset, uint8_t reg)
>  {
>      outb (pXGI->RelIO + index_offset, reg);
>      return inb(pXGI->RelIO + index_offset+1);
>  }
>  
> -static void SetXGIReg(XGIPtr pXGI, CARD8 index_offset, CARD8 reg, CARD8 data)
> +static void SetXGIReg(XGIPtr pXGI, uint8_t index_offset, uint8_t reg, uint8_t data)
>  {
>      outb (pXGI->RelIO + index_offset, reg);
>      outb (pXGI->RelIO + index_offset+1, data);
> @@ -208,13 +208,13 @@ XGIComputeXvGamma(XGIPtr pXGI)
>  	
>      for(i = 0; i <= num; i++) {
>          pXGI->XvGammaRampRed[i] =
> -	    (red == 1.0) ? i : (CARD8)(pow((double)i / (double)num, red) * (double)num + 0.5);
> +	    (red == 1.0) ? i : (uint8_t)(pow((double)i / (double)num, red) * (double)num + 0.5);
>  
>  		pXGI->XvGammaRampGreen[i] =
> -	    (green == 1.0) ? i : (CARD8)(pow((double)i / (double)num, green) * (double)num + 0.5);
> +	    (green == 1.0) ? i : (uint8_t)(pow((double)i / (double)num, green) * (double)num + 0.5);
>  
>  		pXGI->XvGammaRampBlue[i] =
> -	    (blue == 1.0) ? i : (CARD8)(pow((double)i / (double)num, blue) * (double)num + 0.5);
> +	    (blue == 1.0) ? i : (uint8_t)(pow((double)i / (double)num, blue) * (double)num + 0.5);
>      }
>  }
>  
> @@ -509,7 +509,7 @@ SetMergeLineBufReg(XGIPtr pXGI, Bool enable)
>  void
>  SetVideoFormatReg(XGIPtr pXGI, int format)
>  {
> -    CARD8 fmt;
> +    uint8_t fmt;
>  
>      switch (format)
>      {
> @@ -554,9 +554,9 @@ SetVideoFormatReg(XGIPtr pXGI, int format)
>  }
>  
>  void
> -SetColorkeyReg(XGIPtr pXGI, CARD32 colorkey)
> +SetColorkeyReg(XGIPtr pXGI, uint32_t colorkey)
>  {
> -    CARD8 r, g, b;
> +    uint8_t r, g, b;
>  
>      b = LOBYTE(LOWORD(colorkey));
>      g = HIBYTE(LOWORD(colorkey));
> @@ -575,7 +575,7 @@ SetColorkeyReg(XGIPtr pXGI, CARD32 colorkey)
>  void
>  SetVideoBrightnessReg(XGIPtr pXGI, INT32 value)
>  {
> -    CARD8   brightness;
> +    uint8_t   brightness;
>  
>      brightness = LOBYTE(value);
>  
> @@ -585,9 +585,9 @@ SetVideoBrightnessReg(XGIPtr pXGI, INT32 value)
>  void
>  SetVideoContrastReg(XGIPtr pXGI, INT32 value)
>  {
> -    CARD8   contrast;
> +    uint8_t   contrast;
>  
> -    contrast = (CARD8)(((value * 7) / 255) & 0x000F);
> +    contrast = (uint8_t)(((value * 7) / 255) & 0x000F);
>  
>      SetVideoRegMask(pXGI, Index_VI_Contrast_Enh_Ctrl, contrast, 0x07);
>  }
> @@ -595,7 +595,7 @@ SetVideoContrastReg(XGIPtr pXGI, INT32 value)
>  void
>  SetVideoHueReg(XGIPtr pXGI, INT32 value)
>  {
> -    CARD8   hue;
> +    uint8_t   hue;
>  
>      if ( value > 0 )
>      {
> @@ -608,7 +608,7 @@ SetVideoHueReg(XGIPtr pXGI, INT32 value)
>         value = -value;
>      }
>  
> -    hue = (CARD8)(((value * 7) / 180) & 0x0007);
> +    hue = (uint8_t)(((value * 7) / 180) & 0x0007);
>  
>  
>      SetVideoRegMask(pXGI, Index_VI_Hue, hue, 0x07);
> @@ -617,7 +617,7 @@ SetVideoHueReg(XGIPtr pXGI, INT32 value)
>  void
>  SetVideoSaturationReg(XGIPtr pXGI, INT32 value)
>  {
> -    CARD8   saturation;
> +    uint8_t   saturation;
>  
>      if ( value > 0 )
>      {
> @@ -632,7 +632,7 @@ SetVideoSaturationReg(XGIPtr pXGI, INT32 value)
>         value = -value;
>      }
>  
> -    saturation = (CARD8)(((value * 7) / 180) & 0x000F);
> +    saturation = (uint8_t)(((value * 7) / 180) & 0x000F);
>  
>      SetVideoRegMask(pXGI, Index_VI_Saturation, saturation, 0x07);
>      SetVideoRegMask(pXGI, Index_VI_Saturation, saturation << 4, 0x70);
> @@ -645,12 +645,12 @@ SetOverlayReg(XGIPtr pXGI, XGIOverlayPtr pOverlay)
>      ScrnInfoPtr pScrn = pXGI->pScrn;
>  	XGIPortPrivPtr pPriv = GET_PORT_PRIVATE(pScrn);
>  	
> -    CARD32 tmpYPitch;
> -    CARD16 top, left;
> -    CARD16 bottom, right;
> -    CARD32 PSY, PSU, PSV;
> -    CARD16 screenX = pScrn->currentMode->HDisplay;
> -    CARD16 screenY = pScrn->currentMode->VDisplay;
> +    uint32_t tmpYPitch;
> +    uint16_t top, left;
> +    uint16_t bottom, right;
> +    uint32_t PSY, PSU, PSV;
> +    uint16_t screenX = pScrn->currentMode->HDisplay;
> +    uint16_t screenY = pScrn->currentMode->VDisplay;
>  
>      top    = pOverlay->dstBox.y1;
>      bottom = pOverlay->dstBox.y2;
> @@ -721,7 +721,7 @@ SetOverlayReg(XGIPtr pXGI, XGIOverlayPtr pOverlay)
>  		(pOverlay->pixelFormat == PIXEL_FMT_NV21))
>      {
>          /* set UV pitch */
> -		CARD32  uvpitch = tmpYPitch;
> +		uint32_t  uvpitch = tmpYPitch;
>          BYTE    bYUV_Pitch_High;
>  
>  		if(pOverlay->pixelFormat == PIXEL_FMT_YV12)
> @@ -777,7 +777,7 @@ SetCloseOverlayReg(XGIPtr pXGI)
>  }
>  
>  void
> -SetSelectOverlayReg(XGIPtr pXGI, CARD8 index)
> +SetSelectOverlayReg(XGIPtr pXGI, uint8_t index)
>  {
>    SetVideoRegMask(pXGI, Index_VI_Control_Misc2, index, 0x01);
>  }
> diff --git a/src/xgi_videohw.h b/src/xgi_videohw.h
> index 12e9faa..24d751c 100755
> --- a/src/xgi_videohw.h
> +++ b/src/xgi_videohw.h
> @@ -33,39 +33,39 @@ typedef struct {
>  
>     int     pixelFormat;
>  
> -   CARD32  pitch;
> +   uint32_t  pitch;
>  
> -   CARD8   keyOP;
> -   CARD16  HUSF;
> -   CARD16  VUSF;
> -   CARD8   IntBit;
> -   CARD8   wHPre;
> +   uint8_t   keyOP;
> +   uint16_t  HUSF;
> +   uint16_t  VUSF;
> +   uint8_t   IntBit;
> +   uint8_t   wHPre;
>     float   f_scale;
>  
> -   CARD16  srcW;
> -   CARD16  srcH;
> +   uint16_t  srcW;
> +   uint16_t  srcH;
>  
>     BoxRec  dstBox;
>  
> -   CARD32  PSY;
> -   CARD32  PSV;
> -   CARD32  PSU;
> -   CARD8   bobEnable;
> +   uint32_t  PSY;
> +   uint32_t  PSV;
> +   uint32_t  PSU;
> +   uint8_t   bobEnable;
>  
> -   CARD32  lineBufSize;
> +   uint32_t  lineBufSize;
>  
> -   CARD32  dwContrastFactor;
> -   CARD32  SamplePixel;
> +   uint32_t  dwContrastFactor;
> +   uint32_t  SamplePixel;
>  
>  } XGIOverlayRec, *XGIOverlayPtr;
>  
>  /******************************************************************************/
>  /* BIT OPERATION */
>  /******************************************************************************/
> -#define LOBYTE(x)       ((CARD8)(x&0xFF))
> -#define HIBYTE(x)       ((CARD8)((x>>8)&0xFF))
> -#define LOWORD(x)   ((CARD16)(x&0xFFFF))
> -#define HIWORD(x)   ((CARD16)((x>>16)&0xFFFF))
> +#define LOBYTE(x)       ((uint8_t)(x&0xFF))
> +#define HIBYTE(x)       ((uint8_t)((x>>8)&0xFF))
> +#define LOWORD(x)   ((uint16_t)(x&0xFFFF))
> +#define HIWORD(x)   ((uint16_t)((x>>16)&0xFFFF))
>  
>  /******************************************************************************/
>  /* DEFINITIONS FOR VIDEO PORT */
> @@ -339,10 +339,10 @@ typedef struct {
>  /*******************************
>  *       Function               *
>  *******************************/
> -/* static CARD8 vblank_active_CRT1(XGIPtr); */
> +/* static uint8_t vblank_active_CRT1(XGIPtr); */
>  void SetOverlayReg(XGIPtr, XGIOverlayPtr);
> -void SetColorkeyReg(XGIPtr, CARD32);
> -void SetSelectOverlayReg(XGIPtr, CARD8);
> +void SetColorkeyReg(XGIPtr, uint32_t);
> +void SetSelectOverlayReg(XGIPtr, uint8_t);
>  void SetEnableOverlayReg(XGIPtr, Bool);
>  void SetCloseOverlayReg(XGIPtr);
>  
> -- 
> 2.4.5
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel

-- 
Matthieu Herrb


More information about the xorg-devel mailing list