From c5a694ec02ff44636a2ce3fdcee32a2538fcc2c1 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Fri, 21 Mar 2008 01:36:28 -0300 Subject: [PATCH] Compile warning fixes. o Don't declare unused variables. o Minor reordering to avoid warnings about mixed declarations and code. o Rename macros in smi_pcirename.h to a more consistent name. --- src/smi_driver.c | 18 +++++++++--------- src/smi_exa.c | 5 ++--- src/smi_pcirename.h | 6 +++--- src/smi_video.c | 1 - 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/smi_driver.c b/src/smi_driver.c index ec2af1a..479a6fb 100644 --- a/src/smi_driver.c +++ b/src/smi_driver.c @@ -1101,9 +1101,9 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags) } if (!pSmi->NoAccel) { - from = X_DEFAULT; char *strptr; - + + from = X_DEFAULT; if ((strptr = (char *)xf86GetOptValString(pSmi->Options, OPTION_ACCELMETHOD))) { if (!xf86NameCmp(strptr,"XAA")) { from = X_CONFIG; @@ -1589,7 +1589,7 @@ SMI_WriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr, SMIRegPtr restore) if (pSmi->Dualhead) { - /* TFT panel uses FIFO1, DSTN panel uses FIFO1 for upper panel and + /* TFT panel uses FIFO1, DSTN panel uses FIFO1 for upper panel and * FIFO2 for lower panel. I don't have a DSTN panel, so it's untested. * -- AGD */ @@ -2636,6 +2636,12 @@ SMI_ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) /* dualhead */ if (pSmi->Dualhead) { + /* TFT panel uses FIFO1, DSTN panel uses FIFO1 for upper panel and + * FIFO2 for lower panel. I don't have a DSTN panel, so it's untested. + * -- AGD + */ + CARD32 fifo1_readoffset, fifo2_readoffset, fifo_writeoffset; + /* PLL controls */ /* set LCD to vclk2 */ new->SR69 = 0x04; @@ -2666,12 +2672,6 @@ SMI_ModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) new->SR6F = 0x89; } - /* TFT panel uses FIFO1, DSTN panel uses FIFO1 for upper panel and - * FIFO2 for lower panel. I don't have a DSTN panel, so it's untested. - * -- AGD - */ - CARD32 fifo1_readoffset, fifo2_readoffset, fifo_writeoffset; - /* setting SR21 bit 2 disables ZV circuitry, * if ZV is needed, SR21 = 0x20 */ diff --git a/src/smi_exa.c b/src/smi_exa.c index 575ab65..e53f482 100644 --- a/src/smi_exa.c +++ b/src/smi_exa.c @@ -439,14 +439,13 @@ SMI_DownloadFromScreen(PixmapPtr pSrc, int x, int y, int w, int h, { ScrnInfoPtr pScrn = xf86Screens[pSrc->drawable.pScreen->myNum]; SMIPtr pSmi = SMIPTR(pScrn); + unsigned char *src = pSrc->devPrivate.ptr; + int src_pitch = exaGetPixmapPitch(pSrc); ENTER_PROC("SMI_DownloadFromScreen"); DEBUG((VERBLEV, "x=%d y=%d w=%d h=%d dst=%d dst_pitch=%d\n", x, y, w, h, dst, dst_pitch)); - unsigned char *src = pSrc->devPrivate.ptr; - int src_pitch = exaGetPixmapPitch(pSrc); - exaWaitSync(pSrc->drawable.pScreen); src += (y * src_pitch) + (x * pSmi->Bpp); diff --git a/src/smi_pcirename.h b/src/smi_pcirename.h index 9321046..64f52f3 100644 --- a/src/smi_pcirename.h +++ b/src/smi_pcirename.h @@ -26,8 +26,8 @@ * library. The main purpose being to facilitate source code compatibility. */ -#ifndef S3PCIRENAME_H -#define S3PCIRENAME_H +#ifndef SMIPCIRENAME_H +#define SMIPCIRENAME_H enum region_type { REGION_MEM, @@ -119,4 +119,4 @@ typedef struct pci_device *pciVideoPtr; #endif /* XSERVER_LIBPCIACCESS */ -#endif /* CIRPCIRENAME_H */ +#endif /* SMIPCIRENAME_H */ diff --git a/src/smi_video.c b/src/smi_video.c index b00b8da..d0c7bd6 100644 --- a/src/smi_video.c +++ b/src/smi_video.c @@ -1762,7 +1762,6 @@ SMI_ClipVideo( INT32 height ) { - ScreenPtr pScreen = pScrn->pScreen; INT32 vscale, hscale; BoxPtr extents = REGION_EXTENTS(pScreen, reg); int diff; -- 1.5.3.2