aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/common
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xfree86/common')
-rw-r--r--xorg-server/hw/xfree86/common/xf86DGA.c2
-rw-r--r--xorg-server/hw/xfree86/common/xf86Helper.c4
-rw-r--r--xorg-server/hw/xfree86/common/xf86Init.c21
-rw-r--r--xorg-server/hw/xfree86/common/xf86VGAarbiter.c169
-rw-r--r--xorg-server/hw/xfree86/common/xf86VGAarbiter.h96
-rw-r--r--xorg-server/hw/xfree86/common/xf86VGAarbiterPriv.h513
-rw-r--r--xorg-server/hw/xfree86/common/xf86Xinput.c1
-rw-r--r--xorg-server/hw/xfree86/common/xf86xv.c9
8 files changed, 403 insertions, 412 deletions
diff --git a/xorg-server/hw/xfree86/common/xf86DGA.c b/xorg-server/hw/xfree86/common/xf86DGA.c
index bc2aa3ba6..1d46a67d3 100644
--- a/xorg-server/hw/xfree86/common/xf86DGA.c
+++ b/xorg-server/hw/xfree86/common/xf86DGA.c
@@ -1095,7 +1095,7 @@ DGAProcessPointerEvent (ScreenPtr pScreen, DGAEvent *event, DeviceIntPtr mouse)
ev.header = ET_Internal;
ev.length = sizeof(ev);
ev.type = event->subtype;
- ev.corestate = butc->state;
+ ev.corestate = butc ? butc->state : 0;
if (master && master->key)
ev.corestate |= XkbStateFieldFromRec(&master->key->xkbInfo->state);
diff --git a/xorg-server/hw/xfree86/common/xf86Helper.c b/xorg-server/hw/xfree86/common/xf86Helper.c
index c84f4a0ab..51a503eb9 100644
--- a/xorg-server/hw/xfree86/common/xf86Helper.c
+++ b/xorg-server/hw/xfree86/common/xf86Helper.c
@@ -1267,7 +1267,7 @@ xf86MsgVerb(MessageType type, int verb, const char *format, ...)
va_list ap;
va_start(ap, format);
- xf86VDrvMsgVerb(-1, type, verb, format, ap);
+ LogVMessageVerb(type, verb, format, ap);
va_end(ap);
}
@@ -1278,7 +1278,7 @@ xf86Msg(MessageType type, const char *format, ...)
va_list ap;
va_start(ap, format);
- xf86VDrvMsgVerb(-1, type, 1, format, ap);
+ LogVMessageVerb(type, 1, format, ap);
va_end(ap);
}
diff --git a/xorg-server/hw/xfree86/common/xf86Init.c b/xorg-server/hw/xfree86/common/xf86Init.c
index fd3281b83..ab5b5a34d 100644
--- a/xorg-server/hw/xfree86/common/xf86Init.c
+++ b/xorg-server/hw/xfree86/common/xf86Init.c
@@ -314,18 +314,10 @@ InstallSignalHandlers(void)
signal(SIGEMT, SIG_DFL);
#endif
signal(SIGFPE, SIG_DFL);
-#ifdef SIGBUS
signal(SIGBUS, SIG_DFL);
-#endif
-#ifdef SIGSYS
signal(SIGSYS, SIG_DFL);
-#endif
-#ifdef SIGXCPU
signal(SIGXCPU, SIG_DFL);
-#endif
-#ifdef SIGXFSZ
signal(SIGXFSZ, SIG_DFL);
-#endif
}
}
@@ -863,9 +855,7 @@ OsVendorInit(void)
{
static Bool beenHere = FALSE;
-#ifdef SIGCHLD
signal(SIGCHLD, SIG_DFL); /* Need to wait for child processes */
-#endif
if (!beenHere) {
umask(022);
@@ -1046,11 +1036,6 @@ xf86PrintDefaultLibraryPath(void)
int
ddxProcessArgument(int argc, char **argv, int i)
{
- /*
- * Note: can't use xalloc/xfree here because OsInit() hasn't been called
- * yet. Use malloc/free instead.
- */
-
#define CHECK_FOR_REQUIRED_ARGUMENT() \
if (((i + 1) >= argc) || (!argv[i + 1])) { \
ErrorF("Required argument to %s not specified\n", argv[i]); \
@@ -1067,10 +1052,9 @@ ddxProcessArgument(int argc, char **argv, int i)
{
char *mp;
CHECK_FOR_REQUIRED_ARGUMENT();
- mp = malloc(strlen(argv[i + 1]) + 1);
+ mp = strdup(argv[i + 1]);
if (!mp)
FatalError("Can't allocate memory for ModulePath\n");
- strcpy(mp, argv[i + 1]);
xf86ModulePath = mp;
xf86ModPathFrom = X_CMDLINE;
return 2;
@@ -1079,10 +1063,9 @@ ddxProcessArgument(int argc, char **argv, int i)
{
char *lf;
CHECK_FOR_REQUIRED_ARGUMENT();
- lf = malloc(strlen(argv[i + 1]) + 1);
+ lf = strdup(argv[i + 1]);
if (!lf)
FatalError("Can't allocate memory for LogFile\n");
- strcpy(lf, argv[i + 1]);
xf86LogFile = lf;
xf86LogFileFrom = X_CMDLINE;
return 2;
diff --git a/xorg-server/hw/xfree86/common/xf86VGAarbiter.c b/xorg-server/hw/xfree86/common/xf86VGAarbiter.c
index d75b86502..1af525e49 100644
--- a/xorg-server/hw/xfree86/common/xf86VGAarbiter.c
+++ b/xorg-server/hw/xfree86/common/xf86VGAarbiter.c
@@ -138,11 +138,12 @@ xf86VGAarbiterScrnInit(ScrnInfoPtr pScrn)
}
void
-xf86VGAarbiterDeviceDecodes(ScrnInfoPtr pScrn)
+xf86VGAarbiterDeviceDecodes(ScrnInfoPtr pScrn, int rsrc)
{
if (vga_no_arb)
return;
- pci_device_vgaarb_decodes(VGA_ARB_RSRC_LEGACY_MEM | VGA_ARB_RSRC_LEGACY_IO);
+ pci_device_vgaarb_set_target(pScrn->vgaDev);
+ pci_device_vgaarb_decodes(rsrc);
}
Bool
@@ -266,7 +267,7 @@ VGAarbiterBlockHandler(int i,
{
ScreenPtr pScreen = screenInfo.screens[i];
SCREEN_PROLOG(BlockHandler);
- VGAGet();
+ VGAGet(pScreen);
pScreen->BlockHandler(i, blockData, pTimeout, pReadmask);
VGAPut();
SCREEN_EPILOG(BlockHandler, VGAarbiterBlockHandler);
@@ -277,7 +278,7 @@ VGAarbiterWakeupHandler(int i, pointer blockData, unsigned long result, pointer
{
ScreenPtr pScreen = screenInfo.screens[i];
SCREEN_PROLOG(WakeupHandler);
- VGAGet();
+ VGAGet(pScreen);
pScreen->WakeupHandler(i, blockData, result, pReadmask);
VGAPut();
SCREEN_EPILOG(WakeupHandler, VGAarbiterWakeupHandler);
@@ -295,7 +296,7 @@ VGAarbiterGetImage (
ScreenPtr pScreen = pDrawable->pScreen;
SCREEN_PROLOG(GetImage);
// if (xf86Screens[pScreen->myNum]->vtSema) {
- VGAGet();
+ VGAGet(pScreen);
// }
(*pScreen->GetImage) (pDrawable, sx, sy, w, h,
format, planemask, pdstLine);
@@ -316,7 +317,7 @@ VGAarbiterGetSpans (
ScreenPtr pScreen = pDrawable->pScreen;
SCREEN_PROLOG (GetSpans);
- VGAGet();
+ VGAGet(pScreen);
(*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
VGAPut();
SCREEN_EPILOG (GetSpans, VGAarbiterGetSpans);
@@ -329,7 +330,7 @@ VGAarbiterSourceValidate (
{
ScreenPtr pScreen = pDrawable->pScreen;
SCREEN_PROLOG (SourceValidate);
- VGAGet();
+ VGAGet(pScreen);
if (pScreen->SourceValidate)
(*pScreen->SourceValidate) (pDrawable, x, y, width, height);
VGAPut();
@@ -345,7 +346,7 @@ VGAarbiterCopyWindow(
ScreenPtr pScreen = pWin->drawable.pScreen;
SCREEN_PROLOG (CopyWindow);
- VGAGet();
+ VGAGet(pScreen);
(*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
VGAPut();
SCREEN_EPILOG (CopyWindow, VGAarbiterCopyWindow);
@@ -361,7 +362,7 @@ VGAarbiterClearToBackground (
ScreenPtr pScreen = pWin->drawable.pScreen;
SCREEN_PROLOG ( ClearToBackground);
- VGAGet();
+ VGAGet(pScreen);
(*pScreen->ClearToBackground) (pWin, x, y, w, h, generateExposures);
VGAPut();
SCREEN_EPILOG (ClearToBackground, VGAarbiterClearToBackground);
@@ -373,7 +374,7 @@ VGAarbiterCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usag
PixmapPtr pPix;
SCREEN_PROLOG ( CreatePixmap);
- VGAGet();
+ VGAGet(pScreen);
pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint);
VGAPut();
SCREEN_EPILOG (CreatePixmap, VGAarbiterCreatePixmap);
@@ -387,7 +388,7 @@ VGAarbiterSaveScreen(ScreenPtr pScreen, Bool unblank)
Bool val;
SCREEN_PROLOG (SaveScreen);
- VGAGet();
+ VGAGet(pScreen);
val = (*pScreen->SaveScreen) (pScreen, unblank);
VGAPut();
SCREEN_EPILOG (SaveScreen, VGAarbiterSaveScreen);
@@ -404,7 +405,7 @@ VGAarbiterStoreColors (
ScreenPtr pScreen = pmap->pScreen;
SCREEN_PROLOG (StoreColors);
- VGAGet();
+ VGAGet(pScreen);
(*pScreen->StoreColors) (pmap,ndef,pdefs);
VGAPut();
SCREEN_EPILOG ( StoreColors, VGAarbiterStoreColors);
@@ -419,7 +420,7 @@ VGAarbiterRecolorCursor (
)
{
SCREEN_PROLOG (RecolorCursor);
- VGAGet();
+ VGAGet(pScreen);
(*pScreen->RecolorCursor) (pDev, pScreen, pCurs, displayed);
VGAPut();
SCREEN_EPILOG ( RecolorCursor, VGAarbiterRecolorCursor);
@@ -435,7 +436,7 @@ VGAarbiterRealizeCursor (
Bool val;
SCREEN_PROLOG (RealizeCursor);
- VGAGet();
+ VGAGet(pScreen);
val = (*pScreen->RealizeCursor) (pDev, pScreen,pCursor);
VGAPut();
SCREEN_EPILOG ( RealizeCursor, VGAarbiterRealizeCursor);
@@ -452,7 +453,7 @@ VGAarbiterUnrealizeCursor (
Bool val;
SCREEN_PROLOG (UnrealizeCursor);
- VGAGet();
+ VGAGet(pScreen);
val = (*pScreen->UnrealizeCursor) (pDev, pScreen, pCursor);
VGAPut();
SCREEN_EPILOG ( UnrealizeCursor, VGAarbiterUnrealizeCursor);
@@ -469,7 +470,7 @@ VGAarbiterDisplayCursor (
Bool val;
SCREEN_PROLOG (DisplayCursor);
- VGAGet();
+ VGAGet(pScreen);
val = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor);
VGAPut();
SCREEN_EPILOG ( DisplayCursor, VGAarbiterDisplayCursor);
@@ -486,7 +487,7 @@ VGAarbiterSetCursorPosition (
Bool val;
SCREEN_PROLOG (SetCursorPosition);
- VGAGet();
+ VGAGet(pScreen);
val = (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent);
VGAPut();
SCREEN_EPILOG ( SetCursorPosition, VGAarbiterSetCursorPosition);
@@ -500,7 +501,7 @@ VGAarbiterAdjustFrame(int index, int x, int y, int flags)
VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
&pScreen->devPrivates, VGAarbiterScreenKey);
- VGAGet();
+ VGAGet(pScreen);
(*pScreenPriv->AdjustFrame)(index, x, y, flags);
VGAPut();
}
@@ -513,7 +514,7 @@ VGAarbiterSwitchMode(int index, DisplayModePtr mode, int flags)
VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
&pScreen->devPrivates, VGAarbiterScreenKey);
- VGAGet();
+ VGAGet(pScreen);
val = (*pScreenPriv->SwitchMode)(index, mode, flags);
VGAPut();
return val;
@@ -528,7 +529,7 @@ VGAarbiterEnterVT(int index, int flags)
VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
&pScreen->devPrivates, VGAarbiterScreenKey);
- VGAGet();
+ VGAGet(pScreen);
pScrn->EnterVT = pScreenPriv->EnterVT;
val = (*pScrn->EnterVT)(index, flags);
pScreenPriv->EnterVT = pScrn->EnterVT;
@@ -545,7 +546,7 @@ VGAarbiterLeaveVT(int index, int flags)
VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
&pScreen->devPrivates, VGAarbiterScreenKey);
- VGAGet();
+ VGAGet(pScreen);
pScrn->LeaveVT = pScreenPriv->LeaveVT;
(*pScreenPriv->LeaveVT)(index, flags);
pScreenPriv->LeaveVT = pScrn->LeaveVT;
@@ -560,7 +561,7 @@ VGAarbiterFreeScreen(int index, int flags)
VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
&pScreen->devPrivates, VGAarbiterScreenKey);
- VGAGet();
+ VGAGet(pScreen);
(*pScreenPriv->FreeScreen)(index, flags);
VGAPut();
}
@@ -573,7 +574,7 @@ VGAarbiterCreateGC(GCPtr pGC)
Bool ret;
SCREEN_PROLOG(CreateGC);
- VGAGet();
+ VGAGet(pScreen);
ret = (*pScreen->CreateGC)(pGC);
VGAPut();
GC_WRAP(pGC);
@@ -662,10 +663,11 @@ VGAarbiterFillSpans(
int *pwidthInit,
int fSorted )
{
+ ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC);
- VGAGet_GC();
+ VGAGet(pScreen);
(*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
- VGAPut_GC();
+ VGAPut();
GC_WRAP(pGC);
}
@@ -679,10 +681,11 @@ VGAarbiterSetSpans(
int nspans,
int fSorted )
{
+ ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC);
- VGAGet_GC();
+ VGAGet(pScreen);
(*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
- VGAPut_GC();
+ VGAPut();
GC_WRAP(pGC);
}
@@ -696,11 +699,12 @@ VGAarbiterPutImage(
int format,
char *pImage )
{
+ ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC);
- VGAGet_GC();
+ VGAGet(pScreen);
(*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
leftPad, format, pImage);
- VGAPut_GC();
+ VGAPut();
GC_WRAP(pGC);
}
@@ -714,12 +718,12 @@ VGAarbiterCopyArea(
int dstx, int dsty )
{
RegionPtr ret;
-
+ ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC);
- VGAGet_GC();
+ VGAGet(pScreen);
ret = (*pGC->ops->CopyArea)(pSrc, pDst,
pGC, srcx, srcy, width, height, dstx, dsty);
- VGAPut_GC();
+ VGAPut();
GC_WRAP(pGC);
return ret;
}
@@ -735,12 +739,12 @@ VGAarbiterCopyPlane(
unsigned long bitPlane )
{
RegionPtr ret;
-
+ ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC);
- VGAGet_GC();
+ VGAGet(pScreen);
ret = (*pGC->ops->CopyPlane)(pSrc, pDst, pGC, srcx, srcy,
width, height, dstx, dsty, bitPlane);
- VGAPut_GC();
+ VGAPut();
GC_WRAP(pGC);
return ret;
}
@@ -753,10 +757,11 @@ VGAarbiterPolyPoint(
int npt,
xPoint *pptInit )
{
+ ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC);
- VGAGet_GC();
+ VGAGet(pScreen);
(*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
- VGAPut_GC();
+ VGAPut();
GC_WRAP(pGC);
}
@@ -769,10 +774,11 @@ VGAarbiterPolylines(
int npt,
DDXPointPtr pptInit )
{
+ ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC);
- VGAGet_GC();
+ VGAGet(pScreen);
(*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
- VGAPut_GC();
+ VGAPut();
GC_WRAP(pGC);
}
@@ -783,10 +789,11 @@ VGAarbiterPolySegment(
int nseg,
xSegment *pSeg )
{
+ ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC);
- VGAGet_GC();
+ VGAGet(pScreen);
(*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
- VGAPut_GC();
+ VGAPut();
GC_WRAP(pGC);
}
@@ -797,10 +804,11 @@ VGAarbiterPolyRectangle(
int nRectsInit,
xRectangle *pRectsInit )
{
+ ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC);
- VGAGet_GC();
+ VGAGet(pScreen);
(*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
- VGAPut_GC();
+ VGAPut();
GC_WRAP(pGC);
}
@@ -811,10 +819,11 @@ VGAarbiterPolyArc(
int narcs,
xArc *parcs )
{
+ ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC);
- VGAGet_GC();
+ VGAGet(pScreen);
(*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
- VGAPut_GC();
+ VGAPut();
GC_WRAP(pGC);
}
@@ -827,10 +836,11 @@ VGAarbiterFillPolygon(
int count,
DDXPointPtr ptsIn )
{
+ ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC);
- VGAGet_GC();
+ VGAGet(pScreen);
(*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
- VGAPut_GC();
+ VGAPut();
GC_WRAP(pGC);
}
@@ -841,10 +851,11 @@ VGAarbiterPolyFillRect(
int nrectFill,
xRectangle *prectInit)
{
+ ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC);
- VGAGet_GC();
+ VGAGet(pScreen);
(*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
- VGAPut_GC();
+ VGAPut();
GC_WRAP(pGC);
}
@@ -855,10 +866,11 @@ VGAarbiterPolyFillArc(
int narcs,
xArc *parcs )
{
+ ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC);
- VGAGet_GC();
+ VGAGet(pScreen);
(*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
- VGAPut_GC();
+ VGAPut();
GC_WRAP(pGC);
}
@@ -872,11 +884,11 @@ VGAarbiterPolyText8(
char *chars )
{
int ret;
-
+ ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC);
- VGAGet_GC();
+ VGAGet(pScreen);
ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
- VGAPut_GC();
+ VGAPut();
GC_WRAP(pGC);
return ret;
}
@@ -891,11 +903,11 @@ VGAarbiterPolyText16(
unsigned short *chars )
{
int ret;
-
+ ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC);
- VGAGet_GC();
+ VGAGet(pScreen);
ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
- VGAPut_GC();
+ VGAPut();
GC_WRAP(pGC);
return ret;
}
@@ -909,10 +921,11 @@ VGAarbiterImageText8(
int count,
char *chars )
{
+ ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC);
- VGAGet_GC();
+ VGAGet(pScreen);
(*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
- VGAPut_GC();
+ VGAPut();
GC_WRAP(pGC);
}
@@ -925,10 +938,11 @@ VGAarbiterImageText16(
int count,
unsigned short *chars )
{
+ ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC);
- VGAGet_GC();
+ VGAGet(pScreen);
(*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
- VGAPut_GC();
+ VGAPut();
GC_WRAP(pGC);
}
@@ -942,11 +956,12 @@ VGAarbiterImageGlyphBlt(
CharInfoPtr *ppci,
pointer pglyphBase )
{
+ ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC);
- VGAGet_GC();
+ VGAGet(pScreen);
(*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit,
nglyph, ppci, pglyphBase);
- VGAPut_GC();
+ VGAPut();
GC_WRAP(pGC);
}
@@ -959,11 +974,12 @@ VGAarbiterPolyGlyphBlt(
CharInfoPtr *ppci,
pointer pglyphBase )
{
+ ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC);
- VGAGet_GC();
+ VGAGet(pScreen);
(*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit,
nglyph, ppci, pglyphBase);
- VGAPut_GC();
+ VGAPut();
GC_WRAP(pGC);
}
@@ -974,10 +990,11 @@ VGAarbiterPushPixels(
DrawablePtr pDraw,
int dx, int dy, int xOrg, int yOrg )
{
+ ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC);
- VGAGet_GC();
+ VGAGet(pScreen);
(*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
- VGAPut_GC();
+ VGAPut();
GC_WRAP(pGC);
}
@@ -988,7 +1005,7 @@ VGAarbiterSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pC
{
Bool val;
SPRITE_PROLOG;
- VGAGet();
+ VGAGet(pScreen);
val = PointPriv->spriteFuncs->RealizeCursor(pDev, pScreen, pCur);
VGAPut();
SPRITE_EPILOG;
@@ -1000,7 +1017,7 @@ VGAarbiterSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr
{
Bool val;
SPRITE_PROLOG;
- VGAGet();
+ VGAGet(pScreen);
val = PointPriv->spriteFuncs->UnrealizeCursor(pDev, pScreen, pCur);
VGAPut();
SPRITE_EPILOG;
@@ -1011,7 +1028,7 @@ static void
VGAarbiterSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCur, int x, int y)
{
SPRITE_PROLOG;
- VGAGet();
+ VGAGet(pScreen);
PointPriv->spriteFuncs->SetCursor(pDev, pScreen, pCur, x, y);
VGAPut();
SPRITE_EPILOG;
@@ -1021,7 +1038,7 @@ static void
VGAarbiterSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
{
SPRITE_PROLOG;
- VGAGet();
+ VGAGet(pScreen);
PointPriv->spriteFuncs->MoveCursor(pDev, pScreen, x, y);
VGAPut();
SPRITE_EPILOG;
@@ -1032,7 +1049,7 @@ VGAarbiterDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
{
Bool val;
SPRITE_PROLOG;
- VGAGet();
+ VGAGet(pScreen);
val = PointPriv->spriteFuncs->DeviceCursorInitialize(pDev, pScreen);
VGAPut();
SPRITE_EPILOG;
@@ -1043,7 +1060,7 @@ static void
VGAarbiterDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
{
SPRITE_PROLOG;
- VGAGet();
+ VGAGet(pScreen);
PointPriv->spriteFuncs->DeviceCursorCleanup(pDev, pScreen);
VGAPut();
SPRITE_EPILOG;
@@ -1060,7 +1077,7 @@ VGAarbiterComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
PICTURE_PROLOGUE(Composite);
- VGAGet();
+ VGAGet(pScreen);
(*ps->Composite) (op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst,
yDst, width, height);
VGAPut();
@@ -1077,7 +1094,7 @@ VGAarbiterGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
PICTURE_PROLOGUE(Glyphs);
- VGAGet();
+ VGAGet(pScreen);
(*ps->Glyphs)(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs);
VGAPut();
PICTURE_EPILOGUE (Glyphs, VGAarbiterGlyphs);
@@ -1092,7 +1109,7 @@ VGAarbiterCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor *color, int nRe
PICTURE_PROLOGUE(CompositeRects);
- VGAGet();
+ VGAGet(pScreen);
(*ps->CompositeRects)(op, pDst, color, nRect, rects);
VGAPut();
PICTURE_EPILOGUE (CompositeRects, VGAarbiterCompositeRects);
diff --git a/xorg-server/hw/xfree86/common/xf86VGAarbiter.h b/xorg-server/hw/xfree86/common/xf86VGAarbiter.h
index 904b6b079..ae9c51dd2 100644
--- a/xorg-server/hw/xfree86/common/xf86VGAarbiter.h
+++ b/xorg-server/hw/xfree86/common/xf86VGAarbiter.h
@@ -1,48 +1,48 @@
-/*
- * Copyright (c) 2009 Tiago Vignatti
- *
- * 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 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.
- */
-
-#ifndef __XF86VGAARBITER_H
-#define __XF86VGAARBITER_H
-
-#include "screenint.h"
-#include "misc.h"
-#include "xf86.h"
-
-/* Functions */
-extern void xf86VGAarbiterInit(void);
-extern void xf86VGAarbiterFini(void);
-void xf86VGAarbiterScrnInit(ScrnInfoPtr pScrn);
-extern Bool xf86VGAarbiterWrapFunctions(void);
-extern void xf86VGAarbiterLock(ScrnInfoPtr pScrn);
-extern void xf86VGAarbiterUnlock(ScrnInfoPtr pScrn);
-
-/* allow a driver to remove itself from arbiter - really should be
- * done in the kernel though */
-extern _X_EXPORT void xf86VGAarbiterDeviceDecodes(ScrnInfoPtr pScrn);
-/* DRI and arbiter are really not possible together,
- * you really want to remove the card from arbitration if you can */
-extern _X_EXPORT Bool xf86VGAarbiterAllowDRI(ScreenPtr pScreen);
-
-#endif /* __XF86VGAARBITER_H */
+/*
+ * Copyright (c) 2009 Tiago Vignatti
+ *
+ * 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 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.
+ */
+
+#ifndef __XF86VGAARBITER_H
+#define __XF86VGAARBITER_H
+
+#include "screenint.h"
+#include "misc.h"
+#include "xf86.h"
+
+/* Functions */
+extern void xf86VGAarbiterInit(void);
+extern void xf86VGAarbiterFini(void);
+void xf86VGAarbiterScrnInit(ScrnInfoPtr pScrn);
+extern Bool xf86VGAarbiterWrapFunctions(void);
+extern void xf86VGAarbiterLock(ScrnInfoPtr pScrn);
+extern void xf86VGAarbiterUnlock(ScrnInfoPtr pScrn);
+
+/* allow a driver to remove itself from arbiter - really should be
+ * done in the kernel though */
+extern _X_EXPORT void xf86VGAarbiterDeviceDecodes(ScrnInfoPtr pScrn, int rsrc);
+/* DRI and arbiter are really not possible together,
+ * you really want to remove the card from arbitration if you can */
+extern _X_EXPORT Bool xf86VGAarbiterAllowDRI(ScreenPtr pScreen);
+
+#endif /* __XF86VGAARBITER_H */
diff --git a/xorg-server/hw/xfree86/common/xf86VGAarbiterPriv.h b/xorg-server/hw/xfree86/common/xf86VGAarbiterPriv.h
index 9b4a59731..0107a4952 100644
--- a/xorg-server/hw/xfree86/common/xf86VGAarbiterPriv.h
+++ b/xorg-server/hw/xfree86/common/xf86VGAarbiterPriv.h
@@ -1,260 +1,253 @@
-/*
- * Copyright (c) 2009 Tiago Vignatti
- *
- * 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 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.
- *
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include "misc.h"
-#include "xf86.h"
-#include "xf86_OSproc.h"
-#include <X11/X.h>
-#include "colormapst.h"
-#include "scrnintstr.h"
-#include "screenint.h"
-#include "gcstruct.h"
-#include "pixmapstr.h"
-#include "pixmap.h"
-#include "windowstr.h"
-#include "window.h"
-#include "xf86str.h"
-#include "mipointer.h"
-#include "mipointrst.h"
-# include "picturestr.h"
-
-
-#define WRAP_SCREEN(x,y) {pScreenPriv->x = pScreen->x; pScreen->x = y;}
-
-#define UNWRAP_SCREEN(x) pScreen->x = pScreenPriv->x
-
-#define SCREEN_PROLOG(x) pScreen->x = ((VGAarbiterScreenPtr) \
- dixLookupPrivate(&(pScreen)->devPrivates, VGAarbiterScreenKey))->x
-
-#define SCREEN_EPILOG(x,y) pScreen->x = y;
-
-#define WRAP_PICT(x,y) if (ps) {pScreenPriv->x = ps->x;\
- ps->x = y;}
-
-#define UNWRAP_PICT(x) if (ps) {ps->x = pScreenPriv->x;}
-
-#define PICTURE_PROLOGUE(field) ps->field = \
- ((VGAarbiterScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, \
- VGAarbiterScreenKey))->field
-
-#define PICTURE_EPILOGUE(field, wrap) ps->field = wrap
-
-#define WRAP_SCREEN_INFO(x,y) do {pScreenPriv->x = pScrn->x; pScrn->x = y;} while(0)
-
-#define UNWRAP_SCREEN_INFO(x) pScrn->x = pScreenPriv->x
-
-#define SPRITE_PROLOG miPointerScreenPtr PointPriv = \
- (miPointerScreenPtr)dixLookupPrivate(&pScreen->devPrivates, \
- miPointerScreenKey); VGAarbiterScreenPtr pScreenPriv = \
- ((VGAarbiterScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, \
- VGAarbiterScreenKey)); PointPriv->spriteFuncs = pScreenPriv->miSprite;
-
-#define SPRITE_EPILOG pScreenPriv->miSprite = PointPriv->spriteFuncs;\
- PointPriv->spriteFuncs = &VGAarbiterSpriteFuncs;
-
-#define WRAP_SPRITE do { pScreenPriv->miSprite = PointPriv->spriteFuncs;\
- PointPriv->spriteFuncs = &VGAarbiterSpriteFuncs; \
- } while (0)
-
-#define UNWRAP_SPRITE PointPriv->spriteFuncs = pScreenPriv->miSprite
-
-#define GC_WRAP(x) pGCPriv->wrapOps = (x)->ops;\
- pGCPriv->wrapFuncs = (x)->funcs; (x)->ops = &VGAarbiterGCOps;\
- (x)->funcs = &VGAarbiterGCFuncs;
-
-#define GC_UNWRAP(x) VGAarbiterGCPtr pGCPriv = \
- (VGAarbiterGCPtr)dixLookupPrivate(&(x)->devPrivates, VGAarbiterGCKey);\
- (x)->ops = pGCPriv->wrapOps; (x)->funcs = pGCPriv->wrapFuncs;
-
-#define GC_SCREEN register ScrnInfoPtr pScrn = \
- xf86Screens[pGC->pScreen->myNum]
-
-#define VGAGet(x)\
- pci_device_vgaarb_set_target(xf86Screens[pScreen->myNum]->vgaDev); \
- pci_device_vgaarb_lock();
-
-#define VGAGet_GC(x)\
- pci_device_vgaarb_set_target(xf86Screens[pGC->pScreen->myNum]->vgaDev); \
- pci_device_vgaarb_lock();
-
-#define VGAPut(x)\
- pci_device_vgaarb_unlock();
-
-#define VGAPut_GC(x)\
- pci_device_vgaarb_unlock();
-
-
-typedef struct _VGAarbiterScreen {
- CreateGCProcPtr CreateGC;
- CloseScreenProcPtr CloseScreen;
- ScreenBlockHandlerProcPtr BlockHandler;
- ScreenWakeupHandlerProcPtr WakeupHandler;
- GetImageProcPtr GetImage;
- GetSpansProcPtr GetSpans;
- SourceValidateProcPtr SourceValidate;
- CopyWindowProcPtr CopyWindow;
- ClearToBackgroundProcPtr ClearToBackground;
- CreatePixmapProcPtr CreatePixmap;
- SaveScreenProcPtr SaveScreen;
- /* Colormap */
- StoreColorsProcPtr StoreColors;
- /* Cursor */
- DisplayCursorProcPtr DisplayCursor;
- RealizeCursorProcPtr RealizeCursor;
- 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);
- miPointerSpriteFuncPtr miSprite;
- CompositeProcPtr Composite;
- GlyphsProcPtr Glyphs;
- CompositeRectsProcPtr CompositeRects;
-} VGAarbiterScreenRec, *VGAarbiterScreenPtr;
-
-typedef struct _VGAarbiterGC {
- GCOps *wrapOps;
- GCFuncs *wrapFuncs;
-} VGAarbiterGCRec, *VGAarbiterGCPtr;
-
-/* Screen funcs */
-static void VGAarbiterBlockHandler(int i, pointer blockData, pointer pTimeout, pointer pReadmask);
-static void VGAarbiterWakeupHandler(int i, pointer blockData, unsigned long result, pointer pReadmask);
-static Bool VGAarbiterCloseScreen (int i, ScreenPtr pScreen);
-static void VGAarbiterGetImage (DrawablePtr pDrawable, int sx, int sy, int w,
- int h, unsigned int format, unsigned long planemask, char *pdstLine);
-static void VGAarbiterGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr
- ppt, int *pwidth, int nspans, char *pdstStart);
-static void VGAarbiterSourceValidate (DrawablePtr pDrawable, int x, int y,
- int width, int height);
-static void VGAarbiterCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
- RegionPtr prgnSrc);
-static void VGAarbiterClearToBackground (WindowPtr pWin, int x, int y, int w,
- int h, Bool generateExposures);
-static PixmapPtr VGAarbiterCreatePixmap(ScreenPtr pScreen, int w, int h,
- int depth, unsigned int usage_hint);
-static Bool VGAarbiterCreateGC(GCPtr pGC);
-static Bool VGAarbiterSaveScreen(ScreenPtr pScreen, Bool unblank);
-static void VGAarbiterStoreColors (ColormapPtr pmap, int ndef, xColorItem
- *pdefs);
-static void VGAarbiterRecolorCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
- CursorPtr pCurs, Bool displayed);
-static Bool VGAarbiterRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
- CursorPtr pCursor);
-static Bool VGAarbiterUnrealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
- CursorPtr pCursor);
-static Bool VGAarbiterDisplayCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
- CursorPtr pCursor);
-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);
-
-/* GC funcs */
-static void VGAarbiterValidateGC(GCPtr pGC, unsigned long changes,
- DrawablePtr pDraw);
-static void VGAarbiterChangeGC(GCPtr pGC, unsigned long mask);
-static void VGAarbiterCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
-static void VGAarbiterDestroyGC(GCPtr pGC);
-static void VGAarbiterChangeClip(GCPtr pGC, int type, pointer pvalue,
- int nrects);
-static void VGAarbiterDestroyClip(GCPtr pGC);
-static void VGAarbiterCopyClip(GCPtr pgcDst, GCPtr pgcSrc);
-
-/* GC ops */
-static void VGAarbiterFillSpans( DrawablePtr pDraw, GC *pGC, int nInit,
- DDXPointPtr pptInit, int *pwidthInit, int fSorted);
-static void VGAarbiterSetSpans(DrawablePtr pDraw, GCPtr pGC, char *pcharsrc,
- register DDXPointPtr ppt, int *pwidth, int nspans, int fSorted);
-static void VGAarbiterPutImage(DrawablePtr pDraw, GCPtr pGC, int depth,
- int x, int y, int w, int h, int leftPad, int format, char *pImage);
-static RegionPtr VGAarbiterCopyArea(DrawablePtr pSrc, DrawablePtr pDst,
- GC *pGC, int srcx, int srcy, int width, int height, int dstx, int dsty);
-static RegionPtr VGAarbiterCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
- GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty,
- unsigned long bitPlane);
-static void VGAarbiterPolyPoint(DrawablePtr pDraw, GCPtr pGC, int mode,
- int npt, xPoint *pptInit);
-static void VGAarbiterPolylines(DrawablePtr pDraw, GCPtr pGC, int mode,
- int npt, DDXPointPtr pptInit);
-static void VGAarbiterPolySegment(DrawablePtr pDraw, GCPtr pGC, int nseg,
- xSegment *pSeg);
-static void VGAarbiterPolyRectangle(DrawablePtr pDraw, GCPtr pGC,
- int nRectsInit, xRectangle *pRectsInit);
-static void VGAarbiterPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs,
- xArc *parcs);
-static void VGAarbiterFillPolygon(DrawablePtr pDraw, GCPtr pGC, int shape,
- int mode, int count, DDXPointPtr ptsIn);
-static void VGAarbiterPolyFillRect( DrawablePtr pDraw, GCPtr pGC,
- int nrectFill, xRectangle *prectInit);
-static void VGAarbiterPolyFillArc(DrawablePtr pDraw, GCPtr pGC, int narcs,
- xArc *parcs);
-static int VGAarbiterPolyText8(DrawablePtr pDraw, GCPtr pGC, int x, int y,
- int count, char *chars);
-static int VGAarbiterPolyText16(DrawablePtr pDraw, GCPtr pGC, int x, int y,
- int count, unsigned short *chars);
-static void VGAarbiterImageText8(DrawablePtr pDraw, GCPtr pGC, int x, int y,
- int count, char *chars);
-static void VGAarbiterImageText16(DrawablePtr pDraw, GCPtr pGC, int x, int y,
- int count, unsigned short *chars);
-static void VGAarbiterImageGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit,
- int yInit, unsigned int nglyph, CharInfoPtr *ppci, pointer pglyphBase);
-static void VGAarbiterPolyGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit,
- int yInit, unsigned int nglyph, CharInfoPtr *ppci, pointer pglyphBase);
-static void VGAarbiterPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr
- pDraw, int dx, int dy, int xOrg, int yOrg);
-
-/* miSpriteFuncs */
-static Bool VGAarbiterSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr
- pScreen, CursorPtr pCur);
-static Bool VGAarbiterSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr
- pScreen, CursorPtr pCur);
-static void VGAarbiterSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
- CursorPtr pCur, int x, int y);
-static void VGAarbiterSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
- int x, int y);
-static Bool VGAarbiterDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen);
-static void VGAarbiterDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen);
-
-
-static void VGAarbiterComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
- PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask,
- INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
-static void VGAarbiterGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
- PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist, GlyphListPtr
- list, GlyphPtr *glyphs);
-static void VGAarbiterCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor
- *color, int nRect, xRectangle *rects);
+/*
+ * Copyright (c) 2009 Tiago Vignatti
+ *
+ * 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 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.
+ *
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include "misc.h"
+#include "xf86.h"
+#include "xf86_OSproc.h"
+#include <X11/X.h>
+#include "colormapst.h"
+#include "scrnintstr.h"
+#include "screenint.h"
+#include "gcstruct.h"
+#include "pixmapstr.h"
+#include "pixmap.h"
+#include "windowstr.h"
+#include "window.h"
+#include "xf86str.h"
+#include "mipointer.h"
+#include "mipointrst.h"
+# include "picturestr.h"
+
+
+#define WRAP_SCREEN(x,y) {pScreenPriv->x = pScreen->x; pScreen->x = y;}
+
+#define UNWRAP_SCREEN(x) pScreen->x = pScreenPriv->x
+
+#define SCREEN_PROLOG(x) pScreen->x = ((VGAarbiterScreenPtr) \
+ dixLookupPrivate(&(pScreen)->devPrivates, VGAarbiterScreenKey))->x
+
+#define SCREEN_EPILOG(x,y) pScreen->x = y;
+
+#define WRAP_PICT(x,y) if (ps) {pScreenPriv->x = ps->x;\
+ ps->x = y;}
+
+#define UNWRAP_PICT(x) if (ps) {ps->x = pScreenPriv->x;}
+
+#define PICTURE_PROLOGUE(field) ps->field = \
+ ((VGAarbiterScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, \
+ VGAarbiterScreenKey))->field
+
+#define PICTURE_EPILOGUE(field, wrap) ps->field = wrap
+
+#define WRAP_SCREEN_INFO(x,y) do {pScreenPriv->x = pScrn->x; pScrn->x = y;} while(0)
+
+#define UNWRAP_SCREEN_INFO(x) pScrn->x = pScreenPriv->x
+
+#define SPRITE_PROLOG miPointerScreenPtr PointPriv = \
+ (miPointerScreenPtr)dixLookupPrivate(&pScreen->devPrivates, \
+ miPointerScreenKey); VGAarbiterScreenPtr pScreenPriv = \
+ ((VGAarbiterScreenPtr)dixLookupPrivate(&(pScreen)->devPrivates, \
+ VGAarbiterScreenKey)); PointPriv->spriteFuncs = pScreenPriv->miSprite;
+
+#define SPRITE_EPILOG pScreenPriv->miSprite = PointPriv->spriteFuncs;\
+ PointPriv->spriteFuncs = &VGAarbiterSpriteFuncs;
+
+#define WRAP_SPRITE do { pScreenPriv->miSprite = PointPriv->spriteFuncs;\
+ PointPriv->spriteFuncs = &VGAarbiterSpriteFuncs; \
+ } while (0)
+
+#define UNWRAP_SPRITE PointPriv->spriteFuncs = pScreenPriv->miSprite
+
+#define GC_WRAP(x) pGCPriv->wrapOps = (x)->ops;\
+ pGCPriv->wrapFuncs = (x)->funcs; (x)->ops = &VGAarbiterGCOps;\
+ (x)->funcs = &VGAarbiterGCFuncs;
+
+#define GC_UNWRAP(x) VGAarbiterGCPtr pGCPriv = \
+ (VGAarbiterGCPtr)dixLookupPrivate(&(x)->devPrivates, VGAarbiterGCKey);\
+ (x)->ops = pGCPriv->wrapOps; (x)->funcs = pGCPriv->wrapFuncs;
+
+static inline void
+VGAGet(ScreenPtr pScreen) {
+ pci_device_vgaarb_set_target(xf86Screens[pScreen->myNum]->vgaDev);
+ pci_device_vgaarb_lock();
+}
+
+static inline void
+VGAPut(void) {
+ pci_device_vgaarb_unlock();
+}
+
+typedef struct _VGAarbiterScreen {
+ CreateGCProcPtr CreateGC;
+ CloseScreenProcPtr CloseScreen;
+ ScreenBlockHandlerProcPtr BlockHandler;
+ ScreenWakeupHandlerProcPtr WakeupHandler;
+ GetImageProcPtr GetImage;
+ GetSpansProcPtr GetSpans;
+ SourceValidateProcPtr SourceValidate;
+ CopyWindowProcPtr CopyWindow;
+ ClearToBackgroundProcPtr ClearToBackground;
+ CreatePixmapProcPtr CreatePixmap;
+ SaveScreenProcPtr SaveScreen;
+ /* Colormap */
+ StoreColorsProcPtr StoreColors;
+ /* Cursor */
+ DisplayCursorProcPtr DisplayCursor;
+ RealizeCursorProcPtr RealizeCursor;
+ 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);
+ miPointerSpriteFuncPtr miSprite;
+ CompositeProcPtr Composite;
+ GlyphsProcPtr Glyphs;
+ CompositeRectsProcPtr CompositeRects;
+} VGAarbiterScreenRec, *VGAarbiterScreenPtr;
+
+typedef struct _VGAarbiterGC {
+ GCOps *wrapOps;
+ GCFuncs *wrapFuncs;
+} VGAarbiterGCRec, *VGAarbiterGCPtr;
+
+/* Screen funcs */
+static void VGAarbiterBlockHandler(int i, pointer blockData, pointer pTimeout, pointer pReadmask);
+static void VGAarbiterWakeupHandler(int i, pointer blockData, unsigned long result, pointer pReadmask);
+static Bool VGAarbiterCloseScreen (int i, ScreenPtr pScreen);
+static void VGAarbiterGetImage (DrawablePtr pDrawable, int sx, int sy, int w,
+ int h, unsigned int format, unsigned long planemask, char *pdstLine);
+static void VGAarbiterGetSpans (DrawablePtr pDrawable, int wMax, DDXPointPtr
+ ppt, int *pwidth, int nspans, char *pdstStart);
+static void VGAarbiterSourceValidate (DrawablePtr pDrawable, int x, int y,
+ int width, int height);
+static void VGAarbiterCopyWindow(WindowPtr pWin, DDXPointRec ptOldOrg,
+ RegionPtr prgnSrc);
+static void VGAarbiterClearToBackground (WindowPtr pWin, int x, int y, int w,
+ int h, Bool generateExposures);
+static PixmapPtr VGAarbiterCreatePixmap(ScreenPtr pScreen, int w, int h,
+ int depth, unsigned int usage_hint);
+static Bool VGAarbiterCreateGC(GCPtr pGC);
+static Bool VGAarbiterSaveScreen(ScreenPtr pScreen, Bool unblank);
+static void VGAarbiterStoreColors (ColormapPtr pmap, int ndef, xColorItem
+ *pdefs);
+static void VGAarbiterRecolorCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
+ CursorPtr pCurs, Bool displayed);
+static Bool VGAarbiterRealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
+ CursorPtr pCursor);
+static Bool VGAarbiterUnrealizeCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
+ CursorPtr pCursor);
+static Bool VGAarbiterDisplayCursor (DeviceIntPtr pDev, ScreenPtr pScreen,
+ CursorPtr pCursor);
+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);
+
+/* GC funcs */
+static void VGAarbiterValidateGC(GCPtr pGC, unsigned long changes,
+ DrawablePtr pDraw);
+static void VGAarbiterChangeGC(GCPtr pGC, unsigned long mask);
+static void VGAarbiterCopyGC(GCPtr pGCSrc, unsigned long mask, GCPtr pGCDst);
+static void VGAarbiterDestroyGC(GCPtr pGC);
+static void VGAarbiterChangeClip(GCPtr pGC, int type, pointer pvalue,
+ int nrects);
+static void VGAarbiterDestroyClip(GCPtr pGC);
+static void VGAarbiterCopyClip(GCPtr pgcDst, GCPtr pgcSrc);
+
+/* GC ops */
+static void VGAarbiterFillSpans( DrawablePtr pDraw, GC *pGC, int nInit,
+ DDXPointPtr pptInit, int *pwidthInit, int fSorted);
+static void VGAarbiterSetSpans(DrawablePtr pDraw, GCPtr pGC, char *pcharsrc,
+ register DDXPointPtr ppt, int *pwidth, int nspans, int fSorted);
+static void VGAarbiterPutImage(DrawablePtr pDraw, GCPtr pGC, int depth,
+ int x, int y, int w, int h, int leftPad, int format, char *pImage);
+static RegionPtr VGAarbiterCopyArea(DrawablePtr pSrc, DrawablePtr pDst,
+ GC *pGC, int srcx, int srcy, int width, int height, int dstx, int dsty);
+static RegionPtr VGAarbiterCopyPlane(DrawablePtr pSrc, DrawablePtr pDst,
+ GCPtr pGC, int srcx, int srcy, int width, int height, int dstx, int dsty,
+ unsigned long bitPlane);
+static void VGAarbiterPolyPoint(DrawablePtr pDraw, GCPtr pGC, int mode,
+ int npt, xPoint *pptInit);
+static void VGAarbiterPolylines(DrawablePtr pDraw, GCPtr pGC, int mode,
+ int npt, DDXPointPtr pptInit);
+static void VGAarbiterPolySegment(DrawablePtr pDraw, GCPtr pGC, int nseg,
+ xSegment *pSeg);
+static void VGAarbiterPolyRectangle(DrawablePtr pDraw, GCPtr pGC,
+ int nRectsInit, xRectangle *pRectsInit);
+static void VGAarbiterPolyArc(DrawablePtr pDraw, GCPtr pGC, int narcs,
+ xArc *parcs);
+static void VGAarbiterFillPolygon(DrawablePtr pDraw, GCPtr pGC, int shape,
+ int mode, int count, DDXPointPtr ptsIn);
+static void VGAarbiterPolyFillRect( DrawablePtr pDraw, GCPtr pGC,
+ int nrectFill, xRectangle *prectInit);
+static void VGAarbiterPolyFillArc(DrawablePtr pDraw, GCPtr pGC, int narcs,
+ xArc *parcs);
+static int VGAarbiterPolyText8(DrawablePtr pDraw, GCPtr pGC, int x, int y,
+ int count, char *chars);
+static int VGAarbiterPolyText16(DrawablePtr pDraw, GCPtr pGC, int x, int y,
+ int count, unsigned short *chars);
+static void VGAarbiterImageText8(DrawablePtr pDraw, GCPtr pGC, int x, int y,
+ int count, char *chars);
+static void VGAarbiterImageText16(DrawablePtr pDraw, GCPtr pGC, int x, int y,
+ int count, unsigned short *chars);
+static void VGAarbiterImageGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit,
+ int yInit, unsigned int nglyph, CharInfoPtr *ppci, pointer pglyphBase);
+static void VGAarbiterPolyGlyphBlt(DrawablePtr pDraw, GCPtr pGC, int xInit,
+ int yInit, unsigned int nglyph, CharInfoPtr *ppci, pointer pglyphBase);
+static void VGAarbiterPushPixels(GCPtr pGC, PixmapPtr pBitMap, DrawablePtr
+ pDraw, int dx, int dy, int xOrg, int yOrg);
+
+/* miSpriteFuncs */
+static Bool VGAarbiterSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr
+ pScreen, CursorPtr pCur);
+static Bool VGAarbiterSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr
+ pScreen, CursorPtr pCur);
+static void VGAarbiterSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
+ CursorPtr pCur, int x, int y);
+static void VGAarbiterSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen,
+ int x, int y);
+static Bool VGAarbiterDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen);
+static void VGAarbiterDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen);
+
+
+static void VGAarbiterComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask,
+ PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask,
+ INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
+static void VGAarbiterGlyphs(CARD8 op, PicturePtr pSrc, PicturePtr pDst,
+ PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int nlist, GlyphListPtr
+ list, GlyphPtr *glyphs);
+static void VGAarbiterCompositeRects(CARD8 op, PicturePtr pDst, xRenderColor
+ *color, int nRect, xRectangle *rects);
diff --git a/xorg-server/hw/xfree86/common/xf86Xinput.c b/xorg-server/hw/xfree86/common/xf86Xinput.c
index 8ea50aa94..585be69a5 100644
--- a/xorg-server/hw/xfree86/common/xf86Xinput.c
+++ b/xorg-server/hw/xfree86/common/xf86Xinput.c
@@ -66,6 +66,7 @@
#include "xf86InPriv.h"
#include "compiler.h"
#include "extinit.h"
+#include "loaderProcs.h"
#ifdef DPMSExtension
#include <X11/extensions/dpmsconst.h>
diff --git a/xorg-server/hw/xfree86/common/xf86xv.c b/xorg-server/hw/xfree86/common/xf86xv.c
index 29c74f66e..74e76f923 100644
--- a/xorg-server/hw/xfree86/common/xf86xv.c
+++ b/xorg-server/hw/xfree86/common/xf86xv.c
@@ -429,8 +429,7 @@ xf86XVInitAdaptors(
pa->ddGetPortAttribute = xf86XVGetPortAttribute;
pa->ddQueryBestSize = xf86XVQueryBestSize;
pa->ddQueryImageAttributes = xf86XVQueryImageAttributes;
- if((pa->name = malloc(strlen(adaptorPtr->name) + 1)))
- strcpy(pa->name, adaptorPtr->name);
+ pa->name = strdup(adaptorPtr->name);
if(adaptorPtr->nEncodings &&
(pEncode = calloc(adaptorPtr->nEncodings, sizeof(XvEncodingRec)))) {
@@ -440,8 +439,7 @@ xf86XVInitAdaptors(
{
pe->id = encodingPtr->id;
pe->pScreen = pScreen;
- if((pe->name = malloc(strlen(encodingPtr->name) + 1)))
- strcpy(pe->name, encodingPtr->name);
+ pe->name = strdup(encodingPtr->name);
pe->width = encodingPtr->width;
pe->height = encodingPtr->height;
pe->rate.numerator = encodingPtr->rate.numerator;
@@ -493,8 +491,7 @@ xf86XVInitAdaptors(
pat->flags = attributePtr->flags;
pat->min_value = attributePtr->min_value;
pat->max_value = attributePtr->max_value;
- if((pat->name = malloc(strlen(attributePtr->name) + 1)))
- strcpy(pat->name, attributePtr->name);
+ pat->name = strdup(attributePtr->name);
}
pa->nAttributes = adaptorPtr->nAttributes;
pa->pAttributes = pAttribute;