xfree86: vgaarb: remove superfluous and confusing VGAGet_GC and VGAPut_GC

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
This commit is contained in:
Tiago Vignatti 2010-05-10 21:03:30 +03:00
parent c0aed4c99b
commit ad698dd5bc
2 changed files with 60 additions and 55 deletions

View File

@ -662,10 +662,11 @@ VGAarbiterFillSpans(
int *pwidthInit, int *pwidthInit,
int fSorted ) int fSorted )
{ {
ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC); GC_UNWRAP(pGC);
VGAGet_GC(pGC); VGAGet(pScreen);
(*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted); (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
VGAPut_GC(); VGAPut();
GC_WRAP(pGC); GC_WRAP(pGC);
} }
@ -679,10 +680,11 @@ VGAarbiterSetSpans(
int nspans, int nspans,
int fSorted ) int fSorted )
{ {
ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC); GC_UNWRAP(pGC);
VGAGet_GC(pGC); VGAGet(pScreen);
(*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted); (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
VGAPut_GC(); VGAPut();
GC_WRAP(pGC); GC_WRAP(pGC);
} }
@ -696,11 +698,12 @@ VGAarbiterPutImage(
int format, int format,
char *pImage ) char *pImage )
{ {
ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC); GC_UNWRAP(pGC);
VGAGet_GC(pGC); VGAGet(pScreen);
(*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h, (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
leftPad, format, pImage); leftPad, format, pImage);
VGAPut_GC(); VGAPut();
GC_WRAP(pGC); GC_WRAP(pGC);
} }
@ -714,12 +717,12 @@ VGAarbiterCopyArea(
int dstx, int dsty ) int dstx, int dsty )
{ {
RegionPtr ret; RegionPtr ret;
ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC); GC_UNWRAP(pGC);
VGAGet_GC(pGC); VGAGet(pScreen);
ret = (*pGC->ops->CopyArea)(pSrc, pDst, ret = (*pGC->ops->CopyArea)(pSrc, pDst,
pGC, srcx, srcy, width, height, dstx, dsty); pGC, srcx, srcy, width, height, dstx, dsty);
VGAPut_GC(); VGAPut();
GC_WRAP(pGC); GC_WRAP(pGC);
return ret; return ret;
} }
@ -735,12 +738,12 @@ VGAarbiterCopyPlane(
unsigned long bitPlane ) unsigned long bitPlane )
{ {
RegionPtr ret; RegionPtr ret;
ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC); GC_UNWRAP(pGC);
VGAGet_GC(pGC); VGAGet(pScreen);
ret = (*pGC->ops->CopyPlane)(pSrc, pDst, pGC, srcx, srcy, ret = (*pGC->ops->CopyPlane)(pSrc, pDst, pGC, srcx, srcy,
width, height, dstx, dsty, bitPlane); width, height, dstx, dsty, bitPlane);
VGAPut_GC(); VGAPut();
GC_WRAP(pGC); GC_WRAP(pGC);
return ret; return ret;
} }
@ -753,10 +756,11 @@ VGAarbiterPolyPoint(
int npt, int npt,
xPoint *pptInit ) xPoint *pptInit )
{ {
ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC); GC_UNWRAP(pGC);
VGAGet_GC(pGC); VGAGet(pScreen);
(*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit); (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
VGAPut_GC(); VGAPut();
GC_WRAP(pGC); GC_WRAP(pGC);
} }
@ -769,10 +773,11 @@ VGAarbiterPolylines(
int npt, int npt,
DDXPointPtr pptInit ) DDXPointPtr pptInit )
{ {
ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC); GC_UNWRAP(pGC);
VGAGet_GC(pGC); VGAGet(pScreen);
(*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit); (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
VGAPut_GC(); VGAPut();
GC_WRAP(pGC); GC_WRAP(pGC);
} }
@ -783,10 +788,11 @@ VGAarbiterPolySegment(
int nseg, int nseg,
xSegment *pSeg ) xSegment *pSeg )
{ {
ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC); GC_UNWRAP(pGC);
VGAGet_GC(pGC); VGAGet(pScreen);
(*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg); (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
VGAPut_GC(); VGAPut();
GC_WRAP(pGC); GC_WRAP(pGC);
} }
@ -797,10 +803,11 @@ VGAarbiterPolyRectangle(
int nRectsInit, int nRectsInit,
xRectangle *pRectsInit ) xRectangle *pRectsInit )
{ {
ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC); GC_UNWRAP(pGC);
VGAGet_GC(pGC); VGAGet(pScreen);
(*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit); (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
VGAPut_GC(); VGAPut();
GC_WRAP(pGC); GC_WRAP(pGC);
} }
@ -811,10 +818,11 @@ VGAarbiterPolyArc(
int narcs, int narcs,
xArc *parcs ) xArc *parcs )
{ {
ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC); GC_UNWRAP(pGC);
VGAGet_GC(pGC); VGAGet(pScreen);
(*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs); (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
VGAPut_GC(); VGAPut();
GC_WRAP(pGC); GC_WRAP(pGC);
} }
@ -827,10 +835,11 @@ VGAarbiterFillPolygon(
int count, int count,
DDXPointPtr ptsIn ) DDXPointPtr ptsIn )
{ {
ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC); GC_UNWRAP(pGC);
VGAGet_GC(pGC); VGAGet(pScreen);
(*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn); (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
VGAPut_GC(); VGAPut();
GC_WRAP(pGC); GC_WRAP(pGC);
} }
@ -841,10 +850,11 @@ VGAarbiterPolyFillRect(
int nrectFill, int nrectFill,
xRectangle *prectInit) xRectangle *prectInit)
{ {
ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC); GC_UNWRAP(pGC);
VGAGet_GC(pGC); VGAGet(pScreen);
(*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit); (*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
VGAPut_GC(); VGAPut();
GC_WRAP(pGC); GC_WRAP(pGC);
} }
@ -855,10 +865,11 @@ VGAarbiterPolyFillArc(
int narcs, int narcs,
xArc *parcs ) xArc *parcs )
{ {
ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC); GC_UNWRAP(pGC);
VGAGet_GC(pGC); VGAGet(pScreen);
(*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs); (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
VGAPut_GC(); VGAPut();
GC_WRAP(pGC); GC_WRAP(pGC);
} }
@ -872,11 +883,11 @@ VGAarbiterPolyText8(
char *chars ) char *chars )
{ {
int ret; int ret;
ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC); GC_UNWRAP(pGC);
VGAGet_GC(pGC); VGAGet(pScreen);
ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars); ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
VGAPut_GC(); VGAPut();
GC_WRAP(pGC); GC_WRAP(pGC);
return ret; return ret;
} }
@ -891,11 +902,11 @@ VGAarbiterPolyText16(
unsigned short *chars ) unsigned short *chars )
{ {
int ret; int ret;
ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC); GC_UNWRAP(pGC);
VGAGet_GC(pGC); VGAGet(pScreen);
ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars); ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
VGAPut_GC(); VGAPut();
GC_WRAP(pGC); GC_WRAP(pGC);
return ret; return ret;
} }
@ -909,10 +920,11 @@ VGAarbiterImageText8(
int count, int count,
char *chars ) char *chars )
{ {
ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC); GC_UNWRAP(pGC);
VGAGet_GC(pGC); VGAGet(pScreen);
(*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars); (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
VGAPut_GC(); VGAPut();
GC_WRAP(pGC); GC_WRAP(pGC);
} }
@ -925,10 +937,11 @@ VGAarbiterImageText16(
int count, int count,
unsigned short *chars ) unsigned short *chars )
{ {
ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC); GC_UNWRAP(pGC);
VGAGet_GC(pGC); VGAGet(pScreen);
(*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars); (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
VGAPut_GC(); VGAPut();
GC_WRAP(pGC); GC_WRAP(pGC);
} }
@ -942,11 +955,12 @@ VGAarbiterImageGlyphBlt(
CharInfoPtr *ppci, CharInfoPtr *ppci,
pointer pglyphBase ) pointer pglyphBase )
{ {
ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC); GC_UNWRAP(pGC);
VGAGet_GC(pGC); VGAGet(pScreen);
(*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit, (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit,
nglyph, ppci, pglyphBase); nglyph, ppci, pglyphBase);
VGAPut_GC(); VGAPut();
GC_WRAP(pGC); GC_WRAP(pGC);
} }
@ -959,11 +973,12 @@ VGAarbiterPolyGlyphBlt(
CharInfoPtr *ppci, CharInfoPtr *ppci,
pointer pglyphBase ) pointer pglyphBase )
{ {
ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC); GC_UNWRAP(pGC);
VGAGet_GC(pGC); VGAGet(pScreen);
(*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit, (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit,
nglyph, ppci, pglyphBase); nglyph, ppci, pglyphBase);
VGAPut_GC(); VGAPut();
GC_WRAP(pGC); GC_WRAP(pGC);
} }
@ -974,10 +989,11 @@ VGAarbiterPushPixels(
DrawablePtr pDraw, DrawablePtr pDraw,
int dx, int dy, int xOrg, int yOrg ) int dx, int dy, int xOrg, int yOrg )
{ {
ScreenPtr pScreen = pGC->pScreen;
GC_UNWRAP(pGC); GC_UNWRAP(pGC);
VGAGet_GC(pGC); VGAGet(pScreen);
(*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg); (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
VGAPut_GC(); VGAPut();
GC_WRAP(pGC); GC_WRAP(pGC);
} }

View File

@ -102,22 +102,11 @@ VGAGet(ScreenPtr pScreen) {
pci_device_vgaarb_lock(); pci_device_vgaarb_lock();
} }
static inline void
VGAGet_GC(GC *pGC) {
pci_device_vgaarb_set_target(xf86Screens[pGC->pScreen->myNum]->vgaDev);
pci_device_vgaarb_lock();
}
static inline void static inline void
VGAPut(void) { VGAPut(void) {
pci_device_vgaarb_unlock(); pci_device_vgaarb_unlock();
} }
static inline void
VGAPut_GC(void) {
pci_device_vgaarb_unlock();
}
typedef struct _VGAarbiterScreen { typedef struct _VGAarbiterScreen {
CreateGCProcPtr CreateGC; CreateGCProcPtr CreateGC;
CloseScreenProcPtr CloseScreen; CloseScreenProcPtr CloseScreen;