summaryrefslogtreecommitdiff
path: root/driver
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2012-09-09 21:13:07 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2012-09-09 21:13:07 +0000
commit23e452e7dde29d9af7ac979d0001e4e483f5c35c (patch)
tree3d34ebde989268cfbdfa0fb37a7a4f2fb61e3b06 /driver
parent108136152493cb583435feeb532360c6ffcdd37f (diff)
Add compat-api.h. 1st step to get this version of the intel driver
working with xserver 1.13.
Diffstat (limited to 'driver')
-rw-r--r--driver/xf86-video-intel/src/Makefile.am1
-rw-r--r--driver/xf86-video-intel/src/compat-api.h98
-rw-r--r--driver/xf86-video-intel/src/intel.h1
-rw-r--r--driver/xf86-video-intel/src/intel_driver.c70
-rw-r--r--driver/xf86-video-intel/src/legacy/i810/i810.h5
-rw-r--r--driver/xf86-video-intel/src/legacy/i810/i810_dga.c14
-rw-r--r--driver/xf86-video-intel/src/legacy/i810/i810_driver.c238
-rw-r--r--driver/xf86-video-intel/src/legacy/i810/i810_video.c22
-rw-r--r--driver/xf86-video-intel/uxa/uxa-priv.h4
-rw-r--r--driver/xf86-video-intel/uxa/uxa.c44
10 files changed, 298 insertions, 199 deletions
diff --git a/driver/xf86-video-intel/src/Makefile.am b/driver/xf86-video-intel/src/Makefile.am
index 2d20c24f6..829d86770 100644
--- a/driver/xf86-video-intel/src/Makefile.am
+++ b/driver/xf86-video-intel/src/Makefile.am
@@ -85,6 +85,7 @@ intel_drv_la_SOURCES = \
i965_video.c \
i965_render.c \
drmmode_display.c \
+ compat-api.h \
$(NULL)
if DRI
diff --git a/driver/xf86-video-intel/src/compat-api.h b/driver/xf86-video-intel/src/compat-api.h
new file mode 100644
index 000000000..16e7c6ad1
--- /dev/null
+++ b/driver/xf86-video-intel/src/compat-api.h
@@ -0,0 +1,98 @@
+/*
+ * Copyright 2012 Red Hat, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Author: Dave Airlie <airlied@redhat.com>
+ */
+
+/* this file provides API compat between server post 1.13 and pre it,
+ it should be reused inside as many drivers as possible */
+#ifndef COMPAT_API_H
+#define COMPAT_API_H
+
+#ifndef GLYPH_HAS_GLYPH_PICTURE_ACCESSOR
+#define GetGlyphPicture(g, s) GlyphPicture((g))[(s)->myNum]
+#define SetGlyphPicture(g, s, p) GlyphPicture((g))[(s)->myNum] = p
+#endif
+
+#ifndef XF86_HAS_SCRN_CONV
+#define xf86ScreenToScrn(s) xf86Screens[(s)->myNum]
+#define xf86ScrnToScreen(s) screenInfo.screens[(s)->scrnIndex]
+#endif
+
+#ifndef XF86_SCRN_INTERFACE
+
+#define SCRN_ARG_TYPE int
+#define SCRN_INFO_PTR(arg1) ScrnInfoPtr scrn = xf86Screens[(arg1)]
+
+#define SCREEN_ARG_TYPE int
+#define SCREEN_PTR(arg1) ScreenPtr screen = screenInfo.screens[(arg1)]
+
+#define SCREEN_INIT_ARGS_DECL int i, ScreenPtr screen, int argc, char **argv
+
+#define BLOCKHANDLER_ARGS_DECL int arg, pointer blockData, pointer pTimeout, pointer pReadmask
+#define BLOCKHANDLER_ARGS arg, blockData, pTimeout, pReadmask
+
+#define CLOSE_SCREEN_ARGS_DECL int scrnIndex, ScreenPtr 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 scrn->scrnIndex, 0
+
+#define SCRN_OR_INDEX_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 pTimeout, pointer pReadmask
+#define BLOCKHANDLER_ARGS arg, pTimeout, pReadmask
+
+#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 scrn
+
+#define SCRN_OR_INDEX_ARG(x) (x)
+
+#endif
+
+#endif
diff --git a/driver/xf86-video-intel/src/intel.h b/driver/xf86-video-intel/src/intel.h
index 52dedd4fc..c497b2b2e 100644
--- a/driver/xf86-video-intel/src/intel.h
+++ b/driver/xf86-video-intel/src/intel.h
@@ -71,6 +71,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "i915_drm.h"
#include "intel_driver.h"
+#include "compat-api.h"
#include "uxa.h"
/* XXX
diff --git a/driver/xf86-video-intel/src/intel_driver.c b/driver/xf86-video-intel/src/intel_driver.c
index 314cfb914..94d2553ca 100644
--- a/driver/xf86-video-intel/src/intel_driver.c
+++ b/driver/xf86-video-intel/src/intel_driver.c
@@ -143,9 +143,9 @@ static OptionInfoRec I830Options[] = {
};
/* *INDENT-ON* */
-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);
static Bool SaveHWState(ScrnInfoPtr scrn);
static Bool RestoreHWState(ScrnInfoPtr scrn);
@@ -2027,15 +2027,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;
@@ -2249,9 +2249,9 @@ intel_flush_callback(CallbackListPtr *list,
}
static Bool
-I830ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv)
+I830ScreenInit(SCREEN_INIT_ARGS_DECL)
{
- ScrnInfoPtr scrn = xf86Screens[screen->myNum];
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
vgaHWPtr hwp = NULL;
intel_screen_private *intel = intel_get_screen_private(scrn);
VisualPtr visual;
@@ -2466,7 +2466,7 @@ I830ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv)
* later memory should be bound when allocating, e.g rotate_mem */
scrn->vtSema = TRUE;
- if (!I830EnterVT(scrnIndex, 0))
+ if (!I830EnterVT(VT_FUNC_ARGS))
return FALSE;
intel->BlockHandler = screen->BlockHandler;
@@ -2548,9 +2548,9 @@ I830ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv)
return TRUE;
}
-static void i830AdjustFrame(int scrnIndex, int x, int y, int flags)
+static void i830AdjustFrame(ADJUST_FRAME_ARGS_DECL)
{
- ScrnInfoPtr scrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
intel_screen_private *intel = intel_get_screen_private(scrn);
xf86OutputPtr output = config->output[config->compat_output];
@@ -2572,20 +2572,20 @@ static void i830AdjustFrame(int scrnIndex, int x, int y, int flags)
}
}
-static void I830FreeScreen(int scrnIndex, int flags)
+static void I830FreeScreen(FREE_SCREEN_ARGS_DECL)
{
- ScrnInfoPtr scrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
intel_close_drm_master(scrn);
- I830FreeRec(xf86Screens[scrnIndex]);
+ I830FreeRec(scrn);
if (xf86LoaderCheckSymbol("vgaHWFreeHWRec"))
- vgaHWFreeHWRec(xf86Screens[scrnIndex]);
+ vgaHWFreeHWRec(scrn);
}
-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;
@@ -2637,9 +2637,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);
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
intel_screen_private *intel = intel_get_screen_private(scrn);
int i, ret;
@@ -2742,20 +2742,20 @@ 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 (scrn->vtSema == TRUE) {
- I830LeaveVT(scrnIndex, 0);
+ I830LeaveVT(VT_FUNC_ARGS);
}
DeleteCallback(&FlushCallback, intel_flush_callback, scrn);
@@ -2808,7 +2808,7 @@ static Bool I830CloseScreen(int scrnIndex, ScreenPtr screen)
intel->offscreenImages = NULL;
screen->CloseScreen = intel->CloseScreen;
- (*screen->CloseScreen) (scrnIndex, screen);
+ (*screen->CloseScreen) (CLOSE_SCREEN_ARGS);
if (intel->directRenderingOpen
&& intel->directRenderingType == DRI_DRI2) {
@@ -2816,18 +2816,18 @@ 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);
}
@@ -2848,9 +2848,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);
DPRINTF(PFX, "Enter VT, event %d, undo: %s\n", event,
@@ -2863,12 +2863,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);
intel->suspended = TRUE;
sleep(SUSPEND_SLEEP);
} else if (undo && intel->suspended) {
sleep(RESUME_SLEEP);
- scrn->EnterVT(scrnIndex, 0);
+ scrn->EnterVT(VT_FUNC_ARGS);
intel->suspended = FALSE;
}
break;
@@ -2877,7 +2877,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);
intel->suspended = FALSE;
/*
* Turn the screen saver off when resuming. This seems to be
diff --git a/driver/xf86-video-intel/src/legacy/i810/i810.h b/driver/xf86-video-intel/src/legacy/i810/i810.h
index 662069518..07132ea98 100644
--- a/driver/xf86-video-intel/src/legacy/i810/i810.h
+++ b/driver/xf86-video-intel/src/legacy/i810/i810.h
@@ -52,6 +52,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "xorg-server.h"
#include <pciaccess.h>
+#include "compat-api.h"
#ifdef XF86DRI
#include "xf86drm.h"
#include "sarea.h"
@@ -301,8 +302,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/driver/xf86-video-intel/src/legacy/i810/i810_dga.c b/driver/xf86-video-intel/src/legacy/i810/i810_dga.c
index d9ddda045..e6bd32d30 100644
--- a/driver/xf86-video-intel/src/legacy/i810/i810_dga.c
+++ b/driver/xf86-video-intel/src/legacy/i810/i810_dga.c
@@ -143,23 +143,23 @@ static DisplayModePtr I810SavedDGAModes[MAXSCREENS];
static Bool
I810_SetMode(ScrnInfoPtr pScrn, DGAModePtr pMode)
{
- int index = pScrn->pScreen->myNum;
+ int idx = pScrn->pScreen->myNum;
I810Ptr pI810 = I810PTR(pScrn);
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->currentMode = I810SavedDGAModes[idx];
+ pScrn->SwitchMode(SWITCH_MODE_ARGS(pScrn, pScrn->currentMode));
+ pScrn->AdjustFrame(ADJUST_FRAME_ARGS(pScrn, 0, 0));
pI810->DGAactive = FALSE;
}
} else {
if (!pI810->DGAactive) {
- I810SavedDGAModes[index] = pScrn->currentMode;
+ I810SavedDGAModes[idx] = pScrn->currentMode;
pI810->DGAactive = TRUE;
}
- pScrn->SwitchMode(index, pMode->mode, 0);
+ pScrn->SwitchMode(SWITCH_MODE_ARGS(pScrn, pMode->mode));
}
return TRUE;
@@ -179,7 +179,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/driver/xf86-video-intel/src/legacy/i810/i810_driver.c b/driver/xf86-video-intel/src/legacy/i810/i810_driver.c
index ae5641b80..41998dcfc 100644
--- a/driver/xf86-video-intel/src/legacy/i810/i810_driver.c
+++ b/driver/xf86-video-intel/src/legacy/i810/i810_driver.c
@@ -78,17 +78,16 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include "../legacy.h"
static Bool I810PreInit(ScrnInfoPtr pScrn, int flags);
-static Bool I810ScreenInit(int Index, ScreenPtr pScreen, int argc,
- char **argv);
-static Bool I810EnterVT(int scrnIndex, int flags);
-static void I810LeaveVT(int scrnIndex, int flags);
-static Bool I810CloseScreen(int scrnIndex, ScreenPtr pScreen);
+static Bool I810ScreenInit(SCREEN_INIT_ARGS_DECL);
+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(int scrnIndex, int flags);
+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 {
@@ -188,19 +187,19 @@ intel_host_bridge (void)
}
static void
-I810ProbeDDC(ScrnInfoPtr pScrn, int index)
+I810ProbeDDC(ScrnInfoPtr pScrn, int ScrnIndex)
{
vbeInfoPtr pVbe;
if (xf86LoadSubModule(pScrn, "vbe")) {
- pVbe = VBEInit(NULL, index);
+ pVbe = VBEInit(NULL, ScrnIndex);
ConfiguredMonitor = vbeDoEDID(pVbe, NULL);
vbeFree(pVbe);
}
}
static xf86MonPtr
-I810DoDDC(ScrnInfoPtr pScrn, int index)
+I810DoDDC(ScrnInfoPtr pScrn, int ScrnIndex)
{
vbeInfoPtr pVbe;
xf86MonPtr MonInfo = NULL;
@@ -211,7 +210,7 @@ I810DoDDC(ScrnInfoPtr pScrn, int index)
return MonInfo;
}
- if (xf86LoadSubModule(pScrn, "vbe") && (pVbe = VBEInit(NULL, index))) {
+ if (xf86LoadSubModule(pScrn, "vbe") && (pVbe = VBEInit(NULL, ScrnIndex))) {
MonInfo = vbeDoEDID(pVbe, NULL);
xf86PrintEDID(MonInfo);
xf86SetDDCproperties(pScrn, MonInfo);
@@ -1393,19 +1392,19 @@ I810LoadPalette15(ScrnInfoPtr pScrn, int numColors, int *indices,
{
I810Ptr pI810;
vgaHWPtr hwp;
- int i, j, index;
+ int i, j, idx;
unsigned char r, g, b;
pI810 = I810PTR(pScrn);
hwp = VGAHWPTR(pScrn);
for (i = 0; i < numColors; i++) {
- index = indices[i];
- r = colors[index].red;
- g = colors[index].green;
- b = colors[index].blue;
+ idx = indices[i];
+ r = colors[idx].red;
+ g = colors[idx].green;
+ b = colors[idx].blue;
for (j = 0; j < 8; j++) {
- hwp->writeDacWriteAddr(hwp, (index << 3) + j);
+ hwp->writeDacWriteAddr(hwp, (idx << 3) + j);
hwp->writeDacData(hwp, r);
hwp->writeDacData(hwp, g);
hwp->writeDacData(hwp, b);
@@ -1419,7 +1418,7 @@ I810LoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices,
{
I810Ptr pI810;
vgaHWPtr hwp;
- int i, index;
+ int i, idx;
unsigned char r, g, b;
pI810 = I810PTR(pScrn);
@@ -1427,52 +1426,52 @@ I810LoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices,
/* Load all four entries in each of the 64 color ranges. -jens */
for (i = 0; i < numColors; i++) {
- index = indices[i / 2];
- r = colors[index].red;
- b = colors[index].blue;
- index = indices[i];
- g = colors[index].green;
+ idx = indices[i / 2];
+ r = colors[idx].red;
+ b = colors[idx].blue;
+ idx = indices[i];
+ g = colors[idx].green;
- hwp->writeDacWriteAddr(hwp, index << 2);
+ hwp->writeDacWriteAddr(hwp, idx << 2);
hwp->writeDacData(hwp, r);
hwp->writeDacData(hwp, g);
hwp->writeDacData(hwp, b);
- hwp->writeDacWriteAddr(hwp, (index << 2) + 1);
+ hwp->writeDacWriteAddr(hwp, (idx << 2) + 1);
hwp->writeDacData(hwp, r);
hwp->writeDacData(hwp, g);
hwp->writeDacData(hwp, b);
- hwp->writeDacWriteAddr(hwp, (index << 2) + 2);
+ hwp->writeDacWriteAddr(hwp, (idx << 2) + 2);
hwp->writeDacData(hwp, r);
hwp->writeDacData(hwp, g);
hwp->writeDacData(hwp, b);
- hwp->writeDacWriteAddr(hwp, (index << 2) + 3);
+ hwp->writeDacWriteAddr(hwp, (idx << 2) + 3);
hwp->writeDacData(hwp, r);
hwp->writeDacData(hwp, g);
hwp->writeDacData(hwp, b);
i++;
- index = indices[i];
- g = colors[index].green;
+ idx = indices[i];
+ g = colors[idx].green;
- hwp->writeDacWriteAddr(hwp, index << 2);
+ hwp->writeDacWriteAddr(hwp, idx << 2);
hwp->writeDacData(hwp, r);
hwp->writeDacData(hwp, g);
hwp->writeDacData(hwp, b);
- hwp->writeDacWriteAddr(hwp, (index << 2) + 1);
+ hwp->writeDacWriteAddr(hwp, (idx << 2) + 1);
hwp->writeDacData(hwp, r);
hwp->writeDacData(hwp, g);
hwp->writeDacData(hwp, b);
- hwp->writeDacWriteAddr(hwp, (index << 2) + 2);
+ hwp->writeDacWriteAddr(hwp, (idx << 2) + 2);
hwp->writeDacData(hwp, r);
hwp->writeDacData(hwp, g);
hwp->writeDacData(hwp, b);
- hwp->writeDacWriteAddr(hwp, (index << 2) + 3);
+ hwp->writeDacWriteAddr(hwp, (idx << 2) + 3);
hwp->writeDacData(hwp, r);
hwp->writeDacData(hwp, g);
hwp->writeDacData(hwp, b);
@@ -1485,18 +1484,18 @@ I810LoadPalette24(ScrnInfoPtr pScrn, int numColors, int *indices,
{
I810Ptr pI810;
vgaHWPtr hwp;
- int i, index;
+ int i, idx;
unsigned char r, g, b;
pI810 = I810PTR(pScrn);
hwp = VGAHWPTR(pScrn);
for (i = 0; i < numColors; i++) {
- index = indices[i];
- r = colors[index].red;
- g = colors[index].green;
- b = colors[index].blue;
- hwp->writeDacWriteAddr(hwp, index);
+ idx = indices[i];
+ r = colors[idx].red;
+ g = colors[idx].green;
+ b = colors[idx].blue;
+ hwp->writeDacWriteAddr(hwp, idx);
hwp->writeDacData(hwp, r);
hwp->writeDacData(hwp, g);
hwp->writeDacData(hwp, b);
@@ -1593,7 +1592,7 @@ I810AllocateFront(ScrnInfoPtr pScrn)
}
static Bool
-I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
+I810ScreenInit(SCREEN_INIT_ARGS_DECL)
{
ScrnInfoPtr pScrn;
vgaHWPtr hwp;
@@ -1601,7 +1600,7 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
VisualPtr visual;
MessageType driFrom = X_DEFAULT;
- pScrn = xf86Screens[pScreen->myNum];
+ pScrn = xf86ScreenToScrn(screen);
pI810 = I810PTR(pScrn);
hwp = VGAHWPTR(pScrn);
@@ -1647,7 +1646,7 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
pI810->directRenderingEnabled = !pI810->directRenderingDisabled;
if (pI810->directRenderingEnabled==TRUE)
- pI810->directRenderingEnabled = I810DRIScreenInit(pScreen);
+ pI810->directRenderingEnabled = I810DRIScreenInit(screen);
else
driFrom = X_CONFIG;
@@ -1674,10 +1673,10 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (!I810ModeInit(pScrn, pScrn->currentMode))
return FALSE;
- I810SaveScreen(pScreen, FALSE);
- I810AdjustFrame(scrnIndex, pScrn->frameX0, pScrn->frameY0, 0);
+ I810SaveScreen(screen, FALSE);
+ I810AdjustFrame(ADJUST_FRAME_ARGS(pScrn, pScrn->frameX0, pScrn->frameY0));
- if (!fbScreenInit(pScreen, pI810->FbBase + pScrn->fbOffset,
+ if (!fbScreenInit(screen, pI810->FbBase + pScrn->fbOffset,
pScrn->virtualX, pScrn->virtualY,
pScrn->xDpi, pScrn->yDpi,
pScrn->displayWidth, pScrn->bitsPerPixel))
@@ -1685,8 +1684,8 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (pScrn->bitsPerPixel > 8) {
/* Fixup RGB ordering */
- visual = pScreen->visuals + pScreen->numVisuals;
- while (--visual >= pScreen->visuals) {
+ visual = screen->visuals + screen->numVisuals;
+ while (--visual >= screen->visuals) {
if ((visual->class | DynamicClass) == DirectColor) {
visual->offsetRed = pScrn->offset.red;
visual->offsetGreen = pScrn->offset.green;
@@ -1698,15 +1697,15 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
}
}
- fbPictureInit(pScreen, NULL, 0);
+ fbPictureInit(screen, NULL, 0);
- xf86SetBlackWhitePixels(pScreen);
+ xf86SetBlackWhitePixels(screen);
#ifdef XF86DRI
if (pI810->LpRing->mem.Start == 0 && pI810->directRenderingEnabled) {
pI810->directRenderingEnabled = FALSE;
driFrom = X_PROBED;
- I810DRICloseScreen(pScreen);
+ I810DRICloseScreen(screen);
}
if (!pI810->directRenderingEnabled) {
@@ -1719,10 +1718,10 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
#endif
#ifdef XFreeXDGA
- I810DGAInit(pScreen);
+ I810DGAInit(screen);
#endif
- if (!xf86InitFBManager(pScreen, &(pI810->FbMemBox))) {
+ if (!xf86InitFBManager(screen, &(pI810->FbMemBox))) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Failed to init memory manager\n");
return FALSE;
@@ -1732,7 +1731,7 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (pI810->LpRing->mem.Size != 0) {
I810SetRingRegs(pScrn);
- if (!I810AccelInit(pScreen)) {
+ if (!I810AccelInit(screen)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Hardware acceleration initialization failed\n");
} else /* PK added 16.02.2004 */
@@ -1740,57 +1739,57 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
}
}
- miInitializeBackingStore(pScreen);
- xf86SetBackingStore(pScreen);
- xf86SetSilkenMouse(pScreen);
+ miInitializeBackingStore(screen);
+ xf86SetBackingStore(screen);
+ xf86SetSilkenMouse(screen);
- miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
+ miDCInitialize(screen, xf86GetPointerScreenFuncs());
if (!xf86ReturnOptValBool(pI810->Options, OPTION_SW_CURSOR, FALSE)) {
- if (!I810CursorInit(pScreen)) {
+ if (!I810CursorInit(screen)) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
"Hardware cursor initialization failed\n");
}
}
- if (!miCreateDefColormap(pScreen))
+ if (!miCreateDefColormap(screen))
return FALSE;
/* Use driver specific palette load routines for Direct Color support. -jens */
if (pScrn->bitsPerPixel == 16) {
if (pScrn->depth == 15) {
- if (!xf86HandleColormaps(pScreen, 256, 8, I810LoadPalette15, NULL,
+ if (!xf86HandleColormaps(screen, 256, 8, I810LoadPalette15, NULL,
CMAP_PALETTED_TRUECOLOR |
CMAP_RELOAD_ON_MODE_SWITCH))
return FALSE;
} else {
- if (!xf86HandleColormaps(pScreen, 256, 8, I810LoadPalette16, NULL,
+ if (!xf86HandleColormaps(screen, 256, 8, I810LoadPalette16, NULL,
CMAP_PALETTED_TRUECOLOR |
CMAP_RELOAD_ON_MODE_SWITCH))
return FALSE;
}
} else {
- if (!xf86HandleColormaps(pScreen, 256, 8, I810LoadPalette24, NULL,
+ if (!xf86HandleColormaps(screen, 256, 8, I810LoadPalette24, NULL,
CMAP_PALETTED_TRUECOLOR |
CMAP_RELOAD_ON_MODE_SWITCH))
return FALSE;
}
- xf86DPMSInit(pScreen, I810DisplayPowerManagementSet, 0);
+ xf86DPMSInit(screen, I810DisplayPowerManagementSet, 0);
- I810InitVideo(pScreen);
+ I810InitVideo(screen);
#ifdef XF86DRI
if (pI810->directRenderingEnabled) {
/* Now that mi, fb, drm and others have done their thing,
* complete the DRI setup.
*/
- pI810->directRenderingEnabled = I810DRIFinishScreenInit(pScreen);
+ pI810->directRenderingEnabled = I810DRIFinishScreenInit(screen);
}
#ifdef XvMCExtension
if ((pI810->directRenderingEnabled) && (pI810->numSurfaces)) {
/* Initialize the hardware motion compensation code */
- I810InitMC(pScreen);
+ I810InitMC(screen);
}
#endif
#endif
@@ -1801,9 +1800,9 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Direct rendering disabled\n");
}
- pScreen->SaveScreen = I810SaveScreen;
- pI810->CloseScreen = pScreen->CloseScreen;
- pScreen->CloseScreen = I810CloseScreen;
+ screen->SaveScreen = I810SaveScreen;
+ pI810->CloseScreen = screen->CloseScreen;
+ screen->CloseScreen = I810CloseScreen;
if (serverGeneration == 1)
xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);
@@ -1812,14 +1811,14 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
}
Bool
-I810SwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
+I810SwitchMode(SWITCH_MODE_ARGS_DECL)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ SCRN_INFO_PTR(arg);
#if 0
- I810Ptr pI810 = I810PTR(pScrn);
+ 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
/*
@@ -1839,17 +1838,17 @@ I810SwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
}
# endif
if (pI810->AccelInfoRec != NULL) {
- I810RefreshRing(pScrn);
- I810Sync(pScrn);
+ I810RefreshRing(scrn);
+ I810Sync(scrn);
pI810->AccelInfoRec->NeedToSync = FALSE;
}
- I810Restore(pScrn);
+ I810Restore(scrn);
# ifdef XF86DRI
if (pI810->directRenderingEnabled) {
- if (!I810DRILeave(pScrn))
+ if (!I810DRILeave(scrn))
return FALSE;
- if (!I810DRIEnter(pScrn))
+ if (!I810DRIEnter(scrn))
return FALSE;
if (I810_DEBUG & DEBUG_VERBOSE_DRI)
@@ -1859,33 +1858,33 @@ I810SwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
}
# endif
#endif
- return I810ModeInit(pScrn, mode);
+ return I810ModeInit(scrn, mode);
}
void
-I810AdjustFrame(int scrnIndex, int x, int y, int flags)
+I810AdjustFrame(ADJUST_FRAME_ARGS_DECL)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
- I810Ptr pI810 = I810PTR(pScrn);
- vgaHWPtr hwp = VGAHWPTR(pScrn);
+ SCRN_INFO_PTR(arg);
+ I810Ptr pI810 = I810PTR(scrn);
+ vgaHWPtr hwp = VGAHWPTR(scrn);
int Base;
#if 1
if (pI810->showCache) {
int lastline = pI810->FbMapSize /
- ((pScrn->displayWidth * pScrn->bitsPerPixel) / 8);
- lastline -= pScrn->currentMode->VDisplay;
+ ((scrn->displayWidth * scrn->bitsPerPixel) / 8);
+ lastline -= scrn->currentMode->VDisplay;
if (y > 0)
- y += pScrn->currentMode->VDisplay;
+ y += scrn->currentMode->VDisplay;
if (y > lastline) y = lastline;
}
#endif
- Base = (y * pScrn->displayWidth + x) >> 2;
+ 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 (pScrn->bitsPerPixel) {
+ switch (scrn->bitsPerPixel) {
case 8:
break;
case 16:
@@ -1915,44 +1914,43 @@ 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 pScrn = xf86Screens[scrnIndex];
-
+ SCRN_INFO_PTR(arg);
#ifdef XF86DRI
- I810Ptr pI810 = I810PTR(pScrn);
+ I810Ptr pI810 = I810PTR(scrn);
#endif
if (I810_DEBUG & DEBUG_VERBOSE_DRI)
ErrorF("\n\nENTER VT\n");
- if (!I810BindGARTMemory(pScrn)) {
+ if (!I810BindGARTMemory(scrn)) {
return FALSE;
}
#ifdef XF86DRI
- if (!I810DRIEnter(pScrn)) {
+ if (!I810DRIEnter(scrn)) {
return FALSE;
}
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(pScrn, pScrn->currentMode))
+ if (!I810ModeInit(scrn, scrn->currentMode))
return FALSE;
- I810AdjustFrame(scrnIndex, pScrn->frameX0, pScrn->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 pScrn = xf86Screens[scrnIndex];
- vgaHWPtr hwp = VGAHWPTR(pScrn);
- I810Ptr pI810 = I810PTR(pScrn);
+ SCRN_INFO_PTR(arg);
+ vgaHWPtr hwp = VGAHWPTR(scrn);
+ I810Ptr pI810 = I810PTR(scrn);
if (I810_DEBUG & DEBUG_VERBOSE_DRI)
ErrorF("\n\n\nLeave VT\n");
@@ -1961,22 +1959,22 @@ 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
if (pI810->AccelInfoRec != NULL) {
- I810RefreshRing(pScrn);
- I810Sync(pScrn);
+ I810RefreshRing(scrn);
+ I810Sync(scrn);
pI810->AccelInfoRec->NeedToSync = FALSE;
}
- I810Restore(pScrn);
+ I810Restore(scrn);
- if (!I810UnbindGARTMemory(pScrn))
+ if (!I810UnbindGARTMemory(scrn))
return;
#ifdef XF86DRI
- if (!I810DRILeave(pScrn))
+ if (!I810DRILeave(scrn))
return;
#endif
@@ -1984,9 +1982,9 @@ I810LeaveVT(int scrnIndex, int flags)
}
static Bool
-I810CloseScreen(int scrnIndex, ScreenPtr pScreen)
+I810CloseScreen(CLOSE_SCREEN_ARGS_DECL)
{
- ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+ ScrnInfoPtr pScrn = xf86ScreenToScrn(screen);
vgaHWPtr hwp = VGAHWPTR(pScrn);
I810Ptr pI810 = I810PTR(pScrn);
XAAInfoRecPtr infoPtr = pI810->AccelInfoRec;
@@ -2002,7 +2000,7 @@ I810CloseScreen(int scrnIndex, ScreenPtr pScreen)
}
#ifdef XF86DRI
if (pI810->directRenderingEnabled) {
- I810DRICloseScreen(pScreen);
+ I810DRICloseScreen(screen);
pI810->directRenderingEnabled = FALSE;
}
#endif
@@ -2042,30 +2040,32 @@ I810CloseScreen(int scrnIndex, ScreenPtr pScreen)
/* Need to actually close the gart fd, or the unbound memory will just sit
* around. Will prevent the Xserver from recycling.
*/
- xf86GARTCloseScreen(scrnIndex);
+ xf86GARTCloseScreen(pScrn->scrnIndex);
free(pI810->LpRing);
pI810->LpRing = NULL;
pScrn->vtSema = FALSE;
- pScreen->CloseScreen = pI810->CloseScreen;
- return (*pScreen->CloseScreen) (scrnIndex, pScreen);
+ screen->CloseScreen = pI810->CloseScreen;
+ 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/driver/xf86-video-intel/src/legacy/i810/i810_video.c b/driver/xf86-video-intel/src/legacy/i810/i810_video.c
index 91af7da58..6faaf687f 100644
--- a/driver/xf86-video-intel/src/legacy/i810/i810_video.c
+++ b/driver/xf86-video-intel/src/legacy/i810/i810_video.c
@@ -79,7 +79,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)
@@ -1146,23 +1146,19 @@ I810QueryImageAttributes(
}
static void
-I810BlockHandler (
- int i,
- pointer blockData,
- pointer pTimeout,
- pointer pReadmask
-){
- ScreenPtr pScreen = 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);
- pScreen->BlockHandler = pI810->BlockHandler;
+ screen->BlockHandler = pI810->BlockHandler;
- (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask);
+ (*screen->BlockHandler) (BLOCKHANDLER_ARGS);
- pScreen->BlockHandler = I810BlockHandler;
+ screen->BlockHandler = I810BlockHandler;
if(pPriv->videoStatus & TIMER_MASK) {
UpdateCurrentTime();
@@ -1384,7 +1380,7 @@ I810DisplaySurface(
pPriv->isOn = TRUE;
/* we've prempted the XvImage stream so set its free timer */
if(pI810Priv->videoStatus & CLIENT_VIDEO_ON) {
- REGION_EMPTY(pScrn->pScreen, & pI810Priv->clip);
+ REGION_EMPTY(pScrn->screen, & pI810Priv->clip);
UpdateCurrentTime();
pI810Priv->videoStatus = FREE_TIMER;
pI810Priv->freeTime = currentTime.milliseconds + FREE_DELAY;
diff --git a/driver/xf86-video-intel/uxa/uxa-priv.h b/driver/xf86-video-intel/uxa/uxa-priv.h
index 6b9a9c11f..cb34cd9d3 100644
--- a/driver/xf86-video-intel/uxa/uxa-priv.h
+++ b/driver/xf86-video-intel/uxa/uxa-priv.h
@@ -59,6 +59,8 @@
#endif
#include "damage.h"
+#include "../src/compat-api.h"
+
/* Provide substitutes for gcc's __FUNCTION__ on other compilers */
#if !defined(__GNUC__) && !defined(__FUNCTION__)
# if defined(__STDC__) && (__STDC_VERSION__>=199901L) /* C99 */
@@ -109,7 +111,7 @@ typedef struct {
#define UXA_NUM_SOLID_CACHE 16
-typedef void (*EnableDisableFBAccessProcPtr) (int, Bool);
+typedef void (*EnableDisableFBAccessProcPtr) (SCRN_ARG_TYPE, Bool);
typedef struct {
uxa_driver_t *info;
CreateGCProcPtr SavedCreateGC;
diff --git a/driver/xf86-video-intel/uxa/uxa.c b/driver/xf86-video-intel/uxa/uxa.c
index 856a0ce5b..678991edf 100644
--- a/driver/xf86-video-intel/uxa/uxa.c
+++ b/driver/xf86-video-intel/uxa/uxa.c
@@ -333,10 +333,10 @@ static RegionPtr uxa_bitmap_to_region(PixmapPtr pPix)
return ret;
}
-static void uxa_xorg_enable_disable_fb_access(int index, Bool enable)
+static void uxa_xorg_enable_disable_fb_access(SCRN_ARG_TYPE arg, Bool enable)
{
- ScreenPtr screen = screenInfo.screens[index];
- uxa_screen_t *uxa_screen = uxa_get_screen(screen);
+ SCRN_INFO_PTR(arg);
+ uxa_screen_t *uxa_screen = uxa_get_screen(scrn->pScreen);
if (!enable && uxa_screen->disableFbCount++ == 0)
uxa_screen->swappedOut = TRUE;
@@ -345,7 +345,7 @@ static void uxa_xorg_enable_disable_fb_access(int index, Bool enable)
uxa_screen->swappedOut = FALSE;
if (uxa_screen->SavedEnableDisableFBAccess)
- uxa_screen->SavedEnableDisableFBAccess(index, enable);
+ uxa_screen->SavedEnableDisableFBAccess(arg, enable);
}
void uxa_set_fallback_debug(ScreenPtr screen, Bool enable)
@@ -366,12 +366,12 @@ 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);
- ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
+ uxa_screen_t *uxa_screen = uxa_get_screen(screen);
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
#ifdef RENDER
- PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
+ PictureScreenPtr ps = GetPictureScreenIfSet(screen);
#endif
int n;
@@ -384,28 +384,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;
scrn->EnableDisableFBAccess = uxa_screen->SavedEnableDisableFBAccess;
#ifdef RENDER
if (ps) {
@@ -422,7 +422,7 @@ static Bool uxa_close_screen(int i, ScreenPtr pScreen)
free(uxa_screen);
- return (*pScreen->CloseScreen) (i, pScreen);
+ return (*screen->CloseScreen) (CLOSE_SCREEN_ARGS);
}
/**