summaryrefslogtreecommitdiff
path: root/src/legacy
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-05-22 15:35:01 +0100
committerDave Airlie <airlied@redhat.com>2012-06-05 11:31:45 +0100
commit8f5001493e18b6b3b97ca5f0c923678a51975bd0 (patch)
tree02a82c3e163c1318242ceeb8638fe7be639d059a /src/legacy
parentc9824827422f8ec4f46c9cba42d871c98dc54761 (diff)
intel: port legacy and uxa to new API.
This ports the legacy and uxa driver to the new server API. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/legacy')
-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
4 files changed, 47 insertions, 51 deletions
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;