From ac84fe358f338bb757ae01d935e361156830f7f9 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Tue, 12 Aug 2025 17:33:38 -0700 Subject: [PATCH] Strip trailing whitespace from source files Performed with: `git ls-files | xargs perl -i -p -e 's{[ \t]+$}{}'` `git diff -w` & `git diff -b` show no diffs from this change Signed-off-by: Alan Coopersmith Part-of: --- .gitignore | 4 +- README.multihead | 2 +- src/alp_driver.c | 110 ++++++++++++++++++++++---------------------- src/alp_hwcurs.c | 14 +++--- src/cir_dga.c | 24 +++++----- src/cir_driver.c | 22 ++++----- src/cir_pcirename.h | 2 +- src/cir_shadow.c | 14 +++--- src/lg_blit.h | 2 +- src/lg_hwcurs.c | 40 ++++++++-------- 10 files changed, 117 insertions(+), 117 deletions(-) diff --git a/.gitignore b/.gitignore index 79dfc22..c21362b 100644 --- a/.gitignore +++ b/.gitignore @@ -71,8 +71,8 @@ core *.tar.bz2 *.tar.gz # -# Add & Override patterns for xf86-video-cirrus +# Add & Override patterns for xf86-video-cirrus # # Edit the following section as needed # For example, !report.pc overrides *.pc. See 'man gitignore' -# +# diff --git a/README.multihead b/README.multihead index 514696d..fc5bac8 100644 --- a/README.multihead +++ b/README.multihead @@ -23,7 +23,7 @@ not do it right too. I tried it with a 5465 (AGP) as a primary and 5446B (PCI) secondary on an ABIT LX6 upgraded to the latest bios. -Version A of the 5446 cannot be pure MMIO (The driver +Version A of the 5446 cannot be pure MMIO (The driver requires that it is the primary display adapter). You can distinguish between the rel A and rel B by running "scanpci -v". Version 1 does not report a diff --git a/src/alp_driver.c b/src/alp_driver.c index 5c355ff..9b3959a 100644 --- a/src/alp_driver.c +++ b/src/alp_driver.c @@ -178,7 +178,7 @@ _X_EXPORT ScrnInfoPtr AlpProbe(int entity) { ScrnInfoPtr pScrn = NULL; - + if ((pScrn = xf86ConfigPciEntity(pScrn, 0, entity, CIRPciChipsets, NULL,NULL, NULL, NULL, NULL))) { pScrn->PreInit = AlpPreInit; @@ -237,7 +237,7 @@ AlpCountRam(ScrnInfoPtr pScrn) vgaHWPtr hwp = VGAHWPTR(pScrn); MessageType from; int videoram = 0; - + /* Map the Alp memory and MMIO areas */ pCir->FbMapSize = 1024*1024; /* XX temp */ if (!pCir->IoMapSize) @@ -265,7 +265,7 @@ AlpCountRam(ScrnInfoPtr pScrn) } xf86DrvMsg(pScrn->scrnIndex, from, "Memory Config reg 1 is 0x%02X\n", (unsigned int)pCir->chip.alp->sr0f); - + switch (pCir->Chipset) { case PCI_CHIP_GD5430: /* case PCI_CHIP_GD5440: */ @@ -281,7 +281,7 @@ AlpCountRam(ScrnInfoPtr pScrn) break; } break; - + case PCI_CHIP_GD5434_4: case PCI_CHIP_GD5434_8: case PCI_CHIP_GD5436: @@ -295,10 +295,10 @@ AlpCountRam(ScrnInfoPtr pScrn) videoram = 4096; break; } - + case PCI_CHIP_GD5446: videoram = 1024; - + if (pCir->chip.alp->sr17 != (CARD32)-1) { from = X_CONFIG; hwp->writeSeq(hwp, 0x17, pCir->chip.alp->sr17); @@ -308,7 +308,7 @@ AlpCountRam(ScrnInfoPtr pScrn) } xf86DrvMsg(pScrn->scrnIndex, from, "Memory Config reg 2 is 0x%02X\n", (unsigned int)pCir->chip.alp->sr17); - + if ((pCir->chip.alp->sr0f & 0x18) == 0x18) { if (pCir->chip.alp->sr0f & 0x80) { if (pCir->chip.alp->sr17 & 0x80) @@ -323,7 +323,7 @@ AlpCountRam(ScrnInfoPtr pScrn) } } break; - + case PCI_CHIP_GD5480: if (pCir->chip.alp->sr17 != (CARD32)-1) { from = X_CONFIG; @@ -343,7 +343,7 @@ AlpCountRam(ScrnInfoPtr pScrn) if (pCir->chip.alp->sr17 & 0x80) videoram <<= 1; break; - + case PCI_CHIP_GD7548: videoram = 1024; switch (pCir->chip.alp->sr0f & 0x90) { @@ -365,8 +365,8 @@ AlpCountRam(ScrnInfoPtr pScrn) /* UNMap the Alp memory and MMIO areas */ if (!CirUnmapMem(pCir, pScrn->scrnIndex)) return 0; - vgaHWSetStdFuncs(hwp); - + vgaHWSetStdFuncs(hwp); + return videoram; } @@ -563,7 +563,7 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags) if (!xf86SetDefaultVisual(pScrn, -1)) { return FALSE; - } + } /* Collect all of the relevant option flags (fill in pScrn->options) */ xf86CollectOptions(pScrn, NULL); @@ -573,12 +573,12 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags) memcpy(pCir->Options, CirOptions, sizeof(CirOptions)); xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pCir->Options); - if (!xf86IsPrimaryPci(pCir->PciInfo) + if (!xf86IsPrimaryPci(pCir->PciInfo) && !(pInt || (xf86IsOptionSet(pCir->Options,OPTION_MEMCFG1) && xf86IsOptionSet(pCir->Options,OPTION_MEMCFG2)))) return FALSE; - - if (pScrn->depth == 8) + + if (pScrn->depth == 8) pScrn->rgbBits = 6; from = X_DEFAULT; @@ -689,17 +689,17 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags) } else { pCir->UseMMIO = FALSE; from1 = X_PROBED; - } - } else { + } + } else { pCir->UseMMIO = FALSE; from1 = X_PROBED; - } - + } + if (pCir->UseMMIO) { xf86DrvMsg(pScrn->scrnIndex, from1, "Using MMIO\n"); xf86DrvMsg(pScrn->scrnIndex, from, "MMIO registers at 0x%lX\n", (unsigned long)pCir->IOAddress); - } else + } else xf86DrvMsg(pScrn->scrnIndex, from1, "Not Using MMIO\n"); #ifndef XSERVER_LIBPCIACCESS @@ -725,12 +725,12 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags) AlpFreeRec(pScrn); return FALSE; } - + if (!xf86LoadSubModule(pScrn, "ddc")) { AlpFreeRec(pScrn); return FALSE; } - + if(!AlpI2CInit(pScrn)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "I2C initialization failed\n"); @@ -748,22 +748,22 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags) pCir->NoAccel = TRUE; } #endif - + /* Probe the possible LCD display */ AlpProbeLCD(pScrn); #ifdef CIRPROBEI2C CirProbeI2C(pScrn->scrnIndex); #endif - + /* The gamma fields must be initialised when using the new cmap code */ if (pScrn->depth > 1) { Gamma zeros = {0.0, 0.0, 0.0}; - + if (!xf86SetGamma(pScrn, zeros)) return FALSE; } - + /* XXX If UseMMIO == TRUE and for any reason we cannot do MMIO, abort here */ @@ -771,13 +771,13 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags) OPTION_SHADOW_FB,&pCir->shadowFB)) xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "ShadowFB %s.\n", pCir->shadowFB ? "enabled" : "disabled"); - + if ((s = xf86GetOptValString(pCir->Options, OPTION_ROTATE))) { if(!xf86NameCmp(s, "CW")) { /* accel is disabled below for shadowFB */ pCir->shadowFB = TRUE; pCir->rotate = 1; - xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, + xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Rotating screen clockwise - acceleration disabled\n"); } else if(!xf86NameCmp(s, "CCW")) { pCir->shadowFB = TRUE; @@ -787,7 +787,7 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags) } else { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "\"%s\" is not a valid" "value for Option \"Rotate\"\n", s); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Valid options are \"CW\" or \"CCW\"\n"); } } @@ -809,7 +809,7 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags) "HW cursor not supported with \"rotate\".\n"); pCir->HWCursor = FALSE; } - + /* XXX We do not know yet how to configure memory on this card. Use options MemCFG1 and MemCFG2 to set registers SR0F and SR17 before trying to count ram size. */ @@ -856,7 +856,7 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags) /* We use a programmable clock */ pScrn->progClock = TRUE; - + /* XXX Set HW cursor use */ /* Set the min pixel clock */ @@ -1068,7 +1068,7 @@ AlpPreInit(ScrnInfoPtr pScrn, int flags) static void AlpSave(ScrnInfoPtr pScrn) { - CirPtr pCir = CIRPTR(pScrn); + CirPtr pCir = CIRPTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn); #ifdef ALP_DEBUG @@ -1134,9 +1134,9 @@ alpRestore(vgaHWPtr hwp, AlpRegPtr cirReg) /* The first 4 reads are for the pixel mask register. After 4 times that this register is accessed in succession reading/writing this address accesses the HDR. */ - hwp->readDacMask(hwp); - hwp->readDacMask(hwp); - hwp->readDacMask(hwp); + hwp->readDacMask(hwp); + hwp->readDacMask(hwp); + hwp->readDacMask(hwp); hwp->readDacMask(hwp); hwp->writeDacMask(hwp, cirReg->ExtVga[HDR ]); } @@ -1345,7 +1345,7 @@ AlpModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) /* Programme the registers */ vgaHWProtect(pScrn, TRUE); - hwp->writeMiscOut(hwp, hwp->ModeReg.MiscOutReg); + hwp->writeMiscOut(hwp, hwp->ModeReg.MiscOutReg); alpRestore(hwp,&pCir->chip.alp->ModeReg); AlpSetClock(pCir, hwp, mode->SynthClock); @@ -1383,7 +1383,7 @@ AlpRestore(ScrnInfoPtr pScrn) vgaHWProtect(pScrn, TRUE); alpRestore(hwp,alpReg); - + vgaHWRestore(pScrn, vgaReg, VGA_SR_ALL); vgaHWProtect(pScrn, FALSE); } @@ -1404,14 +1404,14 @@ AlpScreenInit(ScreenPtr pScreen, int argc, char **argv) int displayWidth,width,height; unsigned char * FbBase = NULL; int cursor_size = 0; - + #ifdef ALP_DEBUG ErrorF("AlpScreenInit\n"); #endif hwp = VGAHWPTR(pScrn); pCir = CIRPTR(pScrn); - + /* Map the VGA memory when the primary video */ if (!vgaHWMapMem(pScrn)) return FALSE; @@ -1478,7 +1478,7 @@ AlpScreenInit(ScreenPtr pScreen, int argc, char **argv) width = pScrn->virtualX; height = pScrn->virtualY; } - + if(pCir->shadowFB) { pCir->ShadowPitch = BitmapBytePad(pScrn->bitsPerPixel * width); pCir->ShadowPtr = malloc(pCir->ShadowPitch * height); @@ -1488,7 +1488,7 @@ AlpScreenInit(ScreenPtr pScreen, int argc, char **argv) pCir->ShadowPtr = NULL; FbBase = pCir->FbBase; } - + /* * Call the framebuffer layer's ScreenInit function, and fill in other * pScreen fields. @@ -1539,17 +1539,17 @@ AlpScreenInit(ScreenPtr pScreen, int argc, char **argv) /* must be after RGB ordering fixed */ if (init_picture) fbPictureInit (pScreen, 0, 0); - + /* * Set initial black & white colourmap indices. */ xf86SetBlackWhitePixels(pScreen); - /* + /* Allocation of off-screen memory to various stuff (hardware cursor, 8x8 mono pattern...) Allocation goes top-down in memory, since the cursor - *must* be in the last videoram locations + *must* be in the last videoram locations */ pCir->offscreen_offset = pScrn->videoRam*1024; pCir->offscreen_size = pScrn->videoRam * 1024 - pScrn->virtualY * @@ -1559,11 +1559,11 @@ AlpScreenInit(ScreenPtr pScreen, int argc, char **argv) ErrorF("offscreen_offset=%d, offscreen_size=%d\n", pCir->offscreen_offset, pCir->offscreen_size); #endif - + /* Initialise cursor functions */ if (pCir->HWCursor) { /* Initialize HW cursor layer */ - - if ((pCir->properties & HWCUR64) + + if ((pCir->properties & HWCUR64) && (pCir->offscreen_size >= 64*8*2)) { cursor_size = 64; pCir->offscreen_size -= 64*8*2; @@ -1582,7 +1582,7 @@ AlpScreenInit(ScreenPtr pScreen, int argc, char **argv) #if 1 pCir->DGAModeInit = AlpModeInit; if (!CirDGAInit(pScreen)) - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "DGA initialization failed\n"); #endif xf86SetSilkenMouse(pScreen); @@ -1593,7 +1593,7 @@ AlpScreenInit(ScreenPtr pScreen, int argc, char **argv) if (pCir->HWCursor) { if (!AlpHWCursorInit(pScreen, cursor_size)) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Hardware cursor initialization failed\n"); + "Hardware cursor initialization failed\n"); #ifdef ALP_DEBUG ErrorF("AlpHWCursorInit() complete\n"); #endif @@ -1601,13 +1601,13 @@ AlpScreenInit(ScreenPtr pScreen, int argc, char **argv) if (pCir->shadowFB) { RefreshAreaFuncPtr refreshArea = cirRefreshArea; - + if(pCir->rotate) { if (!pCir->PointerMoved) { pCir->PointerMoved = pScrn->PointerMoved; pScrn->PointerMoved = cirPointerMoved; } - + switch(pScrn->bitsPerPixel) { case 8: refreshArea = cirRefreshArea8; break; case 16: refreshArea = cirRefreshArea16; break; @@ -1615,7 +1615,7 @@ AlpScreenInit(ScreenPtr pScreen, int argc, char **argv) case 32: refreshArea = cirRefreshArea32; break; } } - + ShadowFBInit(pScreen, refreshArea); } @@ -1724,7 +1724,7 @@ AlpEnterVT(ScrnInfoPtr pScrn) /* Should we re-save the text mode on each VT enter? */ if (!(ret = AlpModeInit(pScrn, pScrn->currentMode))) return FALSE; - + if (!pCir->NoAccel) pCir->InitAccel(pScrn); @@ -1953,7 +1953,7 @@ static void AlpProbeI2C(int scrnIndex) static void AlpProbeLCD(ScrnInfoPtr pScrn) { - CirPtr pCir = CIRPTR(pScrn); + CirPtr pCir = CIRPTR(pScrn); AlpPtr pAlp = ALPPTR(pCir); vgaHWPtr hwp = VGAHWPTR(pScrn); @@ -2005,7 +2005,7 @@ AlpProbeLCD(ScrnInfoPtr pScrn) pAlp->lcdHeight = 0; break; } - + /* Disable LCD control registers */ hwp->writeCrtc(hwp, 0x2D, lcdCrtl); break; diff --git a/src/alp_hwcurs.c b/src/alp_hwcurs.c index c369ffe..f0c49b4 100644 --- a/src/alp_hwcurs.c +++ b/src/alp_hwcurs.c @@ -43,12 +43,12 @@ AlpSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg) static void AlpLoadSkewedCursor(CirPtr pCir, int x, int y) { - + const AlpPtr pAlp = ALPPTR(pCir); unsigned char *memx = pAlp->HWCursorBits; unsigned char *CursorBits = pAlp->CursorBits; - + unsigned char mem[2*MAXCURSORSIZE]; unsigned char *p1, *p2; int i, a, b; @@ -87,7 +87,7 @@ AlpLoadSkewedCursor(CirPtr pCir, int x, int y) { /* last cursor byte */ *p1++ = (p2[0] << b); } - + /* Clear to end (bottom) of cursor. */ for (i = i+1; i < CURSORSIZE; i++) *p1++ = 0; @@ -202,7 +202,7 @@ AlpHWCursorInit(ScreenPtr pScreen, int size) ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); const CirPtr pCir = CIRPTR(pScrn); const AlpPtr pAlp = ALPPTR(pCir); - + xf86CursorInfoPtr infoPtr; #ifdef ALP_DEBUG @@ -221,20 +221,20 @@ AlpHWCursorInit(ScreenPtr pScreen, int size) CURSORWIDTH = CURSORHEIGHT = 64; else CURSORWIDTH = CURSORHEIGHT = 32; - + pAlp->HWCursorBits = pCir->FbBase + 1024*pScrn->videoRam - 2*CURSORSIZE; infoPtr->MaxWidth = CURSORWIDTH; infoPtr->MaxHeight = CURSORHEIGHT; if (CURSORWIDTH == 64) - infoPtr->Flags = + infoPtr->Flags = #if X_BYTE_ORDER == X_LITTLE_ENDIAN HARDWARE_CURSOR_BIT_ORDER_MSBFIRST | #endif HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 | HARDWARE_CURSOR_TRUECOLOR_AT_8BPP; else - infoPtr->Flags = + infoPtr->Flags = #if X_BYTE_ORDER == X_LITTLE_ENDIAN HARDWARE_CURSOR_BIT_ORDER_MSBFIRST | #endif diff --git a/src/cir_dga.c b/src/cir_dga.c index 6a50e71..7c7bbc7 100644 --- a/src/cir_dga.c +++ b/src/cir_dga.c @@ -34,7 +34,7 @@ #include "cir.h" #include "dgaproc.h" -static Bool Cir_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **, +static Bool Cir_OpenFramebuffer(ScrnInfoPtr, char **, unsigned char **, int *, int *, int *); static Bool Cir_SetMode(ScrnInfoPtr, DGAModePtr); static int Cir_GetViewport(ScrnInfoPtr); @@ -66,7 +66,7 @@ CirDGAInit(ScreenPtr pScreen) int imlines = (pScrn->videoRam * 1024) / (pScrn->displayWidth * (pScrn->bitsPerPixel >> 3)); - + if (!pCir->DGAnumModes) { pMode = firstMode = pScrn->modes; while (pMode) { @@ -101,15 +101,15 @@ CirDGAInit(ScreenPtr pScreen) currentMode->offset = 0; currentMode->address = pCir->FbBase; currentMode->bytesPerScanline = ((pScrn->displayWidth * Bpp) + 3) & ~3L; - currentMode->pixmapWidth = currentMode->imageWidth + currentMode->pixmapWidth = currentMode->imageWidth = pScrn->displayWidth; currentMode->pixmapHeight = currentMode->imageHeight = imlines; - currentMode->maxViewportX = currentMode->imageWidth - + currentMode->maxViewportX = currentMode->imageWidth - currentMode->viewportWidth; /* this might need to get clamped to some maximum */ currentMode->maxViewportY = currentMode->imageHeight - currentMode->viewportHeight; - + pMode = pMode->next; if(pMode == firstMode) break; @@ -120,9 +120,9 @@ CirDGAInit(ScreenPtr pScreen) return DGAInit(pScreen, &CirDGAFuncs, pCir->DGAModes, pCir->DGAnumModes); } -static Bool +static Bool Cir_OpenFramebuffer( - ScrnInfoPtr pScrn, + ScrnInfoPtr pScrn, char **name, unsigned char **mem, int *size, @@ -162,7 +162,7 @@ Cir_SetMode( pCir->DGAactive = TRUE; } - pScrn->displayWidth = pMode->bytesPerScanline / + pScrn->displayWidth = pMode->bytesPerScanline / (pMode->bitsPerPixel >> 3); ret = pCir->DGAModeInit(xf86Screens[index], pMode->mode); @@ -170,10 +170,10 @@ Cir_SetMode( return ret; } -static void +static void Cir_SetViewport( - ScrnInfoPtr pScrn, - int x, int y, + ScrnInfoPtr pScrn, + int x, int y, int flags ){ CirPtr pCir = CIRPTR(pScrn); @@ -187,7 +187,7 @@ Cir_SetViewport( pCir->DGAViewportStatus = 0; /* AdjustFrame loops until finished */ } -static int +static int Cir_GetViewport( ScrnInfoPtr pScrn ){ diff --git a/src/cir_driver.c b/src/cir_driver.c index bc1e4b3..85a7b66 100644 --- a/src/cir_driver.c +++ b/src/cir_driver.c @@ -184,13 +184,13 @@ CIRProbe(DriverPtr drv, int flags) #ifdef CIR_DEBUG ErrorF("CirProbe\n"); #endif - + if ((numDevSections = xf86MatchDevice(CIR_DRIVER_NAME, &devSections)) <= 0) { return FALSE; } -#ifndef XSERVER_LIBPCIACCESS +#ifndef XSERVER_LIBPCIACCESS if (xf86GetPciVideoInfo() == NULL) { /* * We won't let anything in the config file override finding no @@ -199,7 +199,7 @@ CIRProbe(DriverPtr drv, int flags) return FALSE; } #endif - + numUsed = xf86MatchPciInstances(CIR_NAME, PCI_VENDOR_CIRRUS, CIRChipsets, CIRPciChipsets, devSections, numDevSections, drv, &usedChips); @@ -239,7 +239,7 @@ CIRProbe(DriverPtr drv, int flags) } else { pScrn = AlpProbe(usedChips[i]); } - + if (pScrn) { foundScreen = TRUE; /* Fill in what we can of the ScrnInfoRec */ @@ -251,7 +251,7 @@ CIRProbe(DriverPtr drv, int flags) } free(devSections); free(usedChips); - + return foundScreen; } @@ -272,7 +272,7 @@ CirMapMem(CirPtr pCir, int scrnIndex) if (pCir->FbMapSize) { #ifndef XSERVER_LIBPCIACCESS - + pCir->FbBase = xf86MapPciMem(scrnIndex, VIDMEM_FRAMEBUFFER, pCir->PciTag, pCir->FbAddress, pCir->FbMapSize); @@ -288,11 +288,11 @@ CirMapMem(CirPtr pCir, int scrnIndex) PCI_DEV_MAP_FLAG_WRITE_COMBINE, result); - if (err) + if (err) return FALSE; #endif } - + #ifdef CIR_DEBUG ErrorF("CirMapMem pCir->FbBase=0x%08x\n", pCir->FbBase); #endif @@ -324,10 +324,10 @@ CirMapMem(CirPtr pCir, int scrnIndex) pCir->IoMapSize, PCI_DEV_MAP_FLAG_WRITABLE, result); - - if (err) + + if (err) return FALSE; - + #endif } diff --git a/src/cir_pcirename.h b/src/cir_pcirename.h index 5c47f99..8060eea 100644 --- a/src/cir_pcirename.h +++ b/src/cir_pcirename.h @@ -31,7 +31,7 @@ enum region_type { REGION_MEM, - REGION_IO + REGION_IO }; #include "xf86Module.h" diff --git a/src/cir_shadow.c b/src/cir_shadow.c index 377c9fb..8d26fc6 100644 --- a/src/cir_shadow.c +++ b/src/cir_shadow.c @@ -1,5 +1,5 @@ /* - Copyright (c) 1999,2000 The XFree86 Project Inc. + Copyright (c) 1999,2000 The XFree86 Project Inc. based on code written by Mark Vojkovich */ @@ -23,7 +23,7 @@ cirRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox) { CirPtr pCir = CIRPTR(pScrn); unsigned char *src, *dst; - + int Bpp = pScrn->bitsPerPixel >> 3; int FBPitch = BitmapBytePad(pScrn->displayWidth * pScrn->bitsPerPixel); @@ -50,7 +50,7 @@ cirRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox) pbox++; } -} +} _X_EXPORT void cirPointerMoved(ScrnInfoPtr pScrn, int x, int y) @@ -119,7 +119,7 @@ cirRefreshArea8(ScrnInfoPtr pScrn, int num, BoxPtr pbox) pbox++; } -} +} _X_EXPORT void @@ -216,13 +216,13 @@ cirRefreshArea24(ScrnInfoPtr pScrn, int num, BoxPtr pbox) int count = height; while(count--) { dst[0] = src[0] | (src[1] << 8) | (src[2] << 16) | - (src[srcPitch] << 24); + (src[srcPitch] << 24); dst[1] = src[srcPitch + 1] | (src[srcPitch + 2] << 8) | (src[srcPitch * 2] << 16) | - (src[(srcPitch * 2) + 1] << 24); + (src[(srcPitch * 2) + 1] << 24); dst[2] = src[(srcPitch * 2) + 2] | (src[srcPitch * 3] << 8) | (src[(srcPitch * 3) + 1] << 16) | - (src[(srcPitch * 3) + 2] << 24); + (src[(srcPitch * 3) + 2] << 24); dst += 3; src += srcPitch * 4; } diff --git a/src/lg_blit.h b/src/lg_blit.h index b5edd90..8894bab 100644 --- a/src/lg_blit.h +++ b/src/lg_blit.h @@ -75,7 +75,7 @@ enum { /* OR these together to form a bitBLT mode */ still around, even in the '64 and the '65. It's a performance option, anyway, so not using it should be okay. */ - + BLITUP = 0x8000 /* The blit is proceeding from bottom to top */ }; diff --git a/src/lg_hwcurs.c b/src/lg_hwcurs.c index 7d085ec..0ed553a 100644 --- a/src/lg_hwcurs.c +++ b/src/lg_hwcurs.c @@ -49,7 +49,7 @@ enum { CURSOR_CONTROL = 0x00E6, CURSOR_ADDR = 0x00E8 }; - + static void LgFindCursorTile(ScrnInfoPtr pScrn, int *x, int *y, int *width, int *height, @@ -90,12 +90,12 @@ static void LgSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg) * Set the (x,y) position of the pointer. * * Note: (x,y) are /frame/ relative, not /framebuffer/ relative. - * That is, if the virtual desktop has been panned all the way to - * the right, and the pointer is to be in the upper-right hand corner + * That is, if the virtual desktop has been panned all the way to + * the right, and the pointer is to be in the upper-right hand corner * of the viewable screen, the pointer coords are (0,0) (even though * the pointer is on, say (550,0) wrt the frame buffer). This is, of * course, a /good/ thing -- we don't want to have to deal with where - * the virtual display is, etc, in the cursor code. + * the virtual display is, etc, in the cursor code. * */ static void LgSetCursorPosition(ScrnInfoPtr pScrn, int x, int y) @@ -170,7 +170,7 @@ static void LgLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *bits) /* Destination */ LgSETMDSTXY(pLg->HWCursorImageX+pLg->HWCursorTileWidth, pLg->HWCursorImageY); - /* Set the source pitch. 0 means that, worst case, the source is + /* Set the source pitch. 0 means that, worst case, the source is aligned only on a byte boundary */ LgSETMPHASE1(0); @@ -178,19 +178,19 @@ static void LgLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *bits) for (l = 0; l < CURSORHEIGHT; l++) { /* Plane 0 */ - for (w = 0; w < CURSORWIDTH >> 5; w++) + for (w = 0; w < CURSORWIDTH >> 5; w++) memwl(HOSTDATA, 0x00000000); /* Plane 1 */ - for (w = 0; w < CURSORWIDTH >> 5; w++) + for (w = 0; w < CURSORWIDTH >> 5; w++) memwl(HOSTDATA, 0x00000000); } /* Now, copy the real cursor image */ - + /* Set the destination */ LgSETMDSTXY(pLg->HWCursorImageX, pLg->HWCursorImageY); - /* Set the source pitch. 0 means that, worst case, the source is + /* Set the source pitch. 0 means that, worst case, the source is aligned only on a byte boundary */ LgSETMPHASE1(0); @@ -199,10 +199,10 @@ static void LgLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *bits) for (l = 0; l < CURSORHEIGHT; l++) { /* Plane 0 */ - for (w = 0; w < CURSORWIDTH >> 5; w++) + for (w = 0; w < CURSORWIDTH >> 5; w++) memwl(HOSTDATA, *pXCursorBits++); /* Plane 1 */ - for (w = 0; w < CURSORWIDTH >> 5; w++) + for (w = 0; w < CURSORWIDTH >> 5; w++) memwl(HOSTDATA, *pXCursorBits++); } @@ -215,7 +215,7 @@ static void LgLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *bits) /* * LgFindCursorTile() finds the tile of display memory that will be * used to load the pointer image into. The tile chosen will be the - * last tile in the last line of the frame buffer. + * last tile in the last line of the frame buffer. */ static void LgFindCursorTile(ScrnInfoPtr pScrn, int *x, int *y, int *width, int *height, @@ -230,10 +230,10 @@ LgFindCursorTile(ScrnInfoPtr pScrn, int *x, int *y, int *width, int *height, int tilesPerLine = LgLineData[pLg->lineDataIndex].tilesPerLine; int filledOutTileLines, leftoverMem; int yTile, xTile; - + filledOutTileLines = videoRam / (tilesPerLine * 2); /* tiles are 2K */ leftoverMem = videoRam - filledOutTileLines*tilesPerLine*2; - + if (leftoverMem > 0) { yTile = filledOutTileLines; } else { @@ -262,14 +262,14 @@ LgFindCursorTile(ScrnInfoPtr pScrn, int *x, int *y, int *width, int *height, nIL = pLg->memInterleave==0x00? 1 : (pLg->memInterleave==0x40 ? 2 : 4); if (PCI_CHIP_GD5465 == pCir->Chipset) { - /* The Where's The Cursor formula changed for the 5465. It's really + /* The Where's The Cursor formula changed for the 5465. It's really kinda weird now. */ unsigned long page, bank; unsigned int nX, nY; - + nX = xTile * tileWidth; nY = yTile * tileHeight; - + page = (nY / (tileHeight * nIL)) * tilesPerLine + nX / tileWidth; bank = (nX/tileWidth + nY/tileHeight) % nIL + page/(512*nIL); page = page & 0x1FF; @@ -299,7 +299,7 @@ void LgHideCursor(ScrnInfoPtr pScrn) We don't just clear the cursor enable bit because doesn't work in some cases (like when switching back to text mode). */ - + #ifdef LG_CURSOR_DEBUG ErrorF("LgHideCursor\n"); #endif @@ -354,14 +354,14 @@ Bool LgHWCursorInit(ScreenPtr pScreen) infoPtr = xf86CreateCursorInfoRec(); if(!infoPtr) return FALSE; - + pCir->CursorInfoRec = infoPtr; LgFindCursorTile(pScrn, &pCir->chip.lg->HWCursorImageX, &pCir->chip.lg->HWCursorImageY, &pCir->chip.lg->HWCursorTileWidth, &pCir->chip.lg->HWCursorTileHeight, &pCir->chip.lg->HWCursorAddr); /* Keep only bits 22:10 of the address. */ pCir->chip.lg->HWCursorAddr = (pCir->chip.lg->HWCursorAddr >> 8) & 0x7FFC; - + pCir->CursorIsSkewed = FALSE; infoPtr->MaxWidth = CURSORWIDTH;