diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h index ef99106e5..0eb000d41 100644 --- a/hw/xfree86/common/xf86.h +++ b/hw/xfree86/common/xf86.h @@ -76,8 +76,8 @@ extern _X_EXPORT Bool xf86DRI2Enabled(void); extern _X_EXPORT Bool VTSwitchEnabled; /* kbd driver */ -#define XF86SCRNINFO(p) ((ScrnInfoPtr)dixLookupPrivate(&(p)->devPrivates, \ - xf86ScreenKey)) +#define XF86SCRNINFO(p) xf86ScreenToScrn(p) + #define XF86FLIP_PIXELS() \ do { \ if (xf86GetFlipPixels()) { \ diff --git a/hw/xfree86/common/xf86Cursor.c b/hw/xfree86/common/xf86Cursor.c index 3716434f0..61cae6aa7 100644 --- a/hw/xfree86/common/xf86Cursor.c +++ b/hw/xfree86/common/xf86Cursor.c @@ -133,7 +133,7 @@ xf86InitViewport(ScrnInfoPtr pScr) void xf86SetViewport(ScreenPtr pScreen, int x, int y) { - ScrnInfoPtr pScr = XF86SCRNINFO(pScreen); + ScrnInfoPtr pScr = xf86ScreenToScrn(pScreen); (*pScr->PointerMoved) (pScreen->myNum, x, y); } @@ -184,7 +184,8 @@ xf86PointerMoved(int scrnIndex, int x, int y) void xf86LockZoom(ScreenPtr pScreen, Bool lock) { - XF86SCRNINFO(pScreen)->zoomLocked = lock; + ScrnInfoPtr pScr = xf86ScreenToScrn(pScreen); + pScr->zoomLocked = lock; } /* @@ -196,7 +197,7 @@ xf86LockZoom(ScreenPtr pScreen, Bool lock) Bool xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode) { - ScrnInfoPtr pScr = XF86SCRNINFO(pScreen); + ScrnInfoPtr pScr = xf86ScreenToScrn(pScreen); ScreenPtr pCursorScreen; Bool Switched; int px, py, was_blocked; @@ -316,7 +317,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode) void xf86ZoomViewport(ScreenPtr pScreen, int zoom) { - ScrnInfoPtr pScr = XF86SCRNINFO(pScreen); + ScrnInfoPtr pScr = xf86ScreenToScrn(pScreen); DisplayModePtr mode; if (pScr->zoomLocked || !(mode = pScr->currentMode)) diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c index abd894dff..b17f601d1 100644 --- a/hw/xfree86/common/xf86RandR.c +++ b/hw/xfree86/common/xf86RandR.c @@ -66,7 +66,7 @@ static Bool xf86RandRGetInfo(ScreenPtr pScreen, Rotation * rotations) { RRScreenSizePtr pSize; - ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); + ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); DisplayModePtr mode; int refresh0 = 60; @@ -147,7 +147,7 @@ xf86RandRSetMode(ScreenPtr pScreen, DisplayModePtr mode, Bool useVirtual, int mmWidth, int mmHeight) { - ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); + ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); int oldWidth = pScreen->width; int oldHeight = pScreen->height; @@ -228,7 +228,7 @@ static Bool xf86RandRSetConfig(ScreenPtr pScreen, Rotation rotation, int rate, RRScreenSizePtr pSize) { - ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); + ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); DisplayModePtr mode; int pos[MAXDEVICES][2]; @@ -344,7 +344,7 @@ xf86RandRCreateScreenResources(ScreenPtr pScreen) XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); #if 0 - ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); + ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); DisplayModePtr mode; #endif @@ -367,7 +367,7 @@ xf86RandRCreateScreenResources(ScreenPtr pScreen) static Bool xf86RandRCloseScreen(int index, ScreenPtr pScreen) { - ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); + ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); scrp->virtualX = pScreen->width = randrp->virtualX; @@ -417,8 +417,9 @@ xf86RandRSetNewVirtualAndDimensions(ScreenPtr pScreen, /* This is only for during server start */ if (resetMode) { + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); return (xf86RandRSetMode(pScreen, - XF86SCRNINFO(pScreen)->currentMode, + pScrn->currentMode, TRUE, pScreen->mmWidth, pScreen->mmHeight)); } @@ -430,7 +431,7 @@ xf86RandRInit(ScreenPtr pScreen) { rrScrPrivPtr rp; XF86RandRInfoPtr randrp; - ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); + ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); #ifdef PANORAMIX /* XXX disable RandR when using Xinerama */ diff --git a/hw/xfree86/exa/examodule.c b/hw/xfree86/exa/examodule.c index a422bb278..50924587d 100644 --- a/hw/xfree86/exa/examodule.c +++ b/hw/xfree86/exa/examodule.c @@ -72,7 +72,7 @@ static const OptionInfoRec EXAOptions[] = { static Bool exaXorgCloseScreen(int i, ScreenPtr pScreen) { - ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen); + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); ExaXorgScreenPrivPtr pScreenPriv = (ExaXorgScreenPrivPtr) dixLookupPrivate(&pScreen->devPrivates, exaXorgScreenPrivateKey); @@ -111,7 +111,6 @@ void exaDDXDriverInit(ScreenPtr pScreen) { ExaScreenPriv(pScreen); - /* Do NOT use XF86SCRNINFO macro here!! */ ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); ExaXorgScreenPrivPtr pScreenPriv; diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index 49287d9c5..e6b205223 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -447,7 +447,7 @@ static Bool xf86RandR12GetInfo(ScreenPtr pScreen, Rotation * rotations) { RRScreenSizePtr pSize; - ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); + ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); DisplayModePtr mode; int refresh0 = 60; @@ -504,7 +504,7 @@ xf86RandR12SetMode(ScreenPtr pScreen, DisplayModePtr mode, Bool useVirtual, int mmWidth, int mmHeight) { - ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); + ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); int oldWidth = pScreen->width; int oldHeight = pScreen->height; @@ -576,7 +576,7 @@ Bool xf86RandR12SetConfig(ScreenPtr pScreen, Rotation rotation, int rate, RRScreenSizePtr pSize) { - ScrnInfoPtr scrp = XF86SCRNINFO(pScreen); + ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); DisplayModePtr mode; int pos[MAXDEVICES][2]; @@ -671,7 +671,7 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen, CARD16 height, CARD32 mmWidth, CARD32 mmHeight) { XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); - ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen); + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); WindowPtr pRoot = pScreen->root; PixmapPtr pScrnPix; diff --git a/hw/xfree86/vgahw/vgaCmap.c b/hw/xfree86/vgahw/vgaCmap.c index 25d406ebd..a1aa405a8 100644 --- a/hw/xfree86/vgahw/vgaCmap.c +++ b/hw/xfree86/vgahw/vgaCmap.c @@ -81,9 +81,6 @@ xColorItem *pdefs; xColorItem directDefs[256]; Bool new_overscan = FALSE; Bool writeColormap; - - /* This can get called before the ScrnInfoRec is installed so we - can't rely on getting it with XF86SCRNINFO() */ int scrnIndex = pmap->pScreen->myNum; ScrnInfoPtr scrninfp = xf86ScreenToScrn(pmap->pScreen); vgaHWPtr hwp = VGAHWPTR(scrninfp);