[Intel-gfx] [PATCH 04/14] Remove EXA support.

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


UXA has completely replaced EXA at this point.  UXA is the same rendering
core as EXA, but relying on kernel memory management or a fake bufmgr instead
of trying to manage memory in the X Server.
---
 man/intel.man          |    8 --
 src/Makefile.am        |    2 +-
 src/drmmode_display.c  |   24 ----
 src/i830.h             |   28 +----
 src/i830_accel.c       |   25 +----
 src/i830_batchbuffer.h |    4 +-
 src/i830_driver.c      |  113 +-----------------
 src/i830_exa.c         |  314 +-----------------------------------------------
 src/i830_memory.c      |   42 -------
 src/i830_video.c       |   12 --
 10 files changed, 17 insertions(+), 555 deletions(-)

diff --git a/man/intel.man b/man/intel.man
index 3e74bc2..05aa678 100644
--- a/man/intel.man
+++ b/man/intel.man
@@ -146,14 +146,6 @@ have options for selecting adaptors.
 .IP
 Default: Textured video adaptor is preferred.
 .TP
-.BI "Option \*qAccelMethod\*q \*q" string \*q
-Choose acceleration architecture, either "UXA" or "EXA".
-EXA is a simple acceleration architecture designed for systems without
-kernel memory management, while UXA is designed to take advantage of the
-capabilities of kernel memory management.
-.IP
-Default: "UXA" if kernel-modesetting is available, "EXA" otherwise.
-.TP
 .BI "Option \*qModeDebug\*q \*q" boolean \*q
 Enable printing of additional debugging information about modesetting to
 the server log.
diff --git a/src/Makefile.am b/src/Makefile.am
index 6401269..d4b9c8a 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 \
-	-DI830_XV -DI830_USE_EXA -DI830_USE_UXA
+	-DI830_XV -DI830_USE_UXA
 
 intel_drv_la_LTLIBRARIES = intel_drv.la
 intel_drv_la_LDFLAGS = -module -avoid-version
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index b081a7b..8f682d5 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -926,28 +926,4 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp)
 	return TRUE;
 }
 
-Bool drmmode_is_rotate_pixmap(ScrnInfoPtr pScrn, pointer pPixData, dri_bo **bo)
-{
-	return FALSE;
-
-#if 0
-	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR (pScrn);
-	int i;
-
-	for (i = 0; i < config->num_crtc; i++) {
-		xf86CrtcPtr crtc = config->crtc[i];
-		drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
-
-		if (!drmmode_crtc->rotate_bo)
-			continue;
-
-		if (drmmode_crtc->rotate_bo->virtual == pPixData) {
-			*bo = drmmode_crtc->rotate_bo;
-			return TRUE;
-		}
-	}
-	return FALSE;
-#endif
-}
-
 #endif
diff --git a/src/i830.h b/src/i830.h
index 48a7380..20b039f 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -73,11 +73,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);
-#endif
-
 #ifdef I830_USE_UXA
 #include "uxa.h"
 Bool i830_uxa_init(ScreenPtr pScreen);
@@ -87,7 +82,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
@@ -333,7 +328,6 @@ enum backlight_control {
 typedef enum accel_method {
     ACCEL_UNINIT = 0,
     ACCEL_NONE,
-    ACCEL_EXA,
     ACCEL_UXA
 } accel_method_t;
 
@@ -373,9 +367,6 @@ typedef struct _I830Rec {
    /* separate small buffers for kernels that support this */
    i830_memory *cursor_mem_classic[2];
    i830_memory *cursor_mem_argb[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. */
@@ -452,15 +443,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;
@@ -495,12 +483,12 @@ typedef struct _I830Rec {
    } video;
 #endif
 
-   /* EXA render state */
+   /* Render accel 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 accel state */
    uint32_t mapstate[6];
    uint32_t samplerstate[6];
 
@@ -652,10 +640,6 @@ typedef struct _I830Rec {
 unsigned long intel_get_pixmap_offset(PixmapPtr pPix);
 unsigned long intel_get_pixmap_pitch(PixmapPtr pPix);
 
-struct i830_exa_pixmap_priv {
-    dri_bo *bo;
-};
-
 /* Batchbuffer support macros and functions */
 #include "i830_batchbuffer.h"
 
@@ -718,8 +702,6 @@ void I830DRI2CloseScreen(ScreenPtr pScreen);
 
 #ifdef XF86DRM_MODE
 extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp);
-extern Bool drmmode_is_rotate_pixmap(ScrnInfoPtr pScrn, pointer pPixData,
-				     dri_bo **bo);
 #endif
 
 extern Bool I830AccelInit(ScreenPtr pScreen);
@@ -886,7 +868,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);	\
+		   "fallback: " s "\n", ##arg);	\
     }							\
     return FALSE;					\
 } while(0)
diff --git a/src/i830_accel.c b/src/i830_accel.c
index 31410c9..5af02c9 100644
--- a/src/i830_accel.c
+++ b/src/i830_accel.c
@@ -66,28 +66,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;
 }
 
@@ -136,9 +124,6 @@ I830WaitLpRing(ScrnInfoPtr pScrn, int n, int timeout_millis)
 	 else
 	     i830_dump_error_state(pScrn);
 	 ErrorF("space: %d wanted %d\n", ring->space, n);
-#ifdef I830_USE_EXA
-	 pI830->EXADriverPtr = NULL;
-#endif
 #ifdef I830_USE_UXA
 	pI830->uxa_driver = NULL;
 #endif
@@ -279,7 +264,7 @@ I830AccelInit(ScreenPtr pScreen)
      *
      * 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.
+     * so UXA doesn't need to worry.
      */
     if (IS_I965G(pI830)) {
 	pI830->accel_pixmap_offset_alignment = 4 * 2;
@@ -300,14 +285,6 @@ I830AccelInit(ScreenPtr pScreen)
     case ACCEL_UXA:
 #ifdef I830_USE_UXA
 	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);
 #endif
     case ACCEL_UNINIT:
     case ACCEL_NONE:
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_driver.c b/src/i830_driver.c
index 4689330..aad04ab 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -213,18 +213,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include <xf86drmMode.h>
 #endif
 
-#ifdef I830_USE_EXA
-static 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))
@@ -297,7 +285,6 @@ static PciChipsets I830PciChipsets[] = {
  */
 
 typedef enum {
-   OPTION_ACCELMETHOD,
    OPTION_NOACCEL,
    OPTION_DRI,
    OPTION_VIDEO_KEY,
@@ -316,7 +303,6 @@ typedef enum {
 } I830Opts;
 
 static OptionInfoRec I830Options[] = {
-   {OPTION_ACCELMETHOD,	"AccelMethod",	OPTV_ANYSTR,	{0},	FALSE},
    {OPTION_NOACCEL,	"NoAccel",	OPTV_BOOLEAN,	{0},	FALSE},
    {OPTION_DRI,		"DRI",		OPTV_BOOLEAN,	{0},	TRUE},
    {OPTION_COLOR_KEY,	"ColorKey",	OPTV_INTEGER,	{0},	FALSE},
@@ -1474,7 +1460,6 @@ static const char *accel_name[] =
 {
    "unspecified",
    "no",
-   "EXA",
    "UXA",
 };
 
@@ -1567,34 +1552,12 @@ I830AccelMethodInit(ScrnInfoPtr pScrn)
 {
     I830Ptr pI830 = I830PTR(pScrn);
     MessageType from = X_PROBED;
-    char *s;
     int i, num_pipe;
 
     if (xf86ReturnOptValBool(pI830->Options, OPTION_NOACCEL, FALSE)) {
 	pI830->accel = ACCEL_NONE;
-    }
-
-    if (!(pI830->accel == ACCEL_NONE)) {
-#ifdef I830_USE_UXA
-	pI830->accel = ACCEL_UXA;
-#endif
-#ifdef I830_USE_EXA
-	pI830->accel = ACCEL_EXA;
-#endif
-#if I830_USE_EXA + 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, "UXA")) {
-		from = X_CONFIG;
-	       pI830->accel = ACCEL_UXA;
-	    }
-	}
-#endif
+    } else {
+       pI830->accel = ACCEL_UXA;
 	xf86DrvMsg(pScrn->scrnIndex, from, "Using %s for acceleration\n",
 		   accel_name[pI830->accel]);
     }
@@ -1672,25 +1635,10 @@ 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, "UXA"))
-	    xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "kernel mode setting active,overridding accelmethod and using UXA\n");
-    }
-
-    pI830->can_resize = FALSE;
-    if (pI830->accel == ACCEL_UXA)
-	pI830->can_resize = TRUE;
-
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-	       "Resizable framebuffer: %s (%d %d)\n",
-	       pI830->can_resize ? "available" : "not available",
-	       pI830->directRenderingType, pI830->accel);
+    pI830->can_resize = TRUE;
 
     bus_id = DRICreatePCIBusID(pI830->PciInfo);
 
@@ -1897,33 +1845,6 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
 
    xf86LoaderReqSymLists(I810fbSymbols, NULL);
 
-   switch (pI830->accel) {
-#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;
-   }
-
    if (!pI830->use_drm_mode) {
        i830CompareRegsToSnapshot(pScrn, "After PreInit");
 
@@ -3238,7 +3159,7 @@ I830LeaveVT(int scrnIndex, int flags)
 	 FatalError("DRM_I915_LEAVEVT failed: %s\n", strerror(ret));
    }
 
-   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);
 
    ret = drmDropMaster(pI830->drmSubFD);
@@ -3318,8 +3239,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) {
@@ -3404,13 +3324,6 @@ I830CloseScreen(int scrnIndex, ScreenPtr pScreen)
        vgaHWUnmapMem(pScrn);
    }
 
-#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);
@@ -3548,14 +3461,6 @@ i830WaitSync(ScrnInfoPtr pScrn)
    I830Ptr pI830 = I830PTR(pScrn);
 
    switch (pI830->accel) {
-#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) {
@@ -3575,14 +3480,6 @@ i830MarkSync(ScrnInfoPtr pScrn)
    I830Ptr pI830 = I830PTR(pScrn);
 
    switch (pI830->accel) {
-#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 03000a3..f04d58e 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -153,39 +153,6 @@ 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);
-}
-
 /**
  * Sets up hardware state for a series of solid fills.
  */
@@ -200,7 +167,7 @@ i830_uxa_prepare_solid(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)
@@ -295,7 +262,7 @@ i830_uxa_prepare_copy(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)
@@ -481,265 +448,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 = i830_uxa_prepare_solid;
-    pI830->EXADriverPtr->Solid = i830_uxa_solid;
-    pI830->EXADriverPtr->DoneSolid = i830_uxa_done_solid;
-
-    /* Copy */
-    pI830->EXADriverPtr->PrepareCopy = i830_uxa_prepare_copy;
-    pI830->EXADriverPtr->Copy = i830_uxa_copy;
-    pI830->EXADriverPtr->DoneCopy = i830_uxa_done_copy;
-
-    /* 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;
-	}
-    }
-
-    return TRUE;
-}
-
 dri_bo *
 i830_get_pixmap_bo(PixmapPtr pixmap)
 {
@@ -752,13 +460,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;
 }
@@ -778,17 +479,8 @@ 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)
 
 static void
diff --git a/src/i830_memory.c b/src/i830_memory.c
index 339ebc7..0f17098 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -70,10 +70,6 @@ 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.
  *
  * The user may request a specific amount of memory to be used
  * (pI830->pEnt->videoRam != 0), in which case allocations have to fit within
@@ -366,7 +362,6 @@ i830_reset_allocations(ScrnInfoPtr pScrn)
 	pI830->cursor_mem_argb[p] = NULL;
     }
     pI830->front_buffer = NULL;
-    pI830->exa_offscreen = NULL;
     pI830->overlay_regs = NULL;
     pI830->power_context = NULL;
     pI830->ring.mem = NULL;
@@ -451,11 +446,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);
-	}
 	/* Overlay and cursors, if physical, need to be allocated outside
 	 * of the kernel memory manager.
 	 */
@@ -1292,8 +1282,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 (!xf86AgpGARTSupported() || !xf86AcquireGART(pScrn->scrnIndex)) {
@@ -1339,36 +1327,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 */
-
     return TRUE;
 }
 
diff --git a/src/i830_video.c b/src/i830_video.c
index 772bb30..c796025 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -138,11 +138,6 @@ static Atom xvSyncToVblank;
 #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
  */
@@ -2478,13 +2473,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) {
 	i830_display_video(pScrn, crtc, destId, width, height, dstPitch,
 			   x1, y1, x2, y2, &dstBox, src_w, src_h,
-- 
1.6.2.2




More information about the Intel-gfx mailing list