summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2009-12-30 11:23:16 -0500
committerAdam Jackson <ajax@redhat.com>2009-12-30 11:23:16 -0500
commit3c73bfc96817348449e5ab6a7f7b03ac6c85bd47 (patch)
tree0c50327af5f08f779fb9502e7d7aed329562c8c7
parent2c8da9b4e703678b0f0f16edb1c48a523c8442fd (diff)
downloadxorg-driver-xf86-video-vesa-3c73bfc96817348449e5ab6a7f7b03ac6c85bd47.tar.gz
Code motion
Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r--src/vesa.c63
1 files changed, 29 insertions, 34 deletions
diff --git a/src/vesa.c b/src/vesa.c
index df73152..ecf228d 100644
--- a/src/vesa.c
+++ b/src/vesa.c
@@ -105,10 +105,35 @@ static void RestoreFonts(ScrnInfoPtr pScrn);
static Bool
VESASaveRestore(ScrnInfoPtr pScrn, vbeSaveRestoreFunction function);
-static void *VESAWindowLinear(ScreenPtr pScrn, CARD32 row, CARD32 offset,
- int mode, CARD32 *size, void *closure);
-static void *VESAWindowWindowed(ScreenPtr pScrn, CARD32 row, CARD32 offset,
- int mode, CARD32 *size, void *closure);
+static void *
+VESAWindowLinear(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode,
+ CARD32 *size, void *closure)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ VESAPtr pVesa = VESAGetRec(pScrn);
+
+ *size = pVesa->maxBytesPerScanline;
+ return ((CARD8 *)pVesa->base + row * pVesa->maxBytesPerScanline + offset);
+}
+
+static void *
+VESAWindowWindowed(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode,
+ CARD32 *size, void *closure)
+{
+ ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
+ VESAPtr pVesa = VESAGetRec(pScrn);
+ VbeModeInfoBlock *data = ((VbeModeInfoData*)(pScrn->currentMode->Private))->data;
+ int window;
+
+ offset += pVesa->maxBytesPerScanline * row;
+ window = offset / (data->WinGranularity * 1024);
+ pVesa->windowAoffset = window * data->WinGranularity * 1024;
+ VESABankSwitch(pScreen, window);
+ *size = data->WinSize * 1024 - (offset - pVesa->windowAoffset);
+
+ return (void *)((unsigned long)pVesa->base +
+ (offset - pVesa->windowAoffset));
+}
static Bool VESADGAInit(ScrnInfoPtr pScrn, ScreenPtr pScreen);
@@ -1286,36 +1311,6 @@ VESAUnmapVidMem(ScrnInfoPtr pScrn)
pVesa->base = NULL;
}
-static void *
-VESAWindowLinear(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode,
- CARD32 *size, void *closure)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- VESAPtr pVesa = VESAGetRec(pScrn);
-
- *size = pVesa->maxBytesPerScanline;
- return ((CARD8 *)pVesa->base + row * pVesa->maxBytesPerScanline + offset);
-}
-
-static void *
-VESAWindowWindowed(ScreenPtr pScreen, CARD32 row, CARD32 offset, int mode,
- CARD32 *size, void *closure)
-{
- ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
- VESAPtr pVesa = VESAGetRec(pScrn);
- VbeModeInfoBlock *data = ((VbeModeInfoData*)(pScrn->currentMode->Private))->data;
- int window;
-
- offset += pVesa->maxBytesPerScanline * row;
- window = offset / (data->WinGranularity * 1024);
- pVesa->windowAoffset = window * data->WinGranularity * 1024;
- VESABankSwitch(pScreen, window);
- *size = data->WinSize * 1024 - (offset - pVesa->windowAoffset);
-
- return (void *)((unsigned long)pVesa->base +
- (offset - pVesa->windowAoffset));
-}
-
/* This code works, but is very slow for programs that use it intensively */
static void
VESALoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices,