summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compat-api.h64
-rw-r--r--src/intel_driver.c61
-rw-r--r--src/legacy/i810/i810.h4
-rw-r--r--src/legacy/i810/i810_dga.c9
-rw-r--r--src/legacy/i810/i810_driver.c69
-rw-r--r--src/legacy/i810/i810_video.c16
-rw-r--r--uxa/uxa.c36
7 files changed, 160 insertions, 99 deletions
diff --git a/src/compat-api.h b/src/compat-api.h
index 1bb77241..2daf9105 100644
--- a/src/compat-api.h
+++ b/src/compat-api.h
@@ -38,4 +38,68 @@
#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex]
#endif
+#ifndef XF86_SCRN_INTERFACE
+
+#define SCRN_ARG_TYPE int
+#define SCRN_INFO_PTR(arg1) ScrnInfoPtr scrn = xf86Screens[(arg1)]
+
+#define SCREEN_ARG_TYPE int
+#define SCREEN_PTR(arg1) ScreenPtr screen = screenInfo.screens[(arg1)]
+
+#define SCREEN_INIT_ARGS_DECL int scrnIndex, ScreenPtr screen, int argc, char **argv
+
+#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer timeout, pointer read_mask
+#define BLOCKHANDLER_ARGS arg, blockData, timeout, read_mask
+
+#define WAKEUPHANDLER_ARGS_DECL int arg, pointer wakeupData, unsigned long result, pointer read_mask
+#define WAKEUPHANDLER_ARGS arg, wakeupData, result, read_mask
+
+#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr screen
+#define CLOSE_SCREEN_ARGS scrnIndex, screen
+
+#define ADJUST_FRAME_ARGS_DECL int arg, int x, int y, int flags
+#define ADJUST_FRAME_ARGS(arg, x, y) (arg)->scrnIndex, x, y, 0
+
+#define SWITCH_MODE_ARGS_DECL int arg, DisplayModePtr mode, int flags
+#define SWITCH_MODE_ARGS(arg, m) (arg)->scrnIndex, m, 0
+
+#define FREE_SCREEN_ARGS_DECL int arg, int flags
+
+#define VT_FUNC_ARGS_DECL int arg, int flags
+#define VT_FUNC_ARGS(flags) scrn->scrnIndex, (flags)
+
+#define XF86_ENABLEDISABLEFB_ARG(x) ((x)->scrnIndex)
+
+#else
+#define SCRN_ARG_TYPE ScrnInfoPtr
+#define SCRN_INFO_PTR(arg1) ScrnInfoPtr scrn = (arg1)
+
+#define SCREEN_ARG_TYPE ScreenPtr
+#define SCREEN_PTR(arg1) ScreenPtr screen = (arg1)
+
+#define SCREEN_INIT_ARGS_DECL ScreenPtr screen, int argc, char **argv
+
+#define BLOCKHANDLER_ARGS_DECL ScreenPtr arg, pointer timeout, pointer read_mask
+#define BLOCKHANDLER_ARGS arg, timeout, read_mask
+
+#define WAKEUPHANDLER_ARGS_DECL ScreenPtr arg, unsigned long result, pointer read_mask
+#define WAKEUPHANDLER_ARGS arg, result, read_mask
+
+#define CLOSE_SCREEN_ARGS_DECL ScreenPtr screen
+#define CLOSE_SCREEN_ARGS screen
+
+#define ADJUST_FRAME_ARGS_DECL ScrnInfoPtr arg, int x, int y
+#define ADJUST_FRAME_ARGS(arg, x, y) arg, x, y
+
+#define SWITCH_MODE_ARGS_DECL ScrnInfoPtr arg, DisplayModePtr mode
+#define SWITCH_MODE_ARGS(arg, m) arg, m
+
+#define FREE_SCREEN_ARGS_DECL ScrnInfoPtr arg
+
+#define VT_FUNC_ARGS_DECL ScrnInfoPtr arg
+#define VT_FUNC_ARGS(flags) scrn
+
+#define XF86_ENABLEDISABLEFB_ARG(x) (x)
+
+#endif
#endif
diff --git a/src/intel_driver.c b/src/intel_driver.c
index 190517f3..67cec488 100644
--- a/src/intel_driver.c
+++ b/src/intel_driver.c
@@ -80,9 +80,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "intel_glamor.h"
#include "intel_options.h"
-static void i830AdjustFrame(int scrnIndex, int x, int y, int flags);
-static Bool I830CloseScreen(int scrnIndex, ScreenPtr screen);
-static Bool I830EnterVT(int scrnIndex, int flags);
+static void i830AdjustFrame(ADJUST_FRAME_ARGS_DECL);
+static Bool I830CloseScreen(CLOSE_SCREEN_ARGS_DECL);
+static Bool I830EnterVT(VT_FUNC_ARGS_DECL);
/* temporary */
extern void xf86SetCursor(ScreenPtr screen, CursorPtr pCurs, int x, int y);
@@ -677,15 +677,15 @@ void IntelEmitInvarientState(ScrnInfoPtr scrn)
}
static void
-I830BlockHandler(int i, pointer blockData, pointer pTimeout, pointer pReadmask)
+I830BlockHandler(BLOCKHANDLER_ARGS_DECL)
{
- ScreenPtr screen = screenInfo.screens[i];
- ScrnInfoPtr scrn = xf86Screens[i];
+ SCREEN_PTR(arg);
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
screen->BlockHandler = intel->BlockHandler;
- (*screen->BlockHandler) (i, blockData, pTimeout, pReadmask);
+ (*screen->BlockHandler) (BLOCKHANDLER_ARGS);
intel->BlockHandler = screen->BlockHandler;
screen->BlockHandler = I830BlockHandler;
@@ -837,7 +837,7 @@ I830UeventFini(ScrnInfoPtr scrn)
#endif /* HAVE_UDEV */
static Bool
-I830ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv)
+I830ScreenInit(SCREEN_INIT_ARGS_DECL)
{
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
@@ -1007,16 +1007,16 @@ I830ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv)
* later memory should be bound when allocating, e.g rotate_mem */
scrn->vtSema = TRUE;
- return I830EnterVT(scrnIndex, 0);
+ return I830EnterVT(VT_FUNC_ARGS(0));
}
-static void i830AdjustFrame(int scrnIndex, int x, int y, int flags)
+static void i830AdjustFrame(ADJUST_FRAME_ARGS_DECL)
{
}
-static void I830FreeScreen(int scrnIndex, int flags)
+static void I830FreeScreen(FREE_SCREEN_ARGS_DECL)
{
- ScrnInfoPtr scrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
intel_screen_private *intel = intel_get_screen_private(scrn);
if (intel) {
@@ -1029,9 +1029,9 @@ static void I830FreeScreen(int scrnIndex, int flags)
}
}
-static void I830LeaveVT(int scrnIndex, int flags)
+static void I830LeaveVT(VT_FUNC_ARGS_DECL)
{
- ScrnInfoPtr scrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
intel_screen_private *intel = intel_get_screen_private(scrn);
int ret;
@@ -1048,9 +1048,9 @@ static void I830LeaveVT(int scrnIndex, int flags)
/*
* This gets called when gaining control of the VT, and from ScreenInit().
*/
-static Bool I830EnterVT(int scrnIndex, int flags)
+static Bool I830EnterVT(VT_FUNC_ARGS_DECL)
{
- ScrnInfoPtr scrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
intel_screen_private *intel = intel_get_screen_private(scrn);
int ret;
@@ -1067,16 +1067,16 @@ static Bool I830EnterVT(int scrnIndex, int flags)
return TRUE;
}
-static Bool I830SwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
+static Bool I830SwitchMode(SWITCH_MODE_ARGS_DECL)
{
- ScrnInfoPtr scrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
return xf86SetSingleMode(scrn, mode, RR_Rotate_0);
}
-static Bool I830CloseScreen(int scrnIndex, ScreenPtr screen)
+static Bool I830CloseScreen(CLOSE_SCREEN_ARGS_DECL)
{
- ScrnInfoPtr scrn = xf86Screens[scrnIndex];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
intel_screen_private *intel = intel_get_screen_private(scrn);
#if HAVE_UDEV
@@ -1084,7 +1084,7 @@ static Bool I830CloseScreen(int scrnIndex, ScreenPtr screen)
#endif
if (scrn->vtSema == TRUE) {
- I830LeaveVT(scrnIndex, 0);
+ I830LeaveVT(VT_FUNC_ARGS(0));
}
DeleteCallback(&FlushCallback, intel_flush_callback, scrn);
@@ -1141,7 +1141,7 @@ static Bool I830CloseScreen(int scrnIndex, ScreenPtr screen)
i965_free_video(scrn);
screen->CloseScreen = intel->CloseScreen;
- (*screen->CloseScreen) (scrnIndex, screen);
+ (*screen->CloseScreen) (CLOSE_SCREEN_ARGS);
if (intel->directRenderingOpen
&& intel->directRenderingType == DRI_DRI2) {
@@ -1149,18 +1149,19 @@ static Bool I830CloseScreen(int scrnIndex, ScreenPtr screen)
I830DRI2CloseScreen(screen);
}
- xf86GARTCloseScreen(scrnIndex);
+ xf86GARTCloseScreen(scrn->scrnIndex);
scrn->vtSema = FALSE;
return TRUE;
}
static ModeStatus
-I830ValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
+I830ValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags)
{
+ SCRN_INFO_PTR(arg);
if (mode->Flags & V_INTERLACE) {
if (verbose) {
- xf86DrvMsg(scrnIndex, X_PROBED,
+ xf86DrvMsg(scrn->scrnIndex, X_PROBED,
"Removing interlaced mode \"%s\"\n",
mode->name);
}
@@ -1181,9 +1182,9 @@ I830ValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
* DoApmEvent() in common/xf86PM.c, including if we want to see events other
* than suspend/resume.
*/
-static Bool I830PMEvent(int scrnIndex, pmEvent event, Bool undo)
+static Bool I830PMEvent(SCRN_ARG_TYPE arg, pmEvent event, Bool undo)
{
- ScrnInfoPtr scrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
intel_screen_private *intel = intel_get_screen_private(scrn);
switch (event) {
@@ -1193,12 +1194,12 @@ static Bool I830PMEvent(int scrnIndex, pmEvent event, Bool undo)
case XF86_APM_SYS_STANDBY:
case XF86_APM_USER_STANDBY:
if (!undo && !intel->suspended) {
- scrn->LeaveVT(scrnIndex, 0);
+ scrn->LeaveVT(VT_FUNC_ARGS(0));
intel->suspended = TRUE;
sleep(SUSPEND_SLEEP);
} else if (undo && intel->suspended) {
sleep(RESUME_SLEEP);
- scrn->EnterVT(scrnIndex, 0);
+ scrn->EnterVT(VT_FUNC_ARGS(0));
intel->suspended = FALSE;
}
break;
@@ -1207,7 +1208,7 @@ static Bool I830PMEvent(int scrnIndex, pmEvent event, Bool undo)
case XF86_APM_CRITICAL_RESUME:
if (intel->suspended) {
sleep(RESUME_SLEEP);
- scrn->EnterVT(scrnIndex, 0);
+ scrn->EnterVT(VT_FUNC_ARGS(0));
intel->suspended = FALSE;
/*
* Turn the screen saver off when resuming. This seems to be
diff --git a/src/legacy/i810/i810.h b/src/legacy/i810/i810.h
index f4caf562..874551be 100644
--- a/src/legacy/i810/i810.h
+++ b/src/legacy/i810/i810.h
@@ -287,8 +287,8 @@ extern Bool I810UnbindGARTMemory(ScrnInfoPtr pScrn);
extern int I810CheckAvailableMemory(ScrnInfoPtr pScrn);
-extern Bool I810SwitchMode(int scrnIndex, DisplayModePtr mode, int flags);
-extern void I810AdjustFrame(int scrnIndex, int x, int y, int flags);
+extern Bool I810SwitchMode(SWITCH_MODE_ARGS_DECL);
+extern void I810AdjustFrame(ADJUST_FRAME_ARGS_DECL);
extern void I810SetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir,
int ydir, int rop,
diff --git a/src/legacy/i810/i810_dga.c b/src/legacy/i810/i810_dga.c
index baf0011d..336588c6 100644
--- a/src/legacy/i810/i810_dga.c
+++ b/src/legacy/i810/i810_dga.c
@@ -148,8 +148,8 @@ I810_SetMode(ScrnInfoPtr pScrn, DGAModePtr pMode)
if (!pMode) { /* restore the original mode */
if (pI810->DGAactive) {
pScrn->currentMode = I810SavedDGAModes[index];
- pScrn->SwitchMode(index, pScrn->currentMode, 0);
- pScrn->AdjustFrame(index, 0, 0, 0);
+ pScrn->SwitchMode(SWITCH_MODE_ARGS(pScrn, pScrn->currentMode));
+ pScrn->AdjustFrame(ADJUST_FRAME_ARGS(pScrn, 0, 0));
pI810->DGAactive = FALSE;
}
} else {
@@ -157,8 +157,7 @@ I810_SetMode(ScrnInfoPtr pScrn, DGAModePtr pMode)
I810SavedDGAModes[index] = pScrn->currentMode;
pI810->DGAactive = TRUE;
}
-
- pScrn->SwitchMode(index, pMode->mode, 0);
+ pScrn->SwitchMode(SWITCH_MODE_ARGS(pScrn, pMode->mode));
}
return TRUE;
@@ -178,7 +177,7 @@ I810_SetViewport(ScrnInfoPtr pScrn, int x, int y, int flags)
I810Ptr pI810 = I810PTR(pScrn);
vgaHWPtr hwp = VGAHWPTR(pScrn);
- pScrn->AdjustFrame(pScrn->pScreen->myNum, x, y, flags);
+ pScrn->AdjustFrame(ADJUST_FRAME_ARGS(pScrn, x, y));
/* wait for retrace */
while ((hwp->readST01(hwp) & 0x08)) ;
diff --git a/src/legacy/i810/i810_driver.c b/src/legacy/i810/i810_driver.c
index 4a73e9b5..519a4f0b 100644
--- a/src/legacy/i810/i810_driver.c
+++ b/src/legacy/i810/i810_driver.c
@@ -77,18 +77,17 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "../legacy.h"
-static Bool I810PreInit(ScrnInfoPtr scrn, int flags);
-static Bool I810ScreenInit(int Index, ScreenPtr screen, int argc,
- char **argv);
-static Bool I810EnterVT(int scrnIndex, int flags);
-static void I810LeaveVT(int scrnIndex, int flags);
-static Bool I810CloseScreen(int scrnIndex, ScreenPtr screen);
-static Bool I810SaveScreen(ScreenPtr screen, Bool unblank);
-static void I810FreeScreen(int scrnIndex, int flags);
-static void I810DisplayPowerManagementSet(ScrnInfoPtr scrn,
+static Bool I810PreInit(ScrnInfoPtr pScrn, int flags);
+static Bool I810ScreenInit(SCREEN_INIT_ARGS);
+static Bool I810EnterVT(VT_FUNC_ARGS_DECL);
+static void I810LeaveVT(VT_FUNC_ARGS_DECL);
+static Bool I810CloseScreen(CLOSE_SCREEN_ARGS_DECL);
+static Bool I810SaveScreen(ScreenPtr pScreen, Bool unblank);
+static void I810FreeScreen(FREE_SCREEN_ARGS_DECL);
+static void I810DisplayPowerManagementSet(ScrnInfoPtr pScrn,
int PowerManagermentMode,
int flags);
-static ModeStatus I810ValidMode(int scrnIndex, DisplayModePtr mode,
+static ModeStatus I810ValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode,
Bool verbose, int flags);
typedef enum {
@@ -1570,7 +1569,7 @@ I810AllocateFront(ScrnInfoPtr scrn)
}
static Bool
-I810ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv)
+I810ScreenInit(SCREEN_INIT_ARGS_DECL)
{
ScrnInfoPtr scrn;
vgaHWPtr hwp;
@@ -1649,7 +1648,7 @@ I810ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv)
return FALSE;
I810SaveScreen(screen, FALSE);
- I810AdjustFrame(scrnIndex, scrn->frameX0, scrn->frameY0, 0);
+ I810AdjustFrame(ADJUST_FRAME_ARGS(scrn, scrn->frameX0, scrn->frameY0));
if (!fbScreenInit(screen, pI810->FbBase + scrn->fbOffset,
scrn->virtualX, scrn->virtualY,
@@ -1785,14 +1784,14 @@ I810ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv)
}
Bool
-I810SwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
+I810SwitchMode(SWITCH_MODE_ARGS_DECL)
{
- ScrnInfoPtr scrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
#if 0
I810Ptr pI810 = I810PTR(scrn);
#endif
if (I810_DEBUG & DEBUG_VERBOSE_CURSOR)
- ErrorF("I810SwitchMode %p %x\n", (void *)mode, flags);
+ ErrorF("I810SwitchMode %p\n", (void *)mode);
#if 0
/*
@@ -1836,9 +1835,9 @@ I810SwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
}
void
-I810AdjustFrame(int scrnIndex, int x, int y, int flags)
+I810AdjustFrame(ADJUST_FRAME_ARGS_DECL)
{
- ScrnInfoPtr scrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
I810Ptr pI810 = I810PTR(scrn);
vgaHWPtr hwp = VGAHWPTR(scrn);
int Base;
@@ -1856,7 +1855,7 @@ I810AdjustFrame(int scrnIndex, int x, int y, int flags)
Base = (y * scrn->displayWidth + x) >> 2;
if (I810_DEBUG & DEBUG_VERBOSE_CURSOR)
- ErrorF("I810AdjustFrame %d,%d %x\n", x, y, flags);
+ ErrorF("I810AdjustFrame %d,%d\n", x, y);
switch (scrn->bitsPerPixel) {
case 8:
@@ -1888,9 +1887,9 @@ I810AdjustFrame(int scrnIndex, int x, int y, int flags)
/* These functions are usually called with the lock **not held**.
*/
static Bool
-I810EnterVT(int scrnIndex, int flags)
+I810EnterVT(VT_FUNC_ARGS_DECL)
{
- ScrnInfoPtr scrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
#ifdef HAVE_DRI1
I810Ptr pI810 = I810PTR(scrn);
@@ -1909,21 +1908,21 @@ I810EnterVT(int scrnIndex, int flags)
if (pI810->directRenderingEnabled) {
if (I810_DEBUG & DEBUG_VERBOSE_DRI)
ErrorF("calling dri unlock\n");
- DRIUnlock(screenInfo.screens[scrnIndex]);
+ DRIUnlock(xf86ScrnToScreen(scrn));
pI810->LockHeld = 0;
}
#endif
if (!I810ModeInit(scrn, scrn->currentMode))
return FALSE;
- I810AdjustFrame(scrnIndex, scrn->frameX0, scrn->frameY0, 0);
+ I810AdjustFrame(ADJUST_FRAME_ARGS(scrn, scrn->frameX0, scrn->frameY0));
return TRUE;
}
static void
-I810LeaveVT(int scrnIndex, int flags)
+I810LeaveVT(VT_FUNC_ARGS_DECL)
{
- ScrnInfoPtr scrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
vgaHWPtr hwp = VGAHWPTR(scrn);
I810Ptr pI810 = I810PTR(scrn);
@@ -1934,7 +1933,7 @@ I810LeaveVT(int scrnIndex, int flags)
if (pI810->directRenderingEnabled) {
if (I810_DEBUG & DEBUG_VERBOSE_DRI)
ErrorF("calling dri lock\n");
- DRILock(screenInfo.screens[scrnIndex], 0);
+ DRILock(xf86ScrnToScreen(scrn), 0);
pI810->LockHeld = 1;
}
#endif
@@ -1957,9 +1956,9 @@ I810LeaveVT(int scrnIndex, int flags)
}
static Bool
-I810CloseScreen(int scrnIndex, ScreenPtr screen)
+I810CloseScreen(CLOSE_SCREEN_ARGS_DECL)
{
- ScrnInfoPtr scrn = xf86Screens[scrnIndex];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
vgaHWPtr hwp = VGAHWPTR(scrn);
I810Ptr pI810 = I810PTR(scrn);
XAAInfoRecPtr infoPtr = pI810->AccelInfoRec;
@@ -2015,30 +2014,32 @@ I810CloseScreen(int scrnIndex, ScreenPtr screen)
/* Need to actually close the gart fd, or the unbound memory will just sit
* around. Will prevent the Xserver from recycling.
*/
- xf86GARTCloseScreen(scrnIndex);
+ xf86GARTCloseScreen(scrn->scrnIndex);
free(pI810->LpRing);
pI810->LpRing = NULL;
scrn->vtSema = FALSE;
screen->CloseScreen = pI810->CloseScreen;
- return (*screen->CloseScreen) (scrnIndex, screen);
+ return (*screen->CloseScreen) (CLOSE_SCREEN_ARGS);
}
static void
-I810FreeScreen(int scrnIndex, int flags)
+I810FreeScreen(FREE_SCREEN_ARGS_DECL)
{
- I810FreeRec(xf86Screens[scrnIndex]);
+ SCRN_INFO_PTR(arg);
+ I810FreeRec(scrn);
if (xf86LoaderCheckSymbol("vgaHWFreeHWRec"))
- vgaHWFreeHWRec(xf86Screens[scrnIndex]);
+ vgaHWFreeHWRec(scrn);
}
static ModeStatus
-I810ValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
+I810ValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags)
{
+ SCRN_INFO_PTR(arg);
if (mode->Flags & V_INTERLACE) {
if (verbose) {
- xf86DrvMsg(scrnIndex, X_PROBED,
+ xf86DrvMsg(scrn->scrnIndex, X_PROBED,
"Removing interlaced mode \"%s\"\n", mode->name);
}
return MODE_BAD;
diff --git a/src/legacy/i810/i810_video.c b/src/legacy/i810/i810_video.c
index 613cbf22..440f9f73 100644
--- a/src/legacy/i810/i810_video.c
+++ b/src/legacy/i810/i810_video.c
@@ -78,7 +78,7 @@ static int I810PutImage( ScrnInfoPtr,
static int I810QueryImageAttributes(ScrnInfoPtr,
int, unsigned short *, unsigned short *, int *, int *);
-static void I810BlockHandler(int, pointer, pointer, pointer);
+static void I810BlockHandler(BLOCKHANDLER_ARGS_DECL);
#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE)
@@ -1139,21 +1139,17 @@ I810QueryImageAttributes(
}
static void
-I810BlockHandler (
- int i,
- pointer blockData,
- pointer pTimeout,
- pointer pReadmask
-){
- ScreenPtr screen = screenInfo.screens[i];
- ScrnInfoPtr pScrn = xf86Screens[i];
+I810BlockHandler (BLOCKHANDLER_ARGS_DECL)
+{
+ SCREEN_PTR(arg);
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(screen);
I810Ptr pI810 = I810PTR(pScrn);
I810PortPrivPtr pPriv = GET_PORT_PRIVATE(pScrn);
I810OverlayRegPtr overlay = (I810OverlayRegPtr) (pI810->FbBase + pI810->OverlayStart);
screen->BlockHandler = pI810->BlockHandler;
- (*screen->BlockHandler) (i, blockData, pTimeout, pReadmask);
+ (*screen->BlockHandler) (BLOCKHANDLER_ARGS);
screen->BlockHandler = I810BlockHandler;
diff --git a/uxa/uxa.c b/uxa/uxa.c
index 1cc82abc..2635b502 100644
--- a/uxa/uxa.c
+++ b/uxa/uxa.c
@@ -363,11 +363,11 @@ void uxa_set_force_fallback(ScreenPtr screen, Bool value)
* uxa_close_screen() unwraps its wrapped screen functions and tears down UXA's
* screen private, before calling down to the next CloseSccreen.
*/
-static Bool uxa_close_screen(int i, ScreenPtr pScreen)
+static Bool uxa_close_screen(CLOSE_SCREEN_ARGS_DECL)
{
- uxa_screen_t *uxa_screen = uxa_get_screen(pScreen);
+ uxa_screen_t *uxa_screen = uxa_get_screen(screen);
#ifdef RENDER
- PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
+ PictureScreenPtr ps = GetPictureScreenIfSet(screen);
#endif
int n;
@@ -380,28 +380,28 @@ static Bool uxa_close_screen(int i, ScreenPtr pScreen)
for (n = 0; n < uxa_screen->solid_cache_size; n++)
FreePicture(uxa_screen->solid_cache[n].picture, 0);
- uxa_glyphs_fini(pScreen);
+ uxa_glyphs_fini(screen);
- if (pScreen->devPrivate) {
+ if (screen->devPrivate) {
/* Destroy the pixmap created by miScreenInit() *before*
* chaining up as we finalize ourselves here and so this
* is the last chance we have of releasing our resources
* associated with the Pixmap. So do it first.
*/
- (void) (*pScreen->DestroyPixmap) (pScreen->devPrivate);
- pScreen->devPrivate = NULL;
+ (void) (*screen->DestroyPixmap) (screen->devPrivate);
+ screen->devPrivate = NULL;
}
- pScreen->CreateGC = uxa_screen->SavedCreateGC;
- pScreen->CloseScreen = uxa_screen->SavedCloseScreen;
- pScreen->GetImage = uxa_screen->SavedGetImage;
- pScreen->GetSpans = uxa_screen->SavedGetSpans;
- pScreen->CreatePixmap = uxa_screen->SavedCreatePixmap;
- pScreen->DestroyPixmap = uxa_screen->SavedDestroyPixmap;
- pScreen->CopyWindow = uxa_screen->SavedCopyWindow;
- pScreen->ChangeWindowAttributes =
+ screen->CreateGC = uxa_screen->SavedCreateGC;
+ screen->CloseScreen = uxa_screen->SavedCloseScreen;
+ screen->GetImage = uxa_screen->SavedGetImage;
+ screen->GetSpans = uxa_screen->SavedGetSpans;
+ screen->CreatePixmap = uxa_screen->SavedCreatePixmap;
+ screen->DestroyPixmap = uxa_screen->SavedDestroyPixmap;
+ screen->CopyWindow = uxa_screen->SavedCopyWindow;
+ screen->ChangeWindowAttributes =
uxa_screen->SavedChangeWindowAttributes;
- pScreen->BitmapToRegion = uxa_screen->SavedBitmapToRegion;
+ screen->BitmapToRegion = uxa_screen->SavedBitmapToRegion;
#ifdef RENDER
if (ps) {
ps->Composite = uxa_screen->SavedComposite;
@@ -416,7 +416,7 @@ static Bool uxa_close_screen(int i, ScreenPtr pScreen)
free(uxa_screen);
- return (*pScreen->CloseScreen) (i, pScreen);
+ return (*screen->CloseScreen) (CLOSE_SCREEN_ARGS);
}
/**
@@ -435,7 +435,7 @@ uxa_driver_t *uxa_driver_alloc(void)
}
/**
- * @param pScreen screen being initialized
+ * @param screen screen being initialized
* @param pScreenInfo UXA driver record
*
* uxa_driver_init sets up UXA given a driver record filled in by the driver.