[Intel-gfx] [PATCH 01/14] Remove pre-server-1.5 support.

Eric Anholt eric at anholt.net
Wed Apr 22 01:13:23 CEST 2009


---
 configure.ac      |    9 +------
 src/i830.h        |    4 ---
 src/i830_exa.c    |   37 -------------------------------
 uxa/uxa-accel.c   |   63 -----------------------------------------------------
 uxa/uxa-glyphs.c  |    4 ---
 uxa/uxa-priv.h    |    8 ------
 uxa/uxa-render.c  |    5 ----
 uxa/uxa-unaccel.c |   18 ---------------
 uxa/uxa.c         |   29 ------------------------
 9 files changed, 1 insertions(+), 176 deletions(-)

diff --git a/configure.ac b/configure.ac
index ae5278c..8dd04d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,14 +83,7 @@ XORG_DRIVER_CHECK_EXT(XF86DRI, xextproto x11)
 XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
 
 # Checks for pkg-config packages
-PKG_CHECK_MODULES(XORG, [xorg-server >= 1.3 xproto fontsproto $REQUIRED_MODULES])
-
-PKG_CHECK_MODULES(SERVER_1_5, [xorg-server >= 1.5],
-			      [SERVER_1_5=yes], [SERVER_1_5=no])
-
-if test "$SERVER_1_5" = yes; then
-   AC_DEFINE(SERVER_1_5, 1, [Building against server 1.5])
-fi
+PKG_CHECK_MODULES(XORG, [xorg-server >= 1.6 xproto fontsproto $REQUIRED_MODULES])
 
 sdkdir=$(pkg-config --variable=sdkdir xorg-server)
 drm_cflags=$(pkg-config --cflags libdrm)
diff --git a/src/i830.h b/src/i830.h
index b252f56..de119ca 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -935,10 +935,6 @@ i830_get_transformed_coordinates_3d(int x, int y, PictTransformPtr transform,
 
 void i830_enter_render(ScrnInfoPtr);
 
-#ifndef SERVER_1_5
-Bool xf86MonitorIsHDMI(xf86MonPtr mon);
-#endif
-
 static inline void
 i830_wait_ring_idle(ScrnInfoPtr pScrn)
 {
diff --git a/src/i830_exa.c b/src/i830_exa.c
index 5199cef..7413ae2 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -83,18 +83,6 @@ const int I830PatternROP[16] =
 static int uxa_pixmap_index;
 #endif
 
-#ifndef SERVER_1_5
-static inline void *dixLookupPrivate(DevUnion **privates, int *key)
-{
-    return (*privates)[*key].ptr;
-}
-
-static inline void dixSetPrivate(DevUnion **privates, int *key, void *val)
-{
-    (*privates)[*key].ptr = val;
-}
-#endif
-
 /**
  * Returns whether a given pixmap is tiled or not.
  *
@@ -917,11 +905,7 @@ i830_uxa_create_pixmap (ScreenPtr screen, int w, int h, int depth, unsigned usag
     if (w > 32767 || h > 32767)
 	return NullPixmap;
 
-#ifdef SERVER_1_5
     pixmap = fbCreatePixmap (screen, 0, 0, depth, usage);
-#else
-    pixmap = fbCreatePixmap (screen, 0, 0, depth);
-#endif
 
     if (w && h)
     {
@@ -966,18 +950,6 @@ i830_uxa_create_pixmap (ScreenPtr screen, int w, int h, int depth, unsigned usag
     return pixmap;
 }
 
-
-#ifndef SERVER_1_5
-static PixmapPtr
-i830_uxa_server_14_create_pixmap (ScreenPtr screen, int w, int h, int depth)
-{
-    /* For server pre-1.6, we're never allocating DRI2 buffers, so no need for
-     * a hint.
-     */
-    return i830_uxa_create_pixmap(screen, w, h, depth, 0);
-}
-#endif
-
 static Bool
 i830_uxa_destroy_pixmap (PixmapPtr pixmap)
 {
@@ -1010,13 +982,8 @@ i830_uxa_init (ScreenPtr pScreen)
     ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
     I830Ptr i830 = I830PTR(scrn);
 
-#ifdef SERVER_1_5
     if (!dixRequestPrivate(&uxa_pixmap_index, 0))
 	return FALSE;
-#else
-    if (!AllocatePixmapPrivate(pScreen, uxa_pixmap_index, 0))
-	return FALSE;
-#endif
 
     i830->uxa_driver = uxa_driver_alloc();
     if (i830->uxa_driver == NULL) {
@@ -1071,11 +1038,7 @@ i830_uxa_init (ScreenPtr pScreen)
 	return FALSE;
     }
 
-#ifdef SERVER_1_5
     pScreen->CreatePixmap = i830_uxa_create_pixmap;
-#else
-    pScreen->CreatePixmap = i830_uxa_server_14_create_pixmap;
-#endif
     pScreen->DestroyPixmap = i830_uxa_destroy_pixmap;
 
     I830SelectBuffer(scrn, I830_SELECT_FRONT);
diff --git a/uxa/uxa-accel.c b/uxa/uxa-accel.c
index e322054..a225a4d 100644
--- a/uxa/uxa-accel.c
+++ b/uxa/uxa-accel.c
@@ -977,69 +977,6 @@ out:
     return ret;
 }
 
-#ifndef SERVER_1_5
-void
-uxa_paint_window(WindowPtr pWin, RegionPtr pRegion, int what)
-{
-    ScreenPtr       screen = pWin->drawable.pScreen;
-    uxa_screen_t    *uxa_screen = uxa_get_screen(screen);
-    DDXPointRec     zeros = { 0, 0 };
-
-    if (REGION_NIL(pRegion))
-	return;
-
-    if (uxa_screen->swappedOut) {
-	uxa_check_paint_window(pWin, pRegion, what);
-	return;
-    }
-
-    switch (what) {
-    case PW_BACKGROUND:
-	switch (pWin->backgroundState) {
-	case None:
-	    return;
-	case ParentRelative:
-	    do {
-		pWin = pWin->parent;
-	    } while (pWin->backgroundState == ParentRelative);
-	    (*pWin->drawable.pScreen->PaintWindowBackground)(pWin, pRegion,
-							     what);
-	    return;
-	case BackgroundPixel:
-	    if (uxa_fill_region_solid(&pWin->drawable, pRegion,
-				      pWin->background.pixel,
-				      FB_ALLONES, GXcopy))
-		return;
-	    break;
-	case BackgroundPixmap:
-	    if (uxa_fill_region_tiled(&pWin->drawable, pRegion,
-				      pWin->background.pixmap,
-				      &zeros, FB_ALLONES, GXcopy))
-		return;
-	    break;
-	}
-	break;
-    case PW_BORDER:
-	if (pWin->borderIsPixel) {
-	    if (uxa_fill_region_solid(&pWin->drawable, pRegion,
-				      pWin->border.pixel,
-				      FB_ALLONES, GXcopy))
-		return;
-	    break;
-	} else {
-	    if (uxa_fill_region_tiled(&pWin->drawable, pRegion,
-				      pWin->border.pixmap,
-				      &zeros, FB_ALLONES, GXcopy))
-		return;
-	    break;
-	}
-	break;
-    }
-
-    uxa_check_paint_window(pWin, pRegion, what);
-}
-#endif /* !SERVER_1_5 */
-
 /**
  * Accelerates GetImage for solid ZPixmap downloads from framebuffer memory.
  *
diff --git a/uxa/uxa-glyphs.c b/uxa/uxa-glyphs.c
index 3cb03f5..af5f587 100644
--- a/uxa/uxa-glyphs.c
+++ b/uxa/uxa-glyphs.c
@@ -50,8 +50,6 @@
 
 #include "mipict.h"
 
-#ifdef SERVER_1_5
-
 #if DEBUG_GLYPH_CACHE
 #define DBG_GLYPH_CACHE(a) ErrorF a
 #else
@@ -873,5 +871,3 @@ uxa_glyphs (CARD8 	 op,
 	(*pScreen->DestroyPixmap) (pMaskPixmap);
     }
 }
-
-#endif /* SERVER_1_5 */
diff --git a/uxa/uxa-priv.h b/uxa/uxa-priv.h
index d1cd341..696ffaf 100644
--- a/uxa/uxa-priv.h
+++ b/uxa/uxa-priv.h
@@ -129,10 +129,6 @@ typedef struct {
     CloseScreenProcPtr 		 SavedCloseScreen;
     GetImageProcPtr 		 SavedGetImage;
     GetSpansProcPtr 		 SavedGetSpans;
-#ifndef SERVER_1_5
-    PaintWindowBackgroundProcPtr SavedPaintWindowBackground;
-    PaintWindowBorderProcPtr	 SavedPaintWindowBorder;
-#endif
     CreatePixmapProcPtr 	 SavedCreatePixmap;
     DestroyPixmapProcPtr 	 SavedDestroyPixmap;
     CopyWindowProcPtr 		 SavedCopyWindow;
@@ -171,12 +167,8 @@ extern int uxa_screen_index;
 static inline uxa_screen_t *
 uxa_get_screen(ScreenPtr screen)
 {
-#ifdef SERVER_1_5
     return (uxa_screen_t *)dixLookupPrivate(&screen->devPrivates,
 					    &uxa_screen_index);
-#else
-    return screen->devPrivates[uxa_screen_index].ptr;
-#endif
 }
 
 /** Align an offset to an arbitrary alignment */
diff --git a/uxa/uxa-render.c b/uxa/uxa-render.c
index edbf0d8..b377bf5 100644
--- a/uxa/uxa-render.c
+++ b/uxa/uxa-render.c
@@ -818,13 +818,8 @@ uxa_create_alpha_picture (ScreenPtr     pScreen,
 	    return 0;
     }
 
-#ifdef SERVER_1_5
     pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
 					pPictFormat->depth, 0);
-#else
-    pPixmap = (*pScreen->CreatePixmap) (pScreen, width, height,
-					pPictFormat->depth);
-#endif
     if (!pPixmap)
 	return 0;
     pGC = GetScratchGC (pPixmap->drawable.depth, pScreen);
diff --git a/uxa/uxa-unaccel.c b/uxa/uxa-unaccel.c
index f63c03b..8f86468 100644
--- a/uxa/uxa-unaccel.c
+++ b/uxa/uxa-unaccel.c
@@ -336,24 +336,6 @@ uxa_check_get_spans (DrawablePtr pDrawable,
     }
 }
 
-#ifndef SERVER_1_5
-void
-uxa_check_paint_window (WindowPtr pWin, RegionPtr pRegion, int what)
-{
-    ScreenPtr screen = pWin->drawable.pScreen;
-
-    UXA_FALLBACK(("from %p (%c)\n", pWin,
-		  uxa_drawable_location (&pWin->drawable)));
-    if (uxa_prepare_access (&pWin->drawable, UXA_ACCESS_RW)) {
-	if (uxa_prepare_access_window (pWin)) {
-	    fbPaintWindow (pWin, pRegion, what);
-	    uxa_finish_access_window (pWin);
-	}
-	uxa_finish_access(&pWin->drawable);
-    }
-}
-#endif
-
 void
 uxa_check_composite (CARD8      op,
                    PicturePtr pSrc,
diff --git a/uxa/uxa.c b/uxa/uxa.c
index b51a282..1f2d75b 100644
--- a/uxa/uxa.c
+++ b/uxa/uxa.c
@@ -40,9 +40,6 @@
 #include "uxa.h"
 
 int uxa_screen_index;
-#ifndef SERVER_1_5
-static int uxa_generation;
-#endif
 
 /**
  * uxa_get_drawable_pixmap() returns a backing pixmap for a given drawable.
@@ -370,18 +367,12 @@ uxa_close_screen(int i, ScreenPtr pScreen)
     PictureScreenPtr	ps = GetPictureScreenIfSet(pScreen);
 #endif
 
-#ifdef SERVER_1_5
     uxa_glyphs_fini(pScreen);
-#endif
 
     pScreen->CreateGC = uxa_screen->SavedCreateGC;
     pScreen->CloseScreen = uxa_screen->SavedCloseScreen;
     pScreen->GetImage = uxa_screen->SavedGetImage;
     pScreen->GetSpans = uxa_screen->SavedGetSpans;
-#ifndef SERVER_1_5
-    pScreen->PaintWindowBackground = uxa_screen->SavedPaintWindowBackground;
-    pScreen->PaintWindowBorder = uxa_screen->SavedPaintWindowBorder;
-#endif
     pScreen->CreatePixmap = uxa_screen->SavedCreatePixmap;
     pScreen->DestroyPixmap = uxa_screen->SavedDestroyPixmap;
     pScreen->CopyWindow = uxa_screen->SavedCopyWindow;
@@ -478,15 +469,7 @@ uxa_driver_init(ScreenPtr screen, uxa_driver_t *uxa_driver)
 
     uxa_screen->info = uxa_driver;
 
-#ifdef SERVER_1_5
     dixSetPrivate(&screen->devPrivates, &uxa_screen_index, uxa_screen);
-#else
-    if (uxa_generation != serverGeneration) {
-	uxa_screen_index = AllocateScreenPrivateIndex();
-	uxa_generation = serverGeneration;
-    }
-    screen->devPrivates[uxa_screen_index].ptr = uxa_screen;
-#endif
 
 //    exaDDXDriverInit(screen);
 
@@ -505,14 +488,6 @@ uxa_driver_init(ScreenPtr screen, uxa_driver_t *uxa_driver)
     uxa_screen->SavedGetSpans = screen->GetSpans;
     screen->GetSpans = uxa_check_get_spans;
 
-#ifndef SERVER_1_5
-    uxa_screen->SavedPaintWindowBackground = screen->PaintWindowBackground;
-    screen->PaintWindowBackground = uxa_paint_window;
-
-    uxa_screen->SavedPaintWindowBorder = screen->PaintWindowBorder;
-    screen->PaintWindowBorder = uxa_paint_window;
-#endif /* !SERVER_1_5 */
-
     uxa_screen->SavedCopyWindow = screen->CopyWindow;
     screen->CopyWindow = uxa_copy_window;
 
@@ -530,10 +505,8 @@ uxa_driver_init(ScreenPtr screen, uxa_driver_t *uxa_driver)
         uxa_screen->SavedComposite = ps->Composite;
 	ps->Composite = uxa_composite;
 
-#ifdef SERVER_1_5
 	uxa_screen->SavedGlyphs = ps->Glyphs;
 	ps->Glyphs = uxa_glyphs;
-#endif
 
 	uxa_screen->SavedTriangles = ps->Triangles;
 	ps->Triangles = uxa_triangles;
@@ -554,9 +527,7 @@ uxa_driver_init(ScreenPtr screen, uxa_driver_t *uxa_driver)
     ShmRegisterFuncs(screen, &uxa_shm_funcs);
 #endif
 
-#ifdef SERVER_1_5
     uxa_glyphs_init(screen);
-#endif
 
     LogMessage(X_INFO, "UXA(%d): Driver registered support for the following"
 	       " operations:\n", screen->myNum);
-- 
1.6.2.2




More information about the Intel-gfx mailing list