diff options
author | Dave Airlie <airlied@redhat.com> | 2012-06-06 12:14:42 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-06-06 12:14:42 +0100 |
commit | 062923d3ca1a9ab5ee5226c0d87bc5ec6d5e62c4 (patch) | |
tree | 5a0a63d43e13f247d6a66ddd6e588217c07e23ec | |
parent | c4796200c2d322a59ccf2eeb2df3be874507fd48 (diff) |
glint: port to new compat API
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | src/IBMramdac.c | 2 | ||||
-rw-r--r-- | src/Makefile.am | 1 | ||||
-rw-r--r-- | src/TIramdac.c | 2 | ||||
-rw-r--r-- | src/compat-api.h | 99 | ||||
-rw-r--r-- | src/glint.h | 5 | ||||
-rw-r--r-- | src/glint_dga.c | 8 | ||||
-rw-r--r-- | src/glint_driver.c | 93 | ||||
-rw-r--r-- | src/pm2_accel.c | 2 | ||||
-rw-r--r-- | src/pm2_dac.c | 2 | ||||
-rw-r--r-- | src/pm2_video.c | 2 | ||||
-rw-r--r-- | src/pm2v_dac.c | 2 | ||||
-rw-r--r-- | src/pm3_accel.c | 4 | ||||
-rw-r--r-- | src/pm3_video.c | 6 | ||||
-rw-r--r-- | src/pm_accel.c | 2 | ||||
-rw-r--r-- | src/sx_accel.c | 2 | ||||
-rw-r--r-- | src/tx_accel.c | 2 |
16 files changed, 163 insertions, 71 deletions
diff --git a/src/IBMramdac.c b/src/IBMramdac.c index 0aca20e..b80f5a1 100644 --- a/src/IBMramdac.c +++ b/src/IBMramdac.c @@ -111,7 +111,7 @@ glintIBMReadData (ScrnInfoPtr pScrn) Bool glintIBMHWCursorInit(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); GLINTPtr pGlint = GLINTPTR(pScrn); xf86CursorInfoPtr infoPtr; diff --git a/src/Makefile.am b/src/Makefile.am index 9e60e48..85f1966 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -29,6 +29,7 @@ glint_drv_la_LDFLAGS = -module -avoid-version glint_drv_ladir = @moduledir@/drivers glint_drv_la_SOURCES = \ + compat-api.h \ glint_dga.c \ glint_driver.c \ glint.h \ diff --git a/src/TIramdac.c b/src/TIramdac.c index 42ece63..8832e99 100644 --- a/src/TIramdac.c +++ b/src/TIramdac.c @@ -136,7 +136,7 @@ glintTIReadData (ScrnInfoPtr pScrn) Bool glintTIHWCursorInit(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); GLINTPtr pGlint = GLINTPTR(pScrn); xf86CursorInfoPtr infoPtr; diff --git a/src/compat-api.h b/src/compat-api.h new file mode 100644 index 0000000..6bc946f --- /dev/null +++ b/src/compat-api.h @@ -0,0 +1,99 @@ +/* + * Copyright 2012 Red Hat, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * Author: Dave Airlie <airlied@redhat.com> + */ + +/* this file provides API compat between server post 1.13 and pre it, + it should be reused inside as many drivers as possible */ +#ifndef COMPAT_API_H +#define COMPAT_API_H + +#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR +#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum] +#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p +#endif + +#ifndef XF86_HAS_SCRN_CONV +#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum] +#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex] +#endif + +#ifndef XF86_SCRN_INTERFACE + +#define SCRN_ARG_TYPE int +#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = xf86Screens[(arg1)] + +#define SCREEN_ARG_TYPE int +#define SCREEN_PTR(arg1) ScreenPtr pScreen = screenInfo.screens[(arg1)] + +#define SCREEN_INIT_ARGS_DECL int i, ScreenPtr pScreen, int argc, char **argv + +#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask +#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask + +#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr pScreen +#define CLOSE_SCREEN_ARGS scrnIndex, pScreen + +#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags +#define ADJUST_FRAME_ARGS(arg, x, y) (arg)->scrnIndex, x, y, 0 + +#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags +#define SWITCH_MODE_ARGS(arg, m) (arg)->scrnIndex, m, 0 + +#define FREE_SCREEN_ARGS_DECL int arg, int flags + +#define VT_FUNC_ARGS_DECL int arg, int flags +#define VT_FUNC_ARGS pScrn->scrnIndex, 0 + +#define XF86_SCRN_ARG(x) ((x)->scrnIndex) +#else +#define SCRN_ARG_TYPE ScrnInfoPtr +#define SCRN_INFO_PTR(arg1) ScrnInfoPtr pScrn = (arg1) + +#define SCREEN_ARG_TYPE ScreenPtr +#define SCREEN_PTR(arg1) ScreenPtr pScreen = (arg1) + +#define SCREEN_INIT_ARGS_DECL ScreenPtr pScreen, int argc, char **argv + +#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer pTimeout, pointer pReadmask +#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask + +#define CLOSE_SCREEN_ARGS_DECL ScreenPtr pScreen +#define CLOSE_SCREEN_ARGS pScreen + +#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y +#define ADJUST_FRAME_ARGS(arg, x, y) arg, x, y + +#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr mode +#define SWITCH_MODE_ARGS(arg, m) arg, m + +#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg + +#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg +#define VT_FUNC_ARGS pScrn + +#define XF86_SCRN_ARG(x) (x) + +#endif + +#endif diff --git a/src/glint.h b/src/glint.h index 090fbe3..2d4cf47 100644 --- a/src/glint.h +++ b/src/glint.h @@ -42,6 +42,7 @@ #include "xf86DDC.h" #include "xf86xv.h" +#include "compat-api.h" #define GLINT_MAX_MULTI_DEVICES 2 #define GLINT_VERSION 4000 @@ -315,8 +316,8 @@ void Permedia2vOutIndReg(ScrnInfoPtr pScrn, CARD32, unsigned char mask, unsigned char data); unsigned char Permedia2vInIndReg(ScrnInfoPtr pScrn, CARD32); -Bool GLINTSwitchMode(int scrnIndex, DisplayModePtr mode, int flags); -void GLINTAdjustFrame(int scrnIndex, int x, int y, int flags); +Bool GLINTSwitchMode(SWITCH_MODE_ARGS_DECL); +void GLINTAdjustFrame(ADJUST_FRAME_ARGS_DECL); extern int partprodPermedia[]; diff --git a/src/glint_dga.c b/src/glint_dga.c index 44c162b..6e62e8c 100644 --- a/src/glint_dga.c +++ b/src/glint_dga.c @@ -60,7 +60,7 @@ DGAFunctionRec GLINTDGAFuncs = { Bool GLINTDGAInit(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); GLINTPtr pGlint = GLINTPTR(pScrn); DGAModePtr modes = NULL, newmodes = NULL, currentMode; DisplayModePtr pMode, firstMode; @@ -167,7 +167,7 @@ GLINT_SetMode( pScrn->displayWidth = OldDisplayWidth[index]; - GLINTSwitchMode(index, pScrn->currentMode, 0); + GLINTSwitchMode(SWITCH_MODE_ARGS(pScrn, pScrn->currentMode)); pGlint->DGAactive = FALSE; } else { if(!pGlint->DGAactive) { /* save the old parameters */ @@ -179,7 +179,7 @@ GLINT_SetMode( pScrn->displayWidth = pMode->bytesPerScanline / (pMode->bitsPerPixel >> 3); - GLINTSwitchMode(index, pMode->mode, 0); + GLINTSwitchMode(SWITCH_MODE_ARGS(pScrn, pMode->mode)); } return TRUE; @@ -202,7 +202,7 @@ GLINT_SetViewport( ){ GLINTPtr pGlint = GLINTPTR(pScrn); - GLINTAdjustFrame(pScrn->pScreen->myNum, x, y, flags); + GLINTAdjustFrame(ADJUST_FRAME_ARGS(pScrn, x, y)); pGlint->DGAViewportStatus = 0; /* GLINTAdjustFrame loops until finished */ } diff --git a/src/glint_driver.c b/src/glint_driver.c index 4a7bc76..19e39a8 100644 --- a/src/glint_driver.c +++ b/src/glint_driver.c @@ -90,16 +90,15 @@ static const OptionInfoRec * GLINTAvailableOptions(int chipid, int busid); static void GLINTIdentify(int flags); static Bool GLINTProbe(DriverPtr drv, int flags); static Bool GLINTPreInit(ScrnInfoPtr pScrn, int flags); -static Bool GLINTScreenInit(int Index, ScreenPtr pScreen, int argc, - char **argv); -static Bool GLINTEnterVT(int scrnIndex, int flags); -static void GLINTLeaveVT(int scrnIndex, int flags); -static Bool GLINTCloseScreen(int scrnIndex, ScreenPtr pScreen); +static Bool GLINTScreenInit(SCREEN_INIT_ARGS_DECL); +static Bool GLINTEnterVT(VT_FUNC_ARGS_DECL); +static void GLINTLeaveVT(VT_FUNC_ARGS_DECL); +static Bool GLINTCloseScreen(CLOSE_SCREEN_ARGS_DECL); static Bool GLINTSaveScreen(ScreenPtr pScreen, int mode); /* Optional functions */ -static void GLINTFreeScreen(int scrnIndex, int flags); -static ModeStatus GLINTValidMode(int scrnIndex, DisplayModePtr mode, +static void GLINTFreeScreen(FREE_SCREEN_ARGS_DECL); +static ModeStatus GLINTValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags); /* Internally used functions */ @@ -108,7 +107,7 @@ static Bool GLINTUnmapMem(ScrnInfoPtr pScrn); static void GLINTSave(ScrnInfoPtr pScrn); static void GLINTRestore(ScrnInfoPtr pScrn); static Bool GLINTModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); -static void GLINTBlockHandler(int, pointer, pointer, pointer); +static void GLINTBlockHandler(BLOCKHANDLER_ARGS_DECL); /* * This is intentionally screen-independent. It indicates the binding @@ -1938,7 +1937,7 @@ GLINTPreInit(ScrnInfoPtr pScrn, int flags) if (pGlint->DDCBus) { GLINTMapMem(pScrn); - pMon = xf86DoEDID_DDC2(pScrn->scrnIndex, pGlint->DDCBus); + pMon = xf86DoEDID_DDC2(XF86_SCRN_ARG(pScrn), pGlint->DDCBus); GLINTUnmapMem(pScrn); } @@ -2718,9 +2717,9 @@ GLINTRestore(ScrnInfoPtr pScrn) /* This gets called at the start of each server generation */ static Bool -GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) +GLINTScreenInit(SCREEN_INIT_ARGS_DECL) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); GLINTPtr pGlint = GLINTPTR(pScrn); int ret, displayWidth; unsigned char *FBStart; @@ -2734,7 +2733,7 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if (pGlint->FBDev) { fbdevHWSave(pScrn); if (!fbdevHWModeInit(pScrn, pScrn->currentMode)) { - xf86DrvMsg(scrnIndex, X_ERROR, + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Internal error: invalid mode\n"); return FALSE; } @@ -2744,14 +2743,14 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) /* Initialise the first mode */ if ( (!pGlint->FBDev) && !(GLINTModeInit(pScrn, pScrn->currentMode))) { - xf86DrvMsg(scrnIndex, X_ERROR, + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Internal error: invalid mode\n"); return FALSE; } /* Darken the screen for aesthetic reasons and set the viewport */ GLINTSaveScreen(pScreen, SCREEN_SAVER_ON); - GLINTAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); + GLINTAdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0)); /* * The next step is to setup the screen's visuals, and initialise the @@ -2821,7 +2820,7 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) displayWidth, pScrn->bitsPerPixel); break; default: - xf86DrvMsg(scrnIndex, X_ERROR, + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Internal error: invalid bpp (%d) in GLINTScrnInit\n", pScrn->bitsPerPixel); ret = FALSE; @@ -3033,17 +3032,16 @@ GLINTScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) /* Usually mandatory */ Bool -GLINTSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) +GLINTSwitchMode(SWITCH_MODE_ARGS_DECL) { - ScrnInfoPtr pScrn; + SCRN_INFO_PTR(arg); GLINTPtr pGlint; - pScrn = xf86Screens[scrnIndex]; pGlint = GLINTPTR(pScrn); TRACE_ENTER("GLINTSwitchMode"); if (pGlint->FBDev) { - Bool ret = fbdevHWSwitchMode(scrnIndex, mode, flags); + Bool ret = fbdevHWSwitchMode(SWITCH_MODE_ARGS(pScrn, mode)); if (!pGlint->NoAccel) { switch (pGlint->Chipset) { @@ -3097,7 +3095,7 @@ GLINTSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) } TRACE_EXIT("GLINTSwitchMode (normal)"); - return GLINTModeInit(xf86Screens[scrnIndex], mode); + return GLINTModeInit(pScrn, mode); } @@ -3107,18 +3105,17 @@ GLINTSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) */ /* Usually mandatory */ void -GLINTAdjustFrame(int scrnIndex, int x, int y, int flags) +GLINTAdjustFrame(ADJUST_FRAME_ARGS_DECL) { - ScrnInfoPtr pScrn; + SCRN_INFO_PTR(arg); CARD32 base; GLINTPtr pGlint; - pScrn = xf86Screens[scrnIndex]; pGlint = GLINTPTR(pScrn); TRACE_ENTER("GLINTAdjustFrame"); if (pGlint->FBDev) { - fbdevHWAdjustFrame(scrnIndex, x, y, flags); + fbdevHWAdjustFrame(ADJUST_FRAME_ARGS(pScrn, x, y)); TRACE_EXIT("GLINTAdjustFrame (fbdev)"); return; } @@ -3170,15 +3167,15 @@ GLINTAdjustFrame(int scrnIndex, int x, int y, int flags) /* Mandatory */ static Bool -GLINTEnterVT(int scrnIndex, int flags) +GLINTEnterVT(VT_FUNC_ARGS_DECL) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + SCRN_INFO_PTR(arg); GLINTPtr pGlint = GLINTPTR(pScrn); TRACE_ENTER("GLINTEnterVT"); if (pGlint->FBDev) - fbdevHWEnterVT(scrnIndex, flags); + fbdevHWEnterVT(VT_FUNC_ARGS); else /* Should we re-save the text mode on each VT enter? */ if (!GLINTModeInit(pScrn, pScrn->currentMode)) @@ -3253,9 +3250,9 @@ GLINTEnterVT(int scrnIndex, int flags) /* Mandatory */ static void -GLINTLeaveVT(int scrnIndex, int flags) +GLINTLeaveVT(VT_FUNC_ARGS_DECL) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + SCRN_INFO_PTR(arg); GLINTPtr pGlint = GLINTPTR(pScrn); TRACE_ENTER("GLINTLeaveVT"); @@ -3278,9 +3275,9 @@ GLINTLeaveVT(int scrnIndex, int flags) /* Mandatory */ static Bool -GLINTCloseScreen(int scrnIndex, ScreenPtr pScreen) +GLINTCloseScreen(CLOSE_SCREEN_ARGS_DECL) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); GLINTPtr pGlint = GLINTPTR(pScrn); TRACE_ENTER("GLINTCloseScreen"); @@ -3323,7 +3320,7 @@ GLINTCloseScreen(int scrnIndex, ScreenPtr pScreen) pScreen->CloseScreen = pGlint->CloseScreen; TRACE_EXIT("GLINTCloseScreen"); - return (*pScreen->CloseScreen)(scrnIndex, pScreen); + return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS); } @@ -3331,17 +3328,15 @@ GLINTCloseScreen(int scrnIndex, ScreenPtr pScreen) /* Optional */ static void -GLINTFreeScreen(int scrnIndex, int flags) +GLINTFreeScreen(FREE_SCREEN_ARGS_DECL) { -#if DEBUG - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; -#endif + SCRN_INFO_PTR(arg); TRACE_ENTER("GLINTFreeScreen"); if (xf86LoaderCheckSymbol("fbdevHWFreeRec")) - fbdevHWFreeRec(xf86Screens[scrnIndex]); + fbdevHWFreeRec(pScrn); if (xf86LoaderCheckSymbol("RamDacFreeRec")) - RamDacFreeRec(xf86Screens[scrnIndex]); - GLINTFreeRec(xf86Screens[scrnIndex]); + RamDacFreeRec(pScrn); + GLINTFreeRec(pScrn); TRACE_EXIT("GLINTFreeScreen"); } @@ -3350,9 +3345,9 @@ GLINTFreeScreen(int scrnIndex, int flags) /* Optional */ static ModeStatus -GLINTValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags) +GLINTValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + SCRN_INFO_PTR(arg); GLINTPtr pGlint = GLINTPTR(pScrn); if (mode->Flags & V_INTERLACE) @@ -3408,7 +3403,7 @@ GLINTValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags) static Bool GLINTSaveScreen(ScreenPtr pScreen, int mode) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); GLINTPtr pGlint = GLINTPTR(pScrn); CARD32 temp; Bool unblank; @@ -3462,14 +3457,10 @@ GLINTSaveScreen(ScreenPtr pScreen, int mode) } static void -GLINTBlockHandler ( - int i, - pointer blockData, - pointer pTimeout, - pointer pReadmask -){ - ScreenPtr pScreen = screenInfo.screens[i]; - ScrnInfoPtr pScrn = xf86Screens[i]; +GLINTBlockHandler (BLOCKHANDLER_ARGS_DECL) +{ + SCREEN_PTR(arg); + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); GLINTPtr pGlint = GLINTPTR(pScrn); int sigstate = xf86BlockSIGIO(); @@ -3482,7 +3473,7 @@ GLINTBlockHandler ( xf86UnblockSIGIO(sigstate); pScreen->BlockHandler = pGlint->BlockHandler; - (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); + (*pScreen->BlockHandler) (BLOCKHANDLER_ARGS); pScreen->BlockHandler = GLINTBlockHandler; if(pGlint->VideoTimerCallback) { diff --git a/src/pm2_accel.c b/src/pm2_accel.c index 794a1c2..9309789 100644 --- a/src/pm2_accel.c +++ b/src/pm2_accel.c @@ -246,7 +246,7 @@ Bool Permedia2AccelInit(ScreenPtr pScreen) { XAAInfoRecPtr infoPtr; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); GLINTPtr pGlint = GLINTPTR(pScrn); BoxRec AvailFBArea; diff --git a/src/pm2_dac.c b/src/pm2_dac.c index c2ae8eb..85093ff 100644 --- a/src/pm2_dac.c +++ b/src/pm2_dac.c @@ -414,7 +414,7 @@ Permedia2UseHWCursor(ScreenPtr pScr, CursorPtr pCurs) Bool Permedia2HWCursorInit(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); GLINTPtr pGlint = GLINTPTR(pScrn); xf86CursorInfoPtr infoPtr; diff --git a/src/pm2_video.c b/src/pm2_video.c index f5bbdf3..196d222 100644 --- a/src/pm2_video.c +++ b/src/pm2_video.c @@ -2984,7 +2984,7 @@ Permedia2VideoUninit(ScrnInfoPtr pScrn) void Permedia2VideoInit(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); GLINTPtr pGlint = GLINTPTR(pScrn); AdaptorPrivPtr pAPriv; DevUnion Private[PORTS]; diff --git a/src/pm2v_dac.c b/src/pm2v_dac.c index 816f8c6..bf04245 100644 --- a/src/pm2v_dac.c +++ b/src/pm2v_dac.c @@ -540,7 +540,7 @@ Permedia2vUseHWCursor(ScreenPtr pScr, CursorPtr pCurs) Bool Permedia2vHWCursorInit(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); GLINTPtr pGlint = GLINTPTR(pScrn); xf86CursorInfoPtr infoPtr; diff --git a/src/pm3_accel.c b/src/pm3_accel.c index 56dbe2c..646bd4f 100644 --- a/src/pm3_accel.c +++ b/src/pm3_accel.c @@ -385,7 +385,7 @@ Bool Permedia3AccelInit(ScreenPtr pScreen) { XAAInfoRecPtr infoPtr; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); GLINTPtr pGlint = GLINTPTR(pScrn); pGlint->AccelInfoRec = infoPtr = XAACreateInfoRec(); @@ -492,7 +492,7 @@ Permedia3AccelInit(ScreenPtr pScreen) void Permedia3EnableOffscreen (ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); GLINTPtr pGlint = GLINTPTR(pScrn); BoxRec AvailFBArea; diff --git a/src/pm3_video.c b/src/pm3_video.c index 524d6dc..db27d41 100644 --- a/src/pm3_video.c +++ b/src/pm3_video.c @@ -73,7 +73,7 @@ static Atom xvColorKey, xvDoubleBuffer, xvAutopaintColorKey, xvFilter; void Permedia3InitVideo(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); XF86VideoAdaptorPtr *adaptors, *newAdaptors = NULL; XF86VideoAdaptorPtr newAdaptor = NULL; GLINTPtr pGlint = GLINTPTR(pScrn); @@ -280,7 +280,7 @@ void Permedia3ResetVideo(ScrnInfoPtr pScrn) static XF86VideoAdaptorPtr Permedia3SetupImageVideo(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); GLINTPtr pGlint = GLINTPTR(pScrn); XF86VideoAdaptorPtr adapt; GLINTPortPrivPtr pPriv; @@ -623,7 +623,7 @@ Permedia3AllocateMemory(ScrnInfoPtr pScrn, FBAreaPtr area, int width, int height xf86FreeOffscreenArea(area); } - pScreen = screenInfo.screens[pScrn->scrnIndex]; + pScreen = xf86ScrnToScreen(pScrn); new_area = xf86AllocateOffscreenArea(pScreen, width, height, pScrn->bitsPerPixel / 8, NULL, NULL, NULL); diff --git a/src/pm_accel.c b/src/pm_accel.c index aea4c12..16f32e2 100644 --- a/src/pm_accel.c +++ b/src/pm_accel.c @@ -181,7 +181,7 @@ Bool PermediaAccelInit(ScreenPtr pScreen) { XAAInfoRecPtr infoPtr; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); GLINTPtr pGlint = GLINTPTR(pScrn); BoxRec AvailFBArea; diff --git a/src/sx_accel.c b/src/sx_accel.c index 38c5c46..22aa873 100644 --- a/src/sx_accel.c +++ b/src/sx_accel.c @@ -165,7 +165,7 @@ Bool SXAccelInit(ScreenPtr pScreen) { XAAInfoRecPtr infoPtr; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); GLINTPtr pGlint = GLINTPTR(pScrn); long memory = pGlint->FbMapSize; BoxRec AvailFBArea; diff --git a/src/tx_accel.c b/src/tx_accel.c index 51baef4..099d60c 100644 --- a/src/tx_accel.c +++ b/src/tx_accel.c @@ -192,7 +192,7 @@ Bool TXAccelInit(ScreenPtr pScreen) { XAAInfoRecPtr infoPtr; - ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); GLINTPtr pGlint = GLINTPTR(pScrn); long memory = pGlint->FbMapSize; BoxRec AvailFBArea; |