[PATCH 2/5] xfree86: vgaarb: remove superfluous and confusing VGAGet_GC and VGAPut_GC

Tiago Vignatti tiago.vignatti at nokia.com
Thu Jun 3 01:34:11 PDT 2010


Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
Reviewed-by: Jamey Sharp <jamey at minilop.net>
---
 hw/xfree86/common/xf86VGAarbiter.c     |  104 ++++++++++++++++++-------------
 hw/xfree86/common/xf86VGAarbiterPriv.h |   11 ----
 2 files changed, 60 insertions(+), 55 deletions(-)

diff --git a/hw/xfree86/common/xf86VGAarbiter.c b/hw/xfree86/common/xf86VGAarbiter.c
index 05ae3e3..8890606 100644
--- a/hw/xfree86/common/xf86VGAarbiter.c
+++ b/hw/xfree86/common/xf86VGAarbiter.c
@@ -651,10 +651,11 @@ VGAarbiterFillSpans(
     int *pwidthInit,
     int fSorted )
 {
+    ScreenPtr pScreen = pGC->pScreen;
     GC_UNWRAP(pGC);
-    VGAGet_GC(pGC);
+    VGAGet(pScreen);
     (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
-    VGAPut_GC();
+    VGAPut();
     GC_WRAP(pGC);
 }
 
@@ -668,10 +669,11 @@ VGAarbiterSetSpans(
     int         nspans,
     int         fSorted )
 {
+    ScreenPtr pScreen = pGC->pScreen;
     GC_UNWRAP(pGC);
-    VGAGet_GC(pGC);
+    VGAGet(pScreen);
     (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
-    VGAPut_GC();
+    VGAPut();
     GC_WRAP(pGC);
 }
 
@@ -685,11 +687,12 @@ VGAarbiterPutImage(
     int     format,
     char    *pImage )
 {
+    ScreenPtr pScreen = pGC->pScreen;
     GC_UNWRAP(pGC);
-    VGAGet_GC(pGC);
+    VGAGet(pScreen);
     (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
               leftPad, format, pImage);
-    VGAPut_GC();
+    VGAPut();
     GC_WRAP(pGC);
 }
 
@@ -703,12 +706,12 @@ VGAarbiterCopyArea(
     int dstx, int dsty )
 {
     RegionPtr ret;
-
+    ScreenPtr pScreen = pGC->pScreen;
     GC_UNWRAP(pGC);
-    VGAGet_GC(pGC);
+    VGAGet(pScreen);
     ret = (*pGC->ops->CopyArea)(pSrc, pDst,
                 pGC, srcx, srcy, width, height, dstx, dsty);
-    VGAPut_GC();
+    VGAPut();
     GC_WRAP(pGC);
     return ret;
 }
@@ -724,12 +727,12 @@ VGAarbiterCopyPlane(
     unsigned long bitPlane )
 {
     RegionPtr ret;
-
+    ScreenPtr pScreen = pGC->pScreen;
     GC_UNWRAP(pGC);
-    VGAGet_GC(pGC);
+    VGAGet(pScreen);
     ret = (*pGC->ops->CopyPlane)(pSrc, pDst, pGC, srcx, srcy,
                  width, height, dstx, dsty, bitPlane);
-    VGAPut_GC();
+    VGAPut();
     GC_WRAP(pGC);
     return ret;
 }
@@ -742,10 +745,11 @@ VGAarbiterPolyPoint(
     int npt,
     xPoint *pptInit )
 {
+    ScreenPtr pScreen = pGC->pScreen;
     GC_UNWRAP(pGC);
-    VGAGet_GC(pGC);
+    VGAGet(pScreen);
     (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
-    VGAPut_GC();
+    VGAPut();
     GC_WRAP(pGC);
 }
 
@@ -758,10 +762,11 @@ VGAarbiterPolylines(
     int     npt,
     DDXPointPtr pptInit )
 {
+    ScreenPtr pScreen = pGC->pScreen;
     GC_UNWRAP(pGC);
-    VGAGet_GC(pGC);
+    VGAGet(pScreen);
     (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
-    VGAPut_GC();
+    VGAPut();
     GC_WRAP(pGC);
 }
 
@@ -772,10 +777,11 @@ VGAarbiterPolySegment(
     int     nseg,
     xSegment    *pSeg )
 {
+    ScreenPtr pScreen = pGC->pScreen;
     GC_UNWRAP(pGC);
-    VGAGet_GC(pGC);
+    VGAGet(pScreen);
     (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
-    VGAPut_GC();
+    VGAPut();
     GC_WRAP(pGC);
 }
 
@@ -786,10 +792,11 @@ VGAarbiterPolyRectangle(
     int          nRectsInit,
     xRectangle  *pRectsInit )
 {
+    ScreenPtr pScreen = pGC->pScreen;
     GC_UNWRAP(pGC);
-    VGAGet_GC(pGC);
+    VGAGet(pScreen);
     (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
-    VGAPut_GC();
+    VGAPut();
     GC_WRAP(pGC);
 }
 
@@ -800,10 +807,11 @@ VGAarbiterPolyArc(
     int     narcs,
     xArc    *parcs )
 {
+    ScreenPtr pScreen = pGC->pScreen;
     GC_UNWRAP(pGC);
-    VGAGet_GC(pGC);
+    VGAGet(pScreen);
     (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
-    VGAPut_GC();
+    VGAPut();
     GC_WRAP(pGC);
 }
 
@@ -816,10 +824,11 @@ VGAarbiterFillPolygon(
     int     count,
     DDXPointPtr ptsIn )
 {
+    ScreenPtr pScreen = pGC->pScreen;
     GC_UNWRAP(pGC);
-    VGAGet_GC(pGC);
+    VGAGet(pScreen);
     (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
-    VGAPut_GC();
+    VGAPut();
     GC_WRAP(pGC);
 }
 
@@ -830,10 +839,11 @@ VGAarbiterPolyFillRect(
     int     nrectFill,
     xRectangle  *prectInit)
 {
+    ScreenPtr pScreen = pGC->pScreen;
     GC_UNWRAP(pGC);
-    VGAGet_GC(pGC);
+    VGAGet(pScreen);
     (*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
-    VGAPut_GC();
+    VGAPut();
     GC_WRAP(pGC);
 }
 
@@ -844,10 +854,11 @@ VGAarbiterPolyFillArc(
     int     narcs,
     xArc    *parcs )
 {
+    ScreenPtr pScreen = pGC->pScreen;
     GC_UNWRAP(pGC);
-    VGAGet_GC(pGC);
+    VGAGet(pScreen);
     (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
-    VGAPut_GC();
+    VGAPut();
     GC_WRAP(pGC);
 }
 
@@ -861,11 +872,11 @@ VGAarbiterPolyText8(
     char    *chars )
 {
     int ret;
-
+    ScreenPtr pScreen = pGC->pScreen;
     GC_UNWRAP(pGC);
-    VGAGet_GC(pGC);
+    VGAGet(pScreen);
     ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
-    VGAPut_GC();
+    VGAPut();
     GC_WRAP(pGC);
     return ret;
 }
@@ -880,11 +891,11 @@ VGAarbiterPolyText16(
     unsigned short *chars )
 {
     int ret;
-
+    ScreenPtr pScreen = pGC->pScreen;
     GC_UNWRAP(pGC);
-    VGAGet_GC(pGC);
+    VGAGet(pScreen);
     ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
-    VGAPut_GC();
+    VGAPut();
     GC_WRAP(pGC);
     return ret;
 }
@@ -898,10 +909,11 @@ VGAarbiterImageText8(
     int     count,
     char    *chars )
 {
+    ScreenPtr pScreen = pGC->pScreen;
     GC_UNWRAP(pGC);
-    VGAGet_GC(pGC);
+    VGAGet(pScreen);
     (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
-    VGAPut_GC();
+    VGAPut();
     GC_WRAP(pGC);
 }
 
@@ -914,10 +926,11 @@ VGAarbiterImageText16(
     int     count,
     unsigned short *chars )
 {
+    ScreenPtr pScreen = pGC->pScreen;
     GC_UNWRAP(pGC);
-    VGAGet_GC(pGC);
+    VGAGet(pScreen);
     (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
-    VGAPut_GC();
+    VGAPut();
     GC_WRAP(pGC);
 }
 
@@ -931,11 +944,12 @@ VGAarbiterImageGlyphBlt(
     CharInfoPtr *ppci,
     pointer pglyphBase )
 {
+    ScreenPtr pScreen = pGC->pScreen;
     GC_UNWRAP(pGC);
-    VGAGet_GC(pGC);
+    VGAGet(pScreen);
     (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit,
                    nglyph, ppci, pglyphBase);
-    VGAPut_GC();
+    VGAPut();
     GC_WRAP(pGC);
 }
 
@@ -948,11 +962,12 @@ VGAarbiterPolyGlyphBlt(
     CharInfoPtr *ppci,
     pointer pglyphBase )
 {
+    ScreenPtr pScreen = pGC->pScreen;
     GC_UNWRAP(pGC);
-    VGAGet_GC(pGC);
+    VGAGet(pScreen);
     (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit,
                   nglyph, ppci, pglyphBase);
-    VGAPut_GC();
+    VGAPut();
     GC_WRAP(pGC);
 }
 
@@ -963,10 +978,11 @@ VGAarbiterPushPixels(
     DrawablePtr pDraw,
     int dx, int dy, int xOrg, int yOrg )
 {
+    ScreenPtr pScreen = pGC->pScreen;
     GC_UNWRAP(pGC);
-    VGAGet_GC(pGC);
+    VGAGet(pScreen);
     (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
-    VGAPut_GC();
+    VGAPut();
     GC_WRAP(pGC);
 }
 
diff --git a/hw/xfree86/common/xf86VGAarbiterPriv.h b/hw/xfree86/common/xf86VGAarbiterPriv.h
index badac55..df38d6b 100644
--- a/hw/xfree86/common/xf86VGAarbiterPriv.h
+++ b/hw/xfree86/common/xf86VGAarbiterPriv.h
@@ -103,21 +103,10 @@ VGAGet(ScreenPtr pScreen) {
 }
 
 static inline void
-VGAGet_GC(GC *pGC) {
-    pci_device_vgaarb_set_target(xf86Screens[pGC->pScreen->myNum]->vgaDev);
-    pci_device_vgaarb_lock();
-}
-
-static inline void
 VGAPut(void) {
     pci_device_vgaarb_unlock();
 }
 
-static inline void
-VGAPut_GC(void) {
-    pci_device_vgaarb_unlock();
-}
-
 typedef struct _VGAarbiterScreen {
     CreateGCProcPtr             CreateGC;
     CloseScreenProcPtr          CloseScreen;
-- 
1.7.1.226.g770c5



More information about the xorg-devel mailing list