diff options
author | Dave Airlie <airlied@redhat.com> | 2012-06-05 13:22:18 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-06-05 13:22:18 +0100 |
commit | 1f0e8bd5eb1a5539689cfc4f5a6b86b530907ec5 (patch) | |
tree | ebb7eb85f1b38d0876cd627c1107f3febdbc8865 | |
parent | 3476eb38063473a7a5fcd78e2095e284118de839 (diff) |
api: rework the X server driver API to avoid global arrays.for-keithp-squashed
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
117 files changed, 610 insertions, 711 deletions
diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c index 98d327f26..de62a35e7 100644 --- a/Xext/panoramiX.c +++ b/Xext/panoramiX.c @@ -150,7 +150,7 @@ static GCFuncs XineramaGCFuncs = { (pGC)->funcs = &XineramaGCFuncs; static Bool -XineramaCloseScreen(int i, ScreenPtr pScreen) +XineramaCloseScreen(ScreenPtr pScreen) { PanoramiXScreenPtr pScreenPriv = (PanoramiXScreenPtr) dixLookupPrivate(&pScreen->devPrivates, PanoramiXScreenKey); @@ -163,7 +163,7 @@ XineramaCloseScreen(int i, ScreenPtr pScreen) free((pointer) pScreenPriv); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } static Bool diff --git a/Xext/shm.c b/Xext/shm.c index de480207d..e9c4a4e06 100644 --- a/Xext/shm.c +++ b/Xext/shm.c @@ -202,14 +202,14 @@ CheckForShmSyscall(void) #endif static Bool -ShmCloseScreen(int i, ScreenPtr pScreen) +ShmCloseScreen(ScreenPtr pScreen) { ShmScrPrivateRec *screen_priv = ShmGetScreenPriv(pScreen); pScreen->CloseScreen = screen_priv->CloseScreen; dixSetPrivate(&pScreen->devPrivates, shmScrPrivateKey, NULL); free(screen_priv); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } static ShmScrPrivateRec * diff --git a/Xext/xvdix.h b/Xext/xvdix.h index d22672620..59fc1ffc8 100644 --- a/Xext/xvdix.h +++ b/Xext/xvdix.h @@ -215,7 +215,7 @@ typedef struct { DestroyWindowProcPtr DestroyWindow; DestroyPixmapProcPtr DestroyPixmap; CloseScreenProcPtr CloseScreen; - Bool (*ddCloseScreen) (int, ScreenPtr); + Bool (*ddCloseScreen) (ScreenPtr); int (*ddQueryAdaptors) (ScreenPtr, XvAdaptorPtr *, int *); DevUnion devPriv; } XvScreenRec, *XvScreenPtr; diff --git a/Xext/xvmain.c b/Xext/xvmain.c index 48061a286..736114b6e 100644 --- a/Xext/xvmain.c +++ b/Xext/xvmain.c @@ -129,7 +129,7 @@ static void WriteSwappedVideoNotifyEvent(xvEvent *, xvEvent *); static void WriteSwappedPortNotifyEvent(xvEvent *, xvEvent *); static Bool CreateResourceTypes(void); -static Bool XvCloseScreen(int, ScreenPtr); +static Bool XvCloseScreen(ScreenPtr); static Bool XvDestroyPixmap(PixmapPtr); static Bool XvDestroyWindow(WindowPtr); static void XvResetProc(ExtensionEntry *); @@ -290,7 +290,7 @@ XvScreenInit(ScreenPtr pScreen) } static Bool -XvCloseScreen(int ii, ScreenPtr pScreen) +XvCloseScreen(ScreenPtr pScreen) { XvScreenPtr pxvs; @@ -301,13 +301,13 @@ XvCloseScreen(int ii, ScreenPtr pScreen) pScreen->DestroyWindow = pxvs->DestroyWindow; pScreen->CloseScreen = pxvs->CloseScreen; - (*pxvs->ddCloseScreen) (ii, pScreen); + (*pxvs->ddCloseScreen) (pScreen); free(pxvs); dixSetPrivate(&pScreen->devPrivates, XvScreenKey, NULL); - return (*pScreen->CloseScreen) (ii, pScreen); + return (*pScreen->CloseScreen) (pScreen); } static void diff --git a/Xext/xvmc.c b/Xext/xvmc.c index 8a1d94085..4aaff4d9f 100644 --- a/Xext/xvmc.c +++ b/Xext/xvmc.c @@ -709,7 +709,7 @@ XvMCExtensionInit(void) } static Bool -XvMCCloseScreen(int i, ScreenPtr pScreen) +XvMCCloseScreen(ScreenPtr pScreen) { XvMCScreenPtr pScreenPriv = XVMC_GET_PRIVATE(pScreen); @@ -717,7 +717,7 @@ XvMCCloseScreen(int i, ScreenPtr pScreen) free(pScreenPriv); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } int diff --git a/composite/compalloc.c b/composite/compalloc.c index 15a6cd24f..b958b0942 100644 --- a/composite/compalloc.c +++ b/composite/compalloc.c @@ -55,14 +55,13 @@ compScreenUpdate(ScreenPtr pScreen) } static void -compBlockHandler(int i, pointer blockData, pointer pTimeout, pointer pReadmask) +compBlockHandler(ScreenPtr pScreen, pointer pTimeout, pointer pReadmask) { - ScreenPtr pScreen = screenInfo.screens[i]; CompScreenPtr cs = GetCompScreen(pScreen); pScreen->BlockHandler = cs->BlockHandler; compScreenUpdate(pScreen); - (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); + (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); /* Next damage will restore the block handler */ cs->BlockHandler = NULL; diff --git a/composite/compinit.c b/composite/compinit.c index eaa125681..bc1130e78 100644 --- a/composite/compinit.c +++ b/composite/compinit.c @@ -53,7 +53,7 @@ DevPrivateKeyRec CompWindowPrivateKeyRec; DevPrivateKeyRec CompSubwindowsPrivateKeyRec; static Bool -compCloseScreen(int index, ScreenPtr pScreen) +compCloseScreen(ScreenPtr pScreen) { CompScreenPtr cs = GetCompScreen(pScreen); Bool ret; @@ -82,7 +82,7 @@ compCloseScreen(int index, ScreenPtr pScreen) free(cs); dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, NULL); - ret = (*pScreen->CloseScreen) (index, pScreen); + ret = (*pScreen->CloseScreen) (pScreen); return ret; } diff --git a/dix/dispatch.c b/dix/dispatch.c index d97180548..b88f9744d 100644 --- a/dix/dispatch.c +++ b/dix/dispatch.c @@ -3725,8 +3725,7 @@ with its screen number, a pointer to its ScreenRec, argc, and argv. */ int -AddScreen(Bool (*pfnInit) (int /*index */ , - ScreenPtr /*pScreen */ , +AddScreen(Bool (*pfnInit) (ScreenPtr /*pScreen */ , int /*argc */ , char ** /*argv */ ), int argc, char **argv) @@ -3794,7 +3793,7 @@ AddScreen(Bool (*pfnInit) (int /*index */ , */ screenInfo.screens[i] = pScreen; screenInfo.numScreens++; - if (!(*pfnInit) (i, pScreen, argc, argv)) { + if (!(*pfnInit) (pScreen, argc, argv)) { dixFreePrivates(pScreen->devPrivates, PRIVATE_SCREEN); free(pScreen); screenInfo.numScreens--; diff --git a/dix/dixutils.c b/dix/dixutils.c index 9eb54893a..b249a810b 100644 --- a/dix/dixutils.c +++ b/dix/dixutils.c @@ -384,9 +384,8 @@ BlockHandler(pointer pTimeout, pointer pReadmask) ++inHandler; for (i = 0; i < screenInfo.numScreens; i++) - (*screenInfo.screens[i]->BlockHandler) (i, - screenInfo.screens[i]-> - blockData, pTimeout, pReadmask); + (*screenInfo.screens[i]->BlockHandler) (screenInfo.screens[i], + pTimeout, pReadmask); for (i = 0; i < numHandlers; i++) if (!handlers[i].deleted) (*handlers[i].BlockHandler) (handlers[i].blockData, @@ -421,9 +420,8 @@ WakeupHandler(int result, pointer pReadmask) (*handlers[i].WakeupHandler) (handlers[i].blockData, result, pReadmask); for (i = 0; i < screenInfo.numScreens; i++) - (*screenInfo.screens[i]->WakeupHandler) (i, - screenInfo.screens[i]-> - wakeupData, result, pReadmask); + (*screenInfo.screens[i]->WakeupHandler) (screenInfo.screens[i], + result, pReadmask); if (handlerDeleted) { for (i = 0; i < numHandlers;) if (handlers[i].deleted) { @@ -458,32 +458,21 @@ ChangeGCXIDs(ClientPtr client, GC * pGC, BITS32 mask, CARD32 *pC32) return ChangeGC(client, pGC, mask, vals); } -/* CreateGC(pDrawable, mask, pval, pStatus) - creates a default GC for the given drawable, using mask to fill - in any non-default values. - Returns a pointer to the new GC on success, NULL otherwise. - returns status of non-default fields in pStatus -BUG: - should check for failure to create default tile - -*/ -GCPtr -CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus, - XID gcid, ClientPtr client) +static GCPtr +NewGCObject(ScreenPtr pScreen, int depth) { GCPtr pGC; pGC = dixAllocateObjectWithPrivates(GC, PRIVATE_GC); if (!pGC) { - *pStatus = BadAlloc; return (GCPtr) NULL; } - pGC->pScreen = pDrawable->pScreen; - pGC->depth = pDrawable->depth; + pGC->pScreen = pScreen; + pGC->depth = depth; pGC->alu = GXcopy; /* dst <- src */ pGC->planemask = ~0; - pGC->serialNumber = GC_CHANGE_SERIAL_BIT; + pGC->serialNumber = 0; pGC->funcs = 0; pGC->fgPixel = 0; pGC->bgPixel = 1; @@ -496,17 +485,8 @@ CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus, pGC->arcMode = ArcPieSlice; pGC->tile.pixel = 0; pGC->tile.pixmap = NullPixmap; - if (mask & GCForeground) { - /* - * magic special case -- ChangeGC checks for this condition - * and snags the Foreground value to create a pseudo default-tile - */ - pGC->tileIsPixel = FALSE; - } - else { - pGC->tileIsPixel = TRUE; - } + pGC->tileIsPixel = TRUE; pGC->patOrg.x = 0; pGC->patOrg.y = 0; pGC->subWindowMode = ClipByChildren; @@ -521,12 +501,49 @@ CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus, /* use the default font and stipple */ pGC->font = defaultFont; - defaultFont->refcnt++; + if (pGC->font) /* necessary, because open of default font could fail */ + pGC->font->refcnt++; pGC->stipple = pGC->pScreen->PixmapPerDepth[0]; - pGC->stipple->refcnt++; + if (pGC->stipple) + pGC->stipple->refcnt++; /* this is not a scratch GC */ pGC->scratch_inuse = FALSE; + return pGC; +} + +/* CreateGC(pDrawable, mask, pval, pStatus) + creates a default GC for the given drawable, using mask to fill + in any non-default values. + Returns a pointer to the new GC on success, NULL otherwise. + returns status of non-default fields in pStatus +BUG: + should check for failure to create default tile + +*/ +GCPtr +CreateGC(DrawablePtr pDrawable, BITS32 mask, XID *pval, int *pStatus, + XID gcid, ClientPtr client) +{ + GCPtr pGC; + + pGC = NewGCObject(pDrawable->pScreen, pDrawable->depth); + if (!pGC) { + *pStatus = BadAlloc; + return (GCPtr) NULL; + } + + pGC->serialNumber = GC_CHANGE_SERIAL_BIT; + if (mask & GCForeground) { + /* + * magic special case -- ChangeGC checks for this condition + * and snags the Foreground value to create a pseudo default-tile + */ + pGC->tileIsPixel = FALSE; + } + else { + pGC->tileIsPixel = TRUE; + } /* security creation/labeling check */ *pStatus = XaceHook(XACE_RESOURCE_ACCESS, client, gcid, RT_GC, pGC, @@ -784,45 +801,10 @@ CreateScratchGC(ScreenPtr pScreen, unsigned depth) { GCPtr pGC; - pGC = dixAllocateObjectWithPrivates(GC, PRIVATE_GC); + pGC = NewGCObject(pScreen, depth); if (!pGC) return (GCPtr) NULL; - pGC->pScreen = pScreen; - pGC->depth = depth; - pGC->alu = GXcopy; /* dst <- src */ - pGC->planemask = ~0; - pGC->serialNumber = 0; - pGC->fgPixel = 0; - pGC->bgPixel = 1; - pGC->lineWidth = 0; - pGC->lineStyle = LineSolid; - pGC->capStyle = CapButt; - pGC->joinStyle = JoinMiter; - pGC->fillStyle = FillSolid; - pGC->fillRule = EvenOddRule; - pGC->arcMode = ArcPieSlice; - pGC->font = defaultFont; - if (pGC->font) /* necessary, because open of default font could fail */ - pGC->font->refcnt++; - pGC->tileIsPixel = TRUE; - pGC->tile.pixel = 0; - pGC->tile.pixmap = NullPixmap; - pGC->stipple = NullPixmap; - pGC->patOrg.x = 0; - pGC->patOrg.y = 0; - pGC->subWindowMode = ClipByChildren; - pGC->graphicsExposures = TRUE; - pGC->clipOrg.x = 0; - pGC->clipOrg.y = 0; - pGC->clientClipType = CT_NONE; - pGC->dashOffset = 0; - pGC->numInDashList = 2; - pGC->dash = DefaultDash; - - /* scratch GCs in the GCperDepth pool start off unused */ - pGC->scratch_inuse = FALSE; - pGC->stateChanges = GCAllBits; if (!(*pScreen->CreateGC) (pGC)) { FreeGC(pGC, (XID) 0); diff --git a/dix/main.c b/dix/main.c index 70dcc946e..83efa7d7f 100644 --- a/dix/main.c +++ b/dix/main.c @@ -209,7 +209,7 @@ main(int argc, char *argv[], char *envp[]) for (i = 0; i < screenInfo.numScreens; i++) { ScreenPtr pScreen = screenInfo.screens[i]; - if (!CreateScratchPixmapsForScreen(i)) + if (!CreateScratchPixmapsForScreen(pScreen)) FatalError("failed to create scratch pixmaps"); if (pScreen->CreateScreenResources && !(*pScreen->CreateScreenResources) (pScreen)) @@ -322,10 +322,10 @@ main(int argc, char *argv[], char *envp[]) CloseDownEvents(); for (i = screenInfo.numScreens - 1; i >= 0; i--) { - FreeScratchPixmapsForScreen(i); + FreeScratchPixmapsForScreen(screenInfo.screens[i]); FreeGCperDepth(i); FreeDefaultStipple(i); - (*screenInfo.screens[i]->CloseScreen) (i, screenInfo.screens[i]); + (*screenInfo.screens[i]->CloseScreen) (screenInfo.screens[i]); dixFreePrivates(screenInfo.screens[i]->devPrivates, PRIVATE_SCREEN); free(screenInfo.screens[i]); screenInfo.numScreens = i; diff --git a/dix/pixmap.c b/dix/pixmap.c index 47b220b58..545ff54ac 100644 --- a/dix/pixmap.c +++ b/dix/pixmap.c @@ -84,23 +84,23 @@ FreeScratchPixmapHeader(PixmapPtr pPixmap) } Bool -CreateScratchPixmapsForScreen(int scrnum) +CreateScratchPixmapsForScreen(ScreenPtr pScreen) { unsigned int pixmap_size; pixmap_size = sizeof(PixmapRec) + dixPrivatesSize(PRIVATE_PIXMAP); - screenInfo.screens[scrnum]->totalPixmapSize = + pScreen->totalPixmapSize = BitmapBytePad(pixmap_size * 8); /* let it be created on first use */ - screenInfo.screens[scrnum]->pScratchPixmap = NULL; + pScreen->pScratchPixmap = NULL; return TRUE; } void -FreeScratchPixmapsForScreen(int scrnum) +FreeScratchPixmapsForScreen(ScreenPtr pScreen) { - FreeScratchPixmapHeader(screenInfo.screens[scrnum]->pScratchPixmap); + FreeScratchPixmapHeader(pScreen->pScratchPixmap); } /* callable by ddx */ diff --git a/doc/Xserver-spec.xml b/doc/Xserver-spec.xml index 2b11828fc..31b6fb05d 100644 --- a/doc/Xserver-spec.xml +++ b/doc/Xserver-spec.xml @@ -680,7 +680,7 @@ pReadmask is a pointer to the information describing the descriptors that will be waited on. </para> <para> -In the sample server, pTimeout is a struct timeval **, and pReadmask is +In the sample server, pTimeout is a pointer, and pReadmask is the address of the select() mask for reading. </para> <para> @@ -688,15 +688,14 @@ The DIX BlockHandler() iterates through the Screens, for each one calling its BlockHandler. A BlockHandler is declared thus: <blockquote> <programlisting> - void xxxBlockHandler(nscreen, pbdata, pptv, pReadmask) - int nscreen; - pointer pbdata; - struct timeval ** pptv; + void xxxBlockHandler(pScreen, pTimeout, pReadmask) + ScreenPtr pScreen; + pointer pTimeout; pointer pReadmask; </programlisting> </blockquote> -The arguments are the index of the Screen, the blockData field -of the Screen, and the arguments to the DIX BlockHandler(). +The arguments are a pointer to the Screen, and the arguments to the +DIX BlockHandler(). </para> <para> Immediately after WaitForSomething returns from the @@ -721,15 +720,14 @@ The DIX WakeupHandler() calls each Screen's WakeupHandler. A WakeupHandler is declared thus: <blockquote> <programlisting> - void xxxWakeupHandler(nscreen, pbdata, err, pReadmask) - int nscreen; - pointer pbdata; + void xxxWakeupHandler(pScreen, result, pReadmask) + ScreenPtr pScreen; unsigned long result; pointer pReadmask; </programlisting> </blockquote> -The arguments are the index of the Screen, the blockData field -of the Screen, and the arguments to the DIX WakeupHandler(). +The arguments are the Screen, of the Screen, and the arguments to +the DIX WakeupHandler(). </para> <para> In addition to the per-screen BlockHandlers, any module may register @@ -1942,18 +1940,15 @@ FALSE.</para> The scrInitProc should be of the following form: <blockquote><programlisting> - Bool scrInitProc(iScreen, pScreen, argc, argv) - int iScreen; + Bool scrInitProc(pScreen, argc, argv) ScreenPtr pScreen; int argc; char **argv; </programlisting></blockquote> -iScreen is the index for this screen; 0 for the first one initialized, -1 for the second, etc. pScreen is the pointer to the screen's new -ScreenRec. argc and argv are as before. Your screen initialize -procedure should return TRUE upon success or FALSE if the screen -cannot be initialized (for instance, if the screen hardware does not -exist on this machine).</para> +pScreen is the pointer to the screen's new ScreenRec. argc and argv +are as before. Your screen initialize procedure should return TRUE +upon success or FALSE if the screen cannot be initialized (for + instance, if the screen hardware does not exist on this machine).</para> <para> This procedure must determine what actual device it is supposed to initialize. If you have a different procedure for each screen, then it is no problem. @@ -704,11 +704,9 @@ exaCreateScreenResources(ScreenPtr pScreen) } static void -ExaBlockHandler(int screenNum, pointer blockData, pointer pTimeout, +ExaBlockHandler(ScreenPtr pScreen, pointer pTimeout, pointer pReadmask) { - ScreenPtr pScreen = screenInfo.screens[screenNum]; - ExaScreenPriv(pScreen); /* Move any deferred results from a software fallback to the driver pixmap */ @@ -716,7 +714,7 @@ ExaBlockHandler(int screenNum, pointer blockData, pointer pTimeout, exaMoveInPixmap_mixed(pExaScr->deferred_mixed_pixmap); unwrap(pExaScr, pScreen, BlockHandler); - (*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask); + (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); wrap(pExaScr, pScreen, BlockHandler, ExaBlockHandler); /* The rest only applies to classic EXA */ @@ -736,15 +734,13 @@ ExaBlockHandler(int screenNum, pointer blockData, pointer pTimeout, } static void -ExaWakeupHandler(int screenNum, pointer wakeupData, unsigned long result, +ExaWakeupHandler(ScreenPtr pScreen, unsigned long result, pointer pReadmask) { - ScreenPtr pScreen = screenInfo.screens[screenNum]; - ExaScreenPriv(pScreen); unwrap(pExaScr, pScreen, WakeupHandler); - (*pScreen->WakeupHandler) (screenNum, wakeupData, result, pReadmask); + (*pScreen->WakeupHandler) (pScreen, result, pReadmask); wrap(pExaScr, pScreen, WakeupHandler, ExaWakeupHandler); if (result == 0 && pExaScr->numOffscreenAvailable > 1) { @@ -762,7 +758,7 @@ ExaWakeupHandler(int screenNum, pointer wakeupData, unsigned long result, * screen private, before calling down to the next CloseSccreen. */ static Bool -exaCloseScreen(int i, ScreenPtr pScreen) +exaCloseScreen(ScreenPtr pScreen) { ExaScreenPriv(pScreen); PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); @@ -797,7 +793,7 @@ exaCloseScreen(int i, ScreenPtr pScreen) free(pExaScr); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } /** @@ -789,7 +789,7 @@ extern _X_EXPORT void ExaOffscreenMarkUsed(PixmapPtr pPixmap); extern _X_EXPORT void - exaEnableDisableFBAccess(int index, Bool enable); + exaEnableDisableFBAccess(ScreenPtr pScreen, Bool enable); extern _X_EXPORT Bool exaDrawableIsOffscreen(DrawablePtr pDrawable); diff --git a/exa/exa_offscreen.c b/exa/exa_offscreen.c index 5e1d1398e..1f571cf22 100644 --- a/exa/exa_offscreen.c +++ b/exa/exa_offscreen.c @@ -360,10 +360,8 @@ ExaOffscreenSwapIn(ScreenPtr pScreen) * swapped out. */ void -exaEnableDisableFBAccess(int index, Bool enable) +exaEnableDisableFBAccess(ScreenPtr pScreen, Bool enable) { - ScreenPtr pScreen = screenInfo.screens[index]; - ExaScreenPriv(pScreen); if (pExaScr->info->flags & EXA_HANDLES_PIXMAPS) diff --git a/exa/exa_priv.h b/exa/exa_priv.h index bde78c3a0..f980fea6d 100644 --- a/exa/exa_priv.h +++ b/exa/exa_priv.h @@ -147,7 +147,7 @@ typedef struct _ExaMigrationRec { RegionPtr pReg; } ExaMigrationRec, *ExaMigrationPtr; -typedef void (*EnableDisableFBAccessProcPtr) (int, Bool); +typedef void (*EnableDisableFBAccessProcPtr) (ScreenPtr, Bool); typedef struct { ExaDriverPtr info; ScreenBlockHandlerProcPtr SavedBlockHandler; @@ -1419,7 +1419,7 @@ fbPushPixels(GCPtr pGC, */ extern _X_EXPORT Bool - fbCloseScreen(int indx, ScreenPtr pScreen); + fbCloseScreen(ScreenPtr pScreen); extern _X_EXPORT Bool fbRealizeFont(ScreenPtr pScreen, FontPtr pFont); diff --git a/fb/fboverlay.c b/fb/fboverlay.c index 998be66d9..a882ffa39 100644 --- a/fb/fboverlay.c +++ b/fb/fboverlay.c @@ -81,7 +81,7 @@ fbOverlayCreateWindow(WindowPtr pWin) } Bool -fbOverlayCloseScreen(int iScreen, ScreenPtr pScreen) +fbOverlayCloseScreen(ScreenPtr pScreen) { FbOverlayScrPrivPtr pScrPriv = fbOverlayGetScrPriv(pScreen); int i; diff --git a/fb/fboverlay.h b/fb/fboverlay.h index 76198cda5..9a93457c7 100644 --- a/fb/fboverlay.h +++ b/fb/fboverlay.h @@ -63,7 +63,7 @@ extern _X_EXPORT Bool fbOverlayCreateWindow(WindowPtr pWin); extern _X_EXPORT Bool - fbOverlayCloseScreen(int iScreen, ScreenPtr pScreen); + fbOverlayCloseScreen(ScreenPtr pScreen); extern _X_EXPORT int fbOverlayWindowLayer(WindowPtr pWin); diff --git a/fb/fbscreen.c b/fb/fbscreen.c index c0903ec5c..0833cd41e 100644 --- a/fb/fbscreen.c +++ b/fb/fbscreen.c @@ -27,7 +27,7 @@ #include "fb.h" Bool -fbCloseScreen(int index, ScreenPtr pScreen) +fbCloseScreen(ScreenPtr pScreen) { int d; DepthPtr depths = pScreen->allowedDepths; diff --git a/glx/glxdri.c b/glx/glxdri.c index b2209c551..f3690c859 100644 --- a/glx/glxdri.c +++ b/glx/glxdri.c @@ -846,18 +846,17 @@ static const __DRIextension *loader_extensions[] = { }; static Bool -glxDRIEnterVT(int index, int flags) +glxDRIEnterVT(ScrnInfoPtr scrn) { - ScrnInfoPtr scrn = xf86Screens[index]; Bool ret; __GLXDRIscreen *screen = (__GLXDRIscreen *) - glxGetScreen(screenInfo.screens[index]); + glxGetScreen(xf86ScrnToScreen(scrn)); LogMessage(X_INFO, "AIGLX: Resuming AIGLX clients after VT switch\n"); scrn->EnterVT = screen->enterVT; - ret = scrn->EnterVT(index, flags); + ret = scrn->EnterVT(scrn); screen->enterVT = scrn->EnterVT; scrn->EnterVT = glxDRIEnterVT; @@ -871,18 +870,17 @@ glxDRIEnterVT(int index, int flags) } static void -glxDRILeaveVT(int index, int flags) +glxDRILeaveVT(ScrnInfoPtr scrn) { - ScrnInfoPtr scrn = xf86Screens[index]; __GLXDRIscreen *screen = (__GLXDRIscreen *) - glxGetScreen(screenInfo.screens[index]); + glxGetScreen(xf86ScrnToScreen(scrn)); LogMessage(X_INFO, "AIGLX: Suspending AIGLX clients for VT switch\n"); glxSuspendClients(); scrn->LeaveVT = screen->leaveVT; - (*screen->leaveVT) (index, flags); + (*screen->leaveVT) (scrn); screen->leaveVT = scrn->LeaveVT; scrn->LeaveVT = glxDRILeaveVT; } diff --git a/glx/glxdri2.c b/glx/glxdri2.c index cceb12697..6614666ca 100644 --- a/glx/glxdri2.c +++ b/glx/glxdri2.c @@ -587,18 +587,17 @@ static const __DRIextension *loader_extensions[] = { }; static Bool -glxDRIEnterVT(int index, int flags) +glxDRIEnterVT(ScrnInfoPtr scrn) { - ScrnInfoPtr scrn = xf86Screens[index]; Bool ret; __GLXDRIscreen *screen = (__GLXDRIscreen *) - glxGetScreen(screenInfo.screens[index]); + glxGetScreen(xf86ScrnToScreen(scrn)); LogMessage(X_INFO, "AIGLX: Resuming AIGLX clients after VT switch\n"); scrn->EnterVT = screen->enterVT; - ret = scrn->EnterVT(index, flags); + ret = scrn->EnterVT(scrn); screen->enterVT = scrn->EnterVT; scrn->EnterVT = glxDRIEnterVT; @@ -612,18 +611,17 @@ glxDRIEnterVT(int index, int flags) } static void -glxDRILeaveVT(int index, int flags) +glxDRILeaveVT(ScrnInfoPtr scrn) { - ScrnInfoPtr scrn = xf86Screens[index]; __GLXDRIscreen *screen = (__GLXDRIscreen *) - glxGetScreen(screenInfo.screens[index]); + glxGetScreen(xf86ScrnToScreen(scrn)); LogMessage(X_INFO, "AIGLX: Suspending AIGLX clients for VT switch\n"); glxSuspendClients(); scrn->LeaveVT = screen->leaveVT; - (*screen->leaveVT) (index, flags); + (*screen->leaveVT) (scrn); screen->leaveVT = scrn->LeaveVT; scrn->LeaveVT = glxDRILeaveVT; } diff --git a/glx/glxscreens.c b/glx/glxscreens.c index 74b4c421b..386987e26 100644 --- a/glx/glxscreens.c +++ b/glx/glxscreens.c @@ -177,7 +177,7 @@ static char GLXServerExtensions[] = "GLX_SGIX_pbuffer " "GLX_MESA_copy_sub_buffer " "GLX_INTEL_swap_event"; static Bool -glxCloseScreen(int index, ScreenPtr pScreen) +glxCloseScreen(ScreenPtr pScreen) { __GLXscreen *pGlxScreen = glxGetScreen(pScreen); @@ -185,7 +185,7 @@ glxCloseScreen(int index, ScreenPtr pScreen) pGlxScreen->destroy(pGlxScreen); - return pScreen->CloseScreen(index, pScreen); + return pScreen->CloseScreen(pScreen); } __GLXscreen * diff --git a/glx/glxscreens.h b/glx/glxscreens.h index d5420ee8d..172268b29 100644 --- a/glx/glxscreens.h +++ b/glx/glxscreens.h @@ -153,7 +153,7 @@ struct __GLXscreen { unsigned GLXminor; /*@} */ - Bool (*CloseScreen) (int index, ScreenPtr pScreen); + Bool (*CloseScreen) (ScreenPtr pScreen); }; void __glXScreenInit(__GLXscreen * screen, ScreenPtr pScreen); diff --git a/hw/dmx/dmxextension.c b/hw/dmx/dmxextension.c index faa28a590..d7296ae2d 100644 --- a/hw/dmx/dmxextension.c +++ b/hw/dmx/dmxextension.c @@ -1318,7 +1318,7 @@ dmxAttachScreen(int idx, DMXScreenAttributesPtr attr) } /* Initialize the BE screen resources */ - dmxBEScreenInit(idx, screenInfo.screens[idx]); + dmxBEScreenInit(screenInfo.screens[idx]); /* TODO: Handle GLX visual initialization. GLXProxy needs to be * updated to handle dynamic addition/removal of screens. */ diff --git a/hw/dmx/dmxscrinit.c b/hw/dmx/dmxscrinit.c index 37b3f3b5a..849ef16a1 100644 --- a/hw/dmx/dmxscrinit.c +++ b/hw/dmx/dmxscrinit.c @@ -59,7 +59,7 @@ #include "mipointer.h" #include "micmap.h" -extern Bool dmxCloseScreen(int idx, ScreenPtr pScreen); +extern Bool dmxCloseScreen(ScreenPtr pScreen); static Bool dmxSaveScreen(ScreenPtr pScreen, int what); static unsigned long dmxGeneration; @@ -77,9 +77,9 @@ DevPrivateKeyRec dmxGlyphSetPrivateKeyRec; /** Initialize the parts of screen \a idx that require access to the * back-end server. */ void -dmxBEScreenInit(int idx, ScreenPtr pScreen) +dmxBEScreenInit(ScreenPtr pScreen) { - DMXScreenInfo *dmxScreen = &dmxScreens[idx]; + DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; XSetWindowAttributes attribs; XGCValues gcvals; unsigned long mask; @@ -192,11 +192,11 @@ dmxBEScreenInit(int idx, ScreenPtr pScreen) } } -/** Initialize screen number \a idx. */ +/** Initialize screen number \a pScreen->myNum. */ Bool -dmxScreenInit(int idx, ScreenPtr pScreen, int argc, char *argv[]) +dmxScreenInit(ScreenPtr pScreen, int argc, char *argv[]) { - DMXScreenInfo *dmxScreen = &dmxScreens[idx]; + DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; int i, j; if (!dixRegisterPrivateKey(&dmxScreenPrivateKeyRec, PRIVATE_SCREEN, 0)) @@ -286,20 +286,20 @@ dmxScreenInit(int idx, ScreenPtr pScreen, int argc, char *argv[]) } else { MAXSCREENSALLOC(dmxCursorGeneration); - if (dmxCursorGeneration[idx] != serverGeneration) { + if (dmxCursorGeneration[pScreen->myNum] != serverGeneration) { if (!(miPointerInitialize(pScreen, &dmxPointerSpriteFuncs, &dmxPointerCursorFuncs, FALSE))) return FALSE; - dmxCursorGeneration[idx] = serverGeneration; + dmxCursorGeneration[pScreen->myNum] = serverGeneration; } } DMX_WRAP(CloseScreen, dmxCloseScreen, dmxScreen, pScreen); DMX_WRAP(SaveScreen, dmxSaveScreen, dmxScreen, pScreen); - dmxBEScreenInit(idx, pScreen); + dmxBEScreenInit(pScreen); if (!dmxShadowFB) { /* Wrap GC functions */ @@ -422,12 +422,12 @@ dmxBECloseScreen(ScreenPtr pScreen) /** Close screen number \a idx. */ Bool -dmxCloseScreen(int idx, ScreenPtr pScreen) +dmxCloseScreen(ScreenPtr pScreen) { - DMXScreenInfo *dmxScreen = &dmxScreens[idx]; + DMXScreenInfo *dmxScreen = &dmxScreens[pScreen->myNum]; /* Reset the proc vectors */ - if (idx == 0) { + if (pScreen->myNum == 0) { dmxResetRender(); dmxResetFonts(); } @@ -498,7 +498,7 @@ dmxCloseScreen(int idx, ScreenPtr pScreen) } DMX_UNWRAP(CloseScreen, dmxScreen, pScreen); - return pScreen->CloseScreen(idx, pScreen); + return pScreen->CloseScreen(pScreen); } static Bool diff --git a/hw/dmx/dmxscrinit.h b/hw/dmx/dmxscrinit.h index 5c0bfacce..9fe9c9844 100644 --- a/hw/dmx/dmxscrinit.h +++ b/hw/dmx/dmxscrinit.h @@ -40,9 +40,9 @@ #include "scrnintstr.h" -extern Bool dmxScreenInit(int idx, ScreenPtr pScreen, int argc, char *argv[]); +extern Bool dmxScreenInit(ScreenPtr pScreen, int argc, char *argv[]); -extern void dmxBEScreenInit(int idx, ScreenPtr pScreen); +extern void dmxBEScreenInit(ScreenPtr pScreen); extern void dmxBECloseScreen(ScreenPtr pScreen); #endif /* DMXSCRINIT_H */ diff --git a/hw/dmx/input/dmxconsole.c b/hw/dmx/input/dmxconsole.c index f63772b17..600a70553 100644 --- a/hw/dmx/input/dmxconsole.c +++ b/hw/dmx/input/dmxconsole.c @@ -640,7 +640,7 @@ dmxCloseConsole(myPrivate * priv) } static Bool -dmxCloseConsoleScreen(int idx, ScreenPtr pScreen) +dmxCloseConsoleScreen(ScreenPtr pScreen) { myPrivate *priv, *last; @@ -650,7 +650,7 @@ dmxCloseConsoleScreen(int idx, ScreenPtr pScreen) dmxCloseConsole(last = priv); DMX_UNWRAP(CloseScreen, last, pScreen); - return pScreen->CloseScreen(idx, pScreen); + return pScreen->CloseScreen(pScreen); } static Cursor diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c index ecdae1921..a3b9434d1 100644 --- a/hw/kdrive/src/kdrive.c +++ b/hw/kdrive/src/kdrive.c @@ -606,7 +606,7 @@ KdCreateScreenResources(ScreenPtr pScreen) } Bool -KdCloseScreen(int index, ScreenPtr pScreen) +KdCloseScreen(ScreenPtr pScreen) { KdScreenPriv(pScreen); KdScreenInfo *screen = pScreenPriv->screen; @@ -616,7 +616,7 @@ KdCloseScreen(int index, ScreenPtr pScreen) pScreenPriv->closed = TRUE; pScreen->CloseScreen = pScreenPriv->CloseScreen; if (pScreen->CloseScreen) - ret = (*pScreen->CloseScreen) (index, pScreen); + ret = (*pScreen->CloseScreen) (pScreen); else ret = TRUE; @@ -776,7 +776,7 @@ KdSetSubpixelOrder(ScreenPtr pScreen, Rotation randr) static KdScreenInfo *kdCurrentScreen; Bool -KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) +KdScreenInit(ScreenPtr pScreen, int argc, char **argv) { KdScreenInfo *screen = kdCurrentScreen; KdCardInfo *card = screen->card; diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h index 293798aa0..a08a2182e 100644 --- a/hw/kdrive/src/kdrive.h +++ b/hw/kdrive/src/kdrive.h @@ -442,13 +442,13 @@ Bool KdCreateScreenResources(ScreenPtr pScreen); Bool - KdCloseScreen(int index, ScreenPtr pScreen); + KdCloseScreen(ScreenPtr pScreen); Bool KdSaveScreen(ScreenPtr pScreen, int on); Bool - KdScreenInit(int index, ScreenPtr pScreen, int argc, char **argv); + KdScreenInit(ScreenPtr pScreen, int argc, char **argv); void @@ -537,12 +537,12 @@ void void -KdBlockHandler(int screen, +KdBlockHandler(ScreenPtr pScreen, pointer blockData, pointer timeout, pointer readmask); void -KdWakeupHandler(int screen, +KdWakeupHandler(ScreenPtr pScreen, pointer data, unsigned long result, pointer readmask); void diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index 66cdf675a..58ae55278 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -1972,7 +1972,7 @@ _KdEnqueuePointerEvent(KdPointerInfo * pi, int type, int x, int y, int z, } void -KdBlockHandler(int screen, pointer blockData, pointer timeout, pointer readmask) +KdBlockHandler(ScreenPtr pScreen, pointer blockData, pointer timeout, pointer readmask) { KdPointerInfo *pi; int myTimeout = 0; @@ -1998,7 +1998,7 @@ KdBlockHandler(int screen, pointer blockData, pointer timeout, pointer readmask) } void -KdWakeupHandler(int screen, +KdWakeupHandler(ScreenPtr pScreen, pointer data, unsigned long lresult, pointer readmask) { int result = (int) lresult; diff --git a/hw/kdrive/src/kxv.c b/hw/kdrive/src/kxv.c index 7097aee5c..b02dd88f2 100644 --- a/hw/kdrive/src/kxv.c +++ b/hw/kdrive/src/kxv.c @@ -58,7 +58,7 @@ of the copyright holder. /* XvScreenRec fields */ -static Bool KdXVCloseScreen(int, ScreenPtr); +static Bool KdXVCloseScreen(ScreenPtr); static int KdXVQueryAdaptors(ScreenPtr, XvAdaptorPtr *, int *); /* XvAdaptorRec fields */ @@ -1118,7 +1118,7 @@ KdXVClipNotify(WindowPtr pWin, int dx, int dy) /**** Required XvScreenRec fields ****/ static Bool -KdXVCloseScreen(int i, ScreenPtr pScreen) +KdXVCloseScreen(ScreenPtr pScreen) { XvScreenPtr pxvs = GET_XV_SCREEN(pScreen); KdXVScreenPtr ScreenPriv = GET_KDXV_SCREEN(pScreen); diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c index 16edf4307..955624f3d 100644 --- a/hw/vfb/InitOutput.c +++ b/hw/vfb/InitOutput.c @@ -760,9 +760,9 @@ static miPointerScreenFuncRec vfbPointerCursorFuncs = { }; static Bool -vfbCloseScreen(int index, ScreenPtr pScreen) +vfbCloseScreen(ScreenPtr pScreen) { - vfbScreenInfoPtr pvfb = &vfbScreens[index]; + vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum]; int i; pScreen->CloseScreen = pvfb->closeScreen; @@ -781,13 +781,13 @@ vfbCloseScreen(int index, ScreenPtr pScreen) (*pScreen->DestroyPixmap) (pScreen->devPrivate); pScreen->devPrivate = NULL; - return pScreen->CloseScreen(index, pScreen); + return pScreen->CloseScreen(pScreen); } static Bool -vfbScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) +vfbScreenInit(ScreenPtr pScreen, int argc, char **argv) { - vfbScreenInfoPtr pvfb = &vfbScreens[index]; + vfbScreenInfoPtr pvfb = &vfbScreens[pScreen->myNum]; int dpix = monitorResolution, dpiy = monitorResolution; int ret; char *pbits; diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h index 0eb000d41..129660d81 100644 --- a/hw/xfree86/common/xf86.h +++ b/hw/xfree86/common/xf86.h @@ -244,7 +244,7 @@ extern _X_EXPORT void xf86AddDriver(DriverPtr driver, pointer module, int flags); extern _X_EXPORT void xf86DeleteDriver(int drvIndex); extern _X_EXPORT ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags); -extern _X_EXPORT void xf86DeleteScreen(int scrnIndex, int flags); +extern _X_EXPORT void xf86DeleteScreen(ScrnInfoPtr pScrn); extern _X_EXPORT int xf86AllocateScrnInfoPrivateIndex(void); extern _X_EXPORT Bool xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad); @@ -256,7 +256,7 @@ extern _X_EXPORT Bool xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual); extern _X_EXPORT Bool xf86SetGamma(ScrnInfoPtr scrp, Gamma newGamma); extern _X_EXPORT void xf86SetDpi(ScrnInfoPtr pScrn, int x, int y); extern _X_EXPORT void xf86SetBlackWhitePixels(ScreenPtr pScreen); -extern _X_EXPORT void xf86EnableDisableFBAccess(int scrnIndex, Bool enable); +extern _X_EXPORT void xf86EnableDisableFBAccess(ScrnInfoPtr pScrn, Bool enable); extern _X_EXPORT void xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb, const char *format, va_list args) @@ -347,7 +347,7 @@ xf86SetBackingStore(ScreenPtr pScreen); extern _X_EXPORT void xf86SetSilkenMouse(ScreenPtr pScreen); extern _X_EXPORT pointer -xf86FindXvOptions(int scrnIndex, int adapt_index, char *port_name, +xf86FindXvOptions(ScrnInfoPtr pScrn, int adapt_index, char *port_name, char **adaptor_name, pointer *adaptor_options); extern _X_EXPORT void xf86GetOS(const char **name, int *major, int *minor, int *teeny); @@ -357,7 +357,7 @@ xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, EntityProc enter, EntityProc leave, pointer private); extern _X_EXPORT Bool -xf86IsScreenPrimary(int scrnIndex); +xf86IsScreenPrimary(ScrnInfoPtr pScrn); extern _X_EXPORT int xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type, int format, unsigned long len, pointer value); @@ -458,4 +458,6 @@ extern _X_EXPORT ScreenPtr xf86ScrnToScreen(ScrnInfoPtr pScrn); #define XF86_HAS_SCRN_CONV 1 /* define for drivers to use in api compat */ +#define XF86_SCRN_INTERFACE 1 /* define for drivers to use in api compat */ + #endif /* _XF86_H */ diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c index b8764344b..6c86f5e26 100644 --- a/hw/xfree86/common/xf86Bus.c +++ b/hw/xfree86/common/xf86Bus.c @@ -179,7 +179,7 @@ xf86BusConfig(void) xf86Msg(X_ERROR, "Screen %d deleted because of no matching config section.\n", i); - xf86DeleteScreen(i--, 0); + xf86DeleteScreen(xf86Screens[i--]); } } @@ -377,13 +377,12 @@ xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex) } /* - * xf86ClearEntitiesForScreen() - called when a screen is deleted + * xf86ClearEntityListForScreen() - called when a screen is deleted * to mark it's entities unused. Called by xf86DeleteScreen(). */ void -xf86ClearEntityListForScreen(int scrnIndex) +xf86ClearEntityListForScreen(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; int i, entityIndex; if (pScrn->entityList == NULL || pScrn->numEntities == 0) diff --git a/hw/xfree86/common/xf86Cursor.c b/hw/xfree86/common/xf86Cursor.c index 61cae6aa7..c01cfd138 100644 --- a/hw/xfree86/common/xf86Cursor.c +++ b/hw/xfree86/common/xf86Cursor.c @@ -66,7 +66,7 @@ static Bool xf86CursorOffScreen(ScreenPtr *pScreen, int *x, int *y); static void xf86CrossScreen(ScreenPtr pScreen, Bool entering); static void xf86WarpCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y); -static void xf86PointerMoved(int scrnIndex, int x, int y); +static void xf86PointerMoved(ScrnInfoPtr pScrn, int x, int y); static miPointerScreenFuncRec xf86PointerScreenFuncs = { xf86CursorOffScreen, @@ -135,14 +135,13 @@ xf86SetViewport(ScreenPtr pScreen, int x, int y) { ScrnInfoPtr pScr = xf86ScreenToScrn(pScreen); - (*pScr->PointerMoved) (pScreen->myNum, x, y); + (*pScr->PointerMoved) (pScr, x, y); } static void -xf86PointerMoved(int scrnIndex, int x, int y) +xf86PointerMoved(ScrnInfoPtr pScr, int x, int y) { Bool frameChanged = FALSE; - ScrnInfoPtr pScr = xf86Screens[scrnIndex]; /* * check wether (x,y) belongs to the visual part of the screen @@ -173,7 +172,7 @@ xf86PointerMoved(int scrnIndex, int x, int y) } if (frameChanged && pScr->AdjustFrame != NULL) - pScr->AdjustFrame(pScr->scrnIndex, pScr->frameX0, pScr->frameY0, 0); + pScr->AdjustFrame(pScr, pScr->frameX0, pScr->frameY0); } /* @@ -230,7 +229,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode) miPointerGetPosition(dev, &px, &py); was_blocked = xf86BlockSIGIO(); - Switched = (*pScr->SwitchMode) (pScr->scrnIndex, mode, 0); + Switched = (*pScr->SwitchMode) (pScr, mode); if (Switched) { pScr->currentMode = mode; @@ -271,7 +270,7 @@ xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode) xf86UnblockSIGIO(was_blocked); if (pScr->AdjustFrame) - (*pScr->AdjustFrame) (pScr->scrnIndex, pScr->frameX0, pScr->frameY0, 0); + (*pScr->AdjustFrame) (pScr, pScr->frameX0, pScr->frameY0); /* The original code centered the frame around the cursor if possible. * Since this is hard to achieve with multiple cursors, we do the following: diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c index e0314d86e..64163721f 100644 --- a/hw/xfree86/common/xf86DGA.c +++ b/hw/xfree86/common/xf86DGA.c @@ -56,7 +56,7 @@ static DevPrivateKeyRec DGAScreenKeyRec; #define DGAScreenKeyRegistered dixPrivateKeyRegistered(&DGAScreenKeyRec) static Bool mieq_installed; -static Bool DGACloseScreen(int i, ScreenPtr pScreen); +static Bool DGACloseScreen(ScreenPtr pScreen); static void DGADestroyColormap(ColormapPtr pmap); static void DGAInstallColormap(ColormapPtr pmap); static void DGAUninstallColormap(ColormapPtr pmap); @@ -235,7 +235,7 @@ FreeMarkedVisuals(ScreenPtr pScreen) } static Bool -DGACloseScreen(int i, ScreenPtr pScreen) +DGACloseScreen(ScreenPtr pScreen) { DGAScreenPtr pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); @@ -256,7 +256,7 @@ DGACloseScreen(int i, ScreenPtr pScreen) free(pScreenPriv); - return ((*pScreen->CloseScreen) (i, pScreen)); + return ((*pScreen->CloseScreen) (pScreen)); } static void @@ -323,11 +323,10 @@ DGAUninstallColormap(ColormapPtr pmap) } int -xf86SetDGAMode(int index, int num, DGADevicePtr devRet) +xf86SetDGAMode(ScrnInfoPtr pScrn, int num, DGADevicePtr devRet) { - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); DGAScreenPtr pScreenPriv; - ScrnInfoPtr pScrn; DGADevicePtr device; PixmapPtr pPix = NULL; DGAModePtr pMode = NULL; @@ -338,7 +337,6 @@ xf86SetDGAMode(int index, int num, DGADevicePtr devRet) pScreenPriv = DGA_GET_SCREEN_PRIV(pScreen); if (!pScreenPriv) return BadValue; - pScrn = pScreenPriv->pScrn; if (!num) { if (pScreenPriv->current) { @@ -359,7 +357,7 @@ xf86SetDGAMode(int index, int num, DGADevicePtr devRet) pScreenPriv->savedColormap = NULL; } pScreenPriv->dgaColormap = NULL; - (*pScrn->EnableDisableFBAccess) (index, TRUE); + (*pScrn->EnableDisableFBAccess) (pScrn, TRUE); FreeMarkedVisuals(pScreen); } @@ -385,7 +383,7 @@ xf86SetDGAMode(int index, int num, DGADevicePtr devRet) Bool oldVTSema = pScrn->vtSema; pScrn->vtSema = FALSE; /* kludge until we rewrite VT switching */ - (*pScrn->EnableDisableFBAccess) (index, FALSE); + (*pScrn->EnableDisableFBAccess) (pScrn, FALSE); pScrn->vtSema = oldVTSema; } @@ -564,7 +562,7 @@ DGAShutdown(void) for (i = 0; i < screenInfo.numScreens; i++) { pScrn = xf86Screens[i]; - (void) (*pScrn->SetDGAMode) (pScrn->scrnIndex, 0, NULL); + (void) (*pScrn->SetDGAMode) (pScrn, 0, NULL); } } @@ -579,7 +577,7 @@ DGASetMode(int index, int num, XDGAModePtr mode, PixmapPtr *pPix) /* We rely on the extension to check that DGA is available */ - ret = (*pScrn->SetDGAMode) (index, num, &device); + ret = (*pScrn->SetDGAMode) (pScrn, num, &device); if ((ret == Success) && num) { DGACopyModeInfo(device.mode, mode); *pPix = device.pPix; diff --git a/hw/xfree86/common/xf86DPMS.c b/hw/xfree86/common/xf86DPMS.c index 54ad84243..ef4a2c19b 100644 --- a/hw/xfree86/common/xf86DPMS.c +++ b/hw/xfree86/common/xf86DPMS.c @@ -49,7 +49,7 @@ #ifdef DPMSExtension static DevPrivateKeyRec DPMSKeyRec; static DevPrivateKey DPMSKey; -static Bool DPMSClose(int i, ScreenPtr pScreen); +static Bool DPMSClose(ScreenPtr pScreen); static int DPMSCount = 0; #endif @@ -99,10 +99,10 @@ xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags) #ifdef DPMSExtension static Bool -DPMSClose(int i, ScreenPtr pScreen) +DPMSClose(ScreenPtr pScreen) { DPMSPtr pDPMS; - + ScrnInfoPtr pScrn; /* This shouldn't happen */ if (DPMSKey == NULL) return FALSE; @@ -114,20 +114,20 @@ DPMSClose(int i, ScreenPtr pScreen) return FALSE; pScreen->CloseScreen = pDPMS->CloseScreen; - + pScrn = xf86ScreenToScrn(pScreen); /* * Turn on DPMS when shutting down. If this function can be used * depends on the order the driver wraps things. If this is called * after the driver has shut down everything the driver will have * to deal with this internally. */ - if (xf86Screens[i]->vtSema && xf86Screens[i]->DPMSSet) { - xf86Screens[i]->DPMSSet(xf86Screens[i], DPMSModeOn, 0); + if (pScrn->vtSema && pScrn->DPMSSet) { + pScrn->DPMSSet(pScrn, DPMSModeOn, 0); } if (--DPMSCount == 0) DPMSKey = NULL; - return pScreen->CloseScreen(i, pScreen); + return pScreen->CloseScreen(pScreen); } /* diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index 5896f220c..4fcad4000 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -438,7 +438,7 @@ xf86VTSwitch(void) for (i = 0; i < xf86NumScreens; i++) { if (!(dispatchException & DE_TERMINATE)) if (xf86Screens[i]->EnableDisableFBAccess) - (*xf86Screens[i]->EnableDisableFBAccess) (i, FALSE); + (*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], FALSE); } /* @@ -459,7 +459,7 @@ xf86VTSwitch(void) prevSIGIO = xf86BlockSIGIO(); for (i = 0; i < xf86NumScreens; i++) - xf86Screens[i]->LeaveVT(i, 0); + xf86Screens[i]->LeaveVT(xf86Screens[i]); xf86AccessLeave(); /* We need this here, otherwise */ @@ -471,13 +471,13 @@ xf86VTSwitch(void) DebugF("xf86VTSwitch: Leave failed\n"); xf86AccessEnter(); for (i = 0; i < xf86NumScreens; i++) { - if (!xf86Screens[i]->EnterVT(i, 0)) + if (!xf86Screens[i]->EnterVT(xf86Screens[i])) FatalError("EnterVT failed for screen %d\n", i); } if (!(dispatchException & DE_TERMINATE)) { for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->EnableDisableFBAccess) - (*xf86Screens[i]->EnableDisableFBAccess) (i, TRUE); + (*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], TRUE); } } dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset); @@ -527,12 +527,12 @@ xf86VTSwitch(void) xf86AccessEnter(); for (i = 0; i < xf86NumScreens; i++) { xf86Screens[i]->vtSema = TRUE; - if (!xf86Screens[i]->EnterVT(i, 0)) + if (!xf86Screens[i]->EnterVT(xf86Screens[i])) FatalError("EnterVT failed for screen %d\n", i); } for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->EnableDisableFBAccess) - (*xf86Screens[i]->EnableDisableFBAccess) (i, TRUE); + (*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], TRUE); } /* Turn screen saver off when switching back */ diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c index fb56a0b17..5ef1dabfb 100644 --- a/hw/xfree86/common/xf86Helper.c +++ b/hw/xfree86/common/xf86Helper.c @@ -198,24 +198,22 @@ xf86AllocateScreen(DriverPtr drv, int flags) */ void -xf86DeleteScreen(int scrnIndex, int flags) +xf86DeleteScreen(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn; int i; + int scrnIndex; /* First check if the screen is valid */ if (xf86NumScreens == 0 || xf86Screens == NULL) return; - if (scrnIndex > xf86NumScreens - 1) - return; - - if (!(pScrn = xf86Screens[scrnIndex])) + if (!pScrn) return; + scrnIndex = pScrn->scrnIndex; /* If a FreeScreen function is defined, call it here */ if (pScrn->FreeScreen != NULL) - pScrn->FreeScreen(scrnIndex, 0); + pScrn->FreeScreen(pScrn); while (pScrn->modes) xf86DeleteMode(&pScrn->modes, pScrn->modes); @@ -233,7 +231,7 @@ xf86DeleteScreen(int scrnIndex, int flags) free(pScrn->privates); - xf86ClearEntityListForScreen(scrnIndex); + xf86ClearEntityListForScreen(pScrn); free(pScrn); @@ -1027,9 +1025,8 @@ xf86SetBlackWhitePixels(ScreenPtr pScreen) * private data, and therefore don't need to access pScrnInfo->vtSema. */ void -xf86EnableDisableFBAccess(int scrnIndex, Bool enable) +xf86EnableDisableFBAccess(ScrnInfoPtr pScrnInfo, Bool enable) { - ScrnInfoPtr pScrnInfo = xf86Screens[scrnIndex]; ScreenPtr pScreen = pScrnInfo->pScreen; PixmapPtr pspix; @@ -1651,10 +1648,9 @@ xf86SetSilkenMouse(ScreenPtr pScreen) /* Wrote this function for the PM2 Xv driver, preliminary. */ pointer -xf86FindXvOptions(int scrnIndex, int adaptor_index, char *port_name, +xf86FindXvOptions(ScrnInfoPtr pScrn, int adaptor_index, char *port_name, char **adaptor_name, pointer *adaptor_options) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; confXvAdaptorPtr adaptor; int i; @@ -1726,9 +1722,8 @@ xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag, int entityIndex, } Bool -xf86IsScreenPrimary(int scrnIndex) +xf86IsScreenPrimary(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; int i; for (i = 0; i < pScrn->numEntities; i++) { diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c index ead47ccba..ca6efd44e 100644 --- a/hw/xfree86/common/xf86Init.c +++ b/hw/xfree86/common/xf86Init.c @@ -591,7 +591,7 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv) } for (i = 0; i < xf86NumScreens; i++) if (!xf86Screens[i]->configured) - xf86DeleteScreen(i--, 0); + xf86DeleteScreen(xf86Screens[i--]); /* * If no screens left, return now. @@ -1040,7 +1040,7 @@ AbortDDX(enum ExitCode error) * screen explicitely. */ xf86VGAarbiterLock(xf86Screens[i]); - (xf86Screens[i]->LeaveVT) (i, 0); + (xf86Screens[i]->LeaveVT) (xf86Screens[i]); xf86VGAarbiterUnlock(xf86Screens[i]); } } diff --git a/hw/xfree86/common/xf86Mode.c b/hw/xfree86/common/xf86Mode.c index ab4d595c7..d80dec892 100644 --- a/hw/xfree86/common/xf86Mode.c +++ b/hw/xfree86/common/xf86Mode.c @@ -950,7 +950,7 @@ xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, mode->SynthClock /= 2; } - status = (*scrp->ValidMode) (scrp->scrnIndex, mode, FALSE, + status = (*scrp->ValidMode) (scrp, mode, FALSE, MODECHECK_INITIAL); if (status != MODE_OK) return status; @@ -1840,7 +1840,7 @@ xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes, scrp->virtualX = newVirtX; scrp->virtualY = newVirtY; scrp->displayWidth = newLinePitch; - p->status = (scrp->ValidMode) (scrp->scrnIndex, p, FALSE, + p->status = (scrp->ValidMode) (scrp, p, FALSE, MODECHECK_FINAL); if (p->status != MODE_OK) { diff --git a/hw/xfree86/common/xf86Module.h b/hw/xfree86/common/xf86Module.h index 31f5c6a86..bf56acd05 100644 --- a/hw/xfree86/common/xf86Module.h +++ b/hw/xfree86/common/xf86Module.h @@ -82,7 +82,7 @@ typedef enum { * mask is 0xFFFF0000. */ #define ABI_ANSIC_VERSION SET_ABI_VERSION(0, 4) -#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(12, 0) +#define ABI_VIDEODRV_VERSION SET_ABI_VERSION(13, 0) #define ABI_XINPUT_VERSION SET_ABI_VERSION(17, 0) #define ABI_EXTENSION_VERSION SET_ABI_VERSION(6, 0) #define ABI_FONT_VERSION SET_ABI_VERSION(0, 6) diff --git a/hw/xfree86/common/xf86PM.c b/hw/xfree86/common/xf86PM.c index f69fffa0e..1830640d5 100644 --- a/hw/xfree86/common/xf86PM.c +++ b/hw/xfree86/common/xf86PM.c @@ -102,7 +102,7 @@ suspend(pmEvent event, Bool undo) for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->EnableDisableFBAccess) - (*xf86Screens[i]->EnableDisableFBAccess) (i, FALSE); + (*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], FALSE); } pInfo = xf86InputDevs; while (pInfo) { @@ -112,9 +112,9 @@ suspend(pmEvent event, Bool undo) sigio_blocked_for_suspend = xf86BlockSIGIO(); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->PMEvent) - xf86Screens[i]->PMEvent(i, event, undo); + xf86Screens[i]->PMEvent(xf86Screens[i], event, undo); else { - xf86Screens[i]->LeaveVT(i, 0); + xf86Screens[i]->LeaveVT(xf86Screens[i]); xf86Screens[i]->vtSema = FALSE; } } @@ -131,16 +131,16 @@ resume(pmEvent event, Bool undo) xf86AccessEnter(); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->PMEvent) - xf86Screens[i]->PMEvent(i, event, undo); + xf86Screens[i]->PMEvent(xf86Screens[i], event, undo); else { xf86Screens[i]->vtSema = TRUE; - xf86Screens[i]->EnterVT(i, 0); + xf86Screens[i]->EnterVT(xf86Screens[i]); } } xf86UnblockSIGIO(sigio_blocked_for_suspend); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->EnableDisableFBAccess) - (*xf86Screens[i]->EnableDisableFBAccess) (i, TRUE); + (*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], TRUE); } dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset); pInfo = xf86InputDevs; @@ -187,7 +187,7 @@ DoApmEvent(pmEvent event, Bool undo) was_blocked = xf86BlockSIGIO(); for (i = 0; i < xf86NumScreens; i++) { if (xf86Screens[i]->PMEvent) { - xf86Screens[i]->PMEvent(i, event, undo); + xf86Screens[i]->PMEvent(xf86Screens[i], event, undo); } } xf86UnblockSIGIO(was_blocked); diff --git a/hw/xfree86/common/xf86Priv.h b/hw/xfree86/common/xf86Priv.h index 6c5efeacc..42a3b30f0 100644 --- a/hw/xfree86/common/xf86Priv.h +++ b/hw/xfree86/common/xf86Priv.h @@ -114,7 +114,7 @@ extern _X_EXPORT void xf86BusProbe(void); extern _X_EXPORT void xf86AccessEnter(void); extern _X_EXPORT void xf86AccessLeave(void); extern _X_EXPORT void xf86PostProbe(void); -extern _X_EXPORT void xf86ClearEntityListForScreen(int scrnIndex); +extern _X_EXPORT void xf86ClearEntityListForScreen(ScrnInfoPtr pScrn); extern _X_EXPORT void xf86AddDevToEntity(int entityIndex, GDevPtr dev); extern _X_EXPORT void xf86RemoveDevFromEntity(int entityIndex, GDevPtr dev); diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c index b17f601d1..5606bee4b 100644 --- a/hw/xfree86/common/xf86RandR.c +++ b/hw/xfree86/common/xf86RandR.c @@ -159,7 +159,7 @@ xf86RandRSetMode(ScreenPtr pScreen, Bool ret = TRUE; if (pRoot && scrp->vtSema) - (*scrp->EnableDisableFBAccess) (pScreen->myNum, FALSE); + (*scrp->EnableDisableFBAccess) (scrp, FALSE); if (useVirtual) { scrp->virtualX = randrp->virtualX; scrp->virtualY = randrp->virtualY; @@ -220,7 +220,7 @@ xf86RandRSetMode(ScreenPtr pScreen, xf86SetViewport(pScreen, pScreen->width, pScreen->height); xf86SetViewport(pScreen, 0, 0); if (pRoot && scrp->vtSema) - (*scrp->EnableDisableFBAccess) (pScreen->myNum, TRUE); + (*scrp->EnableDisableFBAccess) (scrp, TRUE); return ret; } @@ -365,7 +365,7 @@ xf86RandRCreateScreenResources(ScreenPtr pScreen) * Reset size back to original */ static Bool -xf86RandRCloseScreen(int index, ScreenPtr pScreen) +xf86RandRCloseScreen(ScreenPtr pScreen) { ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); @@ -376,7 +376,7 @@ xf86RandRCloseScreen(int index, ScreenPtr pScreen) pScreen->CloseScreen = randrp->CloseScreen; free(randrp); dixSetPrivate(&pScreen->devPrivates, xf86RandRKey, NULL); - return (*pScreen->CloseScreen) (index, pScreen); + return (*pScreen->CloseScreen) (pScreen); } Rotation diff --git a/hw/xfree86/common/xf86VGAarbiter.c b/hw/xfree86/common/xf86VGAarbiter.c index b9b46f6cd..225fff06e 100644 --- a/hw/xfree86/common/xf86VGAarbiter.c +++ b/hw/xfree86/common/xf86VGAarbiter.c @@ -221,7 +221,7 @@ xf86VGAarbiterWrapFunctions(void) /* Screen funcs */ static Bool -VGAarbiterCloseScreen(int i, ScreenPtr pScreen) +VGAarbiterCloseScreen(ScreenPtr pScreen) { Bool val; ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); @@ -258,34 +258,30 @@ VGAarbiterCloseScreen(int i, ScreenPtr pScreen) UNWRAP_SPRITE; free((pointer) pScreenPriv); - xf86VGAarbiterLock(xf86Screens[i]); - val = (*pScreen->CloseScreen) (i, pScreen); - xf86VGAarbiterUnlock(xf86Screens[i]); + xf86VGAarbiterLock(xf86ScreenToScrn(pScreen)); + val = (*pScreen->CloseScreen) (pScreen); + xf86VGAarbiterUnlock(xf86ScreenToScrn(pScreen)); return val; } static void -VGAarbiterBlockHandler(int i, - pointer blockData, pointer pTimeout, pointer pReadmask) +VGAarbiterBlockHandler(ScreenPtr pScreen, + pointer pTimeout, pointer pReadmask) { - ScreenPtr pScreen = screenInfo.screens[i]; - SCREEN_PROLOG(BlockHandler); VGAGet(pScreen); - pScreen->BlockHandler(i, blockData, pTimeout, pReadmask); + pScreen->BlockHandler(pScreen, pTimeout, pReadmask); VGAPut(); SCREEN_EPILOG(BlockHandler, VGAarbiterBlockHandler); } static void -VGAarbiterWakeupHandler(int i, pointer blockData, unsigned long result, +VGAarbiterWakeupHandler(ScreenPtr pScreen, unsigned long result, pointer pReadmask) { - ScreenPtr pScreen = screenInfo.screens[i]; - SCREEN_PROLOG(WakeupHandler); VGAGet(pScreen); - pScreen->WakeupHandler(i, blockData, result, pReadmask); + pScreen->WakeupHandler(pScreen, result, pReadmask); VGAPut(); SCREEN_EPILOG(WakeupHandler, VGAarbiterWakeupHandler); } @@ -466,46 +462,45 @@ VGAarbiterSetCursorPosition(DeviceIntPtr pDev, } static void -VGAarbiterAdjustFrame(int index, int x, int y, int flags) +VGAarbiterAdjustFrame(ScrnInfoPtr pScrn, int x, int y) { - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr) dixLookupPrivate(&pScreen->devPrivates, VGAarbiterScreenKey); VGAGet(pScreen); - (*pScreenPriv->AdjustFrame) (index, x, y, flags); + (*pScreenPriv->AdjustFrame) (pScrn, x, y); VGAPut(); } static Bool -VGAarbiterSwitchMode(int index, DisplayModePtr mode, int flags) +VGAarbiterSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { Bool val; - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr) dixLookupPrivate(&pScreen->devPrivates, VGAarbiterScreenKey); VGAGet(pScreen); - val = (*pScreenPriv->SwitchMode) (index, mode, flags); + val = (*pScreenPriv->SwitchMode) (pScrn, mode); VGAPut(); return val; } static Bool -VGAarbiterEnterVT(int index, int flags) +VGAarbiterEnterVT(ScrnInfoPtr pScrn) { Bool val; - ScrnInfoPtr pScrn = xf86Screens[index]; - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr) dixLookupPrivate(&pScreen->devPrivates, VGAarbiterScreenKey); VGAGet(pScreen); pScrn->EnterVT = pScreenPriv->EnterVT; - val = (*pScrn->EnterVT) (index, flags); + val = (*pScrn->EnterVT) (pScrn); pScreenPriv->EnterVT = pScrn->EnterVT; pScrn->EnterVT = VGAarbiterEnterVT; VGAPut(); @@ -513,32 +508,31 @@ VGAarbiterEnterVT(int index, int flags) } static void -VGAarbiterLeaveVT(int index, int flags) +VGAarbiterLeaveVT(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[index]; - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr) dixLookupPrivate(&pScreen->devPrivates, VGAarbiterScreenKey); VGAGet(pScreen); pScrn->LeaveVT = pScreenPriv->LeaveVT; - (*pScreenPriv->LeaveVT) (index, flags); + (*pScreenPriv->LeaveVT) (pScrn); pScreenPriv->LeaveVT = pScrn->LeaveVT; pScrn->LeaveVT = VGAarbiterLeaveVT; VGAPut(); } static void -VGAarbiterFreeScreen(int index, int flags) +VGAarbiterFreeScreen(ScrnInfoPtr pScrn) { - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr) dixLookupPrivate(&pScreen->devPrivates, VGAarbiterScreenKey); VGAGet(pScreen); - (*pScreenPriv->FreeScreen) (index, flags); + (*pScreenPriv->FreeScreen) (pScrn); VGAPut(); } diff --git a/hw/xfree86/common/xf86VGAarbiterPriv.h b/hw/xfree86/common/xf86VGAarbiterPriv.h index ebc8854d3..ba6edfcc3 100644 --- a/hw/xfree86/common/xf86VGAarbiterPriv.h +++ b/hw/xfree86/common/xf86VGAarbiterPriv.h @@ -125,11 +125,11 @@ typedef struct _VGAarbiterScreen { UnrealizeCursorProcPtr UnrealizeCursor; RecolorCursorProcPtr RecolorCursor; SetCursorPositionProcPtr SetCursorPosition; - void (*AdjustFrame) (int, int, int, int); - Bool (*SwitchMode) (int, DisplayModePtr, int); - Bool (*EnterVT) (int, int); - void (*LeaveVT) (int, int); - void (*FreeScreen) (int, int); + void (*AdjustFrame) (ScrnInfoPtr, int, int); + Bool (*SwitchMode) (ScrnInfoPtr, DisplayModePtr); + Bool (*EnterVT) (ScrnInfoPtr); + void (*LeaveVT) (ScrnInfoPtr); + void (*FreeScreen) (ScrnInfoPtr); miPointerSpriteFuncPtr miSprite; CompositeProcPtr Composite; GlyphsProcPtr Glyphs; @@ -142,11 +142,11 @@ typedef struct _VGAarbiterGC { } VGAarbiterGCRec, *VGAarbiterGCPtr; /* Screen funcs */ -static void VGAarbiterBlockHandler(int i, pointer blockData, pointer pTimeout, +static void VGAarbiterBlockHandler(ScreenPtr pScreen, pointer pTimeout, pointer pReadmask); -static void VGAarbiterWakeupHandler(int i, pointer blockData, +static void VGAarbiterWakeupHandler(ScreenPtr pScreen, unsigned long result, pointer pReadmask); -static Bool VGAarbiterCloseScreen(int i, ScreenPtr pScreen); +static Bool VGAarbiterCloseScreen(ScreenPtr pScreen); static void VGAarbiterGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, unsigned int format, unsigned long planemask, char *pdstLine); @@ -176,11 +176,11 @@ static Bool VGAarbiterDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, static Bool VGAarbiterSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, Bool generateEvent); -static void VGAarbiterAdjustFrame(int index, int x, int y, int flags); -static Bool VGAarbiterSwitchMode(int index, DisplayModePtr mode, int flags); -static Bool VGAarbiterEnterVT(int index, int flags); -static void VGAarbiterLeaveVT(int index, int flags); -static void VGAarbiterFreeScreen(int index, int flags); +static void VGAarbiterAdjustFrame(ScrnInfoPtr pScrn, int x, int y); +static Bool VGAarbiterSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode); +static Bool VGAarbiterEnterVT(ScrnInfoPtr pScrn); +static void VGAarbiterLeaveVT(ScrnInfoPtr pScrn); +static void VGAarbiterFreeScreen(ScrnInfoPtr pScrn); /* GC funcs */ static void VGAarbiterValidateGC(GCPtr pGC, unsigned long changes, diff --git a/hw/xfree86/common/xf86VidMode.c b/hw/xfree86/common/xf86VidMode.c index 13ffe061c..a7d1c25bf 100644 --- a/hw/xfree86/common/xf86VidMode.c +++ b/hw/xfree86/common/xf86VidMode.c @@ -50,7 +50,7 @@ static DevPrivateKeyRec VidModeKeyRec; static DevPrivateKey VidModeKey; static int VidModeCount = 0; -static Bool VidModeClose(int i, ScreenPtr pScreen); +static Bool VidModeClose(ScreenPtr pScreen); #define VMPTR(p) ((VidModePtr)dixLookupPrivate(&(p)->devPrivates, VidModeKey)) @@ -93,7 +93,7 @@ VidModeExtensionInit(ScreenPtr pScreen) #ifdef XF86VIDMODE static Bool -VidModeClose(int i, ScreenPtr pScreen) +VidModeClose(ScreenPtr pScreen) { VidModePtr pVidMode = VMPTR(pScreen); @@ -108,7 +108,7 @@ VidModeClose(int i, ScreenPtr pScreen) dixSetPrivate(&pScreen->devPrivates, VidModeKey, NULL); VidModeKey = NULL; } - return pScreen->CloseScreen(i, pScreen); + return pScreen->CloseScreen(pScreen); } Bool @@ -303,7 +303,7 @@ VidModeSetViewPort(int scrnIndex, int x, int y) pScrn->virtualY - pScrn->currentMode->VDisplay); pScrn->frameY1 = pScrn->frameY0 + pScrn->currentMode->VDisplay - 1; if (pScrn->AdjustFrame != NULL) - (pScrn->AdjustFrame) (scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); + (pScrn->AdjustFrame) (pScrn, pScrn->frameX0, pScrn->frameY0); return TRUE; } diff --git a/hw/xfree86/common/xf86cmap.c b/hw/xfree86/common/xf86cmap.c index 460fafde3..25f84e579 100644 --- a/hw/xfree86/common/xf86cmap.c +++ b/hw/xfree86/common/xf86cmap.c @@ -80,9 +80,9 @@ typedef struct { DestroyColormapProcPtr DestroyColormap; InstallColormapProcPtr InstallColormap; StoreColorsProcPtr StoreColors; - Bool (*EnterVT) (int, int); - Bool (*SwitchMode) (int, DisplayModePtr, int); - int (*SetDGAMode) (int, int, DGADevicePtr); + Bool (*EnterVT) (ScrnInfoPtr); + Bool (*SwitchMode) (ScrnInfoPtr, DisplayModePtr); + int (*SetDGAMode) (ScrnInfoPtr, int, DGADevicePtr); xf86ChangeGammaProc *ChangeGamma; int maxColors; int sigRGBbits; @@ -111,17 +111,17 @@ static DevPrivateKeyRec CMapColormapKeyRec; static void CMapInstallColormap(ColormapPtr); static void CMapStoreColors(ColormapPtr, int, xColorItem *); -static Bool CMapCloseScreen(int, ScreenPtr); +static Bool CMapCloseScreen(ScreenPtr); static Bool CMapCreateColormap(ColormapPtr); static void CMapDestroyColormap(ColormapPtr); -static Bool CMapEnterVT(int, int); -static Bool CMapSwitchMode(int, DisplayModePtr, int); +static Bool CMapEnterVT(ScrnInfoPtr); +static Bool CMapSwitchMode(ScrnInfoPtr, DisplayModePtr); #ifdef XFreeXDGA -static int CMapSetDGAMode(int, int, DGADevicePtr); +static int CMapSetDGAMode(ScrnInfoPtr, int, DGADevicePtr); #endif -static int CMapChangeGamma(int, Gamma); +static int CMapChangeGamma(ScrnInfoPtr, Gamma); static void ComputeGamma(CMapScreenPtr); static Bool CMapAllocateColormapPrivate(ColormapPtr); @@ -241,11 +241,11 @@ xf86HandleColormaps(ScreenPtr pScreen, /**** Screen functions ****/ static Bool -CMapCloseScreen(int i, ScreenPtr pScreen) +CMapCloseScreen(ScreenPtr pScreen) { CMapUnwrapScreen(pScreen); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } static Bool @@ -462,16 +462,15 @@ CMapInstallColormap(ColormapPtr pmap) /**** ScrnInfoRec functions ****/ static Bool -CMapEnterVT(int index, int flags) +CMapEnterVT(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[index]; - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); Bool ret; CMapScreenPtr pScreenPriv = (CMapScreenPtr) dixLookupPrivate(&pScreen->devPrivates, CMapScreenKey); pScrn->EnterVT = pScreenPriv->EnterVT; - ret = (*pScreenPriv->EnterVT) (index, flags); + ret = (*pScreenPriv->EnterVT) (pScrn); pScreenPriv->EnterVT = pScrn->EnterVT; pScrn->EnterVT = CMapEnterVT; if (ret) { @@ -483,13 +482,13 @@ CMapEnterVT(int index, int flags) } static Bool -CMapSwitchMode(int index, DisplayModePtr mode, int flags) +CMapSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); CMapScreenPtr pScreenPriv = (CMapScreenPtr) dixLookupPrivate(&pScreen->devPrivates, CMapScreenKey); - if ((*pScreenPriv->SwitchMode) (index, mode, flags)) { + if ((*pScreenPriv->SwitchMode) (pScrn, mode)) { if (GetInstalledmiColormap(pScreen)) CMapReinstallMap(GetInstalledmiColormap(pScreen)); return TRUE; @@ -499,16 +498,16 @@ CMapSwitchMode(int index, DisplayModePtr mode, int flags) #ifdef XFreeXDGA static int -CMapSetDGAMode(int index, int num, DGADevicePtr dev) +CMapSetDGAMode(ScrnInfoPtr pScrn, int num, DGADevicePtr dev) { - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); CMapScreenPtr pScreenPriv = (CMapScreenPtr) dixLookupPrivate(&pScreen->devPrivates, CMapScreenKey); int ret; - ret = (*pScreenPriv->SetDGAMode) (index, num, dev); + ret = (*pScreenPriv->SetDGAMode) (pScrn, num, dev); - pScreenPriv->isDGAmode = DGAActive(index); + pScreenPriv->isDGAmode = DGAActive(pScrn->scrnIndex); if (!pScreenPriv->isDGAmode && GetInstalledmiColormap(pScreen) && xf86ScreenToScrn(pScreen)->vtSema) @@ -908,11 +907,10 @@ ComputeGamma(CMapScreenPtr priv) } int -CMapChangeGamma(int index, Gamma gamma) +CMapChangeGamma(ScrnInfoPtr pScrn, Gamma gamma) { int ret = Success; - ScrnInfoPtr pScrn = xf86Screens[index]; - ScreenPtr pScreen = pScrn->pScreen; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); CMapColormapPtr pColPriv; CMapScreenPtr pScreenPriv; CMapLinkPtr pLink; @@ -979,7 +977,7 @@ CMapChangeGamma(int index, Gamma gamma) pScrn->ChangeGamma = pScreenPriv->ChangeGamma; if (pScrn->ChangeGamma) - ret = pScrn->ChangeGamma(index, gamma); + ret = pScrn->ChangeGamma(pScrn, gamma); pScrn->ChangeGamma = CMapChangeGamma; return ret; @@ -1175,7 +1173,7 @@ xf86ChangeGamma(ScreenPtr pScreen, Gamma gamma) ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); if (pScrn->ChangeGamma) - return (*pScrn->ChangeGamma) (pScreen->myNum, gamma); + return (*pScrn->ChangeGamma) (pScrn, gamma); return BadImplementation; } diff --git a/hw/xfree86/common/xf86fbman.c b/hw/xfree86/common/xf86fbman.c index e2db1c354..c2e7bab9f 100644 --- a/hw/xfree86/common/xf86fbman.c +++ b/hw/xfree86/common/xf86fbman.c @@ -1149,7 +1149,7 @@ static FBManagerFuncs xf86FBManFuncs = { }; static Bool -xf86FBCloseScreen(int i, ScreenPtr pScreen) +xf86FBCloseScreen(ScreenPtr pScreen) { FBLinkPtr pLink, tmp; FBLinearLinkPtr pLinearLink, tmp2; @@ -1180,7 +1180,7 @@ xf86FBCloseScreen(int i, ScreenPtr pScreen) free(offman); dixSetPrivate(&pScreen->devPrivates, xf86FBScreenKey, NULL); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } Bool diff --git a/hw/xfree86/common/xf86sbusBus.c b/hw/xfree86/common/xf86sbusBus.c index 27d24f8e1..b6a6b94b3 100644 --- a/hw/xfree86/common/xf86sbusBus.c +++ b/hw/xfree86/common/xf86sbusBus.c @@ -667,7 +667,7 @@ xf86SbusCmapLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, } static Bool -xf86SbusCmapCloseScreen(int i, ScreenPtr pScreen) +xf86SbusCmapCloseScreen(ScreenPtr pScreen) { sbusCmapPtr cmap; struct fbcmap fbcmap; @@ -683,7 +683,7 @@ xf86SbusCmapCloseScreen(int i, ScreenPtr pScreen) } pScreen->CloseScreen = cmap->CloseScreen; free(cmap); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } Bool diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h index 6294845bc..a1404c3aa 100644 --- a/hw/xfree86/common/xf86str.h +++ b/hw/xfree86/common/xf86str.h @@ -630,18 +630,18 @@ typedef struct { typedef Bool xf86ProbeProc(DriverPtr, int); typedef Bool xf86PreInitProc(ScrnInfoPtr, int); -typedef Bool xf86ScreenInitProc(int, ScreenPtr, int, char **); -typedef Bool xf86SwitchModeProc(int, DisplayModePtr, int); -typedef void xf86AdjustFrameProc(int, int, int, int); -typedef Bool xf86EnterVTProc(int, int); -typedef void xf86LeaveVTProc(int, int); -typedef void xf86FreeScreenProc(int, int); -typedef ModeStatus xf86ValidModeProc(int, DisplayModePtr, Bool, int); -typedef void xf86EnableDisableFBAccessProc(int, Bool); -typedef int xf86SetDGAModeProc(int, int, DGADevicePtr); -typedef int xf86ChangeGammaProc(int, Gamma); -typedef void xf86PointerMovedProc(int, int, int); -typedef Bool xf86PMEventProc(int, pmEvent, Bool); +typedef Bool xf86ScreenInitProc(ScreenPtr, int, char **); +typedef Bool xf86SwitchModeProc(ScrnInfoPtr, DisplayModePtr); +typedef void xf86AdjustFrameProc(ScrnInfoPtr, int, int); +typedef Bool xf86EnterVTProc(ScrnInfoPtr); +typedef void xf86LeaveVTProc(ScrnInfoPtr); +typedef void xf86FreeScreenProc(ScrnInfoPtr); +typedef ModeStatus xf86ValidModeProc(ScrnInfoPtr, DisplayModePtr, Bool, int); +typedef void xf86EnableDisableFBAccessProc(ScrnInfoPtr, Bool); +typedef int xf86SetDGAModeProc(ScrnInfoPtr, int, DGADevicePtr); +typedef int xf86ChangeGammaProc(ScrnInfoPtr, Gamma); +typedef void xf86PointerMovedProc(ScrnInfoPtr, int, int); +typedef Bool xf86PMEventProc(ScrnInfoPtr, pmEvent, Bool); typedef void xf86DPMSSetProc(ScrnInfoPtr, int, int); typedef void xf86LoadPaletteProc(ScrnInfoPtr, int, int *, LOCO *, VisualPtr); typedef void xf86SetOverscanProc(ScrnInfoPtr, int); diff --git a/hw/xfree86/common/xf86xv.c b/hw/xfree86/common/xf86xv.c index b10034852..1a964d270 100644 --- a/hw/xfree86/common/xf86xv.c +++ b/hw/xfree86/common/xf86xv.c @@ -56,7 +56,7 @@ /* XvScreenRec fields */ -static Bool xf86XVCloseScreen(int, ScreenPtr); +static Bool xf86XVCloseScreen(ScreenPtr); static int xf86XVQueryAdaptors(ScreenPtr, XvAdaptorPtr *, int *); /* XvAdaptorRec fields */ @@ -100,9 +100,9 @@ static void xf86XVClipNotify(WindowPtr pWin, int dx, int dy); /* ScrnInfoRec functions */ -static Bool xf86XVEnterVT(int, int); -static void xf86XVLeaveVT(int, int); -static void xf86XVAdjustFrame(int index, int x, int y, int flags); +static Bool xf86XVEnterVT(ScrnInfoPtr); +static void xf86XVLeaveVT(ScrnInfoPtr); +static void xf86XVAdjustFrame(ScrnInfoPtr, int x, int y); static void xf86XVModeSet(ScrnInfoPtr pScrn); /* misc */ @@ -1066,7 +1066,7 @@ xf86XVReputOrStopPort(XvPortRecPrivatePtr pPriv, WindowPtr pWin, Bool visible) static void xf86XVReputOrStopAllPorts(ScrnInfoPtr pScrn, Bool onlyChanged) { - ScreenPtr pScreen = pScrn->pScreen; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); XvScreenPtr pxvs = GET_XV_SCREEN(pScreen); XvAdaptorPtr pa; int c, i; @@ -1255,7 +1255,7 @@ xf86XVClipNotify(WindowPtr pWin, int dx, int dy) /**** Required XvScreenRec fields ****/ static Bool -xf86XVCloseScreen(int i, ScreenPtr pScreen) +xf86XVCloseScreen(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); XvScreenPtr pxvs = GET_XV_SCREEN(pScreen); @@ -1299,15 +1299,14 @@ xf86XVQueryAdaptors(ScreenPtr pScreen, /**** ScrnInfoRec fields ****/ static Bool -xf86XVEnterVT(int index, int flags) +xf86XVEnterVT(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[index]; - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen); Bool ret; pScrn->EnterVT = ScreenPriv->EnterVT; - ret = (*ScreenPriv->EnterVT) (index, flags); + ret = (*ScreenPriv->EnterVT) (pScrn); ScreenPriv->EnterVT = pScrn->EnterVT; pScrn->EnterVT = xf86XVEnterVT; @@ -1318,10 +1317,9 @@ xf86XVEnterVT(int index, int flags) } static void -xf86XVLeaveVT(int index, int flags) +xf86XVLeaveVT(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[index]; - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); XvScreenPtr pxvs = GET_XV_SCREEN(pScreen); XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen); XvAdaptorPtr pAdaptor; @@ -1353,21 +1351,20 @@ xf86XVLeaveVT(int index, int flags) } pScrn->LeaveVT = ScreenPriv->LeaveVT; - (*ScreenPriv->LeaveVT) (index, flags); + (*ScreenPriv->LeaveVT) (pScrn); ScreenPriv->LeaveVT = pScrn->LeaveVT; pScrn->LeaveVT = xf86XVLeaveVT; } static void -xf86XVAdjustFrame(int index, int x, int y, int flags) +xf86XVAdjustFrame(ScrnInfoPtr pScrn, int x, int y) { - ScrnInfoPtr pScrn = xf86Screens[index]; - ScreenPtr pScreen = pScrn->pScreen; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); XF86XVScreenPtr ScreenPriv = GET_XF86XV_SCREEN(pScreen); if (ScreenPriv->AdjustFrame) { pScrn->AdjustFrame = ScreenPriv->AdjustFrame; - (*pScrn->AdjustFrame) (index, x, y, flags); + (*pScrn->AdjustFrame) (pScrn, x, y); pScrn->AdjustFrame = xf86XVAdjustFrame; } @@ -1377,7 +1374,7 @@ xf86XVAdjustFrame(int index, int x, int y, int flags) static void xf86XVModeSet(ScrnInfoPtr pScrn) { - ScreenPtr pScreen = pScrn->pScreen; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); XF86XVScreenPtr ScreenPriv; /* Can be called before pScrn->pScreen is set */ diff --git a/hw/xfree86/common/xf86xvmc.c b/hw/xfree86/common/xf86xvmc.c index b7da7589a..2e529dd92 100644 --- a/hw/xfree86/common/xf86xvmc.c +++ b/hw/xfree86/common/xf86xvmc.c @@ -132,7 +132,7 @@ xf86XvMCDestroySubpicture(XvMCSubpicturePtr pSubpicture) } static Bool -xf86XvMCCloseScreen(int i, ScreenPtr pScreen) +xf86XvMCCloseScreen(ScreenPtr pScreen) { xf86XvMCScreenPtr pScreenPriv = XF86XVMC_GET_PRIVATE(pScreen); @@ -141,7 +141,7 @@ xf86XvMCCloseScreen(int i, ScreenPtr pScreen) free(pScreenPriv->dixinfo); free(pScreenPriv); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } Bool diff --git a/hw/xfree86/common/xf86xvpriv.h b/hw/xfree86/common/xf86xvpriv.h index 289ca5843..9bedd9023 100644 --- a/hw/xfree86/common/xf86xvpriv.h +++ b/hw/xfree86/common/xf86xvpriv.h @@ -41,9 +41,9 @@ typedef struct { ClipNotifyProcPtr ClipNotify; WindowExposuresProcPtr WindowExposures; PostValidateTreeProcPtr PostValidateTree; - void (*AdjustFrame) (int, int, int, int); - Bool (*EnterVT) (int, int); - void (*LeaveVT) (int, int); + void (*AdjustFrame) (ScrnInfoPtr, int, int, int); + Bool (*EnterVT) (ScrnInfoPtr); + void (*LeaveVT) (ScrnInfoPtr); xf86ModeSetProc *ModeSet; } XF86XVScreenRec, *XF86XVScreenPtr; diff --git a/hw/xfree86/ddc/ddc.c b/hw/xfree86/ddc/ddc.c index a1281d735..28c969646 100644 --- a/hw/xfree86/ddc/ddc.c +++ b/hw/xfree86/ddc/ddc.c @@ -258,10 +258,9 @@ EDIDRead_DDC1(ScrnInfoPtr pScrn, DDC1SetSpeedProc DDCSpeed, * @return NULL if no monitor attached or failure to interpret the EDID. */ xf86MonPtr -xf86DoEDID_DDC1(int scrnIndex, DDC1SetSpeedProc DDC1SetSpeed, +xf86DoEDID_DDC1(ScrnInfoPtr pScrn, DDC1SetSpeedProc DDC1SetSpeed, unsigned int (*DDC1Read) (ScrnInfoPtr)) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; unsigned char *EDID_block = NULL; xf86MonPtr tmp = NULL; @@ -285,7 +284,7 @@ xf86DoEDID_DDC1(int scrnIndex, DDC1SetSpeedProc DDC1SetSpeed, OsReleaseSignals(); if (EDID_block) { - tmp = xf86InterpretEDID(scrnIndex, EDID_block); + tmp = xf86InterpretEDID(pScrn->scrnIndex, EDID_block); } #ifdef DEBUG else @@ -323,7 +322,7 @@ DDC2MakeDevice(I2CBusPtr pBus, int address, char *name) } static I2CDevPtr -DDC2Init(int scrnIndex, I2CBusPtr pBus) +DDC2Init(I2CBusPtr pBus) { I2CDevPtr dev = NULL; @@ -403,9 +402,8 @@ DDC2Read(I2CDevPtr dev, int block, unsigned char *R_Buffer) * @return NULL if no monitor attached or failure to interpret the EDID. */ xf86MonPtr -xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool complete) +xf86DoEEDID(ScrnInfoPtr pScrn, I2CBusPtr pBus, Bool complete) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; unsigned char *EDID_block = NULL; xf86MonPtr tmp = NULL; I2CDevPtr dev = NULL; @@ -427,7 +425,7 @@ xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool complete) if (noddc || noddc2) return NULL; - if (!(dev = DDC2Init(scrnIndex, pBus))) + if (!(dev = DDC2Init(pBus))) return NULL; EDID_block = calloc(1, EDID1_LEN); @@ -444,7 +442,7 @@ xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool complete) DDC2Read(dev, i + 1, EDID_block + (EDID1_LEN * (1 + i))); } - tmp = xf86InterpretEEDID(scrnIndex, EDID_block); + tmp = xf86InterpretEEDID(pScrn->scrnIndex, EDID_block); } if (tmp && complete) @@ -465,9 +463,9 @@ xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool complete) * @return NULL if no monitor attached or failure to interpret the EDID. */ xf86MonPtr -xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus) +xf86DoEDID_DDC2(ScrnInfoPtr pScrn, I2CBusPtr pBus) { - return xf86DoEEDID(scrnIndex, pBus, FALSE); + return xf86DoEEDID(pScrn, pBus, FALSE); } /* XXX write me */ @@ -489,9 +487,8 @@ DDC2ReadDisplayID(void) * @return NULL if no monitor attached or failure to interpret the DisplayID. */ xf86MonPtr -xf86DoDisplayID(int scrnIndex, I2CBusPtr pBus) +xf86DoDisplayID(ScrnInfoPtr pScrn, I2CBusPtr pBus) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; unsigned char *did = NULL; xf86MonPtr tmp = NULL; I2CDevPtr dev = NULL; @@ -513,7 +510,7 @@ xf86DoDisplayID(int scrnIndex, I2CBusPtr pBus) if (noddc || noddc2) return NULL; - if (!(dev = DDC2Init(scrnIndex, pBus))) + if (!(dev = DDC2Init(pBus))) return NULL; if ((did = DDC2ReadDisplayID())) { @@ -521,7 +518,7 @@ xf86DoDisplayID(int scrnIndex, I2CBusPtr pBus) if (!tmp) return NULL; - tmp->scrnIndex = scrnIndex; + tmp->scrnIndex = pScrn->scrnIndex; tmp->flags |= MONITOR_DISPLAYID; tmp->rawData = did; } diff --git a/hw/xfree86/ddc/xf86DDC.h b/hw/xfree86/ddc/xf86DDC.h index 2071d530d..c63da8bff 100644 --- a/hw/xfree86/ddc/xf86DDC.h +++ b/hw/xfree86/ddc/xf86DDC.h @@ -24,15 +24,15 @@ typedef enum { typedef void (*DDC1SetSpeedProc) (ScrnInfoPtr, xf86ddcSpeed); -extern _X_EXPORT xf86MonPtr xf86DoEDID_DDC1(int scrnIndex, +extern _X_EXPORT xf86MonPtr xf86DoEDID_DDC1(ScrnInfoPtr pScrn, DDC1SetSpeedProc DDC1SetSpeed, unsigned int (*DDC1Read) (ScrnInfoPtr) ); -extern _X_EXPORT xf86MonPtr xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus); +extern _X_EXPORT xf86MonPtr xf86DoEDID_DDC2(ScrnInfoPtr pScrn, I2CBusPtr pBus); -extern _X_EXPORT xf86MonPtr xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool); +extern _X_EXPORT xf86MonPtr xf86DoEEDID(ScrnInfoPtr pScrn, I2CBusPtr pBus, Bool); extern _X_EXPORT xf86MonPtr xf86PrintEDID(xf86MonPtr monPtr); @@ -50,7 +50,7 @@ extern _X_EXPORT DisplayModePtr xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC); extern _X_EXPORT Bool xf86MonitorIsHDMI(xf86MonPtr mon); -extern _X_EXPORT xf86MonPtr xf86DoDisplayID(int scrnIndex, I2CBusPtr pBus); +extern _X_EXPORT xf86MonPtr xf86DoDisplayID(ScrnInfoPtr pScrn, I2CBusPtr pBus); extern _X_EXPORT void xf86DisplayIDMonitorSet(int scrnIndex, MonPtr mon, xf86MonPtr DDC); diff --git a/hw/xfree86/doc/ddxDesign.xml b/hw/xfree86/doc/ddxDesign.xml index a6b9da2d5..24b0c0324 100644 --- a/hw/xfree86/doc/ddxDesign.xml +++ b/hw/xfree86/doc/ddxDesign.xml @@ -1306,7 +1306,7 @@ Here is what <function>InitOutput()</function> does: <blockquote><para> <programlisting> - Bool ChipScreenInit(int index, ScreenPtr pScreen, + Bool ChipScreenInit(ScreenPtr pScreen, int argc, char **argv); </programlisting> <blockquote><para> @@ -1442,7 +1442,7 @@ Here is what <function>InitOutput()</function> does: <blockquote><para> <programlisting> - Bool ChipSwitchMode(int index, DisplayModePtr mode, int flags); + Bool ChipSwitchMode(int index, DisplayModePtr mode); </programlisting> <blockquote><para> Initialises the new mode for the screen identified by @@ -1464,7 +1464,7 @@ Here is what <function>InitOutput()</function> does: <blockquote><para> <programlisting> - void ChipAdjustFrame(int index, int x, int y, int flags); + void ChipAdjustFrame(int index, int x, int y); </programlisting> <blockquote><para> Changes the viewport for the screen identified by @@ -1572,7 +1572,7 @@ Here is what <function>InitOutput()</function> does: <blockquote><para> <programlisting> - Bool ChipEnterVT(int index, int flags); + Bool ChipEnterVT(ScrnInfoPtr pScrn); </programlisting> <blockquote><para> This function should initialise the current video mode and @@ -1589,7 +1589,7 @@ Here is what <function>InitOutput()</function> does: <blockquote><para> <programlisting> - void ChipLeaveVT(int index, int flags); + void ChipLeaveVT(ScrnInfoPtr pScrn); </programlisting> <blockquote><para> This function should restore the saved video state. If @@ -1691,7 +1691,7 @@ but their presence is optional. <blockquote><para> <programlisting> - ModeStatus ChipValidMode(int index, DisplayModePtr mode, + ModeStatus ChipValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags); </programlisting> <blockquote><para> @@ -1739,7 +1739,7 @@ MODECHECK_FINAL are intended for checks that may involve more than one mode. <blockquote><para> <programlisting> - void ChipFreeScreen(int scrnindex, int flags); + void ChipFreeScreen(ScrnInfoPtr pScrn); </programlisting> <blockquote><para> Free any driver-allocated data that may have been allocated up to @@ -2824,12 +2824,12 @@ Several functions are provided to simplify resource registration: <blockquote><para> <programlisting> - Bool xf86IsScreenPrimary(int scrnIndex); + Bool xf86IsScreenPrimary(ScrnInfoPtr pScrn); </programlisting> <blockquote><para> This function returns <constant>TRUE</constant> if the primary entity is registered with the screen referenced by - <parameter>scrnIndex</parameter>. + <parameter>pScrn</parameter>. </para> </blockquote></para></blockquote> @@ -9033,7 +9033,7 @@ ZZZModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode) <programlisting> static Bool -ZZZScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) +ZZZScreenInit(ScreenPtr pScreen, int argc, char **argv) { /* Get the ScrnInfoRec */ pScrn = xf86ScreenToScrn(pScreen); @@ -9051,7 +9051,7 @@ ZZZScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) /* Set the viewport if supported */ - ZZZAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); + ZZZAdjustFrame(pScrn, pScrn->frameX0, pScrn->frameY0); /* * Setup the screen's visuals, and initialise the framebuffer @@ -9220,9 +9220,9 @@ ZZZScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) <programlisting> static Bool -ZZZSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) +ZZZSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { - return ZZZModeInit(xf86Screens[scrnIndex], mode); + return ZZZModeInit(pScrn, mode); } </programlisting> </sect3> @@ -9237,7 +9237,7 @@ ZZZSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) <programlisting> static void -ZZZAdjustFrame(int scrnIndex, int x, int y, int flags) +ZZZAdjustFrame(ScrnInfoPtr pScrn, int x, int y) { /* Adjust the viewport */ } @@ -9258,16 +9258,14 @@ ZZZAdjustFrame(int scrnIndex, int x, int y, int flags) <programlisting> static Bool -ZZZEnterVT(int scrnIndex, int flags) +ZZZEnterVT(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; return ZZZModeInit(pScrn, pScrn->currentMode); } static void -ZZZLeaveVT(int scrnIndex, int flags) +ZZZLeaveVT(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; ZZZRestore(pScrn); } </programlisting> @@ -9288,16 +9286,16 @@ ZZZLeaveVT(int scrnIndex, int flags) <programlisting> static Bool -ZZZCloseScreen(int scrnIndex, ScreenPtr pScreen) +ZZZCloseScreen(ScreenPtr pScreen) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); if (pScrn->vtSema) { ZZZRestore(pScrn); ZZZUnmapMem(pScrn); } pScrn->vtSema = FALSE; pScreen->CloseScreen = ZZZPTR(pScrn)->CloseScreen; - return (*pScreen->CloseScreen)(scrnIndex, pScreen); + return (*pScreen->CloseScreen)(pScreen); } </programlisting> </sect3> @@ -9342,13 +9340,13 @@ ZZZSaveScreen(ScreenPtr pScreen, int mode) <programlisting> static void -ZZZFreeScreen(int scrnIndex, int flags) +ZZZFreeScreen(ScrnInfoPtr pScrn) { /* * If the vgahw module is used vgaHWFreeHWRec() would be called * here. */ - ZZZFreeRec(xf86Screens[scrnIndex]); + ZZZFreeRec(pScrn); } </programlisting> diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index 20eb683ad..46a9ae457 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -1618,7 +1618,7 @@ DRIWakeupHandler(pointer wakeupData, int result, pointer pReadmask) DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (pDRIPriv && pDRIPriv->pDriverInfo->wrap.WakeupHandler) - (*pDRIPriv->pDriverInfo->wrap.WakeupHandler) (i, wakeupData, + (*pDRIPriv->pDriverInfo->wrap.WakeupHandler) (pScreen, result, pReadmask); } } @@ -1633,16 +1633,15 @@ DRIBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask) DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (pDRIPriv && pDRIPriv->pDriverInfo->wrap.BlockHandler) - (*pDRIPriv->pDriverInfo->wrap.BlockHandler) (i, blockData, + (*pDRIPriv->pDriverInfo->wrap.BlockHandler) (pScreen, pTimeout, pReadmask); } } void -DRIDoWakeupHandler(int screenNum, pointer wakeupData, +DRIDoWakeupHandler(ScreenPtr pScreen, unsigned long result, pointer pReadmask) { - ScreenPtr pScreen = screenInfo.screens[screenNum]; DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); DRILock(pScreen, 0); @@ -1658,10 +1657,9 @@ DRIDoWakeupHandler(int screenNum, pointer wakeupData, } void -DRIDoBlockHandler(int screenNum, pointer blockData, +DRIDoBlockHandler(ScreenPtr pScreen, pointer pTimeout, pointer pReadmask) { - ScreenPtr pScreen = screenInfo.screens[screenNum]; DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); if (pDRIPriv->pDriverInfo->driverSwapMethod == DRI_HIDE_X_CONTEXT) { @@ -2307,15 +2305,14 @@ _DRIAdjustFrame(ScrnInfoPtr pScrn, DRIScreenPrivPtr pDRIPriv, int x, int y) } void -DRIAdjustFrame(int scrnIndex, int x, int y, int flags) +DRIAdjustFrame(ScrnInfoPtr pScrn, int x, int y) { - ScreenPtr pScreen = screenInfo.screens[scrnIndex]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); int px, py; if (!pDRIPriv || !pDRIPriv->pSAREA) { - DRIDrvMsg(scrnIndex, X_ERROR, "[DRI] No SAREA (%p %p)\n", + DRIDrvMsg(pScrn->scrnIndex, X_ERROR, "[DRI] No SAREA (%p %p)\n", pDRIPriv, pDRIPriv ? pDRIPriv->pSAREA : NULL); return; } @@ -2347,7 +2344,7 @@ DRIAdjustFrame(int scrnIndex, int x, int y, int flags) /* unwrap */ pScrn->AdjustFrame = pDRIPriv->wrap.AdjustFrame; /* call lower layers */ - (*pScrn->AdjustFrame) (scrnIndex, x, y, flags); + (*pScrn->AdjustFrame) (pScrn, x, y); /* rewrap */ pDRIPriv->wrap.AdjustFrame = pScrn->AdjustFrame; pScrn->AdjustFrame = DRIAdjustFrame; diff --git a/hw/xfree86/dri/dri.h b/hw/xfree86/dri/dri.h index 53458bb4a..0a4036c35 100644 --- a/hw/xfree86/dri/dri.h +++ b/hw/xfree86/dri/dri.h @@ -73,7 +73,7 @@ typedef int DRIWindowRequests; #define DRI_ALL_WINDOWS 2 typedef void (*ClipNotifyPtr) (WindowPtr, int, int); -typedef void (*AdjustFramePtr) (int scrnIndex, int x, int y, int flags); +typedef void (*AdjustFramePtr) (ScrnInfoPtr pScrn, int x, int y); /* * These functions can be wrapped by the DRI. Each of these have @@ -271,13 +271,11 @@ extern _X_EXPORT void DRIWakeupHandler(pointer wakeupData, extern _X_EXPORT void DRIBlockHandler(pointer blockData, OSTimePtr pTimeout, pointer pReadmask); -extern _X_EXPORT void DRIDoWakeupHandler(int screenNum, - pointer wakeupData, +extern _X_EXPORT void DRIDoWakeupHandler(ScreenPtr pScreen, unsigned long result, pointer pReadmask); -extern _X_EXPORT void DRIDoBlockHandler(int screenNum, - pointer blockData, +extern _X_EXPORT void DRIDoBlockHandler(ScreenPtr pScreen, pointer pTimeout, pointer pReadmask); extern _X_EXPORT void DRISwapContext(int drmFD, void *oldctx, void *newctx); @@ -334,7 +332,7 @@ extern _X_EXPORT drm_context_t DRIGetContext(ScreenPtr pScreen); extern _X_EXPORT void DRIQueryVersion(int *majorVersion, int *minorVersion, int *patchVersion); -extern _X_EXPORT void DRIAdjustFrame(int scrnIndex, int x, int y, int flags); +extern _X_EXPORT void DRIAdjustFrame(ScrnInfoPtr pScrn, int x, int y); extern _X_EXPORT void DRIMoveBuffersHelper(ScreenPtr pScreen, int dx, diff --git a/hw/xfree86/exa/examodule.c b/hw/xfree86/exa/examodule.c index 50924587d..4e809ea37 100644 --- a/hw/xfree86/exa/examodule.c +++ b/hw/xfree86/exa/examodule.c @@ -38,7 +38,7 @@ typedef struct _ExaXorgScreenPrivRec { CloseScreenProcPtr SavedCloseScreen; - EnableDisableFBAccessProcPtr SavedEnableDisableFBAccess; + xf86EnableDisableFBAccessProc *SavedEnableDisableFBAccess; OptionInfoPtr options; } ExaXorgScreenPrivRec, *ExaXorgScreenPrivPtr; @@ -70,7 +70,7 @@ static const OptionInfoRec EXAOptions[] = { }; static Bool -exaXorgCloseScreen(int i, ScreenPtr pScreen) +exaXorgCloseScreen(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); ExaXorgScreenPrivPtr pScreenPriv = (ExaXorgScreenPrivPtr) @@ -83,24 +83,24 @@ exaXorgCloseScreen(int i, ScreenPtr pScreen) free(pScreenPriv->options); free(pScreenPriv); - return pScreen->CloseScreen(i, pScreen); + return pScreen->CloseScreen(pScreen); } static void -exaXorgEnableDisableFBAccess(int index, Bool enable) +exaXorgEnableDisableFBAccess(ScrnInfoPtr pScrn, Bool enable) { - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); ExaXorgScreenPrivPtr pScreenPriv = (ExaXorgScreenPrivPtr) dixLookupPrivate(&pScreen->devPrivates, exaXorgScreenPrivateKey); if (!enable) - exaEnableDisableFBAccess(index, enable); + exaEnableDisableFBAccess(pScreen, enable); if (pScreenPriv->SavedEnableDisableFBAccess) - pScreenPriv->SavedEnableDisableFBAccess(index, enable); + pScreenPriv->SavedEnableDisableFBAccess(pScrn, enable); if (enable) - exaEnableDisableFBAccess(index, enable); + exaEnableDisableFBAccess(pScreen, enable); } /** diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c index 0444d481c..d4b5558a7 100644 --- a/hw/xfree86/fbdevhw/fbdevhw.c +++ b/hw/xfree86/fbdevhw/fbdevhw.c @@ -775,10 +775,8 @@ fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, /* these can be hooked directly into ScrnInfoRec */ ModeStatus -fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags) +fbdevHWValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; - if (!fbdevHWSetMode(pScrn, mode, TRUE)) return MODE_BAD; @@ -786,10 +784,8 @@ fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags) } Bool -fbdevHWSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) +fbdevHWSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; - if (!fbdevHWSetMode(pScrn, mode, FALSE)) return FALSE; @@ -797,9 +793,8 @@ fbdevHWSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) } void -fbdevHWAdjustFrame(int scrnIndex, int x, int y, int flags) +fbdevHWAdjustFrame(ScrnInfoPtr pScrn, int x, int y) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; fbdevHWPtr fPtr = FBDEVHWPTR(pScrn); if (x < 0 || x + fPtr->var.xres > fPtr->var.xres_virtual || @@ -809,26 +804,22 @@ fbdevHWAdjustFrame(int scrnIndex, int x, int y, int flags) fPtr->var.xoffset = x; fPtr->var.yoffset = y; if (-1 == ioctl(fPtr->fd, FBIOPAN_DISPLAY, (void *) &fPtr->var)) - xf86DrvMsgVerb(scrnIndex, X_WARNING, 5, + xf86DrvMsgVerb(pScrn->scrnIndex, X_WARNING, 5, "FBIOPAN_DISPLAY: %s\n", strerror(errno)); } Bool -fbdevHWEnterVT(int scrnIndex, int flags) +fbdevHWEnterVT(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; - if (!fbdevHWModeInit(pScrn, pScrn->currentMode)) return FALSE; - fbdevHWAdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); + fbdevHWAdjustFrame(pScrn, pScrn->frameX0, pScrn->frameY0); return TRUE; } void -fbdevHWLeaveVT(int scrnIndex, int flags) +fbdevHWLeaveVT(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; - fbdevHWRestore(pScrn); } diff --git a/hw/xfree86/fbdevhw/fbdevhw.h b/hw/xfree86/fbdevhw/fbdevhw.h index 536987101..4984ccf89 100644 --- a/hw/xfree86/fbdevhw/fbdevhw.h +++ b/hw/xfree86/fbdevhw/fbdevhw.h @@ -44,14 +44,12 @@ extern _X_EXPORT void fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO * colors, VisualPtr pVisual); -extern _X_EXPORT ModeStatus fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, +extern _X_EXPORT ModeStatus fbdevHWValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags); -extern _X_EXPORT Bool fbdevHWSwitchMode(int scrnIndex, DisplayModePtr mode, - int flags); -extern _X_EXPORT void fbdevHWAdjustFrame(int scrnIndex, int x, int y, - int flags); -extern _X_EXPORT Bool fbdevHWEnterVT(int scrnIndex, int flags); -extern _X_EXPORT void fbdevHWLeaveVT(int scrnIndex, int flags); +extern _X_EXPORT Bool fbdevHWSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode); +extern _X_EXPORT void fbdevHWAdjustFrame(ScrnInfoPtr pScrn, int x, int y); +extern _X_EXPORT Bool fbdevHWEnterVT(ScrnInfoPtr pScrn); +extern _X_EXPORT void fbdevHWLeaveVT(ScrnInfoPtr pScrn); extern _X_EXPORT void fbdevHWDPMSSet(ScrnInfoPtr pScrn, int mode, int flags); extern _X_EXPORT Bool fbdevHWSaveScreen(ScreenPtr pScreen, int mode); diff --git a/hw/xfree86/fbdevhw/fbdevhwstub.c b/hw/xfree86/fbdevhw/fbdevhwstub.c index 6e0a470b8..b7b4d2e7d 100644 --- a/hw/xfree86/fbdevhw/fbdevhwstub.c +++ b/hw/xfree86/fbdevhw/fbdevhwstub.c @@ -131,30 +131,30 @@ fbdevHWLoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, } ModeStatus -fbdevHWValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags) +fbdevHWValidMode(ScrnInfoPtr pScrn, DisplayModePtr mode, Bool verbose, int flags) { return MODE_ERROR; } Bool -fbdevHWSwitchMode(int scrnIndex, DisplayModePtr mode, int flags) +fbdevHWSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { return FALSE; } void -fbdevHWAdjustFrame(int scrnIndex, int x, int y, int flags) +fbdevHWAdjustFrame(ScrnInfoPtr pScrn, int x, int y, int flags) { } Bool -fbdevHWEnterVT(int scrnIndex, int flags) +fbdevHWEnterVT(ScrnInfoPtr pScrn) { return FALSE; } void -fbdevHWLeaveVT(int scrnIndex, int flags) +fbdevHWLeaveVT(ScrnInfoPtr pScrn) { } diff --git a/hw/xfree86/i2c/xf86i2c.c b/hw/xfree86/i2c/xf86i2c.c index 1273f4bab..2d261d4ce 100644 --- a/hw/xfree86/i2c/xf86i2c.c +++ b/hw/xfree86/i2c/xf86i2c.c @@ -709,6 +709,7 @@ xf86CreateI2CBusRec(void) if (b != NULL) { b->scrnIndex = -1; + b->pScrn = NULL; b->HoldTime = 5; /* 100 kHz bus */ b->BitTimeout = 5; b->ByteTimeout = 5; diff --git a/hw/xfree86/i2c/xf86i2c.h b/hw/xfree86/i2c/xf86i2c.h index 9a8fb21a3..e296d7d81 100644 --- a/hw/xfree86/i2c/xf86i2c.h +++ b/hw/xfree86/i2c/xf86i2c.h @@ -6,6 +6,7 @@ #define _XF86I2C_H #include "regionstr.h" +#include "xf86.h" typedef unsigned char I2CByte; typedef unsigned short I2CSlaveAddr; @@ -18,6 +19,7 @@ typedef struct _I2CDevRec *I2CDevPtr; typedef struct _I2CBusRec { char *BusName; int scrnIndex; + ScrnInfoPtr pScrn; void (*I2CUDelay) (I2CBusPtr b, int usec); diff --git a/hw/xfree86/int10/generic.c b/hw/xfree86/int10/generic.c index 8614e0b9b..5343e47e3 100644 --- a/hw/xfree86/int10/generic.c +++ b/hw/xfree86/int10/generic.c @@ -70,12 +70,12 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) void *base = 0; void *vbiosMem = 0; void *options = NULL; - int screen; legacyVGARec vga; + ScrnInfoPtr pScrn; - screen = (xf86FindScreenForEntity(entityIndex))->scrnIndex; + pScrn = xf86FindScreenForEntity(entityIndex); - options = xf86HandleInt10Options(xf86Screens[screen], entityIndex); + options = xf86HandleInt10Options(pScrn, entityIndex); if (int10skip(options)) { free(options); @@ -89,7 +89,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) pInt->mem = &genericMem; pInt->private = (pointer) xnfcalloc(1, sizeof(genericInt10Priv)); INTPriv(pInt)->alloc = (pointer) xnfcalloc(1, ALLOC_ENTRIES(getpagesize())); - pInt->scrnIndex = screen; + pInt->pScrn = pScrn; base = INTPriv(pInt)->base = xnfalloc(SYS_BIOS); /* FIXME: Shouldn't this be a failure case? Leaving dev as NULL seems like @@ -109,7 +109,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) INTPriv(pInt)->sysMem = sysMem; if (xf86ReadBIOS(0, 0, base, LOW_PAGE_SIZE) < 0) { - xf86DrvMsg(screen, X_ERROR, "Cannot read int vect\n"); + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Cannot read int vect\n"); goto error1; } @@ -148,7 +148,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) vbiosMem = (unsigned char *) base + bios_location; err = pci_device_read_rom(rom_device, vbiosMem); if (err) { - xf86DrvMsg(screen, X_ERROR, "Cannot read V_BIOS (3) %s\n", + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Cannot read V_BIOS (3) %s\n", strerror(err)); goto error1; } @@ -249,7 +249,6 @@ MapVRam(xf86Int10InfoPtr pInt) static void UnmapVRam(xf86Int10InfoPtr pInt) { - int screen = pInt->scrnIndex; int pagesize = getpagesize(); int size = ((VRAM_SIZE + pagesize - 1) / pagesize) * pagesize; diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c index 1e908778f..1c58cf7ae 100644 --- a/hw/xfree86/int10/helper_exec.c +++ b/hw/xfree86/int10/helper_exec.c @@ -125,7 +125,7 @@ run_bios_int(int num, xf86Int10InfoPtr pInt) if (MEM_RW(pInt, (num << 2) + 2) == (SYS_BIOS >> 4)) { /* SYS_BIOS_SEG ? */ if (num == 21 && X86_AH == 0x4e) { - xf86DrvMsg(pInt->scrnIndex, X_NOTICE, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_NOTICE, "Failing Find-Matching-File on non-PC" " (int 21, func 4e)\n"); X86_AX = 2; @@ -133,7 +133,7 @@ run_bios_int(int num, xf86Int10InfoPtr pInt) return 1; } else { - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "Ignoring int 0x%02x call\n", num); if (xf86GetVerbosity() > 3) { dump_registers(pInt); @@ -169,7 +169,7 @@ dump_code(xf86Int10InfoPtr pInt) int i; CARD32 lina = SEG_ADR((CARD32), X86_CS, IP); - xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, "code at 0x%8.8" PRIx32 ":\n", + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_INFO, 3, "code at 0x%8.8" PRIx32 ":\n", lina); for (i = 0; i < 0x10; i++) xf86ErrorFVerb(3, " %2.2x", MEM_RB(pInt, lina + i)); @@ -182,19 +182,19 @@ dump_code(xf86Int10InfoPtr pInt) void dump_registers(xf86Int10InfoPtr pInt) { - xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_INFO, 3, "EAX=0x%8.8lx, EBX=0x%8.8lx, ECX=0x%8.8lx, EDX=0x%8.8lx\n", (unsigned long) X86_EAX, (unsigned long) X86_EBX, (unsigned long) X86_ECX, (unsigned long) X86_EDX); - xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_INFO, 3, "ESP=0x%8.8lx, EBP=0x%8.8lx, ESI=0x%8.8lx, EDI=0x%8.8lx\n", (unsigned long) X86_ESP, (unsigned long) X86_EBP, (unsigned long) X86_ESI, (unsigned long) X86_EDI); - xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_INFO, 3, "CS=0x%4.4x, SS=0x%4.4x," " DS=0x%4.4x, ES=0x%4.4x, FS=0x%4.4x, GS=0x%4.4x\n", X86_CS, X86_SS, X86_DS, X86_ES, X86_FS, X86_GS); - xf86DrvMsgVerb(pInt->scrnIndex, X_INFO, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_INFO, 3, "EIP=0x%8.8lx, EFLAGS=0x%8.8lx\n", (unsigned long) X86_EIP, (unsigned long) X86_EFLAGS); } @@ -337,7 +337,7 @@ x_inb(CARD16 port) } else if (port < 0x0100) { /* Don't interfere with mainboard */ val = 0; - xf86DrvMsgVerb(Int10Current->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(Int10Current->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "inb 0x%4.4x\n", port); if (xf86GetVerbosity() > 3) { dump_registers(Int10Current); @@ -395,7 +395,7 @@ x_outb(CARD16 port, CARD8 val) #ifdef __NOT_YET__ } else if (port < 0x0100) { /* Don't interfere with mainboard */ - xf86DrvMsgVerb(Int10Current->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(Int10Current->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "outb 0x%4.4x,0x%2.2x\n", port, val); if (xf86GetVerbosity() > 3) { dump_registers(Int10Current); diff --git a/hw/xfree86/int10/helper_mem.c b/hw/xfree86/int10/helper_mem.c index 96c598a53..160c5aedf 100644 --- a/hw/xfree86/int10/helper_mem.c +++ b/hw/xfree86/int10/helper_mem.c @@ -281,7 +281,7 @@ xf86int10GetBiosLocationType(const xf86Int10InfoPtr pInt) #define CHECK_V_SEGMENT_RANGE(x) \ if (((x) << 4) < V_BIOS) { \ - xf86DrvMsg(pInt->scrnIndex, X_ERROR, \ + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, \ "V_BIOS address 0x%lx out of range\n", \ (unsigned long)(x) << 4); \ return FALSE; \ @@ -306,17 +306,17 @@ xf86int10GetBiosSegment(xf86Int10InfoPtr pInt, void *base) CHECK_V_SEGMENT_RANGE(cs); vbiosMem = (unsigned char *) base + (cs << 4); - if (int10_check_bios(pInt->scrnIndex, cs, vbiosMem)) { + if (int10_check_bios(pInt->pScrn->scrnIndex, cs, vbiosMem)) { break; } } if (segments[i] == ~0) { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "No V_BIOS found\n"); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "No V_BIOS found\n"); return FALSE; } - xf86DrvMsg(pInt->scrnIndex, X_INFO, "Primary V_BIOS segment is: 0x%lx\n", + xf86DrvMsg(pInt->pScrn->scrnIndex, X_INFO, "Primary V_BIOS segment is: 0x%lx\n", (unsigned long) cs); pInt->BIOSseg = cs; diff --git a/hw/xfree86/int10/xf86int10.c b/hw/xfree86/int10/xf86int10.c index df347d4dd..5ead44f23 100644 --- a/hw/xfree86/int10/xf86int10.c +++ b/hw/xfree86/int10/xf86int10.c @@ -57,7 +57,7 @@ int_handler(xf86Int10InfoPtr pInt) ret = run_bios_int(num, pInt); if (!ret) { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Halting on int 0x%2.2x!\n", num); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Halting on int 0x%2.2x!\n", num); dump_registers(pInt); stack_trace(pInt); } @@ -257,7 +257,7 @@ int42_handler(xf86Int10InfoPtr pInt) /* DL = character column */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x04) -- Get Light Pen Position\n", pInt->num); if (xf86GetVerbosity() > 3) { @@ -314,10 +314,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* Leave: Nothing */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x06) -- Initialise or Scroll Window Up\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, " AL=0x%2.2x, BH=0x%2.2x," " CH=0x%2.2x, CL=0x%2.2x, DH=0x%2.2x, DL=0x%2.2x\n", X86_AL, X86_BH, X86_CH, X86_CL, X86_DH, X86_DL); @@ -339,10 +339,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* Leave: Nothing */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x07) -- Initialise or Scroll Window Down\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, " AL=0x%2.2x, BH=0x%2.2x," " CH=0x%2.2x, CL=0x%2.2x, DH=0x%2.2x, DL=0x%2.2x\n", X86_AL, X86_BH, X86_CH, X86_CL, X86_DH, X86_DL); @@ -360,10 +360,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* AL = character */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x08) -- Read Character and Attribute at" " Cursor\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, "BH=0x%2.2x\n", X86_BH); if (xf86GetVerbosity() > 3) { dump_registers(pInt); @@ -382,10 +382,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* Leave: Nothing */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x09) -- Write Character and Attribute at" " Cursor\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, "AL=0x%2.2x, BH=0x%2.2x, BL=0x%2.2x, CX=0x%4.4x\n", X86_AL, X86_BH, X86_BL, X86_CX); if (xf86GetVerbosity() > 3) { @@ -404,10 +404,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* Leave: Nothing */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x0A) -- Write Character at Cursor\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, "AL=0x%2.2x, BH=0x%2.2x, BL=0x%2.2x, CX=0x%4.4x\n", X86_AL, X86_BH, X86_BL, X86_CX); if (xf86GetVerbosity() > 3) { @@ -450,10 +450,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* Leave: Nothing */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x0C) -- Write Graphics Pixel\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, "AL=0x%2.2x, BH=0x%2.2x, CX=0x%4.4x, DX=0x%4.4x\n", X86_AL, X86_BH, X86_CX, X86_DX); if (xf86GetVerbosity() > 3) { @@ -471,10 +471,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* Leave: AL = pixel value */ /* Not Implemented */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x0D) -- Read Graphics Pixel\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, "BH=0x%2.2x, CX=0x%4.4x, DX=0x%4.4x\n", X86_BH, X86_CX, X86_DX); if (xf86GetVerbosity() > 3) { @@ -498,10 +498,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* which might or might not have been */ /* installed yet. */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x0E) -- Write Character in Teletype Mode\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, "AL=0x%2.2x, BH=0x%2.2x, BL=0x%2.2x\n", X86_AL, X86_BH, X86_BL); if (xf86GetVerbosity() > 3) { @@ -564,10 +564,10 @@ int42_handler(xf86Int10InfoPtr pInt) /* which might or might not have been */ /* installed yet. */ { /* Localise */ - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x%2.2x(AH=0x13) -- Write String in Teletype Mode\n", pInt->num); - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 3, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 3, "AL=0x%2.2x, BL=0x%2.2x, CX=0x%4.4x," " DH=0x%2.2x, DL=0x%2.2x, ES:BP=0x%4.4x:0x%4.4x\n", X86_AL, X86_BL, X86_CX, X86_DH, X86_DL, X86_ES, X86_BP); @@ -840,7 +840,7 @@ int1A_handler(xf86Int10InfoPtr pInt) #endif return 1; default: - xf86DrvMsgVerb(pInt->scrnIndex, X_NOT_IMPLEMENTED, 2, + xf86DrvMsgVerb(pInt->pScrn->scrnIndex, X_NOT_IMPLEMENTED, 2, "int 0x1a subfunction\n"); dump_registers(pInt); if (xf86GetVerbosity() > 3) diff --git a/hw/xfree86/int10/xf86int10.h b/hw/xfree86/int10/xf86int10.h index 36b659fd7..6d564fc1a 100644 --- a/hw/xfree86/int10/xf86int10.h +++ b/hw/xfree86/int10/xf86int10.h @@ -21,10 +21,10 @@ /* int10 info structure */ typedef struct { int entityIndex; - int scrnIndex; - pointer cpuRegs; CARD16 BIOSseg; CARD16 inb40time; + ScrnInfoPtr pScrn; + pointer cpuRegs; char *BIOSScratch; int Flags; pointer private; diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index ab6ed5e32..2c8878fa7 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -716,7 +716,7 @@ xf86CrtcCreateScreenResources(ScreenPtr screen) * Clean up config on server reset */ static Bool -xf86CrtcCloseScreen(int index, ScreenPtr screen) +xf86CrtcCloseScreen(ScreenPtr screen) { ScrnInfoPtr scrn = xf86ScreenToScrn(screen); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); @@ -738,7 +738,7 @@ xf86CrtcCloseScreen(int index, ScreenPtr screen) } xf86RandR12CloseScreen(screen); - return screen->CloseScreen(index, screen); + return screen->CloseScreen(screen); } /* @@ -3009,7 +3009,7 @@ xf86OutputGetEDID(xf86OutputPtr output, I2CBusPtr pDDCBus) ScrnInfoPtr scrn = output->scrn; xf86MonPtr mon; - mon = xf86DoEEDID(scrn->scrnIndex, pDDCBus, TRUE); + mon = xf86DoEEDID(scrn, pDDCBus, TRUE); if (mon) xf86DDCApplyQuirks(scrn->scrnIndex, mon); diff --git a/hw/xfree86/modes/xf86DiDGA.c b/hw/xfree86/modes/xf86DiDGA.c index fdec6cb4b..bb954ac4b 100644 --- a/hw/xfree86/modes/xf86DiDGA.c +++ b/hw/xfree86/modes/xf86DiDGA.c @@ -137,7 +137,7 @@ xf86_dga_get_viewport(ScrnInfoPtr scrn) static void xf86_dga_set_viewport(ScrnInfoPtr scrn, int x, int y, int flags) { - scrn->AdjustFrame(scrn->pScreen->myNum, x, y, flags); + scrn->AdjustFrame(scrn, x, y); } static Bool diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c index e6b205223..59b6f8217 100644 --- a/hw/xfree86/modes/xf86RandR12.c +++ b/hw/xfree86/modes/xf86RandR12.c @@ -515,7 +515,7 @@ xf86RandR12SetMode(ScreenPtr pScreen, Bool ret = TRUE; if (pRoot) - (*scrp->EnableDisableFBAccess) (pScreen->myNum, FALSE); + (*scrp->EnableDisableFBAccess) (scrp, FALSE); if (useVirtual) { scrp->virtualX = randrp->virtualX; scrp->virtualY = randrp->virtualY; @@ -568,7 +568,7 @@ xf86RandR12SetMode(ScreenPtr pScreen, xf86SetViewport(pScreen, pScreen->width, pScreen->height); xf86SetViewport(pScreen, 0, 0); if (pRoot) - (*scrp->EnableDisableFBAccess) (pScreen->myNum, TRUE); + (*scrp->EnableDisableFBAccess) (scrp, TRUE); return ret; } @@ -685,7 +685,7 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen, } } if (pRoot && pScrn->vtSema) - (*pScrn->EnableDisableFBAccess) (pScreen->myNum, FALSE); + (*pScrn->EnableDisableFBAccess) (pScrn, FALSE); /* Let the driver update virtualX and virtualY */ if (!(*config->funcs->resize) (pScrn, width, height)) @@ -724,7 +724,7 @@ xf86RandR12ScreenSetSize(ScreenPtr pScreen, update_desktop_dimensions(); if (pRoot && pScrn->vtSema) - (*pScrn->EnableDisableFBAccess) (pScreen->myNum, TRUE); + (*pScrn->EnableDisableFBAccess) (pScrn, TRUE); #if RANDR_12_INTERFACE if (xf86RandR12Key && pScreen->root && ret) RRScreenSizeNotify(pScreen); @@ -1596,10 +1596,9 @@ xf86RandR12TellChanged(ScreenPtr pScreen) } static void -xf86RandR12PointerMoved(int scrnIndex, int x, int y) +xf86RandR12PointerMoved(ScrnInfoPtr pScrn, int x, int y) { - ScreenPtr pScreen = screenInfo.screens[scrnIndex]; - ScrnInfoPtr pScrn = XF86SCRNINFO(pScreen); + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); int c; @@ -1688,10 +1687,9 @@ gamma_to_ramp(float gamma, CARD16 *ramp, int size) } static int -xf86RandR12ChangeGamma(int scrnIndex, Gamma gamma) +xf86RandR12ChangeGamma(ScrnInfoPtr pScrn, Gamma gamma) { CARD16 *points, *red, *green, *blue; - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; RRCrtcPtr crtc = xf86CompatRRCrtc(pScrn); int size; @@ -1723,10 +1721,9 @@ xf86RandR12ChangeGamma(int scrnIndex, Gamma gamma) } static Bool -xf86RandR12EnterVT(int screen_index, int flags) +xf86RandR12EnterVT(ScrnInfoPtr pScrn) { - ScreenPtr pScreen = screenInfo.screens[screen_index]; - ScrnInfoPtr pScrn = xf86Screens[screen_index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen); rrScrPrivPtr rp = rrGetScrPriv(pScreen); Bool ret; @@ -1734,7 +1731,7 @@ xf86RandR12EnterVT(int screen_index, int flags) if (randrp->orig_EnterVT) { pScrn->EnterVT = randrp->orig_EnterVT; - ret = pScrn->EnterVT(screen_index, flags); + ret = pScrn->EnterVT(pScrn); randrp->orig_EnterVT = pScrn->EnterVT; pScrn->EnterVT = xf86RandR12EnterVT; if (!ret) diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c index 26eefc8c0..6a661e195 100644 --- a/hw/xfree86/modes/xf86Rotate.c +++ b/hw/xfree86/modes/xf86Rotate.c @@ -250,17 +250,16 @@ xf86RotateRedisplay(ScreenPtr pScreen) } static void -xf86RotateBlockHandler(int screenNum, pointer blockData, +xf86RotateBlockHandler(ScreenPtr pScreen, pointer pTimeout, pointer pReadmask) { - ScreenPtr pScreen = screenInfo.screens[screenNum]; - ScrnInfoPtr pScrn = xf86Screens[screenNum]; + ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn); Bool rotation_active; rotation_active = xf86RotateRedisplay(pScreen); pScreen->BlockHandler = xf86_config->BlockHandler; - (*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask); + (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); /* cannot avoid re-wrapping until all wrapping is audited */ xf86_config->BlockHandler = pScreen->BlockHandler; pScreen->BlockHandler = xf86RotateBlockHandler; diff --git a/hw/xfree86/os-support/linux/int10/linux.c b/hw/xfree86/os-support/linux/int10/linux.c index fa58a72b6..8bca37524 100644 --- a/hw/xfree86/os-support/linux/int10/linux.c +++ b/hw/xfree86/os-support/linux/int10/linux.c @@ -52,7 +52,6 @@ typedef struct { int highMem; char *base; char *base_high; - int screen; char *alloc; } linuxInt10Priv; @@ -89,15 +88,16 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) memType cs; legacyVGARec vga; Bool videoBiosMapped = FALSE; - + ScrnInfoPtr pScrn; if (int10Generation != serverGeneration) { counter = 0; int10Generation = serverGeneration; } - screen = (xf86FindScreenForEntity(entityIndex))->scrnIndex; + pScrn = xf86FindScreenForEntity(entityIndex); + screen = pScrn->scrnIndex; - options = xf86HandleInt10Options(xf86Screens[screen], entityIndex); + options = xf86HandleInt10Options(pScrn, entityIndex); if (int10skip(options)) { free(options); @@ -106,7 +106,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) #if defined DoSubModules if (loadedSubModule == INT10_NOT_LOADED) - loadedSubModule = int10LinuxLoadSubModule(xf86Screens[screen]); + loadedSubModule = int10LinuxLoadSubModule(pScrn); if (loadedSubModule == INT10_LOAD_FAILED) return NULL; @@ -145,7 +145,7 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) } pInt = (xf86Int10InfoPtr) xnfcalloc(1, sizeof(xf86Int10InfoRec)); - pInt->scrnIndex = screen; + pInt->pScrn = pScrn; pInt->entityIndex = entityIndex; pInt->dev = xf86GetPciInfoForEntity(entityIndex); @@ -154,7 +154,6 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) pInt->mem = &linuxMem; pagesize = getpagesize(); pInt->private = (pointer) xnfcalloc(1, sizeof(linuxInt10Priv)); - ((linuxInt10Priv *) pInt->private)->screen = screen; ((linuxInt10Priv *) pInt->private)->alloc = (pointer) xnfcalloc(1, ALLOC_ENTRIES(pagesize)); @@ -333,28 +332,28 @@ MapCurrentInt10(xf86Int10InfoPtr pInt) addr = shmat(((linuxInt10Priv *) pInt->private)->lowMem, (char *) 1, SHM_RND); if (addr == SHMERRORPTR) { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Cannot shmat() low memory\n"); - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Cannot shmat() low memory\n"); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "shmat(low_mem) error: %s\n", strerror(errno)); return FALSE; } if (mprotect((void *) 0, V_RAM, PROT_READ | PROT_WRITE | PROT_EXEC) != 0) - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Cannot set EXEC bit on low memory: %s\n", strerror(errno)); if (((linuxInt10Priv *) pInt->private)->highMem >= 0) { addr = shmat(((linuxInt10Priv *) pInt->private)->highMem, (char *) HIGH_MEM, 0); if (addr == SHMERRORPTR) { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Cannot shmat() high memory\n"); - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "shmget error: %s\n", strerror(errno)); return FALSE; } if (mprotect((void *) HIGH_MEM, HIGH_MEM_SIZE, PROT_READ | PROT_WRITE | PROT_EXEC) != 0) - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Cannot set EXEC bit on high memory: %s\n", strerror(errno)); } @@ -364,13 +363,13 @@ MapCurrentInt10(xf86Int10InfoPtr pInt) PROT_READ | PROT_WRITE | PROT_EXEC, MAP_SHARED | MAP_FIXED, fd, V_BIOS) == MAP_FAILED) { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Cannot map V_BIOS\n"); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Cannot map V_BIOS\n"); close(fd); return FALSE; } } else { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "Cannot open %s\n", DEV_MEM); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Cannot open %s\n", DEV_MEM); return FALSE; } close(fd); diff --git a/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c b/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c index 8502b21b7..187698399 100644 --- a/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c +++ b/hw/xfree86/os-support/linux/int10/vm86/linux_vm86.c @@ -210,19 +210,19 @@ vm86_GP_fault(xf86Int10InfoPtr pInt) return FALSE; case 0x0f: - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "CPU 0x0f Trap at CS:EIP=0x%4.4x:0x%8.8lx\n", X86_CS, X86_EIP); goto op0ferr; default: - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "unknown reason for exception\n"); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "unknown reason for exception\n"); op0ferr: dump_registers(pInt); stack_trace(pInt); dump_code(pInt); - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "cannot continue\n"); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "cannot continue\n"); return FALSE; } /* end of switch() */ return TRUE; @@ -238,7 +238,7 @@ do_vm86(xf86Int10InfoPtr pInt) xf86InterceptSignals(NULL); if (signo >= 0) { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "vm86() syscall generated signal %d.\n", signo); dump_registers(pInt); dump_code(pInt); @@ -252,7 +252,7 @@ do_vm86(xf86Int10InfoPtr pInt) return 0; break; case VM86_STI: - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "vm86_sti :-((\n"); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "vm86_sti :-((\n"); dump_registers(pInt); dump_code(pInt); stack_trace(pInt); @@ -260,7 +260,7 @@ do_vm86(xf86Int10InfoPtr pInt) case VM86_INTx: pInt->num = VM86_ARG(retval); if (!int_handler(pInt)) { - xf86DrvMsg(pInt->scrnIndex, X_ERROR, + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "Unknown vm86_int: 0x%X\n\n", VM86_ARG(retval)); dump_registers(pInt); dump_code(pInt); @@ -275,10 +275,10 @@ do_vm86(xf86Int10InfoPtr pInt) * we used to warn here and bail out - but now the sigio stuff * always fires signals at us. So we just ignore them for now. */ - xf86DrvMsg(pInt->scrnIndex, X_WARNING, "received signal\n"); + xf86DrvMsg(pInt->pScrn->scrnIndex, X_WARNING, "received signal\n"); return 0; default: - xf86DrvMsg(pInt->scrnIndex, X_ERROR, "unknown type(0x%x)=0x%x\n", + xf86DrvMsg(pInt->pScrn->scrnIndex, X_ERROR, "unknown type(0x%x)=0x%x\n", VM86_ARG(retval), VM86_TYPE(retval)); dump_registers(pInt); dump_code(pInt); diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c index 7fd70fc34..15e2ada78 100644 --- a/hw/xfree86/ramdac/xf86Cursor.c +++ b/hw/xfree86/ramdac/xf86Cursor.c @@ -43,14 +43,14 @@ static miPointerSpriteFuncRec xf86CursorSpriteFuncs = { static void xf86CursorInstallColormap(ColormapPtr); static void xf86CursorRecolorCursor(DeviceIntPtr pDev, ScreenPtr, CursorPtr, Bool); -static Bool xf86CursorCloseScreen(int, ScreenPtr); +static Bool xf86CursorCloseScreen(ScreenPtr); static void xf86CursorQueryBestSize(int, unsigned short *, unsigned short *, ScreenPtr); /* ScrnInfoRec functions */ -static void xf86CursorEnableDisableFBAccess(int, Bool); -static Bool xf86CursorSwitchMode(int, DisplayModePtr, int); +static void xf86CursorEnableDisableFBAccess(ScrnInfoPtr, Bool); +static Bool xf86CursorSwitchMode(ScrnInfoPtr, DisplayModePtr); Bool xf86InitCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr) @@ -118,7 +118,7 @@ xf86InitCursor(ScreenPtr pScreen, xf86CursorInfoPtr infoPtr) /***** Screen functions *****/ static Bool -xf86CursorCloseScreen(int i, ScreenPtr pScreen) +xf86CursorCloseScreen(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); miPointerScreenPtr PointPriv = @@ -149,7 +149,7 @@ xf86CursorCloseScreen(int i, ScreenPtr pScreen) free(ScreenPriv->transparentData); free(ScreenPriv); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } static void @@ -203,11 +203,11 @@ xf86CursorRecolorCursor(DeviceIntPtr pDev, /***** ScrnInfoRec functions *********/ static void -xf86CursorEnableDisableFBAccess(int index, Bool enable) +xf86CursorEnableDisableFBAccess(ScrnInfoPtr pScrn, Bool enable) { DeviceIntPtr pDev = inputInfo.pointer; - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); @@ -223,7 +223,7 @@ xf86CursorEnableDisableFBAccess(int index, Bool enable) } if (ScreenPriv->EnableDisableFBAccess) - (*ScreenPriv->EnableDisableFBAccess) (index, enable); + (*ScreenPriv->EnableDisableFBAccess) (pScrn, enable); if (enable && ScreenPriv->SavedCursor) { /* @@ -237,10 +237,10 @@ xf86CursorEnableDisableFBAccess(int index, Bool enable) } static Bool -xf86CursorSwitchMode(int index, DisplayModePtr mode, int flags) +xf86CursorSwitchMode(ScrnInfoPtr pScrn, DisplayModePtr mode) { Bool ret; - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); xf86CursorScreenPtr ScreenPriv = (xf86CursorScreenPtr) dixLookupPrivate(&pScreen->devPrivates, xf86CursorScreenKey); @@ -250,7 +250,7 @@ xf86CursorSwitchMode(int index, DisplayModePtr mode, int flags) ScreenPriv->isUp = FALSE; } - ret = (*ScreenPriv->SwitchMode) (index, mode, flags); + ret = (*ScreenPriv->SwitchMode) (pScrn, mode); /* * Cannot restore cursor here because the new frame[XY][01] haven't been diff --git a/hw/xfree86/ramdac/xf86CursorPriv.h b/hw/xfree86/ramdac/xf86CursorPriv.h index 062b2eb7c..d04f93207 100644 --- a/hw/xfree86/ramdac/xf86CursorPriv.h +++ b/hw/xfree86/ramdac/xf86CursorPriv.h @@ -26,7 +26,7 @@ typedef struct { miPointerSpriteFuncPtr spriteFuncs; Bool PalettedCursor; ColormapPtr pInstalledMap; - Bool (*SwitchMode) (int, DisplayModePtr, int); + Bool (*SwitchMode) (ScrnInfoPtr, DisplayModePtr); xf86EnableDisableFBAccessProc *EnableDisableFBAccess; CursorPtr SavedCursor; diff --git a/hw/xfree86/shadowfb/shadow.c b/hw/xfree86/shadowfb/shadow.c index 5aeee6cbf..614501770 100644 --- a/hw/xfree86/shadowfb/shadow.c +++ b/hw/xfree86/shadowfb/shadow.c @@ -28,13 +28,13 @@ #include "picturestr.h" -static Bool ShadowCloseScreen(int i, ScreenPtr pScreen); +static Bool ShadowCloseScreen(ScreenPtr pScreen); static void ShadowCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgn); static Bool ShadowCreateGC(GCPtr pGC); -static Bool ShadowEnterVT(int index, int flags); -static void ShadowLeaveVT(int index, int flags); +static Bool ShadowEnterVT(ScrnInfoPtr pScrn); +static void ShadowLeaveVT(ScrnInfoPtr pScrn); static void ShadowComposite(CARD8 op, PicturePtr pSrc, @@ -56,8 +56,8 @@ typedef struct { CreateGCProcPtr CreateGC; ModifyPixmapHeaderProcPtr ModifyPixmapHeader; CompositeProcPtr Composite; - Bool (*EnterVT) (int, int); - void (*LeaveVT) (int, int); + Bool (*EnterVT) (ScrnInfoPtr); + void (*LeaveVT) (ScrnInfoPtr); Bool vtSema; } ShadowScreenRec, *ShadowScreenPtr; @@ -192,14 +192,13 @@ ShadowFBInit(ScreenPtr pScreen, RefreshAreaFuncPtr refreshArea) /**********************************************************/ static Bool -ShadowEnterVT(int index, int flags) +ShadowEnterVT(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[index]; Bool ret; ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScrn->pScreen); pScrn->EnterVT = pPriv->EnterVT; - ret = (*pPriv->EnterVT) (index, flags); + ret = (*pPriv->EnterVT) (pScrn); pPriv->EnterVT = pScrn->EnterVT; pScrn->EnterVT = ShadowEnterVT; if (ret) { @@ -211,15 +210,14 @@ ShadowEnterVT(int index, int flags) } static void -ShadowLeaveVT(int index, int flags) +ShadowLeaveVT(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[index]; - ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(xf86Screens[index]->pScreen); + ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScrn->pScreen); pPriv->vtSema = FALSE; pScrn->LeaveVT = pPriv->LeaveVT; - (*pPriv->LeaveVT) (index, flags); + (*pPriv->LeaveVT) (pScrn); pPriv->LeaveVT = pScrn->LeaveVT; pScrn->LeaveVT = ShadowLeaveVT; } @@ -227,7 +225,7 @@ ShadowLeaveVT(int index, int flags) /**********************************************************/ static Bool -ShadowCloseScreen(int i, ScreenPtr pScreen) +ShadowCloseScreen(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); ShadowScreenPtr pPriv = GET_SCREEN_PRIVATE(pScreen); @@ -247,7 +245,7 @@ ShadowCloseScreen(int i, ScreenPtr pScreen) free((pointer) pPriv); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } static void diff --git a/hw/xfree86/vbe/vbe.c b/hw/xfree86/vbe/vbe.c index bbb60e3a1..97a9bcf60 100644 --- a/hw/xfree86/vbe/vbe.c +++ b/hw/xfree86/vbe/vbe.c @@ -179,7 +179,7 @@ static Bool vbeProbeDDC(vbeInfoPtr pVbe) { const char *ddc_level; - int screen = pVbe->pInt10->scrnIndex; + int screen = pVbe->pInt10->pScrn->scrnIndex; if (pVbe->ddc == DDC_NONE) return FALSE; @@ -262,7 +262,8 @@ vbeReadEDID(vbeInfoPtr pVbe) unsigned char *tmp = NULL; Bool novbe = FALSE; Bool noddc = FALSE; - int screen = pVbe->pInt10->scrnIndex; + ScrnInfoPtr pScrn = pVbe->pInt10->pScrn; + int screen = pScrn->scrnIndex; OptionInfoPtr options; if (!page) @@ -270,7 +271,7 @@ vbeReadEDID(vbeInfoPtr pVbe) options = xnfalloc(sizeof(VBEOptions)); (void) memcpy(options, VBEOptions, sizeof(VBEOptions)); - xf86ProcessOptions(screen, xf86Screens[screen]->options, options); + xf86ProcessOptions(screen, pScrn->options, options); xf86GetOptValBool(options, VBEOPT_NOVBE, &novbe); xf86GetOptValBool(options, VBEOPT_NODDC, &noddc); free(options); @@ -330,7 +331,7 @@ vbeDoEDID(vbeInfoPtr pVbe, pointer pDDCModule) if (!(pModule = pDDCModule)) { pModule = - xf86LoadSubModule(xf86Screens[pVbe->pInt10->scrnIndex], "ddc"); + xf86LoadSubModule(pVbe->pInt10->pScrn, "ddc"); if (!pModule) return NULL; } @@ -340,7 +341,7 @@ vbeDoEDID(vbeInfoPtr pVbe, pointer pDDCModule) if (!DDC_data) return NULL; - pMonitor = xf86InterpretEDID(pVbe->pInt10->scrnIndex, DDC_data); + pMonitor = xf86InterpretEDID(pVbe->pInt10->pScrn->scrnIndex, DDC_data); if (!pDDCModule) xf86UnloadSubModule(pModule); @@ -598,7 +599,7 @@ VBESaveRestore(vbeInfoPtr pVbe, vbeSaveRestoreFunction function, */ if ((pVbe->version & 0xff00) > 0x100) { - int screen = pVbe->pInt10->scrnIndex; + int screen = pVbe->pInt10->pScrn->scrnIndex; if (function == MODE_QUERY || (function == MODE_SAVE && !*memory)) { /* Query amount of memory to save state */ @@ -904,7 +905,7 @@ VBEBuildVbeModeList(vbeInfoPtr pVbe, VbeInfoBlock * vbe) m->n = id; m->next = ModeList; - xf86DrvMsgVerb(pVbe->pInt10->scrnIndex, X_PROBED, 3, + xf86DrvMsgVerb(pVbe->pInt10->pScrn->scrnIndex, X_PROBED, 3, "BIOS reported VESA mode 0x%x: x:%i y:%i bpp:%i\n", m->n, m->width, m->height, m->bpp); @@ -1026,23 +1027,22 @@ VBEDPMSSet(vbeInfoPtr pVbe, int mode) } void -VBEInterpretPanelID(int scrnIndex, struct vbePanelID *data) +VBEInterpretPanelID(ScrnInfoPtr pScrn, struct vbePanelID *data) { - ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; DisplayModePtr mode; const float PANEL_HZ = 60.0; if (!data) return; - xf86DrvMsg(scrnIndex, X_INFO, "PanelID returned panel resolution %dx%d\n", + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "PanelID returned panel resolution %dx%d\n", data->hsize, data->vsize); if (pScrn->monitor->nHsync || pScrn->monitor->nVrefresh) return; if (data->hsize < 320 || data->vsize < 240) { - xf86DrvMsg(scrnIndex, X_INFO, "...which I refuse to believe\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "...which I refuse to believe\n"); return; } @@ -1069,7 +1069,7 @@ VBEReadPanelID(vbeInfoPtr pVbe) int RealOff = pVbe->real_mode_base; pointer page = pVbe->memory; void *tmp = NULL; - int screen = pVbe->pInt10->scrnIndex; + int screen = pVbe->pInt10->pScrn->scrnIndex; pVbe->pInt10->ax = 0x4F11; pVbe->pInt10->bx = 0x01; diff --git a/hw/xfree86/vbe/vbe.h b/hw/xfree86/vbe/vbe.h index 81be0ff40..3907c53f3 100644 --- a/hw/xfree86/vbe/vbe.h +++ b/hw/xfree86/vbe/vbe.h @@ -350,7 +350,7 @@ struct vbePanelID { char reserved[14]; }; -extern _X_EXPORT void VBEInterpretPanelID(int scrnIndex, +extern _X_EXPORT void VBEInterpretPanelID(ScrnInfoPtr pScrn, struct vbePanelID *data); extern _X_EXPORT struct vbePanelID *VBEReadPanelID(vbeInfoPtr pVbe); diff --git a/hw/xfree86/xaa/xaaInit.c b/hw/xfree86/xaa/xaaInit.c index 48d0605fa..f146f3adf 100644 --- a/hw/xfree86/xaa/xaaInit.c +++ b/hw/xfree86/xaa/xaaInit.c @@ -27,7 +27,7 @@ #define MIN_OFFPIX_SIZE (320*200) -static Bool XAACloseScreen(int i, ScreenPtr pScreen); +static Bool XAACloseScreen(ScreenPtr pScreen); static void XAAGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, unsigned int format, unsigned long planemask, char *pdstLine); @@ -36,10 +36,10 @@ static void XAAGetSpans(DrawablePtr pDrawable, int wMax, DDXPointPtr ppt, static PixmapPtr XAACreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usage_hint); static Bool XAADestroyPixmap(PixmapPtr pPixmap); -static Bool XAAEnterVT(int index, int flags); -static void XAALeaveVT(int index, int flags); -static int XAASetDGAMode(int index, int num, DGADevicePtr devRet); -static void XAAEnableDisableFBAccess(int index, Bool enable); +static Bool XAAEnterVT(ScrnInfoPtr pScrn); +static void XAALeaveVT(ScrnInfoPtr pScrn); +static int XAASetDGAMode(ScrnInfoPtr pScrn, int num, DGADevicePtr devRet); +static void XAAEnableDisableFBAccess(ScrnInfoPtr pScrn, Bool enable); static Bool XAAChangeWindowAttributes(WindowPtr pWin, unsigned long mask); static DevPrivateKeyRec XAAScreenKeyRec; @@ -214,7 +214,7 @@ XAAInit(ScreenPtr pScreen, XAAInfoRecPtr infoRec) } static Bool -XAACloseScreen(int i, ScreenPtr pScreen) +XAACloseScreen(ScreenPtr pScreen) { ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen); XAAScreenPtr pScreenPriv = @@ -238,7 +238,7 @@ XAACloseScreen(int i, ScreenPtr pScreen) free((pointer) pScreenPriv); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } static void @@ -509,26 +509,24 @@ XAAChangeWindowAttributes(WindowPtr pWin, unsigned long mask) /* These two aren't really needed for anything */ static Bool -XAAEnterVT(int index, int flags) +XAAEnterVT(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[index]; Bool ret; - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); XAAScreenPtr pScreenPriv = (XAAScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XAAScreenKey); pScrn->EnterVT = pScreenPriv->EnterVT; - ret = ((*pScreenPriv->EnterVT) (index, flags)); + ret = ((*pScreenPriv->EnterVT) (pScrn)); pScreenPriv->EnterVT = pScrn->EnterVT; pScrn->EnterVT = XAAEnterVT; return ret; } static void -XAALeaveVT(int index, int flags) +XAALeaveVT(ScrnInfoPtr pScrn) { - ScrnInfoPtr pScrn = xf86Screens[index]; - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); XAAScreenPtr pScreenPriv = (XAAScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XAAScreenKey); XAAInfoRecPtr infoRec = pScreenPriv->AccelInfoRec; @@ -539,7 +537,7 @@ XAALeaveVT(int index, int flags) } pScrn->LeaveVT = pScreenPriv->LeaveVT; - (*pScreenPriv->LeaveVT) (index, flags); + (*pScreenPriv->LeaveVT) (pScrn); pScreenPriv->LeaveVT = pScrn->LeaveVT; pScrn->LeaveVT = XAALeaveVT; } @@ -551,9 +549,9 @@ typedef struct { } SavedCacheState, *SavedCacheStatePtr; static int -XAASetDGAMode(int index, int num, DGADevicePtr devRet) +XAASetDGAMode(ScrnInfoPtr pScrn, int num, DGADevicePtr devRet) { - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); XAAScreenPtr pScreenPriv = (XAAScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XAAScreenKey); @@ -569,7 +567,7 @@ XAASetDGAMode(int index, int num, DGADevicePtr devRet) infoRec->dgaSaves = NULL; } - ret = (*pScreenPriv->SetDGAMode) (index, num, devRet); + ret = (*pScreenPriv->SetDGAMode) (pScrn, num, devRet); if (ret != Success) return ret; @@ -612,9 +610,9 @@ XAASetDGAMode(int index, int num, DGADevicePtr devRet) } static void -XAAEnableDisableFBAccess(int index, Bool enable) +XAAEnableDisableFBAccess(ScrnInfoPtr pScrn, Bool enable) { - ScreenPtr pScreen = screenInfo.screens[index]; + ScreenPtr pScreen = xf86ScrnToScreen(pScrn); XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_SCREEN(pScreen); XAAScreenPtr pScreenPriv = (XAAScreenPtr) dixLookupPrivate(&pScreen->devPrivates, XAAScreenKey); @@ -627,7 +625,7 @@ XAAEnableDisableFBAccess(int index, Bool enable) SwitchedOut = TRUE; } - (*pScreenPriv->EnableDisableFBAccess) (index, enable); + (*pScreenPriv->EnableDisableFBAccess) (pScrn, enable); if (enable) { if ((infoRec->Flags & OFFSCREEN_PIXMAPS) && (infoRec->OffscreenPixmaps)) diff --git a/hw/xfree86/xaa/xaalocal.h b/hw/xfree86/xaa/xaalocal.h index c028ef033..61d9eebe5 100644 --- a/hw/xfree86/xaa/xaalocal.h +++ b/hw/xfree86/xaa/xaalocal.h @@ -47,10 +47,10 @@ typedef struct _XAAScreen { DestroyPixmapProcPtr DestroyPixmap; ChangeWindowAttributesProcPtr ChangeWindowAttributes; XAAInfoRecPtr AccelInfoRec; - Bool (*EnterVT) (int, int); - void (*LeaveVT) (int, int); - int (*SetDGAMode) (int, int, DGADevicePtr); - void (*EnableDisableFBAccess) (int, Bool); + Bool (*EnterVT) (ScrnInfoPtr); + void (*LeaveVT) (ScrnInfoPtr); + int (*SetDGAMode) (ScrnInfoPtr, int, DGADevicePtr); + void (*EnableDisableFBAccess) (ScrnInfoPtr, Bool); CompositeProcPtr Composite; GlyphsProcPtr Glyphs; } XAAScreenRec, *XAAScreenPtr; diff --git a/hw/xnest/Screen.c b/hw/xnest/Screen.c index dd76cb801..7b3c1b361 100644 --- a/hw/xnest/Screen.c +++ b/hw/xnest/Screen.c @@ -129,7 +129,7 @@ static miPointerSpriteFuncRec xnestPointerSpriteFuncs = { }; Bool -xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]) +xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[]) { VisualPtr visuals; DepthPtr depths; @@ -309,8 +309,6 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]) pScreen->BlockHandler = (ScreenBlockHandlerProcPtr) NoopDDA; pScreen->WakeupHandler = (ScreenWakeupHandlerProcPtr) NoopDDA; - pScreen->blockData = NULL; - pScreen->wakeupData = NULL; miDCInitialize(pScreen, &xnestPointerCursorFuncs); /* init SW rendering */ PointPriv = dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey); @@ -409,7 +407,7 @@ xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]) } Bool -xnestCloseScreen(int index, ScreenPtr pScreen) +xnestCloseScreen(ScreenPtr pScreen) { int i; diff --git a/hw/xnest/Screen.h b/hw/xnest/Screen.h index 1d255d79b..17c514af7 100644 --- a/hw/xnest/Screen.h +++ b/hw/xnest/Screen.h @@ -19,7 +19,7 @@ extern Window xnestDefaultWindows[MAXSCREENS]; extern Window xnestScreenSaverWindows[MAXSCREENS]; ScreenPtr xnestScreen(Window window); -Bool xnestOpenScreen(int index, ScreenPtr pScreen, int argc, char *argv[]); -Bool xnestCloseScreen(int index, ScreenPtr pScreen); +Bool xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[]); +Bool xnestCloseScreen(ScreenPtr pScreen); #endif /* XNESTSCREEN_H */ diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c index 41db72af8..d26f18a12 100644 --- a/hw/xquartz/darwin.c +++ b/hw/xquartz/darwin.c @@ -193,7 +193,7 @@ DarwinSaveScreen(ScreenPtr pScreen, int on) * Initialize the screen and communicate information about it back to dix. */ static Bool -DarwinScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) +DarwinScreenInit(ScreenPtr pScreen, int argc, char **argv) { int dpi; static int foundIndex = 0; @@ -204,7 +204,7 @@ DarwinScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) return FALSE; // reset index of found screens for each server generation - if (index == 0) { + if (pScreen->myNum == 0) { foundIndex = 0; // reset the visual list @@ -275,7 +275,7 @@ DarwinScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) pScreen->SaveScreen = DarwinSaveScreen; // finish mode dependent screen setup including cursor support - if (!QuartzSetupScreen(index, pScreen)) { + if (!QuartzSetupScreen(pScreen->myNum, pScreen)) { return FALSE; } diff --git a/hw/xwin/win.h b/hw/xwin/win.h index ce90d05e2..878419da3 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -275,7 +275,7 @@ typedef void (*winShadowUpdateProcPtr) (ScreenPtr, shadowBufPtr); typedef Bool (*winInitScreenProcPtr) (ScreenPtr); -typedef Bool (*winCloseScreenProcPtr) (int, ScreenPtr); +typedef Bool (*winCloseScreenProcPtr) (ScreenPtr); typedef Bool (*winInitVisualsProcPtr) (ScreenPtr); @@ -779,7 +779,7 @@ void winSetAuthorization(void); void -winBlockHandler(int nScreen, +winBlockHandler(ScreenPtr pScreen, pointer pBlockData, pointer pTimeout, pointer pReadMask); #ifdef XWIN_NATIVEGDI @@ -1070,7 +1070,7 @@ winPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr pDrawable, */ Bool - winScreenInit(int index, ScreenPtr pScreen, int argc, char **argv); + winScreenInit(ScreenPtr pScreen, int argc, char **argv); Bool winFinishScreenInitFB(int index, ScreenPtr pScreen, int argc, char **argv); @@ -1122,7 +1122,7 @@ Bool void -winWakeupHandler(int nScreen, +winWakeupHandler(ScreenPtr pScreen, pointer pWakeupData, unsigned long ulResult, pointer pReadmask); diff --git a/hw/xwin/winblock.c b/hw/xwin/winblock.c index c18d080fa..5faa1136d 100644 --- a/hw/xwin/winblock.c +++ b/hw/xwin/winblock.c @@ -36,7 +36,7 @@ /* See Porting Layer Definition - p. 6 */ void -winBlockHandler(int nScreen, +winBlockHandler(ScreenPtr pScreen, pointer pBlockData, pointer pTimeout, pointer pReadMask) { #if defined(XWIN_CLIPBOARD) || defined(XWIN_MULTIWINDOW) diff --git a/hw/xwin/winnativegdi.c b/hw/xwin/winnativegdi.c index 8a1455b90..a2a5123a0 100644 --- a/hw/xwin/winnativegdi.c +++ b/hw/xwin/winnativegdi.c @@ -44,7 +44,7 @@ static void winShadowUpdateNativeGDI(ScreenPtr pScreen, shadowBufPtr pBuf); static Bool - winCloseScreenNativeGDI(int nIndex, ScreenPtr pScreen); + winCloseScreenNativeGDI(ScreenPtr pScreen); static Bool winInitVisualsNativeGDI(ScreenPtr pScreen); @@ -104,7 +104,7 @@ winInitScreenNativeGDI(ScreenPtr pScreen) */ static Bool -winCloseScreenNativeGDI(int nIndex, ScreenPtr pScreen) +winCloseScreenNativeGDI(ScreenPtr pScreen) { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; diff --git a/hw/xwin/winpfbdd.c b/hw/xwin/winpfbdd.c index 3fddd85f4..0fd0efe56 100644 --- a/hw/xwin/winpfbdd.c +++ b/hw/xwin/winpfbdd.c @@ -44,7 +44,7 @@ static Bool winAllocateFBPrimaryDD(ScreenPtr pScreen); static Bool - winCloseScreenPrimaryDD(int nIndex, ScreenPtr pScreen); + winCloseScreenPrimaryDD(ScreenPtr pScreen); static Bool winInitVisualsPrimaryDD(ScreenPtr pScreen); @@ -264,7 +264,7 @@ winInitScreenPrimaryDD(ScreenPtr pScreen) */ static Bool -winCloseScreenPrimaryDD(int nIndex, ScreenPtr pScreen) +winCloseScreenPrimaryDD(ScreenPtr pScreen) { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; @@ -279,7 +279,7 @@ winCloseScreenPrimaryDD(int nIndex, ScreenPtr pScreen) /* Call the wrapped CloseScreen procedure */ WIN_UNWRAP(CloseScreen); if (pScreen->CloseScreen) - fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); + fReturn = (*pScreen->CloseScreen) (pScreen); /* Delete the window property */ RemoveProp(pScreenPriv->hwndScreen, WIN_SCR_PROP); diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c index cf7d2c0f8..5f112f97f 100644 --- a/hw/xwin/winscrinit.c +++ b/hw/xwin/winscrinit.c @@ -81,9 +81,9 @@ static Bool */ Bool -winScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) +winScreenInit(ScreenPtr pScreen, int argc, char **argv) { - winScreenInfoPtr pScreenInfo = &g_ScreenInfo[index]; + winScreenInfoPtr pScreenInfo = &g_ScreenInfo[pScreen->myNum]; winPrivScreenPtr pScreenPriv; HDC hdc; DWORD dwInitialBPP; @@ -202,11 +202,11 @@ winScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) miClearVisualTypes(); /* Call the engine dependent screen initialization procedure */ - if (!((*pScreenPriv->pwinFinishScreenInit) (index, pScreen, argc, argv))) { + if (!((*pScreenPriv->pwinFinishScreenInit) (pScreen->myNum, pScreen, argc, argv))) { ErrorF("winScreenInit - winFinishScreenInit () failed\n"); /* call the engine dependent screen close procedure to clean up from a failure */ - pScreenPriv->pwinCloseScreen(index, pScreen); + pScreenPriv->pwinCloseScreen(pScreen); return FALSE; } @@ -224,7 +224,7 @@ winScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) pScreen->y = pScreenInfo->dwInitialY - GetSystemMetrics(SM_YVIRTUALSCREEN); ErrorF("Screen %d added at virtual desktop coordinate (%d,%d).\n", - index, pScreen->x, pScreen->y); + pScreen->myNum, pScreen->x, pScreen->y); #if CYGDEBUG || YES winDebug("winScreenInit - returning\n"); @@ -355,8 +355,6 @@ winFinishScreenInitFB(int index, ScreenPtr pScreen, int argc, char **argv) */ pScreen->BlockHandler = winBlockHandler; pScreen->WakeupHandler = winWakeupHandler; - pScreen->blockData = pScreen; - pScreen->wakeupData = pScreen; /* Render extension initialization, calls miPictureInit */ if (!fbPictureInit(pScreen, NULL, 0)) { @@ -636,8 +634,6 @@ winFinishScreenInitNativeGDI(int index, */ pScreen->BlockHandler = winBlockHandler; pScreen->WakeupHandler = winWakeupHandler; - pScreen->blockData = pScreen; - pScreen->wakeupData = pScreen; /* Place our save screen function */ pScreen->SaveScreen = winSaveScreen; diff --git a/hw/xwin/winshaddd.c b/hw/xwin/winshaddd.c index a2aaa395e..4c77cc05c 100644 --- a/hw/xwin/winshaddd.c +++ b/hw/xwin/winshaddd.c @@ -65,7 +65,7 @@ static void winShadowUpdateDD(ScreenPtr pScreen, shadowBufPtr pBuf); static Bool - winCloseScreenShadowDD(int nIndex, ScreenPtr pScreen); + winCloseScreenShadowDD(ScreenPtr pScreen); static Bool winInitVisualsShadowDD(ScreenPtr pScreen); @@ -648,7 +648,7 @@ winInitScreenShadowDD(ScreenPtr pScreen) */ static Bool -winCloseScreenShadowDD(int nIndex, ScreenPtr pScreen) +winCloseScreenShadowDD(ScreenPtr pScreen) { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; @@ -665,7 +665,7 @@ winCloseScreenShadowDD(int nIndex, ScreenPtr pScreen) /* Call the wrapped CloseScreen procedure */ WIN_UNWRAP(CloseScreen); if (pScreen->CloseScreen) - fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); + fReturn = (*pScreen->CloseScreen) (pScreen); winFreeFBShadowDD(pScreen); diff --git a/hw/xwin/winshadddnl.c b/hw/xwin/winshadddnl.c index 6e71dd24c..c0879752a 100644 --- a/hw/xwin/winshadddnl.c +++ b/hw/xwin/winshadddnl.c @@ -67,7 +67,7 @@ static void winShadowUpdateDDNL(ScreenPtr pScreen, shadowBufPtr pBuf); static Bool - winCloseScreenShadowDDNL(int nIndex, ScreenPtr pScreen); + winCloseScreenShadowDDNL(ScreenPtr pScreen); static Bool winInitVisualsShadowDDNL(ScreenPtr pScreen); @@ -719,7 +719,7 @@ winInitScreenShadowDDNL(ScreenPtr pScreen) */ static Bool -winCloseScreenShadowDDNL(int nIndex, ScreenPtr pScreen) +winCloseScreenShadowDDNL(ScreenPtr pScreen) { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; @@ -736,7 +736,7 @@ winCloseScreenShadowDDNL(int nIndex, ScreenPtr pScreen) /* Call the wrapped CloseScreen procedure */ WIN_UNWRAP(CloseScreen); if (pScreen->CloseScreen) - fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); + fReturn = (*pScreen->CloseScreen) (pScreen); winFreeFBShadowDDNL(pScreen); diff --git a/hw/xwin/winshadgdi.c b/hw/xwin/winshadgdi.c index 3b7b8b5a8..cdbb46bf2 100644 --- a/hw/xwin/winshadgdi.c +++ b/hw/xwin/winshadgdi.c @@ -50,7 +50,7 @@ static void winShadowUpdateGDI(ScreenPtr pScreen, shadowBufPtr pBuf); static Bool - winCloseScreenShadowGDI(int nIndex, ScreenPtr pScreen); + winCloseScreenShadowGDI(ScreenPtr pScreen); static Bool winInitVisualsShadowGDI(ScreenPtr pScreen); @@ -579,7 +579,7 @@ winInitScreenShadowGDI(ScreenPtr pScreen) */ static Bool -winCloseScreenShadowGDI(int nIndex, ScreenPtr pScreen) +winCloseScreenShadowGDI(ScreenPtr pScreen) { winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; @@ -596,7 +596,7 @@ winCloseScreenShadowGDI(int nIndex, ScreenPtr pScreen) /* Call the wrapped CloseScreen procedure */ WIN_UNWRAP(CloseScreen); if (pScreen->CloseScreen) - fReturn = (*pScreen->CloseScreen) (nIndex, pScreen); + fReturn = (*pScreen->CloseScreen) (pScreen); /* Delete the window property */ RemoveProp(pScreenPriv->hwndScreen, WIN_SCR_PROP); diff --git a/hw/xwin/winwakeup.c b/hw/xwin/winwakeup.c index 1d2bfedbe..8c9140be6 100644 --- a/hw/xwin/winwakeup.c +++ b/hw/xwin/winwakeup.c @@ -38,7 +38,7 @@ /* See Porting Layer Definition - p. 7 */ void -winWakeupHandler(int nScreen, +winWakeupHandler(ScreenPtr pScreen, pointer pWakeupData, unsigned long ulResult, pointer pReadmask) { MSG msg; diff --git a/include/pixmap.h b/include/pixmap.h index 26d737c4d..9bb5bb7b8 100644 --- a/include/pixmap.h +++ b/include/pixmap.h @@ -100,9 +100,9 @@ extern _X_EXPORT PixmapPtr GetScratchPixmapHeader(ScreenPtr /*pScreen */ , extern _X_EXPORT void FreeScratchPixmapHeader(PixmapPtr /*pPixmap */ ); -extern _X_EXPORT Bool CreateScratchPixmapsForScreen(int /*scrnum */ ); +extern _X_EXPORT Bool CreateScratchPixmapsForScreen(ScreenPtr /*pScreen */ ); -extern _X_EXPORT void FreeScratchPixmapsForScreen(int /*scrnum */ ); +extern _X_EXPORT void FreeScratchPixmapsForScreen(ScreenPtr /*pScreen */ ); extern _X_EXPORT PixmapPtr AllocatePixmap(ScreenPtr /*pScreen */ , int /*pixDataSize */ ); diff --git a/include/screenint.h b/include/screenint.h index 881747182..6b0cc70ee 100644 --- a/include/screenint.h +++ b/include/screenint.h @@ -55,7 +55,6 @@ typedef struct _Depth *DepthPtr; typedef struct _Screen *ScreenPtr; extern _X_EXPORT int AddScreen(Bool (* /*pfnInit */ )( - int /*index */ , ScreenPtr /*pScreen */ , int /*argc */ , diff --git a/include/scrnintstr.h b/include/scrnintstr.h index 0ae937777..c592d1ffe 100644 --- a/include/scrnintstr.h +++ b/include/scrnintstr.h @@ -95,8 +95,7 @@ typedef struct _ScreenSaverStuff { * or as a local variable) can easily do so and retain full type checking. */ -typedef Bool (*CloseScreenProcPtr) (int /*index */ , - ScreenPtr /*pScreen */ ); +typedef Bool (*CloseScreenProcPtr) (ScreenPtr /*pScreen */ ); typedef void (*QueryBestSizeProcPtr) (int /*class */ , unsigned short * /*pwidth */ , @@ -258,13 +257,11 @@ typedef void (*SendGraphicsExposeProcPtr) (ClientPtr /*client */ , int /*major */ , int /*minor */ ); -typedef void (*ScreenBlockHandlerProcPtr) (int /*screenNum */ , - pointer /*blockData */ , +typedef void (*ScreenBlockHandlerProcPtr) (ScreenPtr /*pScreen*/ , pointer /*pTimeout */ , pointer /*pReadmask */ ); -typedef void (*ScreenWakeupHandlerProcPtr) (int /*screenNum */ , - pointer /*wakeupData */ , +typedef void (*ScreenWakeupHandlerProcPtr) (ScreenPtr /*pScreen*/ , unsigned long /*result */ , pointer /*pReadMask */ ); @@ -440,9 +437,6 @@ typedef struct _Screen { ScreenBlockHandlerProcPtr BlockHandler; ScreenWakeupHandlerProcPtr WakeupHandler; - pointer blockData; - pointer wakeupData; - /* anybody can get a piece of this array */ PrivateRec *devPrivates; diff --git a/mi/midispcur.c b/mi/midispcur.c index 24b9a700d..9ee824283 100644 --- a/mi/midispcur.c +++ b/mi/midispcur.c @@ -63,7 +63,7 @@ static DevScreenPrivateKeyRec miDCDeviceKeyRec; #define miDCDeviceKey (&miDCDeviceKeyRec) -static Bool miDCCloseScreen(int index, ScreenPtr pScreen); +static Bool miDCCloseScreen(ScreenPtr pScreen); /* per device private data */ typedef struct { @@ -128,7 +128,7 @@ miDCInitialize(ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs) } static Bool -miDCCloseScreen(int index, ScreenPtr pScreen) +miDCCloseScreen(ScreenPtr pScreen) { miDCScreenPtr pScreenPriv; @@ -136,7 +136,7 @@ miDCCloseScreen(int index, ScreenPtr pScreen) miDCScreenKey); pScreen->CloseScreen = pScreenPriv->CloseScreen; free((pointer) pScreenPriv); - return (*pScreen->CloseScreen) (index, pScreen); + return (*pScreen->CloseScreen) (pScreen); } Bool diff --git a/mi/mioverlay.c b/mi/mioverlay.c index f72159e73..2bfd5e401 100644 --- a/mi/mioverlay.c +++ b/mi/mioverlay.c @@ -66,7 +66,7 @@ static Bool HasUnderlayChildren(WindowPtr); static void MarkUnderlayWindow(WindowPtr); static Bool CollectUnderlayChildrenRegions(WindowPtr, RegionPtr); -static Bool miOverlayCloseScreen(int, ScreenPtr); +static Bool miOverlayCloseScreen(ScreenPtr); static Bool miOverlayCreateWindow(WindowPtr); static Bool miOverlayDestroyWindow(WindowPtr); static Bool miOverlayUnrealizeWindow(WindowPtr); @@ -160,7 +160,7 @@ miInitOverlay(ScreenPtr pScreen, } static Bool -miOverlayCloseScreen(int i, ScreenPtr pScreen) +miOverlayCloseScreen(ScreenPtr pScreen) { miOverlayScreenPtr pScreenPriv = MIOVERLAY_GET_SCREEN_PRIVATE(pScreen); @@ -172,7 +172,7 @@ miOverlayCloseScreen(int i, ScreenPtr pScreen) free(pScreenPriv); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } static Bool diff --git a/mi/mipointer.c b/mi/mipointer.c index de6698a37..a56838ead 100644 --- a/mi/mipointer.c +++ b/mi/mipointer.c @@ -91,7 +91,7 @@ static void miPointerCursorLimits(DeviceIntPtr pDev, ScreenPtr pScreen, BoxPtr pTopLeftBox); static Bool miPointerSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y, Bool generateEvent); -static Bool miPointerCloseScreen(int index, ScreenPtr pScreen); +static Bool miPointerCloseScreen(ScreenPtr pScreen); static void miPointerMove(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y); static Bool miPointerDeviceInitialize(DeviceIntPtr pDev, ScreenPtr pScreen); static void miPointerDeviceCleanup(DeviceIntPtr pDev, ScreenPtr pScreen); @@ -154,7 +154,7 @@ miPointerInitialize(ScreenPtr pScreen, * @param pScreen The actual screen pointer */ static Bool -miPointerCloseScreen(int index, ScreenPtr pScreen) +miPointerCloseScreen(ScreenPtr pScreen) { SetupScreen(pScreen); @@ -162,7 +162,7 @@ miPointerCloseScreen(int index, ScreenPtr pScreen) free((pointer) pScreenPriv); FreeEventList(events, GetMaximumEventsNum()); events = NULL; - return (*pScreen->CloseScreen) (index, pScreen); + return (*pScreen->CloseScreen) (pScreen); } /* diff --git a/mi/miscrinit.c b/mi/miscrinit.c index 2850c8d79..4698b532f 100644 --- a/mi/miscrinit.c +++ b/mi/miscrinit.c @@ -119,7 +119,7 @@ miModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth, } static Bool -miCloseScreen(int iScreen, ScreenPtr pScreen) +miCloseScreen(ScreenPtr pScreen) { return ((*pScreen->DestroyPixmap) ((PixmapPtr) pScreen->devPrivate)); } @@ -262,8 +262,6 @@ miScreenInit(ScreenPtr pScreen, pointer pbits, /* pointer to screen bits */ pScreen->SendGraphicsExpose = miSendGraphicsExpose; pScreen->BlockHandler = (ScreenBlockHandlerProcPtr) NoopDDA; pScreen->WakeupHandler = (ScreenWakeupHandlerProcPtr) NoopDDA; - pScreen->blockData = (pointer) 0; - pScreen->wakeupData = (pointer) 0; pScreen->MarkWindow = miMarkWindow; pScreen->MarkOverlappedWindows = miMarkOverlappedWindows; pScreen->MoveWindow = miMoveWindow; diff --git a/mi/misprite.c b/mi/misprite.c index c9fcabcab..97bbf8ef5 100644 --- a/mi/misprite.c +++ b/mi/misprite.c @@ -191,7 +191,7 @@ static DevPrivateKeyRec miSpriteDevPrivatesKeyRec; #define miSpriteDevPrivatesKey (&miSpriteDevPrivatesKeyRec) -static Bool miSpriteCloseScreen(int i, ScreenPtr pScreen); +static Bool miSpriteCloseScreen(ScreenPtr pScreen); static void miSpriteGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, unsigned int format, unsigned long planemask, char *pdstLine); @@ -203,7 +203,7 @@ static void miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y, unsigned int subWindowMode); static void miSpriteCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc); -static void miSpriteBlockHandler(int i, pointer blockData, +static void miSpriteBlockHandler(ScreenPtr pScreen, pointer pTimeout, pointer pReadMask); static void miSpriteInstallColormap(ColormapPtr pMap); static void miSpriteStoreColors(ColormapPtr pMap, int ndef, xColorItem * pdef); @@ -367,7 +367,7 @@ miSpriteInitialize(ScreenPtr pScreen, miPointerScreenFuncPtr screenFuncs) */ static Bool -miSpriteCloseScreen(int i, ScreenPtr pScreen) +miSpriteCloseScreen(ScreenPtr pScreen) { miSpriteScreenPtr pScreenPriv = GetSpriteScreen(pScreen); @@ -382,7 +382,7 @@ miSpriteCloseScreen(int i, ScreenPtr pScreen) free(pScreenPriv); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } static void @@ -520,10 +520,9 @@ miSpriteCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc) } static void -miSpriteBlockHandler(int i, pointer blockData, pointer pTimeout, +miSpriteBlockHandler(ScreenPtr pScreen, pointer pTimeout, pointer pReadmask) { - ScreenPtr pScreen = screenInfo.screens[i]; miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen); DeviceIntPtr pDev; miCursorInfoPtr pCursorInfo; @@ -554,7 +553,7 @@ miSpriteBlockHandler(int i, pointer blockData, pointer pTimeout, SCREEN_PROLOGUE(pPriv, pScreen, BlockHandler); - (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); + (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); if (WorkToDo) SCREEN_EPILOGUE(pPriv, pScreen, BlockHandler); diff --git a/miext/cw/cw.c b/miext/cw/cw.c index 87ced2f6a..7543affb0 100644 --- a/miext/cw/cw.c +++ b/miext/cw/cw.c @@ -51,7 +51,7 @@ DevPrivateKeyRec cwPictureKeyRec; extern GCOps cwGCOps; static Bool - cwCloseScreen(int i, ScreenPtr pScreen); + cwCloseScreen(ScreenPtr pScreen); static void cwValidateGC(GCPtr pGC, unsigned long stateChanges, DrawablePtr pDrawable); @@ -502,7 +502,7 @@ miInitializeCompositeWrapper(ScreenPtr pScreen) } static Bool -cwCloseScreen(int i, ScreenPtr pScreen) +cwCloseScreen(ScreenPtr pScreen) { cwScreenPtr pScreenPriv; PictureScreenPtr ps = GetPictureScreenIfSet(pScreen); @@ -520,5 +520,5 @@ cwCloseScreen(int i, ScreenPtr pScreen) free((pointer) pScreenPriv); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } diff --git a/miext/damage/damage.c b/miext/damage/damage.c index 72ed65997..85b54fc56 100644 --- a/miext/damage/damage.c +++ b/miext/damage/damage.c @@ -1646,7 +1646,7 @@ damageDestroyWindow(WindowPtr pWindow) } static Bool -damageCloseScreen(int i, ScreenPtr pScreen) +damageCloseScreen(ScreenPtr pScreen) { damageScrPriv(pScreen); @@ -1655,7 +1655,7 @@ damageCloseScreen(int i, ScreenPtr pScreen) unwrap(pScrPriv, pScreen, CopyWindow); unwrap(pScrPriv, pScreen, CloseScreen); free(pScrPriv); - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } /** diff --git a/miext/rootless/rootlessScreen.c b/miext/rootless/rootlessScreen.c index ecc72ea92..a1af3e7ac 100644 --- a/miext/rootless/rootlessScreen.c +++ b/miext/rootless/rootlessScreen.c @@ -138,7 +138,7 @@ RootlessCreateScreenResources(ScreenPtr pScreen) } static Bool -RootlessCloseScreen(int i, ScreenPtr pScreen) +RootlessCloseScreen(ScreenPtr pScreen) { RootlessScreenRec *s; @@ -154,7 +154,7 @@ RootlessCloseScreen(int i, ScreenPtr pScreen) } free(s); - return pScreen->CloseScreen(i, pScreen); + return pScreen->CloseScreen(pScreen); } static void diff --git a/miext/shadow/shadow.c b/miext/shadow/shadow.c index d2ba68497..2d869e54b 100644 --- a/miext/shadow/shadow.c +++ b/miext/shadow/shadow.c @@ -96,7 +96,7 @@ shadowGetImage(DrawablePtr pDrawable, int sx, int sy, int w, int h, #define BACKWARDS_COMPATIBILITY static Bool -shadowCloseScreen(int i, ScreenPtr pScreen) +shadowCloseScreen(ScreenPtr pScreen) { shadowBuf(pScreen); @@ -110,7 +110,7 @@ shadowCloseScreen(int i, ScreenPtr pScreen) if (pBuf->pPixmap) pScreen->DestroyPixmap(pBuf->pPixmap); free(pBuf); - return pScreen->CloseScreen(i, pScreen); + return pScreen->CloseScreen(pScreen); } #ifdef BACKWARDS_COMPATIBILITY diff --git a/miext/sync/misync.c b/miext/sync/misync.c index b1e2a36f7..d24921a18 100644 --- a/miext/sync/misync.c +++ b/miext/sync/misync.c @@ -163,13 +163,13 @@ miSyncGetScreenFuncs(ScreenPtr pScreen) } static Bool -SyncCloseScreen(int i, ScreenPtr pScreen) +SyncCloseScreen(ScreenPtr pScreen) { SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen); pScreen->CloseScreen = pScreenPriv->CloseScreen; - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } Bool diff --git a/randr/randr.c b/randr/randr.c index 9f3df5fbe..a64aae366 100644 --- a/randr/randr.c +++ b/randr/randr.c @@ -83,7 +83,7 @@ RRClientCallback(CallbackListPtr *list, pointer closure, pointer data) } static Bool -RRCloseScreen(int i, ScreenPtr pScreen) +RRCloseScreen(ScreenPtr pScreen) { rrScrPriv(pScreen); int j; @@ -98,7 +98,7 @@ RRCloseScreen(int i, ScreenPtr pScreen) free(pScrPriv->outputs); free(pScrPriv); RRNScreens -= 1; /* ok, one fewer screen with RandR running */ - return (*pScreen->CloseScreen) (i, pScreen); + return (*pScreen->CloseScreen) (pScreen); } static void diff --git a/randr/randrstr.h b/randr/randrstr.h index 1c0e9d4db..38fb10751 100644 --- a/randr/randrstr.h +++ b/randr/randrstr.h @@ -198,7 +198,7 @@ typedef Bool (*RRSetPanningProcPtr) (ScreenPtr pScrn, #endif /* RANDR_13_INTERFACE */ typedef Bool (*RRGetInfoProcPtr) (ScreenPtr pScreen, Rotation * rotations); -typedef Bool (*RRCloseScreenProcPtr) (int i, ScreenPtr pscreen); +typedef Bool (*RRCloseScreenProcPtr) (ScreenPtr pscreen); /* These are for 1.0 compatibility */ diff --git a/render/animcur.c b/render/animcur.c index 485c068fe..ebc5b8ef7 100644 --- a/render/animcur.c +++ b/render/animcur.c @@ -89,7 +89,7 @@ static DevPrivateKeyRec AnimCurScreenPrivateKeyRec; #define Unwrap(as,s,elt) ((s)->elt = (as)->elt) static Bool -AnimCurCloseScreen(int index, ScreenPtr pScreen) +AnimCurCloseScreen(ScreenPtr pScreen) { AnimCurScreenPtr as = GetAnimCurScreen(pScreen); Bool ret; @@ -103,7 +103,7 @@ AnimCurCloseScreen(int index, ScreenPtr pScreen) Unwrap(as, pScreen, UnrealizeCursor); Unwrap(as, pScreen, RecolorCursor); SetAnimCurScreen(pScreen, 0); - ret = (*pScreen->CloseScreen) (index, pScreen); + ret = (*pScreen->CloseScreen) (pScreen); free(as); return ret; } @@ -135,11 +135,9 @@ AnimCurCursorLimits(DeviceIntPtr pDev, */ static void -AnimCurScreenBlockHandler(int screenNum, - pointer blockData, +AnimCurScreenBlockHandler(ScreenPtr pScreen, pointer pTimeout, pointer pReadmask) { - ScreenPtr pScreen = screenInfo.screens[screenNum]; AnimCurScreenPtr as = GetAnimCurScreen(pScreen); DeviceIntPtr dev; Bool activeDevice = FALSE; @@ -183,7 +181,7 @@ AnimCurScreenBlockHandler(int screenNum, AdjustWaitForDelay(pTimeout, soonest - now); Unwrap(as, pScreen, BlockHandler); - (*pScreen->BlockHandler) (screenNum, blockData, pTimeout, pReadmask); + (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask); if (activeDevice) Wrap(as, pScreen, BlockHandler, AnimCurScreenBlockHandler); else diff --git a/render/picture.c b/render/picture.c index da3e49936..788785354 100644 --- a/render/picture.c +++ b/render/picture.c @@ -72,14 +72,14 @@ PictureDestroyWindow(WindowPtr pWindow) } Bool -PictureCloseScreen(int index, ScreenPtr pScreen) +PictureCloseScreen(ScreenPtr pScreen) { PictureScreenPtr ps = GetPictureScreen(pScreen); Bool ret; int n; pScreen->CloseScreen = ps->CloseScreen; - ret = (*pScreen->CloseScreen) (index, pScreen); + ret = (*pScreen->CloseScreen) (pScreen); PictureResetFilters(pScreen); for (n = 0; n < ps->nformats; n++) if (ps->formats[n].type == PictTypeIndexed) diff --git a/render/picturestr.h b/render/picturestr.h index cd4ec498c..6da56563d 100644 --- a/render/picturestr.h +++ b/render/picturestr.h @@ -381,7 +381,7 @@ extern _X_EXPORT Bool PictureDestroyWindow(WindowPtr pWindow); extern _X_EXPORT Bool - PictureCloseScreen(int Index, ScreenPtr pScreen); + PictureCloseScreen(ScreenPtr pScreen); extern _X_EXPORT void PictureStoreColors(ColormapPtr pColormap, int ndef, xColorItem * pdef); diff --git a/xfixes/cursor.c b/xfixes/cursor.c index 602b9061e..467529a4f 100644 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -190,7 +190,7 @@ CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) } static Bool -CursorCloseScreen(int index, ScreenPtr pScreen) +CursorCloseScreen(ScreenPtr pScreen) { CursorScreenPtr cs = GetCursorScreen(pScreen); Bool ret; @@ -202,7 +202,7 @@ CursorCloseScreen(int index, ScreenPtr pScreen) Unwrap(cs, pScreen, DisplayCursor, display_proc); Unwrap(cs, pScreen, ConstrainCursorHarder, constrain_proc); deleteCursorHideCountsForScreen(pScreen); - ret = (*pScreen->CloseScreen) (index, pScreen); + ret = (*pScreen->CloseScreen) (pScreen); free(cs); return ret; } |