[Intel-gfx] [PATCH] Remove EXA support and make UXA the default.

Eric Anholt eric at anholt.net
Wed Feb 25 07:42:47 CET 2009


UXA should now have better performance characteristics than EXA for all usage
other than potentially repeated redundant reads of buffer objects.  (Note that
some performance regressions with 3D are reported, but have all been attributed
to DRI2).  Without further EXA interface changes it is the only way to support
DRI2.  EXA development in master has now gratuitously broken drivers, and the
current developers have taken a track that the original authors (myself and
keithp) strongly disagree with.  As a result, EXA is now merely baggage in
our driver.

UXA continues to be distributed within the driver until another driver decides
to use it.  At that point the code will be moved into the server to be shared.
---
 man/intel.man          |    9 +-
 src/Makefile.am        |    2 +-
 src/i830.h             |   23 +---
 src/i830_accel.c       |   27 +----
 src/i830_batchbuffer.h |    4 +-
 src/i830_dri.c         |    6 -
 src/i830_driver.c      |   88 +-----------
 src/i830_exa.c         |  361 +++---------------------------------------------
 src/i830_memory.c      |   43 +------
 src/i830_video.c       |   12 --
 src/i830_xaa.c         |   10 +-
 11 files changed, 46 insertions(+), 539 deletions(-)

diff --git a/man/intel.man b/man/intel.man
index c7a3c61..de66002 100644
--- a/man/intel.man
+++ b/man/intel.man
@@ -151,10 +151,11 @@ increase the memory pool available to other graphics tasks.
 Default for i830 and newer: Enabled.
 Default for i810: this option is not used.
 .BI "Option \*qAccelMethod\*q \*q" string \*q
-Choose acceleration architecture, either "XAA" or "EXA".  XAA is the old
-XFree86 based acceleration architecture.  EXA is a newer and simpler
-acceleration architecture designed to better accelerate the X Render extension.
-Default: "EXA".
+Choose acceleration architecture, either "XAA" or "UXA".  XAA is the old
+XFree86 based acceleration architecture.  UXA is a newer and simpler
+acceleration architecture designed to better accelerate the X Render extension
+and take advantage of kernel memory management.
+Default: "UXA".
 .TP
 .BI "Option \*qModeDebug\*q \*q" boolean \*q
 Enable printing of additional debugging information about modesetting to
diff --git a/src/Makefile.am b/src/Makefile.am
index e05dbab..ca9bbc0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -32,7 +32,7 @@ SUBDIRS = xvmc bios_reader ch7017 ch7xxx ivch sil164 tfp410 $(REGDUMPER)
 
 AM_CFLAGS = @WARN_CFLAGS@ @XORG_CFLAGS@ @DRM_CFLAGS@ @DRI_CFLAGS@ \
 	@PCIACCESS_CFLAGS@ -I$(top_srcdir)/uxa \
-	@XMODES_CFLAGS@ -DI830_XV -DI830_USE_XAA -DI830_USE_EXA -DI830_USE_UXA
+	@XMODES_CFLAGS@ -DI830_XV -DI830_USE_XAA -DI830_USE_UXA
 
 intel_drv_la_LTLIBRARIES = intel_drv.la
 intel_drv_la_LDFLAGS = -module -avoid-version
diff --git a/src/i830.h b/src/i830.h
index ae6c588..1099206 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -76,12 +76,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "intel_bufmgr.h"
 #include "i915_drm.h"
 
-#ifdef I830_USE_EXA
-#include "exa.h"
-Bool I830EXAInit(ScreenPtr pScreen);
-unsigned long long I830TexOffsetStart(PixmapPtr pPix);
-#endif
-
 #ifdef I830_USE_UXA
 #include "uxa.h"
 Bool i830_uxa_init(ScreenPtr pScreen);
@@ -91,7 +85,7 @@ Bool i830_get_aperture_space(ScrnInfoPtr pScrn, drm_intel_bo **bo_table,
 			     int num_bos);
 #endif
 
-#if defined(I830_USE_UXA) || defined(I830_USE_EXA)
+#if defined(I830_USE_UXA)
 dri_bo *i830_get_pixmap_bo (PixmapPtr pixmap);
 void i830_set_pixmap_bo(PixmapPtr pixmap, dri_bo *bo);
 #endif
@@ -364,7 +358,6 @@ typedef enum accel_method {
     ACCEL_UNINIT = 0,
     ACCEL_NONE,
     ACCEL_XAA,
-    ACCEL_EXA,
     ACCEL_UXA
 } accel_method_t;
 
@@ -414,9 +407,6 @@ typedef struct _I830Rec {
    i830_memory *cursor_mem_argb[2];
    i830_memory *xaa_scratch;
    i830_memory *xaa_scratch_2;
-#ifdef I830_USE_EXA
-   i830_memory *exa_offscreen;
-#endif
    i830_memory *fake_bufmgr_mem;
 
    /* Regions allocated either from the above pools, or from agpgart. */
@@ -533,15 +523,12 @@ typedef struct _I830Rec {
 
    void (*batch_flush_notify)(ScrnInfoPtr pScrn);
 
-#ifdef I830_USE_EXA
-   ExaDriverPtr	EXADriverPtr;
-#endif
 #ifdef I830_USE_UXA
    uxa_driver_t *uxa_driver;
    Bool need_flush;
 #endif
    Bool need_sync;
-#if defined(I830_USE_EXA) || defined(I830_USE_UXA)
+#if defined(I830_USE_UXA)
    PixmapPtr pSrcPixmap;
 #endif
    int accel_pixmap_pitch_alignment;
@@ -576,12 +563,12 @@ typedef struct _I830Rec {
    } video;
 #endif
 
-   /* EXA render state */
+   /* Render state */
    float scale_units[2][2];
   /** Transform pointers for src/mask, or NULL if identity */
    PictTransform *transform[2];
    float coord_adjust;
-   /* i915 EXA render state */
+   /* i915 Render state */
    uint32_t mapstate[6];
    uint32_t samplerstate[6];
 
@@ -1012,7 +999,7 @@ static inline int i830_fb_compression_supported(I830Ptr pI830)
 do {							\
     if (I830PTR(pScrn)->fallback_debug) {		\
 	xf86DrvMsg(pScrn->scrnIndex, X_INFO,		\
-		   "EXA fallback: " s "\n", ##arg);	\
+		   "UXA fallback: " s "\n", ##arg);	\
     }							\
     return FALSE;					\
 } while(0)
diff --git a/src/i830_accel.c b/src/i830_accel.c
index 9155c92..8b8e381 100644
--- a/src/i830_accel.c
+++ b/src/i830_accel.c
@@ -67,28 +67,16 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 unsigned long
 intel_get_pixmap_offset(PixmapPtr pPix)
 {
-#if defined(I830_USE_EXA) || defined(I830_USE_UXA)
     ScreenPtr pScreen = pPix->drawable.pScreen;
     ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
     I830Ptr pI830 = I830PTR(pScrn);
 
-    if (pI830->accel == ACCEL_EXA)
-	return exaGetPixmapOffset(pPix);
-#endif
     return (unsigned long)pPix->devPrivate.ptr - (unsigned long)pI830->FbBase;
 }
 
 unsigned long
 intel_get_pixmap_pitch(PixmapPtr pPix)
 {
-#ifdef I830_USE_EXA
-    ScreenPtr pScreen = pPix->drawable.pScreen;
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-    I830Ptr pI830 = I830PTR(pScrn);
-
-    if (pI830->accel == ACCEL_EXA)
-	return exaGetPixmapPitch(pPix);
-#endif
     return (unsigned long)pPix->devKind;
 }
 
@@ -146,9 +134,6 @@ I830WaitLpRing(ScrnInfoPtr pScrn, int n, int timeout_millis)
 #ifdef I830_USE_XAA
 	 pI830->AccelInfoRec = NULL;	/* Stops recursive behavior */
 #endif
-#ifdef I830_USE_EXA
-	 pI830->EXADriverPtr = NULL;
-#endif
 #ifdef I830_USE_UXA
 	pI830->uxa_driver = NULL;
 #endif
@@ -317,9 +302,8 @@ I830AccelInit(ScreenPtr pScreen)
      * i845 limits 3D destination to pitch of 8B - 8kB, in dwords.
      * i845 limits 3D destination drawing rect to w,h of 2048,2048.
      *
-     * For the tiled issues, the only tiled buffer we draw to should be
-     * the front, which will have an appropriate pitch/offset already set up,
-     * so EXA doesn't need to worry.
+     * For the tiled issues, the allocators of tiled pixmaps that get drawn
+     * to with UXA (front buffer and DRI2) manage setting up the pitches.
      */
     if (IS_I965G(pI830)) {
 	pI830->accel_pixmap_offset_alignment = 4 * 2;
@@ -342,12 +326,7 @@ I830AccelInit(ScreenPtr pScreen)
 	return i830_uxa_init(pScreen);
 #else
 	xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-		   "UXA not built in, falling back to EXA.\n");
-	return I830EXAInit(pScreen);
-#endif
-#ifdef I830_USE_EXA
-    case ACCEL_EXA:
-	return I830EXAInit(pScreen);
+		   "UXA not built in, falling back.\n");
 #endif
 #ifdef I830_USE_XAA
     case ACCEL_XAA:
diff --git a/src/i830_batchbuffer.h b/src/i830_batchbuffer.h
index a72786e..f16023d 100644
--- a/src/i830_batchbuffer.h
+++ b/src/i830_batchbuffer.h
@@ -100,13 +100,13 @@ intel_batch_emit_reloc_pixmap(I830Ptr pI830, PixmapPtr pPixmap,
 			      uint32_t read_domains, uint32_t write_domain,
 			      uint32_t delta)
 {
-#if I830_USE_UXA || I830_USE_EXA
+#if I830_USE_UXA
     dri_bo *bo = i830_get_pixmap_bo(pPixmap);
 #endif
     uint32_t offset;
     assert(pI830->batch_ptr != NULL);
     assert(intel_batch_space(pI830) >= 4);
-#if I830_USE_UXA || I830_USE_EXA
+#if I830_USE_UXA
     if (bo) {
 	intel_batch_emit_reloc(pI830, bo, read_domains, write_domain, delta);
 	return;
diff --git a/src/i830_dri.c b/src/i830_dri.c
index 540bf5e..ed63648 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -582,12 +582,6 @@ I830DRIScreenInit(ScreenPtr pScreen)
    pDRIInfo->MoveBuffers = I830DRIMoveBuffers;
    pDRIInfo->bufferRequests = DRI_ALL_WINDOWS;
 
-#if DRIINFO_MAJOR_VERSION > 5 || \
-    (DRIINFO_MAJOR_VERSION == 5 && DRIINFO_MINOR_VERSION >= 3)
-      if (pI830->accel == ACCEL_EXA)
-	 pDRIInfo->texOffsetStart = I830TexOffsetStart;
-#endif
-
 #if DRI_DRIVER_FRAMEBUFFER_MAP
    /* DRI version is high enough that we can get the DRI code to not
     * try to manage the framebuffer.
diff --git a/src/i830_driver.c b/src/i830_driver.c
index fcd12ef..dbc02c1 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -216,18 +216,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include <xf86drmMode.h>
 #endif
 
-#ifdef I830_USE_EXA
-const char *I830exaSymbols[] = {
-    "exaGetVersion",
-    "exaDriverInit",
-    "exaDriverFini",
-    "exaOffscreenAlloc",
-    "exaOffscreenFree",
-    "exaWaitSync",
-    NULL
-};
-#endif
-
 #define BIT(x) (1 << (x))
 #define MAX(a,b) ((a) > (b) ? (a) : (b))
 #define NB_OF(x) (sizeof (x) / sizeof (*x))
@@ -1500,7 +1488,6 @@ static const char *accel_name[] =
    "unspecified",
    "no",
    "XAA",
-   "EXA",
    "UXA",
 };
 
@@ -1598,10 +1585,10 @@ I830AccelMethodInit(ScrnInfoPtr pScrn)
 
     /*
      * The ugliness below:
-     * If either XAA or EXA (exclusive) is compiled in, default to it.
+     * If either XAA or UXA (exclusive) is compiled in, default to it.
      *
      * If both are compiled in, and the user didn't specify noAccel, use the
-     * config option AccelMethod to determine which to use, defaulting to EXA
+     * config option AccelMethod to determine which to use, defaulting to UXA
      * if none is specified, or if the string was unrecognized.
      *
      * All this *could* go away if we removed XAA support from this driver,
@@ -1611,18 +1598,11 @@ I830AccelMethodInit(ScrnInfoPtr pScrn)
 #ifdef I830_USE_UXA
 	pI830->accel = ACCEL_UXA;
 #endif
-#ifdef I830_USE_EXA
-	pI830->accel = ACCEL_EXA;
-#endif
-#if I830_USE_XAA + I830_USE_EXA + I830_USE_UXA >= 2
+#if I830_USE_XAA + I830_USE_UXA >= 2
 	from = X_DEFAULT;
 	if ((s = (char *)xf86GetOptValString(pI830->Options,
 					     OPTION_ACCELMETHOD))) {
-	    if (!xf86NameCmp(s, "EXA")) {
-		from = X_CONFIG;
-		pI830->accel = ACCEL_EXA;
-	    }
-	    else if (!xf86NameCmp(s, "XAA")) {
+	    if (!xf86NameCmp(s, "XAA")) {
 		from = X_CONFIG;
 		pI830->accel = ACCEL_XAA;
 	    }
@@ -1719,21 +1699,11 @@ I830DrmModeInit(ScrnInfoPtr pScrn)
 #ifdef XF86DRM_MODE
     I830Ptr pI830 = I830PTR(pScrn);
     char *bus_id;
-    char *s;
     int ret;
 
     /* Default to UXA but allow override */
     pI830->accel = ACCEL_UXA;
 
-    if ((s = (char *)xf86GetOptValString(pI830->Options, OPTION_ACCELMETHOD))) {
-	if (!xf86NameCmp(s, "EXA"))
-	    pI830->accel = ACCEL_EXA;
-	else if (!xf86NameCmp(s, "UXA"))
-	    pI830->accel = ACCEL_UXA;
-	else
-	    pI830->accel = ACCEL_UXA;
-    }
-
     pI830->can_resize = FALSE;
     if (pI830->accel == ACCEL_UXA && pI830->directRenderingType != DRI_XF86DRI)
 	pI830->can_resize = TRUE;
@@ -2014,28 +1984,6 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
       break;
 #endif
 
-#ifdef I830_USE_EXA
-   case ACCEL_EXA: {
-      XF86ModReqInfo req;
-      int errmaj, errmin;
-
-      memset(&req, 0, sizeof(req));
-      req.majorversion = 2;
-#if EXA_VERSION_MINOR >= 2
-      req.minorversion = 2;
-#else
-      req.minorversion = 1;
-#endif
-      if (!LoadSubModule(pScrn->module, "exa", NULL, NULL, NULL, &req,
-		&errmaj, &errmin)) {
-	 LoaderErrorMsg(NULL, "exa", errmaj, errmin);
-	 PreInitCleanup(pScrn);
-	 return FALSE;
-      }
-      xf86LoaderReqSymLists(I830exaSymbols, NULL);
-      break;
-   }
-#endif
    default:
       break;
    }
@@ -3616,7 +3564,7 @@ I830LeaveVT(int scrnIndex, int flags)
    }
 #endif /* XF86DRI */
 
-   if ((pI830->accel == ACCEL_EXA || pI830->accel == ACCEL_UXA) && IS_I965G(pI830))
+   if (pI830->accel == ACCEL_UXA && IS_I965G(pI830))
       gen4_render_state_cleanup(pScrn);
 
    if (pI830->AccelInfoRec)
@@ -3673,8 +3621,7 @@ I830EnterVT(int scrnIndex, int flags)
 
    intel_batch_init(pScrn);
 
-   if ((pI830->accel == ACCEL_EXA || pI830->accel == ACCEL_UXA) &&
-       IS_I965G(pI830))
+   if (pI830->accel == ACCEL_UXA && IS_I965G(pI830))
       gen4_render_state_init(pScrn);
 
    if (!pI830->use_drm_mode) {
@@ -3823,13 +3770,6 @@ I830CloseScreen(int scrnIndex, ScreenPtr pScreen)
       pI830->AccelInfoRec = NULL;
    }
 #endif
-#ifdef I830_USE_EXA
-   if (pI830->EXADriverPtr) {
-       exaDriverFini(pScreen);
-       xfree(pI830->EXADriverPtr);
-       pI830->EXADriverPtr = NULL;
-   }
-#endif
 #ifdef I830_USE_UXA
    if (pI830->uxa_driver) {
        uxa_driver_fini (pScreen);
@@ -4033,14 +3973,6 @@ i830WaitSync(ScrnInfoPtr pScrn)
       }
       break;
 #endif
-#ifdef I830_USE_EXA
-   case ACCEL_EXA:
-      if (pI830->EXADriverPtr) {
-	 ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
-	 exaWaitSync(pScreen);
-      }
-      break;
-#endif
 #ifdef I830_USE_UXA
    case ACCEL_UXA:
       if (pI830->uxa_driver && pI830->need_sync) {
@@ -4066,14 +3998,6 @@ i830MarkSync(ScrnInfoPtr pScrn)
 	 pI830->AccelInfoRec->NeedToSync = TRUE;
       break;
 #endif
-#ifdef I830_USE_EXA
-   case ACCEL_EXA:
-      if (pI830->EXADriverPtr) {
-	 ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex];
-	 exaMarkSync(pScreen);
-      }
-      break;
-#endif
 #ifdef I830_USE_UXA
    case ACCEL_UXA:
       if (pI830->uxa_driver)
diff --git a/src/i830_exa.c b/src/i830_exa.c
index b9d6c64..5934819 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -167,44 +167,11 @@ i830_pixmap_pitch_is_aligned(PixmapPtr pixmap)
     return i830_pixmap_pitch(pixmap) % pI830->accel_pixmap_pitch_alignment == 0;
 }
 
-static Bool
-i830_exa_pixmap_is_offscreen(PixmapPtr pPixmap)
-{
-    ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
-    I830Ptr pI830 = I830PTR(pScrn);
-
-    if ((void *)pPixmap->devPrivate.ptr >= (void *)pI830->FbBase &&
-	(void *)pPixmap->devPrivate.ptr <
-	(void *)(pI830->FbBase + pI830->FbMapSize))
-    {
-	return TRUE;
-    } else {
-	return FALSE;
-    }
-}
-
 /**
- * I830EXASync - wait for a command to finish
- * @pScreen: current screen
- * @marker: marker command to wait for
- *
- * Wait for the command specified by @marker to finish, then return.  We don't
- * actually do marker waits, though we might in the future.  For now, just
- * wait for a full idle.
- */
-static void
-I830EXASync(ScreenPtr pScreen, int marker)
-{
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-
-    I830Sync(pScrn);
-}
-
-/**
- * I830EXAPrepareSolid - prepare for a Solid operation, if possible
+ * prepare for a Solid operation, if possible
  */
 static Bool
-I830EXAPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg)
+i830_uxa_prepare_solid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg)
 {
     ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
     I830Ptr pI830 = I830PTR(pScrn);
@@ -214,7 +181,7 @@ I830EXAPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg)
 	i830_get_pixmap_bo(pPixmap),
     };
 
-    if (!EXA_PM_IS_SOLID(&pPixmap->drawable, planemask))
+    if (!UXA_PM_IS_SOLID(&pPixmap->drawable, planemask))
 	I830FALLBACK("planemask is not solid");
 
     if (pPixmap->drawable.bitsPerPixel == 24)
@@ -251,7 +218,7 @@ I830EXAPrepareSolid(PixmapPtr pPixmap, int alu, Pixel planemask, Pixel fg)
 }
 
 static void
-I830EXASolid(PixmapPtr pPixmap, int x1, int y1, int x2, int y2)
+i830_uxa_solid(PixmapPtr pPixmap, int x1, int y1, int x2, int y2)
 {
     ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
     I830Ptr pI830 = I830PTR(pScrn);
@@ -286,7 +253,7 @@ I830EXASolid(PixmapPtr pPixmap, int x1, int y1, int x2, int y2)
 }
 
 static void
-I830EXADoneSolid(PixmapPtr pPixmap)
+i830_uxa_done_solid(PixmapPtr pPixmap)
 {
 #if ALWAYS_SYNC || ALWAYS_FLUSH
     ScrnInfoPtr pScrn = xf86Screens[pPixmap->drawable.pScreen->myNum];
@@ -305,8 +272,8 @@ I830EXADoneSolid(PixmapPtr pPixmap)
  *   - support planemask using FULL_BLT_CMD?
  */
 static Bool
-I830EXAPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir,
-		   int ydir, int alu, Pixel planemask)
+i830_uxa_prepare_copy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir,
+		      int ydir, int alu, Pixel planemask)
 {
     ScrnInfoPtr pScrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum];
     I830Ptr pI830 = I830PTR(pScrn);
@@ -316,7 +283,7 @@ I830EXAPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir,
 	i830_get_pixmap_bo(pDstPixmap),
     };
 
-    if (!EXA_PM_IS_SOLID(&pSrcPixmap->drawable, planemask))
+    if (!UXA_PM_IS_SOLID(&pSrcPixmap->drawable, planemask))
 	I830FALLBACK("planemask is not solid");
 
     if (pDstPixmap->drawable.bitsPerPixel < 8)
@@ -346,8 +313,8 @@ I830EXAPrepareCopy(PixmapPtr pSrcPixmap, PixmapPtr pDstPixmap, int xdir,
 }
 
 static void
-I830EXACopy(PixmapPtr pDstPixmap, int src_x1, int src_y1, int dst_x1,
-	    int dst_y1, int w, int h)
+i830_uxa_copy(PixmapPtr pDstPixmap, int src_x1, int src_y1, int dst_x1,
+	      int dst_y1, int w, int h)
 {
     ScrnInfoPtr pScrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum];
     I830Ptr pI830 = I830PTR(pScrn);
@@ -398,7 +365,7 @@ I830EXACopy(PixmapPtr pDstPixmap, int src_x1, int src_y1, int dst_x1,
 }
 
 static void
-I830EXADoneCopy(PixmapPtr pDstPixmap)
+i830_uxa_done_copy(PixmapPtr pDstPixmap)
 {
 #if ALWAYS_SYNC || ALWAYS_FLUSH
     ScrnInfoPtr pScrn = xf86Screens[pDstPixmap->drawable.pScreen->myNum];
@@ -516,267 +483,6 @@ i830_transform_is_affine (PictTransformPtr t)
     return t->matrix[2][0] == 0 && t->matrix[2][1] == 0;
 }
 
-#ifdef XF86DRM_MODE
-
-static void *
-I830EXACreatePixmap(ScreenPtr screen, int size, int align)
-{
-    ScrnInfoPtr scrn = xf86Screens[screen->myNum];
-    I830Ptr i830 = I830PTR(scrn);
-    struct i830_exa_pixmap_priv *new_priv;
-
-    new_priv = xcalloc(1, sizeof(struct i830_exa_pixmap_priv));
-    if (!new_priv)
-        return NULL;
-
-    if (size == 0)
-	return new_priv;
-
-    new_priv->bo = dri_bo_alloc(i830->bufmgr, "pixmap", size,
-				i830->accel_pixmap_offset_alignment);
-    if (!new_priv->bo) {
-	xfree(new_priv);
-	return NULL;
-    }
-
-    return new_priv;
-}
-
-static void
-I830EXADestroyPixmap(ScreenPtr pScreen, void *driverPriv)
-{
-    struct i830_exa_pixmap_priv *priv = driverPriv;
-
-    if (priv->bo)
-	dri_bo_unreference(priv->bo);
-    xfree(priv);
-}
-
-static Bool I830EXAPixmapIsOffscreen(PixmapPtr pPix)
-{
-    struct i830_exa_pixmap_priv *driver_priv = exaGetPixmapDriverPrivate(pPix);
-
-    if (driver_priv && driver_priv->bo)
-	return TRUE;
-
-    return FALSE;
-}
-
-static Bool I830EXAPrepareAccess(PixmapPtr pPix, int index)
-{
-    ScreenPtr screen = pPix->drawable.pScreen;
-    ScrnInfoPtr scrn = xf86Screens[screen->myNum];
-    I830Ptr i830 = I830PTR(scrn);
-    struct i830_exa_pixmap_priv *driver_priv = exaGetPixmapDriverPrivate(pPix);
-
-    if (!driver_priv) {
-	xf86DrvMsg(scrn->scrnIndex, X_WARNING, "%s: no driver private?\n",
-		   __FUNCTION__);
-	return FALSE;
-    }
-
-    if (!driver_priv->bo) {
-	xf86DrvMsg(scrn->scrnIndex, X_WARNING, "%s: no buffer object?\n",
-		   __FUNCTION__);
-	return TRUE;
-    }
-
-    intel_batch_flush(scrn, FALSE);
-    if (i830->need_sync) {
-	I830Sync(scrn);
-	i830->need_sync = FALSE;
-    }
-    if (drm_intel_gem_bo_map_gtt(driver_priv->bo)) {
-	xf86DrvMsg(scrn->scrnIndex, X_WARNING, "%s: bo map failed\n",
-		   __FUNCTION__);
-	return FALSE;
-    }
-    pPix->devPrivate.ptr = driver_priv->bo->virtual;
-
-    return TRUE;
-}
-
-static void I830EXAFinishAccess(PixmapPtr pPix, int index)
-{
-    ScreenPtr screen = pPix->drawable.pScreen;
-    ScrnInfoPtr scrn = xf86Screens[screen->myNum];
-    I830Ptr i830 = I830PTR(scrn);
-    struct i830_exa_pixmap_priv *driver_priv = exaGetPixmapDriverPrivate(pPix);
-
-    if (!driver_priv) {
-	xf86DrvMsg(scrn->scrnIndex, X_WARNING, "%s: no driver private?\n",
-		   __FUNCTION__);
-	return;
-    }
-
-    if (!driver_priv->bo) {
-	xf86DrvMsg(scrn->scrnIndex, X_WARNING, "%s: no buffer object?\n",
-		   __FUNCTION__);
-	return;
-    }
-
-    dri_bo_unmap(driver_priv->bo);
-    pPix->devPrivate.ptr = NULL;
-    if (driver_priv->bo == i830->front_buffer->bo)
-	i830->need_flush = TRUE;
-}
-
-static Bool I830EXAModifyPixmapHeader(PixmapPtr pPix, int width, int height,
-				      int depth, int bitsPerPixel, int devKind,
-				      pointer pPixData)
-{
-    ScreenPtr	pScreen = pPix->drawable.pScreen;
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-    I830Ptr pI830 = I830PTR(pScrn);
-    struct i830_exa_pixmap_priv *driver_priv = exaGetPixmapDriverPrivate(pPix);
-
-    if (!driver_priv)
-	return FALSE;
-
-    if (pI830->use_drm_mode &&
-	drmmode_is_rotate_pixmap(pScrn, pPixData, &driver_priv->bo)) {
-	/* this is a rotate pixmap */
-	dri_bo_unmap(driver_priv->bo);
-	dri_bo_reference(driver_priv->bo);
-        miModifyPixmapHeader(pPix, width, height, depth,
-			     bitsPerPixel, devKind, NULL);
-    }
-
-    if (pPixData == pI830->FbBase + pScrn->fbOffset) {
-	if (driver_priv->bo)
-		dri_bo_unreference(driver_priv->bo);
-	driver_priv->bo =
-	    intel_bo_gem_create_from_name(pI830->bufmgr, "front",
-					  pI830->front_buffer->gem_name);
-	if (!driver_priv->bo)
-	    return FALSE;
-
-	miModifyPixmapHeader(pPix, width, height, depth,
-			     bitsPerPixel, devKind, NULL);
-
-	return TRUE;
-    }
-    return FALSE;
-}
-
-#endif /* XF86DRM_MODE */
-
-Bool
-I830EXAInit(ScreenPtr pScreen)
-{
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-    I830Ptr pI830 = I830PTR(pScrn);
-
-    pI830->EXADriverPtr = exaDriverAlloc();
-    if (pI830->EXADriverPtr == NULL) {
-	pI830->accel = ACCEL_NONE;
-	return FALSE;
-    }
-    memset(pI830->EXADriverPtr, 0, sizeof(*pI830->EXADriverPtr));
-
-    pI830->bufferOffset = 0;
-    pI830->EXADriverPtr->exa_major = 2;
-    /* If compiled against EXA 2.2, require 2.2 so we can use the
-     * PixmapIsOffscreen hook.
-     */
-#if EXA_VERSION_MINOR >= 2
-    pI830->EXADriverPtr->exa_minor = 2;
-#else
-    pI830->EXADriverPtr->exa_minor = 1;
-    xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-	       "EXA compatibility mode.  Output rotation rendering "
-	       "performance may suffer\n");
-#endif
-    if (!pI830->use_drm_mode) {
-	pI830->EXADriverPtr->memoryBase = pI830->FbBase;
-	if (pI830->exa_offscreen) {
-	    pI830->EXADriverPtr->offScreenBase = pI830->exa_offscreen->offset;
-	    pI830->EXADriverPtr->memorySize = pI830->exa_offscreen->offset +
-		pI830->exa_offscreen->size;
-	} else {
-	    pI830->EXADriverPtr->offScreenBase = pI830->FbMapSize;
-	    pI830->EXADriverPtr->memorySize = pI830->FbMapSize;
-	}
-	pI830->EXADriverPtr->flags = EXA_OFFSCREEN_PIXMAPS;
-    } else {
-#ifdef XF86DRM_MODE
-	pI830->EXADriverPtr->flags = EXA_OFFSCREEN_PIXMAPS | EXA_HANDLES_PIXMAPS;
-	pI830->EXADriverPtr->PrepareAccess = I830EXAPrepareAccess;
-	pI830->EXADriverPtr->FinishAccess = I830EXAFinishAccess;
-#if EXA_VERSION_MINOR >= 4
-	pI830->EXADriverPtr->CreatePixmap = I830EXACreatePixmap;
-	pI830->EXADriverPtr->DestroyPixmap = I830EXADestroyPixmap;
-	pI830->EXADriverPtr->PixmapIsOffscreen = I830EXAPixmapIsOffscreen;
-	pI830->EXADriverPtr->ModifyPixmapHeader = I830EXAModifyPixmapHeader;
-#endif
-#endif /* XF86DRM_MODE */
-    }
-
-    DPRINTF(PFX, "EXA Mem: memoryBase 0x%x, end 0x%x, offscreen base 0x%x, "
-	    "memorySize 0x%x\n",
-	    pI830->EXADriverPtr->memoryBase,
-	    pI830->EXADriverPtr->memoryBase + pI830->EXADriverPtr->memorySize,
-	    pI830->EXADriverPtr->offScreenBase,
-	    pI830->EXADriverPtr->memorySize);
-
-    pI830->EXADriverPtr->pixmapOffsetAlign = pI830->accel_pixmap_offset_alignment;
-    pI830->EXADriverPtr->pixmapPitchAlign = pI830->accel_pixmap_pitch_alignment;
-    pI830->EXADriverPtr->maxX = pI830->accel_max_x;
-    pI830->EXADriverPtr->maxY = pI830->accel_max_y;
-
-    /* Sync */
-    pI830->EXADriverPtr->WaitMarker = I830EXASync;
-
-    /* Solid fill */
-    pI830->EXADriverPtr->PrepareSolid = I830EXAPrepareSolid;
-    pI830->EXADriverPtr->Solid = I830EXASolid;
-    pI830->EXADriverPtr->DoneSolid = I830EXADoneSolid;
-
-    /* Copy */
-    pI830->EXADriverPtr->PrepareCopy = I830EXAPrepareCopy;
-    pI830->EXADriverPtr->Copy = I830EXACopy;
-    pI830->EXADriverPtr->DoneCopy = I830EXADoneCopy;
-
-    /* Composite */
-    if (!IS_I9XX(pI830)) {
-    	pI830->EXADriverPtr->CheckComposite = i830_check_composite;
-    	pI830->EXADriverPtr->PrepareComposite = i830_prepare_composite;
-    	pI830->EXADriverPtr->Composite = i830_composite;
-    	pI830->EXADriverPtr->DoneComposite = i830_done_composite;
-    } else if (IS_I915G(pI830) || IS_I915GM(pI830) ||
-	       IS_I945G(pI830) || IS_I945GM(pI830) || IS_G33CLASS(pI830))
-    {
-	pI830->EXADriverPtr->CheckComposite = i915_check_composite;
-   	pI830->EXADriverPtr->PrepareComposite = i915_prepare_composite;
-	pI830->EXADriverPtr->Composite = i915_composite;
-    	pI830->EXADriverPtr->DoneComposite = i830_done_composite;
-    } else {
- 	pI830->EXADriverPtr->CheckComposite = i965_check_composite;
- 	pI830->EXADriverPtr->PrepareComposite = i965_prepare_composite;
- 	pI830->EXADriverPtr->Composite = i965_composite;
- 	pI830->EXADriverPtr->DoneComposite = i830_done_composite;
-    }
-#if EXA_VERSION_MINOR >= 2
-    if (!pI830->use_drm_mode)
-	pI830->EXADriverPtr->PixmapIsOffscreen = i830_exa_pixmap_is_offscreen;
-#endif
-
-    if(!exaDriverInit(pScreen, pI830->EXADriverPtr)) {
-	xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-		   "EXA initialization failed; trying older version\n");
-	pI830->EXADriverPtr->exa_minor = 0;
-	if(!exaDriverInit(pScreen, pI830->EXADriverPtr)) {
-	    xfree(pI830->EXADriverPtr);
-	    pI830->accel = ACCEL_NONE;
-	    return FALSE;
-	}
-    }
-
-    I830SelectBuffer(pScrn, I830_SELECT_FRONT);
-
-    return TRUE;
-}
-
 dri_bo *
 i830_get_pixmap_bo(PixmapPtr pixmap)
 {
@@ -789,13 +495,6 @@ i830_get_pixmap_bo(PixmapPtr pixmap)
 	return dixLookupPrivate(&pixmap->devPrivates, &uxa_pixmap_index);
     }
 #endif
-#ifdef XF86DRM_MODE
-    if (i830->accel == ACCEL_EXA) {
-	struct i830_exa_pixmap_priv *driver_priv =
-	    exaGetPixmapDriverPrivate(pixmap);
-	return driver_priv ? driver_priv->bo : NULL;
-    }
-#endif
 
     return NULL;
 }
@@ -815,16 +514,6 @@ i830_set_pixmap_bo(PixmapPtr pixmap, dri_bo *bo)
 	dixSetPrivate(&pixmap->devPrivates, &uxa_pixmap_index, bo);
     }
 #endif
-#ifdef XF86DRM_MODE
-    if (i830->accel == ACCEL_EXA) {
-	struct i830_exa_pixmap_priv *driver_priv =
-	    exaGetPixmapDriverPrivate(pixmap);
-	if (driver_priv) {
-	    dri_bo_reference(bo);
-	    driver_priv->bo = bo;
-	}
-    }
-#endif
 }
 #if defined(I830_USE_UXA)
 
@@ -1027,14 +716,14 @@ i830_uxa_init (ScreenPtr pScreen)
     i830->uxa_driver->uxa_minor = 0;
 
     /* Solid fill */
-    i830->uxa_driver->prepare_solid = I830EXAPrepareSolid;
-    i830->uxa_driver->solid = I830EXASolid;
-    i830->uxa_driver->done_solid = I830EXADoneSolid;
+    i830->uxa_driver->prepare_solid = i830_uxa_prepare_solid;
+    i830->uxa_driver->solid = i830_uxa_solid;
+    i830->uxa_driver->done_solid = i830_uxa_done_solid;
 
     /* Copy */
-    i830->uxa_driver->prepare_copy = I830EXAPrepareCopy;
-    i830->uxa_driver->copy = I830EXACopy;
-    i830->uxa_driver->done_copy = I830EXADoneCopy;
+    i830->uxa_driver->prepare_copy = i830_uxa_prepare_copy;
+    i830->uxa_driver->copy = i830_uxa_copy;
+    i830->uxa_driver->done_copy = i830_uxa_done_copy;
 
     /* Composite */
     if (!IS_I9XX(i830)) {
@@ -1082,19 +771,3 @@ i830_uxa_init (ScreenPtr pScreen)
     return TRUE;
 }
 #endif /* I830_USE_UXA */
-
-#ifdef XF86DRI
-
-#ifndef ExaOffscreenMarkUsed
-extern void ExaOffscreenMarkUsed(PixmapPtr);
-#endif
-
-unsigned long long
-I830TexOffsetStart(PixmapPtr pPix)
-{
-    exaMoveInPixmap(pPix);
-    ExaOffscreenMarkUsed(pPix);
-
-    return exaGetPixmapOffset(pPix);
-}
-#endif
diff --git a/src/i830_memory.c b/src/i830_memory.c
index 62765d6..cc3ef25 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -73,10 +73,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  * - Compatibility texture pool (optional, more is always better)
  * - New texture pool (optional, more is always better.  aperture allocation
  *     only)
- * - EXA offscreen pool (more is always better)
  *
  * We also want to be able to resize the front/back/depth buffers, and then
- * resize the EXA and texture memory pools appropriately.
+ * resize the UXA and texture memory pools appropriately.
  *
  * The user may request a specific amount of memory to be used
  * (pI830->pEnt->videoRam != 0), in which case allocations have to fit within
@@ -380,7 +379,6 @@ i830_reset_allocations(ScrnInfoPtr pScrn)
     pI830->front_buffer_2 = NULL;
     pI830->xaa_scratch = NULL;
     pI830->xaa_scratch_2 = NULL;
-    pI830->exa_offscreen = NULL;
     pI830->overlay_regs = NULL;
     pI830->power_context = NULL;
 #ifdef XF86DRI
@@ -501,11 +499,6 @@ i830_allocator_init(ScrnInfoPtr pScrn, unsigned long offset, unsigned long size)
 	 */
 	mmsize = size;
 
-	/* EXA area is fixed. */
-	if (pI830->accel == ACCEL_EXA) {
-	    mmsize -= ROUND_TO_PAGE(3 * pScrn->displayWidth * pI830->cpp *
-				    pScrn->virtualY);
-	}
 	/* Classic textures are fixed. */
 	if (pI830->allocate_classic_textures)
 	    mmsize -= MB(32);
@@ -1429,8 +1422,6 @@ Bool
 i830_allocate_2d_memory(ScrnInfoPtr pScrn)
 {
     I830Ptr pI830 = I830PTR(pScrn);
-    unsigned int pitch = pScrn->displayWidth * pI830->cpp;
-    long size;
 
     if (!pI830->use_drm_mode) {
 	if (!pI830->StolenOnly &&
@@ -1460,7 +1451,7 @@ i830_allocate_2d_memory(ScrnInfoPtr pScrn)
 
     if (pI830->memory_manager == NULL) {
 	pI830->fake_bufmgr_mem = i830_allocate_memory(pScrn, "fake bufmgr",
-						      MB(1), PITCH_NONE, GTT_PAGE_SIZE, 0,
+						      MB(32), PITCH_NONE, GTT_PAGE_SIZE, 0,
 						      TILE_NONE);
 	if (pI830->fake_bufmgr_mem == NULL) {
 	    xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
@@ -1492,36 +1483,6 @@ i830_allocate_2d_memory(ScrnInfoPtr pScrn)
     if (pI830->front_buffer == NULL)
 	return FALSE;
 
-#ifdef I830_USE_EXA
-    if (pI830->accel == ACCEL_EXA && !pI830->use_drm_mode) {
-	if (pI830->exa_offscreen == NULL) {
-	    /* Default EXA to having 3 screens worth of offscreen memory space
-	     * (for pixmaps).
-	     *
-	     * XXX: It would be nice to auto-size it larger if the user
-	     * specified a larger size, or to fit along with texture and FB
-	     * memory if a low videoRam is specified.
-	     */
-	    size = 3 * pitch * pScrn->virtualY;
-	    size = ROUND_TO_PAGE(size);
-
-	    /* EXA has no way to tell it that the offscreen memory manager has
-	     * moved its base and all the contents with it, so we have to have
-	     * it locked in place for the whole driver instance.
-	     */
-	    pI830->exa_offscreen =
-		i830_allocate_memory(pScrn, "exa offscreen",
-				     size, PITCH_NONE, 1, NEED_LIFETIME_FIXED,
-				     TILE_NONE);
-	    if (pI830->exa_offscreen == NULL) {
-		xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-			   "Failed to allocate EXA offscreen memory.\n");
-		return FALSE;
-	    }
-	}
-    }
-#endif /* I830_USE_EXA */
-
     if (pI830->accel == ACCEL_XAA) {
 	/* The lifetime fixed offset of xaa scratch is probably not required,
 	 * but we do some setup using it at XAAInit() time.  And XAA may not
diff --git a/src/i830_video.c b/src/i830_video.c
index 76b5189..ad88131 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -143,11 +143,6 @@ static Atom xvGamma0, xvGamma1, xvGamma2, xvGamma3, xvGamma4, xvGamma5;
 #define OVERLAY_DEBUG if (0) ErrorF
 #endif
 
-/* Oops, I never exported this function in EXA.  I meant to. */
-#ifndef exaMoveInPixmap
-void exaMoveInPixmap (PixmapPtr pPixmap);
-#endif
-
 /*
  * OCMD - Overlay Command Register
  */
@@ -2501,13 +2496,6 @@ I830PutImage(ScrnInfoPtr pScrn,
 	pPixmap = (PixmapPtr)pDraw;
     }
 
-#ifdef I830_USE_EXA
-    if (pPriv->textured && pI830->accel == ACCEL_EXA) {
-	/* Force the pixmap into framebuffer so we can draw to it. */
-	exaMoveInPixmap(pPixmap);
-    }
-#endif
-
     if (pPriv->textured && pI830->accel <= ACCEL_XAA &&
 	    (((char *)pPixmap->devPrivate.ptr < (char *)pI830->FbBase) ||
 	     ((char *)pPixmap->devPrivate.ptr >= (char *)pI830->FbBase +
diff --git a/src/i830_xaa.c b/src/i830_xaa.c
index 7684978..0b7d43a 100644
--- a/src/i830_xaa.c
+++ b/src/i830_xaa.c
@@ -313,9 +313,9 @@ I830SetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop,
 	pI830->BR[13] = (pScrn->displayWidth * pI830->cpp);
     }
 
-#ifdef I830_USE_EXA
+#ifdef I830_USE_UXA
     /* This function gets used by I830DRIInitBuffers(), and we might not have
-     * XAAGetPatternROP() available.  So just use the ROPs from our EXA code
+     * XAAGetPatternROP() available.  So just use the ROPs from our UXA code
      * if available.
      */
     pI830->BR[13] |= (I830PatternROP[rop] << 16);
@@ -384,9 +384,9 @@ I830SetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop,
 	pI830->BR[13] = (pScrn->displayWidth * pI830->cpp);
     }
 
-#ifdef I830_USE_EXA
+#ifdef I830_USE_UXA
     /* This function gets used by I830DRIInitBuffers(), and we might not have
-     * XAAGetCopyROP() available.  So just use the ROPs from our EXA code
+     * XAAGetCopyROP() available.  So just use the ROPs from our UXA code
      * if available.
      */
     pI830->BR[13] |= I830CopyROP[rop] << 16;
@@ -807,7 +807,7 @@ i830_xaa_composite(CARD8	op,
 
     /* OK, so we've got a Render operation on one of our shadow pixmaps, with
      * the source being the real framebuffer.  We know that both of these are
-     * in framebuffer, with no x/y offsets, i.e. normal pixmaps like our EXA-
+     * in framebuffer, with no x/y offsets, i.e. normal pixmaps like our UXA-
      * based Render acceleration code expects.
      */
     assert(pSrcPixmap->drawable.x == 0);
-- 
1.5.6.5




More information about the Intel-gfx mailing list