xf86-video-intel: 14 commits - configure.ac man/intel.man src/bios_reader/Makefile.am src/common.h src/drmmode_display.c src/i810_dri.c src/i810_driver.c src/i810.h src/i830_accel.c src/i830_batchbuffer.c src/i830_batchbuffer.h src/i830_bios.c src/i830_display.c src/i830_dri.c src/i830_driver.c src/i830_exa.c src/i830.h src/i830_lvds.c src/i830_memory.c src/i830_video.c src/i830_xaa.c src/i915_video.c src/i965_render.c src/i965_video.c src/Makefile.am src/reg_dumper/gtt.c src/reg_dumper/hotplug.c src/reg_dumper/idle.c src/reg_dumper/main.c src/reg_dumper/reg_dumper.h src/reg_dumper/util.c uxa/uxa-accel.c uxa/uxa.c uxa/uxa-glyphs.c uxa/uxa-priv.h uxa/uxa-render.c uxa/uxa-unaccel.c

Eric Anholt anholt at kemper.freedesktop.org
Mon Apr 27 18:02:21 PDT 2009


 configure.ac                |   52 -
 man/intel.man               |   10 
 src/Makefile.am             |   12 
 src/bios_reader/Makefile.am |    3 
 src/common.h                |   13 
 src/drmmode_display.c       |   33 -
 src/i810.h                  |    7 
 src/i810_dri.c              |   15 
 src/i810_driver.c           |  245 -------
 src/i830.h                  |  145 ----
 src/i830_accel.c            |  115 ---
 src/i830_batchbuffer.c      |   29 
 src/i830_batchbuffer.h      |   14 
 src/i830_bios.c             |   13 
 src/i830_display.c          |   88 --
 src/i830_dri.c              | 1447 --------------------------------------------
 src/i830_driver.c           |  605 ------------------
 src/i830_exa.c              |  391 -----------
 src/i830_lvds.c             |   16 
 src/i830_memory.c           |  403 ------------
 src/i830_video.c            |   32 
 src/i830_xaa.c              |  829 -------------------------
 src/i915_video.c            |    2 
 src/i965_render.c           |   32 
 src/i965_video.c            |   12 
 src/reg_dumper/gtt.c        |    8 
 src/reg_dumper/hotplug.c    |    5 
 src/reg_dumper/idle.c       |    5 
 src/reg_dumper/main.c       |    6 
 src/reg_dumper/reg_dumper.h |    9 
 src/reg_dumper/util.c       |    5 
 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 
 37 files changed, 115 insertions(+), 4613 deletions(-)

New commits:
commit c231b41f3f3eb3ba9c8436d5fd93a30704ed437c
Author: Eric Anholt <eric at anholt.net>
Date:   Tue Apr 21 15:55:01 2009 -0700

    Remove checks for xf86RotateFreeShadow, introduced in server 1.4.

diff --git a/configure.ac b/configure.ac
index 768f39d..12fec79 100644
--- a/configure.ac
+++ b/configure.ac
@@ -119,18 +119,6 @@ AC_MSG_RESULT([$DRI])
 
 PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.10])
 
-SAVE_CPPFLAGS="$CPPFLAGS"
-CPPFLAGS="$CPPFLAGS $XORG_CFLAGS"
-
-AC_CHECK_DECL(xf86RotateFreeShadow,
-	      [AC_DEFINE(HAVE_FREE_SHADOW, 1, [have new FreeShadow API])],
-	      [],
-	      [#include <xorg-server.h>
-	       #include <windowstr.h>
-	       #include <xf86Crtc.h>])
-	     
-CPPFLAGS="$SAVE_CPPFLAGS"
-
 dnl Use lots of warning flags with GCC
 
 WARN_CFLAGS=""
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 3642205..7a81d93 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2969,10 +2969,6 @@ I830LeaveVT(int scrnIndex, int flags)
    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
    I830Ptr pI830 = I830PTR(pScrn);
    int ret;
-#ifndef HAVE_FREE_SHADOW
-   xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
-   int o;
-#endif
 
    DPRINTF(PFX, "Leave VT\n");
 
@@ -2984,21 +2980,7 @@ I830LeaveVT(int scrnIndex, int flags)
 
    i830SetHotkeyControl(pScrn, HOTKEY_BIOS_SWITCH);
 
-
-#ifndef HAVE_FREE_SHADOW
-   for (o = 0; o < config->num_crtc; o++) {
-       xf86CrtcPtr crtc = config->crtc[o];
-
-       if (crtc->rotatedPixmap || crtc->rotatedData) {
-	   crtc->funcs->shadow_destroy(crtc, crtc->rotatedPixmap,
-				crtc->rotatedData);
-	   crtc->rotatedPixmap = NULL;
-	   crtc->rotatedData = NULL;
-       }
-   }
-#else
    xf86RotateFreeShadow(pScrn);
-#endif
 
    xf86_hide_cursors (pScrn);
 
commit e5133a94dc78411eaef324131ea8056aeb81779e
Author: Eric Anholt <eric at anholt.net>
Date:   Tue Apr 21 15:49:01 2009 -0700

    unifdef LIBPCIACCESS and XSERVER_LIBPCIACCESS.
    
    Depending on new server means these are always present.

diff --git a/configure.ac b/configure.ac
index 14a1c6b..768f39d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -117,21 +117,7 @@ if test x$DRI = xauto; then
 fi
 AC_MSG_RESULT([$DRI])
 
-AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
-	      [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
-	      [#include "xorg-server.h"])
-CFLAGS="$save_CFLAGS"
-
-if test x$XSERVER_LIBPCIACCESS = xyes; then
-	PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.10])
-else
-	PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.10],
-				       have_libpciaccess=yes,
-				       have_libpciaccess=no)
-fi
-AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
-AM_CONDITIONAL(LIBPCIACCESS,
-	test "x$XSERVER_LIBPCIACCESS" = xyes -o "x$have_libpciaccess" = xyes)
+PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.10])
 
 SAVE_CPPFLAGS="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS $XORG_CFLAGS"
diff --git a/src/Makefile.am b/src/Makefile.am
index 221b669..3f42e16 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -18,11 +18,7 @@
 #  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 #  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
-if LIBPCIACCESS
-REGDUMPER = reg_dumper
-endif
-
-SUBDIRS = xvmc bios_reader ch7017 ch7xxx ivch sil164 tfp410 $(REGDUMPER)
+SUBDIRS = xvmc bios_reader ch7017 ch7xxx ivch sil164 tfp410 reg_dumper
 
 # this is obnoxious:
 # -module lets us name the module exactly how we want
@@ -37,9 +33,7 @@ intel_drv_la_LTLIBRARIES = intel_drv.la
 intel_drv_la_LDFLAGS = -module -avoid-version
 intel_drv_ladir = @moduledir@/drivers
 intel_drv_la_LIBADD = -lm @DRM_LIBS@ -ldrm_intel ../uxa/libuxa.la
-if XSERVER_LIBPCIACCESS
 intel_drv_la_LIBADD += @PCIACCESS_LIBS@
-endif
 
 INTEL_DRI_SRCS = \
          i810_dri.c \
diff --git a/src/bios_reader/Makefile.am b/src/bios_reader/Makefile.am
index e060633..cff9e1a 100644
--- a/src/bios_reader/Makefile.am
+++ b/src/bios_reader/Makefile.am
@@ -3,7 +3,6 @@ AM_CFLAGS = @WARN_CFLAGS@ @XORG_CFLAGS@ @PCIACCESS_CFLAGS@ \
 
 noinst_PROGRAMS = bios_reader  $(BIOS_DUMPER) $(SWF_DUMPER)
 
-if LIBPCIACCESS
 BIOS_DUMPER = bios_dumper
 
 bios_dumper_SOURCES = bios_dumper.c
@@ -15,5 +14,3 @@ SWF_DUMPER = swf_dumper
 swf_dumper_SOURCES = swf_dumper.c
 
 swf_dumper_LDADD = $(PCIACCESS_LIBS)
-
-endif
diff --git a/src/common.h b/src/common.h
index 99b4645..1576d3a 100644
--- a/src/common.h
+++ b/src/common.h
@@ -322,21 +322,12 @@ extern int I810_DEBUG;
 #define PCI_CHIP_G41_G_BRIDGE	0x2E30
 #endif
 
-#if XSERVER_LIBPCIACCESS
 #define I810_MEMBASE(p,n) (p)->regions[(n)].base_addr
 #define VENDOR_ID(p)      (p)->vendor_id
 #define DEVICE_ID(p)      (p)->device_id
 #define SUBVENDOR_ID(p)	  (p)->subvendor_id
 #define SUBSYS_ID(p)      (p)->subdevice_id
 #define CHIP_REVISION(p)  (p)->revision
-#else
-#define I810_MEMBASE(p,n) (p)->memBase[n]
-#define VENDOR_ID(p)      (p)->vendor
-#define DEVICE_ID(p)      (p)->chipType
-#define SUBVENDOR_ID(p)	  (p)->subsysVendor
-#define SUBSYS_ID(p)      (p)->subsysCard
-#define CHIP_REVISION(p)  (p)->chipRev
-#endif
 
 #define IS_I810(pI810) (DEVICE_ID(pI810->PciInfo) == PCI_CHIP_I810 ||	\
 			DEVICE_ID(pI810->PciInfo) == PCI_CHIP_I810_DC100 || \
@@ -403,9 +394,7 @@ extern int I810_DEBUG;
 
 #define PIPE_NAME(n)			('A' + (n))
 
-#if XSERVER_LIBPCIACCESS
 struct pci_device *
 intel_host_bridge (void);
-#endif
-   
+
 #endif /* _INTEL_COMMON_H_ */
diff --git a/src/i810.h b/src/i810.h
index c88771e..a3f45ad 100644
--- a/src/i810.h
+++ b/src/i810.h
@@ -51,9 +51,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "vgaHW.h"
 
 #include "xorg-server.h"
-#ifdef XSERVER_LIBPCIACCESS
 #include <pciaccess.h>
-#endif
 
 #ifdef XF86DRI
 #include "xf86drm.h"
@@ -190,12 +188,7 @@ typedef struct _I810Rec {
    unsigned long MMIOAddr;
    IOADDRESS ioBase;
    EntityInfoPtr pEnt;
-#if XSERVER_LIBPCIACCESS
    struct pci_device *PciInfo;
-#else
-   pciVideoPtr PciInfo;
-   PCITAG PciTag;
-#endif
 
    I810RingBuffer *LpRing;
    unsigned int BR[20];
diff --git a/src/i810_dri.c b/src/i810_dri.c
index 136a705..00691af 100644
--- a/src/i810_dri.c
+++ b/src/i810_dri.c
@@ -354,14 +354,8 @@ I810DRIScreenInit(ScreenPtr pScreen)
    } else {
       pDRIInfo->busIdString = xalloc(64);
       sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d",
-#if XSERVER_LIBPCIACCESS
 	      ((pI810->PciInfo->domain << 8) | pI810->PciInfo->bus),
 	      pI810->PciInfo->dev, pI810->PciInfo->func
-#else
-	      ((pciConfigPtr) pI810->PciInfo->thisCard)->busnum,
-	      ((pciConfigPtr) pI810->PciInfo->thisCard)->devnum,
-	      ((pciConfigPtr) pI810->PciInfo->thisCard)->funcnum
-#endif
 	      );
    }
    pDRIInfo->ddxDriverMajorVersion = I810_MAJOR_VERSION;
@@ -978,19 +972,10 @@ I810DRIScreenInit(ScreenPtr pScreen)
 
    if (!pI810DRI->irq) {
       pI810DRI->irq = drmGetInterruptFromBusID(pI810->drmSubFD,
-#if XSERVER_LIBPCIACCESS
 					       ((pI810->PciInfo->domain << 8) |
 						pI810->PciInfo->bus),
 					       pI810->PciInfo->dev,
 					       pI810->PciInfo->func
-#else
-					       ((pciConfigPtr) pI810->
-						PciInfo->thisCard)->busnum,
-					       ((pciConfigPtr) pI810->
-						PciInfo->thisCard)->devnum,
-					       ((pciConfigPtr) pI810->
-						PciInfo->thisCard)->funcnum
-#endif
 					       );
       if ((drmCtlInstHandler(pI810->drmSubFD, pI810DRI->irq)) != 0) {
 	 xf86DrvMsg(pScrn->scrnIndex, X_INFO,
diff --git a/src/i810_driver.c b/src/i810_driver.c
index fe4bd62..263e8d9 100644
--- a/src/i810_driver.c
+++ b/src/i810_driver.c
@@ -95,14 +95,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 static void I810Identify(int flags);
 
-#if XSERVER_LIBPCIACCESS
 static Bool intel_pci_probe (DriverPtr		drv,
 			     int		entity_num,
 			     struct pci_device	*dev,
 			     intptr_t		match_data);
-#else
-static Bool I810Probe(DriverPtr drv, int flags);
-#endif
 
 #ifndef I830_ONLY
 static Bool I810PreInit(ScrnInfoPtr pScrn, int flags);
@@ -120,9 +116,6 @@ static ModeStatus I810ValidMode(int scrnIndex, DisplayModePtr mode,
 				Bool verbose, int flags);
 #endif /* I830_ONLY */
 
-
-#if XSERVER_LIBPCIACCESS
-
 #define INTEL_DEVICE_MATCH(d,i) \
     { 0x8086, (d), PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, (i) }
 
@@ -162,25 +155,17 @@ static const struct pci_id_match intel_device_match[] = {
     { 0, 0, 0 },
 };
 
-#endif /* XSERVER_LIBPCIACCESS */
-
 _X_EXPORT DriverRec I810 = {
    I810_VERSION,
    I810_DRIVER_NAME,
    I810Identify,
-#if XSERVER_LIBPCIACCESS
    NULL,
-#else
-   I810Probe,
-#endif
    I810AvailableOptions,
    NULL,
    0,
    NULL,
-#if XSERVER_LIBPCIACCESS
    intel_device_match,
    intel_pci_probe
-#endif
 };
 
 /* *INDENT-OFF* */
@@ -482,11 +467,7 @@ i810Setup(pointer module, pointer opts, int *errmaj, int *errmin)
    if (!setupDone) {
       setupDone = 1;
       xf86AddDriver(&I810, module,
-#if XSERVER_LIBPCIACCESS
 		    HaveDriverFuncs
-#else
-		    0
-#endif
 		    );
 
       /*
@@ -575,7 +556,6 @@ I810AvailableOptions(int chipid, int busid)
 #endif
 }
 
-#if XSERVER_LIBPCIACCESS
 struct pci_device *
 intel_host_bridge (void)
 {
@@ -641,147 +621,6 @@ static Bool intel_pci_probe (DriverPtr		driver,
     }
     return scrn != NULL;
 }
-#else /* XSERVER_LIBPCIACCESS */
-
-/*
- * I810Probe --
- *
- * Look through the PCI bus to find cards that are I810 boards.
- * Setup the dispatch table for the rest of the driver functions.
- *
- */
-static Bool
-I810Probe(DriverPtr drv, int flags)
-{
-   int i, numUsed, numDevSections, *usedChips;
-   DevUnion *pPriv;						
-   GDevPtr *devSections;
-   Bool foundScreen = FALSE;
-   pciVideoPtr *VideoInfo;
-   pciVideoPtr *ppPci;
-   PciChipsets *id;
-
-   /*
-    * Find the config file Device sections that match this
-    * driver, and return if there are none.
-    */
-   if ((numDevSections =
-	xf86MatchDevice(I810_DRIVER_NAME, &devSections)) <= 0 ) {
-      return FALSE;
-   }
-
-   /*
-    * This probing is just checking the PCI data the server already
-    * collected.
-    */
-   if (!(VideoInfo = xf86GetPciVideoInfo()))
-      return FALSE;
-
-   /*
-    * Mobile platforms may have both function 0 and 1 active, but they
-    * are handled as a single entity.  To make sure that the function 1
-    * entity isn't assigned to a screen, check for and claim it here
-    * first.
-    *
-    * XXX If function 1's resources are ever needed, they'll need to be
-    * added to the screen and marked active.
-    */
-   for (ppPci = VideoInfo; ppPci != NULL && *ppPci != NULL; ppPci++) {
-      if ((*ppPci)->vendor == PCI_VENDOR_INTEL &&
-	  (*ppPci)->func == 1) {
-	 for (id = I810PciChipsets; id->PCIid != -1; id++) {
-	    if (id->PCIid == (*ppPci)->chipType) {
-	       /* Claim slot */
-	       if (xf86CheckPciSlot((*ppPci)->bus, (*ppPci)->device,
-				    (*ppPci)->func)) {
-	  	  xf86ClaimPciSlot((*ppPci)->bus, (*ppPci)->device,
-				   (*ppPci)->func, drv, id->PCIid,
-				   NULL, FALSE);
-	       }
-	       break;
-	    }
-	 }
-      }
-   }
-
-   /* Look for Intel i8xx devices. */
-   numUsed = xf86MatchPciInstances(I810_NAME, PCI_VENDOR_INTEL,
-				   I810Chipsets, I810PciChipsets,
-				   devSections, numDevSections,
-				   drv, &usedChips);
-
-   if (flags & PROBE_DETECT) {
-      if (numUsed > 0)
-	 foundScreen = TRUE;
-   } else {
-      for (i = 0; i < numUsed; i++) {
-	 ScrnInfoPtr pScrn = NULL;
-
-	 /* Allocate new ScrnInfoRec and claim the slot */
-	 if ((pScrn = xf86ConfigPciEntity(pScrn, 0, usedChips[i],
-					  I810PciChipsets, NULL, NULL, NULL,
-					  NULL, NULL))) {
-	    EntityInfoPtr pEnt;
-
-	    pEnt = xf86GetEntityInfo(usedChips[i]);
-
-	    pScrn->driverVersion = I810_VERSION;
-	    pScrn->driverName = I810_DRIVER_NAME;
-	    pScrn->name = I810_NAME;
-	    pScrn->Probe = I810Probe;
-	    foundScreen = TRUE;
-	    switch (pEnt->chipset) {
-	    case PCI_CHIP_845_G:
-	    case PCI_CHIP_I865_G:
-	    case PCI_CHIP_I830_M:
-	    case PCI_CHIP_I855_GM:
-	    case PCI_CHIP_I915_G:
-	    case PCI_CHIP_E7221_G:
-	    case PCI_CHIP_I915_GM:
-	    case PCI_CHIP_I945_G:
-	    case PCI_CHIP_I945_GM:
-	    case PCI_CHIP_I945_GME:
-	    case PCI_CHIP_IGD_GM:
-	    case PCI_CHIP_IGD_G:
-	    case PCI_CHIP_I965_G:
-	    case PCI_CHIP_G35_G:
-	    case PCI_CHIP_I965_Q:
-	    case PCI_CHIP_I946_GZ:
-	    case PCI_CHIP_I965_GM:
-	    case PCI_CHIP_I965_GME:
- 	    case PCI_CHIP_G33_G:
- 	    case PCI_CHIP_Q35_G:
- 	    case PCI_CHIP_Q33_G:
- 	    case PCI_CHIP_GM45_GM:
-	    case PCI_CHIP_IGD_E_G:
-	    case PCI_CHIP_G45_G:
-	    case PCI_CHIP_Q45_G:
-	    case PCI_CHIP_G41_G:
-	       I830InitpScrn(pScrn);
-	       break;
-#ifndef I830_ONLY
-	    default:
-	       pScrn->PreInit = I810PreInit;
-	       pScrn->ScreenInit = I810ScreenInit;
-	       pScrn->SwitchMode = I810SwitchMode;
-	       pScrn->AdjustFrame = I810AdjustFrame;
-	       pScrn->EnterVT = I810EnterVT;
-	       pScrn->LeaveVT = I810LeaveVT;
-	       pScrn->FreeScreen = I810FreeScreen;
-	       pScrn->ValidMode = I810ValidMode;
-	       break;
-#endif
-	    }
-	 }
-      }
-   }
-
-   xfree(usedChips);
-   xfree(devSections);
-
-   return foundScreen;
-}
-#endif /* else XSERVER_LIBPCIACCESS */
 
 #ifndef I830_ONLY
 static void
@@ -873,10 +712,6 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
    pI810->ioBase = hwp->PIOOffset;
 
    pI810->PciInfo = xf86GetPciInfoForEntity(pI810->pEnt->index);
-#if !XSERVER_LIBPCIACCESS
-   pI810->PciTag = pciTag(pI810->PciInfo->bus, pI810->PciInfo->device,
-			  pI810->PciInfo->func);
-#endif
 
    if (xf86RegisterResources(pI810->pEnt->index, NULL, ResNone))
       return FALSE;
@@ -1015,45 +850,11 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
    xf86DrvMsg(pScrn->scrnIndex, from, "Chipset: \"%s\"\n",
 	      (pScrn->chipset != NULL) ? pScrn->chipset : "Unknown i810");
 
-#if XSERVER_LIBPCIACCESS
    pI810->LinearAddr = pI810->PciInfo->regions[0].base_addr;
-#else
-   if (pI810->pEnt->device->MemBase != 0) {
-      pI810->LinearAddr = pI810->pEnt->device->MemBase;
-      from = X_CONFIG;
-   } else {
-      if (pI810->PciInfo->memBase[1] != 0) {
-	 pI810->LinearAddr = pI810->PciInfo->memBase[0] & 0xFF000000;
-	 from = X_PROBED;
-      } else {
-	 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		    "No valid FB address in PCI config space\n");
-	 I810FreeRec(pScrn);
-	 return FALSE;
-      }
-   }
-#endif
    xf86DrvMsg(pScrn->scrnIndex, from, "Linear framebuffer at 0x%lX\n",
 	      (unsigned long)pI810->LinearAddr);
 
-#if XSERVER_LIBPCIACCESS
    pI810->MMIOAddr = pI810->PciInfo->regions[1].base_addr;
-#else
-   if (pI810->pEnt->device->IOBase != 0) {
-      pI810->MMIOAddr = pI810->pEnt->device->IOBase;
-      from = X_CONFIG;
-   } else {
-      if (pI810->PciInfo->memBase[1]) {
-	 pI810->MMIOAddr = pI810->PciInfo->memBase[1] & 0xFFF80000;
-	 from = X_PROBED;
-      } else {
-	 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		    "No valid MMIO address in PCI config space\n");
-	 I810FreeRec(pScrn);
-	 return FALSE;
-      }
-   }
-#endif
    xf86DrvMsg(pScrn->scrnIndex, from, "IO registers at addr 0x%lX\n",
 	      (unsigned long)pI810->MMIOAddr);
 
@@ -1072,11 +873,7 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
    {
       uint32_t whtcfg_pamr_drp;
     
-#if XSERVER_LIBPCIACCESS
       pci_device_cfg_read_u32(pI810->PciInfo, & whtcfg_pamr_drp, WHTCFG_PAMR_DRP);
-#else
-      whtcfg_pamr_drp = pciReadLong(pI810->PciTag, WHTCFG_PAMR_DRP);
-#endif
 
       /* Need this for choosing watermarks.
        */
@@ -1129,18 +926,10 @@ I810PreInit(ScrnInfoPtr pScrn, int flags)
 
    /* Calculate Fixed Offsets depending on graphics aperture size */
    {
-#if XSERVER_LIBPCIACCESS
       struct pci_device *bridge = intel_host_bridge ();
       uint32_t   smram_miscc;
       
       pci_device_cfg_read_u32 (bridge, & smram_miscc, SMRAM_MISCC);
-#else
-      PCITAG bridge;
-      long smram_miscc;
-
-      bridge = pciTag(0, 0, 0);		/* This is always the host bridge */
-      smram_miscc = pciReadLong(bridge, SMRAM_MISCC);
-#endif
 
       if ((smram_miscc & GFX_MEM_WIN_SIZE) == GFX_MEM_WIN_32M) {
 	 pI810->FbMapSize = 0x1000000;
@@ -1331,10 +1120,8 @@ I810MapMMIO(ScrnInfoPtr pScrn)
 {
    int mmioFlags;
    I810Ptr pI810 = I810PTR(pScrn);
-#if XSERVER_LIBPCIACCESS
    struct pci_device *const device = pI810->PciInfo;
    int err;
-#endif
 
 #if !defined(__alpha__)
    mmioFlags = VIDMEM_MMIO | VIDMEM_READSIDEEFFECT;
@@ -1342,7 +1129,6 @@ I810MapMMIO(ScrnInfoPtr pScrn)
    mmioFlags = VIDMEM_MMIO | VIDMEM_READSIDEEFFECT | VIDMEM_SPARSE;
 #endif
 
-#if XSERVER_LIBPCIACCESS
    err = pci_device_map_range (device,
 			       pI810->MMIOAddr,
 			       I810_REG_SIZE,
@@ -1355,13 +1141,6 @@ I810MapMMIO(ScrnInfoPtr pScrn)
 		  strerror (err), err);
       return FALSE;
    }
-#else
-   pI810->MMIOBase = xf86MapPciMem(pScrn->scrnIndex, mmioFlags,
-				   pI810->PciTag,
-				   pI810->MMIOAddr, I810_REG_SIZE);
-   if (!pI810->MMIOBase)
-      return FALSE;
-#endif
    return TRUE;
 }
 
@@ -1369,17 +1148,12 @@ static Bool
 I810MapMem(ScrnInfoPtr pScrn)
 {
    I810Ptr pI810 = I810PTR(pScrn);
-#if XSERVER_LIBPCIACCESS
    struct pci_device *const device = pI810->PciInfo;
    int err;
-#else
-   long i;
-#endif
 
    if (!I810MapMMIO(pScrn))
       return FALSE;
 
-#if XSERVER_LIBPCIACCESS
    err = pci_device_map_range (device,
 			       pI810->LinearAddr,
 			       pI810->FbMapSize,
@@ -1392,15 +1166,6 @@ I810MapMem(ScrnInfoPtr pScrn)
 		  strerror (err), err);
       return FALSE;
    }
-#else
-   for (i = 2; i < pI810->FbMapSize; i <<= 1) ;
-
-   pI810->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
-				 pI810->PciTag,
-				 pI810->LinearAddr, i);
-   if (!pI810->FbBase)
-      return FALSE;
-#endif
 
    pI810->LpRing->virtual_start = pI810->FbBase + pI810->LpRing->mem.Start;
 
@@ -1412,12 +1177,7 @@ I810UnmapMMIO(ScrnInfoPtr pScrn)
 {
    I810Ptr pI810 = I810PTR(pScrn);
 
-#if XSERVER_LIBPCIACCESS
    pci_device_unmap_range (pI810->PciInfo, pI810->MMIOBase, I810_REG_SIZE);
-#else
-   xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pI810->MMIOBase,
-		   I810_REG_SIZE);
-#endif
    pI810->MMIOBase = NULL;
 }
 
@@ -1426,12 +1186,7 @@ I810UnmapMem(ScrnInfoPtr pScrn)
 {
    I810Ptr pI810 = I810PTR(pScrn);
 
-#if XSERVER_LIBPCIACCESS
    pci_device_unmap_range (pI810->PciInfo, pI810->FbBase, pI810->FbMapSize);
-#else
-   xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pI810->FbBase,
-		   pI810->FbMapSize);
-#endif
    pI810->FbBase = NULL;
    I810UnmapMMIO(pScrn);
    return TRUE;
diff --git a/src/i830.h b/src/i830.h
index a573c2d..6257e43 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -60,9 +60,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "xf86RandR12.h"
 
 #include "xorg-server.h"
-#ifdef XSERVER_LIBPCIACCESS
 #include <pciaccess.h>
-#endif
 
 #include "xf86drm.h"
 #include "sarea.h"
@@ -420,12 +418,7 @@ typedef struct _I830Rec {
    unsigned long MMIOAddr;
    IOADDRESS ioBase;
    EntityInfoPtr pEnt;
-#if XSERVER_LIBPCIACCESS
    struct pci_device *PciInfo;
-#else
-   pciVideoPtr PciInfo;
-   PCITAG PciTag;
-#endif
    uint8_t variant;
 
    unsigned int BR[20];
diff --git a/src/i830_bios.c b/src/i830_bios.c
index 4f2355d..7c51f38 100644
--- a/src/i830_bios.c
+++ b/src/i830_bios.c
@@ -218,7 +218,6 @@ i830_bios_init(ScrnInfoPtr pScrn)
     int ret;
     int size;
 
-#if XSERVER_LIBPCIACCESS
     size = pI830->PciInfo->rom_size;
     if (size == 0) {
 	size = INTEL_VBIOS_SIZE;
@@ -226,14 +225,10 @@ i830_bios_init(ScrnInfoPtr pScrn)
 		   "libpciaccess reported 0 rom size, guessing %dkB\n",
 		   size / 1024);
     }
-#else
-    size = INTEL_VBIOS_SIZE;
-#endif
     bios = xalloc(size);
     if (bios == NULL)
 	return -1;
 
-#if XSERVER_LIBPCIACCESS
     ret = pci_device_read_rom (pI830->PciInfo, bios);
     if (ret != 0) {
 	xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
@@ -242,14 +237,6 @@ i830_bios_init(ScrnInfoPtr pScrn)
 	xfree (bios);
 	return -1;
     }
-#else
-    /* xf86ReadPciBIOS returns the length read */
-    ret = xf86ReadPciBIOS(0, pI830->PciTag, 0, bios, size);
-    if (ret <= 0) {
-	xfree (bios);
-	return -1;
-    }
-#endif
 
     vbt_off = INTEL_BIOS_16(0x1a);
     if (vbt_off >= size) {
diff --git a/src/i830_display.c b/src/i830_display.c
index c1617e3..a7eafb9 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -1350,11 +1350,7 @@ i830_get_core_clock_speed(ScrnInfoPtr pScrn)
     else if (IS_I915GM(pI830)) {
 	uint16_t gcfgc;
 
-#if XSERVER_LIBPCIACCESS
       pci_device_cfg_read_u16 (pI830->PciInfo, &gcfgc, I915_GCFGC);
-#else
-      gcfgc = pciReadWord(pI830->PciTag, I915_GCFGC);
-#endif
       if (gcfgc & I915_LOW_FREQUENCY_ENABLE)
 	    return 133000;
 	else {
@@ -1369,14 +1365,9 @@ i830_get_core_clock_speed(ScrnInfoPtr pScrn)
     } else if (IS_I865G(pI830))
 	return 266000;
     else if (IS_I855(pI830)) {
-#if XSERVER_LIBPCIACCESS
         struct pci_device *bridge = intel_host_bridge ();
 	uint16_t hpllcc;
 	pci_device_cfg_read_u16 (bridge, &hpllcc, I855_HPLLCC);
-#else
-	PCITAG bridge = pciTag(0, 0, 0); /* This is always the host bridge */
-	uint16_t hpllcc = pciReadWord(bridge, I855_HPLLCC);
-#endif
 
 	/* Assume that the hardware is in the high speed state.  This
 	 * should be the default.
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 5a8c5d9..3642205 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -389,20 +389,11 @@ static int
 I830DetectMemory(ScrnInfoPtr pScrn)
 {
    I830Ptr pI830 = I830PTR(pScrn);
-#if !XSERVER_LIBPCIACCESS
-   PCITAG bridge;
-#endif
    uint16_t gmch_ctrl;
    int memsize = 0, gtt_size;
    int range;
-
-#if XSERVER_LIBPCIACCESS
    struct pci_device *bridge = intel_host_bridge ();
    pci_device_cfg_read_u16(bridge, & gmch_ctrl, I830_GMCH_CTRL);
-#else
-   bridge = pciTag(0, 0, 0);		/* This is always the host bridge */
-   gmch_ctrl = pciReadWord(bridge, I830_GMCH_CTRL);
-#endif
 
    if (IS_I965G(pI830)) {
       /* The 965 may have a GTT that is actually larger than is necessary
@@ -547,15 +538,10 @@ I830DetectMemory(ScrnInfoPtr pScrn)
 static Bool
 I830MapMMIO(ScrnInfoPtr pScrn)
 {
-#if XSERVER_LIBPCIACCESS
    int err;
    struct pci_device *device;
-#else
-   int mmioFlags;
-#endif
    I830Ptr pI830 = I830PTR(pScrn);
 
-#if XSERVER_LIBPCIACCESS
    device = pI830->PciInfo;
    err = pci_device_map_range (device,
 			       pI830->MMIOAddr,
@@ -569,20 +555,6 @@ I830MapMMIO(ScrnInfoPtr pScrn)
 		  strerror (err), err);
       return FALSE;
    }
-#else
-
-#if !defined(__alpha__)
-   mmioFlags = VIDMEM_MMIO | VIDMEM_READSIDEEFFECT;
-#else
-   mmioFlags = VIDMEM_MMIO | VIDMEM_READSIDEEFFECT | VIDMEM_SPARSE;
-#endif
-
-   pI830->MMIOBase = xf86MapPciMem(pScrn->scrnIndex, mmioFlags,
-				   pI830->PciTag,
-				   pI830->MMIOAddr, I810_REG_SIZE);
-   if (!pI830->MMIOBase)
-      return FALSE;
-#endif
 
    /* Set up the GTT mapping for the various places it has been moved over
     * time.
@@ -605,7 +577,6 @@ I830MapMMIO(ScrnInfoPtr pScrn)
 	 gttaddr = I810_MEMBASE(pI830->PciInfo, 3) & 0xFFFFFF00;
 	 pI830->GTTMapSize = pI830->FbMapSize / 1024;
       }
-#if XSERVER_LIBPCIACCESS
       err = pci_device_map_range (device,
 				  gttaddr, pI830->GTTMapSize,
 				  PCI_DEV_MAP_FLAG_WRITABLE,
@@ -617,13 +588,6 @@ I830MapMMIO(ScrnInfoPtr pScrn)
 		     strerror (err), err);
 	 return FALSE;
       }
-#else
-      pI830->GTTBase = xf86MapPciMem(pScrn->scrnIndex, mmioFlags,
-				     pI830->PciTag,
-				     gttaddr, pI830->GTTMapSize);
-      if (pI830->GTTBase == NULL)
-	 return FALSE;
-#endif
    } else {
       /* The GTT aperture on i830 is write-only.  We could probably map the
        * actual physical pages that back it, but leave it alone for now.
@@ -640,27 +604,17 @@ I830MapMem(ScrnInfoPtr pScrn)
 {
    I830Ptr pI830 = I830PTR(pScrn);
    long i;
-#if XSERVER_LIBPCIACCESS
    struct pci_device *const device = pI830->PciInfo;
    int err;
-#endif
 
    for (i = 2; i < pI830->FbMapSize; i <<= 1) ;
    pI830->FbMapSize = i;
 
-#if XSERVER_LIBPCIACCESS
    err = pci_device_map_range (device, pI830->LinearAddr, pI830->FbMapSize,
 			       PCI_DEV_MAP_FLAG_WRITABLE | PCI_DEV_MAP_FLAG_WRITE_COMBINE,
 			       (void **) &pI830->FbBase);
     if (err)
 	return FALSE;
-#else
-   pI830->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
-				 pI830->PciTag,
-				 pI830->LinearAddr, pI830->FbMapSize);
-   if (!pI830->FbBase)
-      return FALSE;
-#endif
 
    if (pI830->ring.mem != NULL) {
       pI830->ring.virtual_start = pI830->FbBase + pI830->ring.mem->offset;
@@ -674,20 +628,11 @@ I830UnmapMMIO(ScrnInfoPtr pScrn)
 {
    I830Ptr pI830 = I830PTR(pScrn);
 
-#if XSERVER_LIBPCIACCESS
    pci_device_unmap_range (pI830->PciInfo, pI830->MMIOBase, I810_REG_SIZE);
-#else
-   xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pI830->MMIOBase,
-		   I810_REG_SIZE);
-#endif
    pI830->MMIOBase = NULL;
 
    if (IS_I9XX(pI830)) {
-#if XSERVER_LIBPCIACCESS
       pci_device_unmap_range (pI830->PciInfo, pI830->GTTBase, pI830->GTTMapSize);
-#else
-      xf86UnMapVidMem(pScrn->scrnIndex, pI830->GTTBase, pI830->GTTMapSize);
-#endif
       pI830->GTTBase = NULL;
    }
 }
@@ -697,12 +642,7 @@ I830UnmapMem(ScrnInfoPtr pScrn)
 {
    I830Ptr pI830 = I830PTR(pScrn);
 
-#if XSERVER_LIBPCIACCESS
    pci_device_unmap_range (pI830->PciInfo, pI830->FbBase, pI830->FbMapSize);
-#else
-   xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pI830->FbBase,
-		   pI830->FbMapSize);
-#endif
    pI830->FbBase = NULL;
    I830UnmapMMIO(pScrn);
    return TRUE;
@@ -1179,11 +1119,7 @@ i830SetHotkeyControl(ScrnInfoPtr pScrn, int mode)
  */
 static Bool i830_kernel_mode_enabled(ScrnInfoPtr pScrn)
 {
-#if XSERVER_LIBPCIACCESS
     struct pci_device *PciInfo;
-#else
-    pciVideoPtr PciInfo;
-#endif
     EntityInfoPtr pEnt;
     char *busIdString;
     int ret;
@@ -1227,11 +1163,7 @@ i830_detect_chipset(ScrnInfoPtr pScrn)
 	break;
     case PCI_CHIP_I855_GM:
 	/* Check capid register to find the chipset variant */
-#if XSERVER_LIBPCIACCESS
 	pci_device_cfg_read_u32 (pI830->PciInfo, &capid, I85X_CAPID);
-#else
-	capid = pciReadLong (pI830->PciTag, I85X_CAPID);
-#endif
 	pI830->variant = (capid >> I85X_VARIANT_SHIFT) & I85X_VARIANT_MASK;
 	switch (pI830->variant) {
 	case I855_GM:
@@ -1410,19 +1342,11 @@ i830_detect_chipset(ScrnInfoPtr pScrn)
 
     /* Now figure out mapsize on 8xx chips */
     if (IS_I830(pI830) || IS_845G(pI830)) {
-#if XSERVER_LIBPCIACCESS
 	uint16_t		gmch_ctrl;
 	struct pci_device *bridge;
 
 	bridge = intel_host_bridge ();
 	pci_device_cfg_read_u16 (bridge, &gmch_ctrl, I830_GMCH_CTRL);
-#else
-	PCITAG bridge;
-	uint16_t gmch_ctrl;
-
-	bridge = pciTag(0, 0, 0);		/* This is always the host bridge */
-	gmch_ctrl = pciReadWord(bridge, I830_GMCH_CTRL);
-#endif
 	if ((gmch_ctrl & I830_GMCH_MEM_MASK) == I830_GMCH_MEM_128M) {
 	    pI830->FbMapSize = 0x8000000;
 	} else {
@@ -1430,12 +1354,7 @@ i830_detect_chipset(ScrnInfoPtr pScrn)
 	}
     } else {
 	if (IS_I9XX(pI830)) {
-#if XSERVER_LIBPCIACCESS
 	    pI830->FbMapSize = pI830->PciInfo->regions[fb_bar].size;
-#else
-	    pI830->FbMapSize = 1UL << pciGetBaseSize(pI830->PciTag, 2, TRUE,
-						     NULL);
-#endif
 	} else {
 	    /* 128MB aperture for later i8xx series. */
 	    pI830->FbMapSize = 0x8000000;
@@ -1726,10 +1645,6 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
       return FALSE;
 
    pI830->PciInfo = xf86GetPciInfoForEntity(pI830->pEnt->index);
-#if !XSERVER_LIBPCIACCESS
-   pI830->PciTag = pciTag(pI830->PciInfo->bus, pI830->PciInfo->device,
-			  pI830->PciInfo->func);
-#endif
 
    if (xf86RegisterResources(pI830->pEnt->index, NULL, ResNone)) {
       PreInitCleanup(pScrn);
diff --git a/src/i830_lvds.c b/src/i830_lvds.c
index 7fc0bce..064810f 100644
--- a/src/i830_lvds.c
+++ b/src/i830_lvds.c
@@ -207,12 +207,8 @@ i830_lvds_set_backlight_legacy(xf86OutputPtr output, int level)
     ScrnInfoPtr pScrn = output->scrn;
     I830Ptr pI830 = I830PTR(pScrn);
 
-#if XSERVER_LIBPCIACCESS
     pci_device_cfg_write_u8(pI830->PciInfo, level,
 			    LEGACY_BACKLIGHT_BRIGHTNESS);
-#else
-    pciWriteByte(pI830->PciTag, LEGACY_BACKLIGHT_BRIGHTNESS, level);
-#endif
 }
 
 static int
@@ -222,11 +218,7 @@ i830_lvds_get_backlight_legacy(xf86OutputPtr output)
     I830Ptr pI830 = I830PTR(pScrn);
     uint8_t lbb;
 
-#if XSERVER_LIBPCIACCESS
     pci_device_cfg_read_u8(pI830->PciInfo, &lbb, LEGACY_BACKLIGHT_BRIGHTNESS);
-#else
-    lbb = pciReadByte(pI830->PciTag, LEGACY_BACKLIGHT_BRIGHTNESS);
-#endif
 
     return lbb;
 }
@@ -242,22 +234,14 @@ i830_lvds_set_backlight_combo(xf86OutputPtr output, int level)
     uint32_t blc_pwm_ctl;
     uint8_t lbb;
 
-#if XSERVER_LIBPCIACCESS
     pci_device_cfg_read_u8(pI830->PciInfo, &lbb, LEGACY_BACKLIGHT_BRIGHTNESS);
-#else
-    lbb = pciReadByte(pI830->PciTag, LEGACY_BACKLIGHT_BRIGHTNESS);
-#endif
     /*
      * If LBB is zero and we're shooting for a non-zero brightness level,
      * we have to increase LBB by at least 1.
      */
     if (!lbb && level) {
-#if XSERVER_LIBPCIACCESS
 	pci_device_cfg_write_u8(pI830->PciInfo, 1,
 				LEGACY_BACKLIGHT_BRIGHTNESS);
-#else
-	pciWriteByte(pI830->PciTag, LEGACY_BACKLIGHT_BRIGHTNESS, 1);
-#endif
     }
 
     /*
diff --git a/src/reg_dumper/gtt.c b/src/reg_dumper/gtt.c
index ead5935..4a46f11 100644
--- a/src/reg_dumper/gtt.c
+++ b/src/reg_dumper/gtt.c
@@ -59,9 +59,9 @@ int main(int argc, char **argv)
 	else {
 		/* 915/945 chips has GTT range in bar 3*/
 		int err = 0;
-		err = pci_device_map_range (pI830->pci_dev,
-				pI830->pci_dev->regions[3].base_addr,
-				pI830->pci_dev->regions[3].size,
+		err = pci_device_map_range (pI830->PciInfo,
+				pI830->PciInfo->regions[3].base_addr,
+				pI830->PciInfo->regions[3].size,
 				PCI_DEV_MAP_FLAG_WRITABLE,
 				(void **)&gtt);
 		if (err != 0) {
@@ -70,7 +70,7 @@ int main(int argc, char **argv)
 		}
 	}
 
-	aper_size = pI830->pci_dev->regions[2].size;
+	aper_size = pI830->PciInfo->regions[2].size;
 
 	for (start = 0; start < aper_size; start += KB(4)) {
 		uint32_t start_pte = INGTT(start);
diff --git a/src/reg_dumper/hotplug.c b/src/reg_dumper/hotplug.c
index 68fe584..de46384 100644
--- a/src/reg_dumper/hotplug.c
+++ b/src/reg_dumper/hotplug.c
@@ -72,10 +72,7 @@ int main(int argc, char **argv)
     if (dev->vendor_id != 0x8086)
 	errx(1, "Graphics card is non-intel");
 
-    i830.PciInfo = &i830.pci_info_rec;
-    i830.PciInfo->chipType = dev->device_id;
-
-    i830.pci_dev = dev;
+    i830.PciInfo = dev;
 
     mmio_bar = IS_I9XX((&i830)) ? 0 : 1;
 
diff --git a/src/reg_dumper/idle.c b/src/reg_dumper/idle.c
index 8d60c0c..cbd68aa 100644
--- a/src/reg_dumper/idle.c
+++ b/src/reg_dumper/idle.c
@@ -142,10 +142,7 @@ int main(int argc, char **argv)
     if (dev->vendor_id != 0x8086)
 	errx(1, "Graphics card is non-intel");
 
-    i830.PciInfo = &i830.pci_info_rec;
-    i830.PciInfo->chipType = dev->device_id;
-
-    i830.pci_dev = dev;
+    i830.PciInfo = dev;
 
     mmio_bar = IS_I9XX((&i830)) ? 0 : 1;
 
diff --git a/src/reg_dumper/main.c b/src/reg_dumper/main.c
index 5c8ef9e..ce883ef 100644
--- a/src/reg_dumper/main.c
+++ b/src/reg_dumper/main.c
@@ -29,7 +29,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdarg.h>
-#include <pciaccess.h>
 #include <err.h>
 
 #include "reg_dumper.h"
@@ -62,10 +61,7 @@ int main(int argc, char **argv)
     if (dev->vendor_id != 0x8086)
 	errx(1, "Graphics card is non-intel");
 
-    i830.PciInfo = &i830.pci_info_rec;
-    i830.PciInfo->chipType = dev->device_id;
-
-    i830.pci_dev = dev;
+    i830.PciInfo = dev;
 
     mmio_bar = IS_I9XX((&i830)) ? 0 : 1;
 
diff --git a/src/reg_dumper/reg_dumper.h b/src/reg_dumper/reg_dumper.h
index 9f24d5c..8c2eb0b 100644
--- a/src/reg_dumper/reg_dumper.h
+++ b/src/reg_dumper/reg_dumper.h
@@ -29,6 +29,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <pciaccess.h>
 #include "common.h"
 
 /** @file
@@ -45,18 +46,12 @@ typedef char Bool;
 #define X_WARNING 1
 #define X_ERROR 2
 
-struct pci_info_rec {
-    uint16_t chipType;
-};
-
 typedef struct _i830 {
     /* Fields in common with the real pI830 */
-    struct pci_info_rec *PciInfo;
+    struct pci_device *PciInfo;
     Bool use_drm_mode;
 
     /* Fields used for setting up reg_dumper */
-    struct pci_device *pci_dev;
-    struct pci_info_rec pci_info_rec;
     volatile unsigned char *mmio;
 } I830Rec, *I830Ptr;
 
diff --git a/src/reg_dumper/util.c b/src/reg_dumper/util.c
index 6dd1e48..4d6380e 100644
--- a/src/reg_dumper/util.c
+++ b/src/reg_dumper/util.c
@@ -65,10 +65,7 @@ void intel_i830rec_init(I830Ptr pI830)
     if (dev->vendor_id != 0x8086)
 	errx(1, "Graphics card is non-intel");
 
-    pI830->PciInfo = &pI830->pci_info_rec;
-    pI830->PciInfo->chipType = dev->device_id;
-
-    pI830->pci_dev = dev;
+    pI830->PciInfo = dev;
 
     mmio_bar = IS_I9XX(pI830) ? 0 : 1;
 
commit 4653a7db622ad54a3182d93c81331765d930db34
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Apr 20 22:05:54 2009 -0700

    Rely on BO pixmaps being present in acceleration paths.

diff --git a/src/i830_batchbuffer.h b/src/i830_batchbuffer.h
index 81e84e2..6e0aaa7 100644
--- a/src/i830_batchbuffer.h
+++ b/src/i830_batchbuffer.h
@@ -102,16 +102,9 @@ intel_batch_emit_reloc_pixmap(I830Ptr pI830, PixmapPtr pPixmap,
 			      uint32_t delta)
 {
     dri_bo *bo = i830_get_pixmap_bo(pPixmap);
-    uint32_t offset;
     assert(pI830->batch_ptr != NULL);
     assert(intel_batch_space(pI830) >= 4);
-    if (bo) {
-	intel_batch_emit_reloc(pI830, bo, read_domains, write_domain, delta);
-	return;
-    }
-    offset = intel_get_pixmap_offset(pPixmap);
-    *(uint32_t *)(pI830->batch_ptr + pI830->batch_used) = offset + delta;
-    pI830->batch_used += 4;
+    intel_batch_emit_reloc(pI830, bo, read_domains, write_domain, delta);
 }
 
 #define OUT_BATCH(dword) intel_batch_emit_dword(pI830, dword)
diff --git a/src/i965_render.c b/src/i965_render.c
index e527f11..7583af1 100644
--- a/src/i965_render.c
+++ b/src/i965_render.c
@@ -923,6 +923,7 @@ i965_set_picture_surface_state(dri_bo *ss_bo, int ss_index,
     struct brw_surface_state_padded *ss;
     struct brw_surface_state local_ss;
     dri_bo *pixmap_bo = i830_get_pixmap_bo(pPixmap);
+    uint32_t write_domain, read_domains;
 
     ss = (struct brw_surface_state_padded *)ss_bo->virtual + ss_index;
 
@@ -952,10 +953,7 @@ i965_set_picture_surface_state(dri_bo *ss_bo, int ss_index,
     local_ss.ss0.vert_line_stride_ofs = 0;
     local_ss.ss0.mipmap_layout_mode = 0;
     local_ss.ss0.render_cache_read_mode = 0;
-    if (pixmap_bo != NULL)
-	local_ss.ss1.base_addr = pixmap_bo->offset;
-    else
-	local_ss.ss1.base_addr = intel_get_pixmap_offset(pPixmap);
+    local_ss.ss1.base_addr = pixmap_bo->offset;
 
     local_ss.ss2.mip_count = 0;
     local_ss.ss2.render_target_rotation = 0;
@@ -967,22 +965,20 @@ i965_set_picture_surface_state(dri_bo *ss_bo, int ss_index,
 
     memcpy(ss, &local_ss, sizeof(local_ss));
 
-    if (pixmap_bo != NULL) {
-	uint32_t write_domain, read_domains;
 
-	if (is_dst) {
-	    write_domain = I915_GEM_DOMAIN_RENDER;
-	    read_domains = I915_GEM_DOMAIN_RENDER;
-	} else {
-	    write_domain = 0;
-	    read_domains = I915_GEM_DOMAIN_SAMPLER;
-	}
-	dri_bo_emit_reloc(ss_bo, read_domains, write_domain,
-			  0,
-			  ss_index * sizeof(*ss) +
-			  offsetof(struct brw_surface_state, ss1),
-			  pixmap_bo);
+    if (is_dst) {
+	write_domain = I915_GEM_DOMAIN_RENDER;
+	read_domains = I915_GEM_DOMAIN_RENDER;
+    } else {
+	write_domain = 0;
+	read_domains = I915_GEM_DOMAIN_SAMPLER;
     }
+    drm_intel_bo_emit_reloc(ss_bo,
+			    ss_index * sizeof(*ss) +
+			    offsetof(struct brw_surface_state, ss1),
+			    pixmap_bo,
+			    0,
+			    read_domains, write_domain);
 }
 
 static void
commit 1784efc1f0c74edda8c78fb1b0cdd989f0a088ad
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Apr 20 18:25:59 2009 -0700

    Remove XF86DRM_MODE.
    
    We now depend on server 1.6 and current libdrm, so no need to ifdef it.

diff --git a/configure.ac b/configure.ac
index 18fe983..14a1c6b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -163,13 +163,6 @@ if test "$DRI" = yes; then
         AC_DEFINE(XF86DRI_DEVEL,1,[Enable developmental DRI driver support])
 fi
 
-dnl Server 1.5's set_mode_major required for DRM_MODE.
-PKG_CHECK_MODULES(DRM_MODE, [xorg-server >= 1.5],
-		 [DRM_MODE=yes], [DRM_MODE=no])
-if test "x$DRM_MODE" = xyes; then
-	AC_DEFINE(XF86DRM_MODE,1,[DRM kernel modesetting])
-fi
-
 AM_CONDITIONAL(VIDEO_DEBUG, test x$VIDEO_DEBUG = xyes)
 if test "$VIDEO_DEBUG" = yes; then
 	AC_DEFINE(VIDEO_DEBUG,1,[Enable debug support])
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 298c471..15ffc29 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -31,7 +31,6 @@
 
 #include "xorgVersion.h"
 
-#ifdef XF86DRM_MODE
 #include "i830.h"
 #include "intel_bufmgr.h"
 #include "xf86drmMode.h"
@@ -921,5 +920,3 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp)
 
 	return TRUE;
 }
-
-#endif
diff --git a/src/i830.h b/src/i830.h
index 8d51f2c..a573c2d 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -685,9 +685,7 @@ i830_pipe_a_require_deactivate (ScrnInfoPtr scrn);
 Bool I830DRI2ScreenInit(ScreenPtr pScreen);
 void I830DRI2CloseScreen(ScreenPtr pScreen);
 
-#ifdef XF86DRM_MODE
 extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp);
-#endif
 
 extern Bool I830AccelInit(ScreenPtr pScreen);
 extern void I830SetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir,
diff --git a/src/i830_dri.c b/src/i830_dri.c
index 745162d..743521c 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -387,15 +387,10 @@ Bool I830DRI2ScreenInit(ScreenPtr pScreen)
 	    pI830->PciInfo->dev,
 	    pI830->PciInfo->func);
 
-    info.fd = -1;
-
-#ifdef XF86DRM_MODE
     /* Use the already opened (master) fd from modesetting */
-    if (pI830->use_drm_mode)
+    if (pI830->use_drm_mode) {
 	info.fd = pI830->drmSubFD;
-#endif
-
-    if (info.fd < 0) {
+    } else {
 	info.fd = drmOpen("i915", buf);
 	drmSetVersion sv;
 	int err;
diff --git a/src/i830_driver.c b/src/i830_driver.c
index b4111d3..5a8c5d9 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -208,10 +208,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include <sys/ioctl.h>
 #include "i915_drm.h"
-
-#ifdef XF86DRM_MODE
 #include <xf86drmMode.h>
-#endif
 
 #define BIT(x) (1 << (x))
 #define MAX(a,b) ((a) > (b) ? (a) : (b))
@@ -1176,7 +1173,6 @@ i830SetHotkeyControl(ScrnInfoPtr pScrn, int mode)
    pI830->writeControl(pI830, GRX, 0x18, gr18);
 }
 
-#ifdef XF86DRM_MODE
 /*
  * DRM mode setting Linux only at this point... later on we could
  * add a wrapper here.
@@ -1207,9 +1203,6 @@ static Bool i830_kernel_mode_enabled(ScrnInfoPtr pScrn)
 
     return TRUE;
 }
-#else
-#define i830_kernel_mode_enabled(x) FALSE
-#endif
 
 static Bool
 i830_detect_chipset(ScrnInfoPtr pScrn)
@@ -1620,7 +1613,6 @@ I830AccelMethodInit(ScrnInfoPtr pScrn)
 static Bool
 I830DrmModeInit(ScrnInfoPtr pScrn)
 {
-#ifdef XF86DRM_MODE
     I830Ptr pI830 = I830PTR(pScrn);
     char *bus_id;
     int ret;
@@ -1651,7 +1643,6 @@ I830DrmModeInit(ScrnInfoPtr pScrn)
     pI830->directRenderingType = DRI_NONE;
 
     i830_init_bufmgr(pScrn);
-#endif
 
     return TRUE;
 }
@@ -2767,10 +2758,8 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
    }
 
    if (pI830->use_drm_mode) {
-#ifdef XF86DRM_MODE
        pI830->stolen_size = 0;
        pScrn->videoRam = ~0UL / KB(1);
-#endif
    } else {
        I830AdjustMemory(pScreen);
    }
commit d82ea4372fb74654eb0f37d996977003473846ed
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Apr 20 13:20:03 2009 -0700

    Replace I830Sync's irq emit/wait code with bufmgr use.
    
    This pre-GEM code was all sorts of broken -- see intel_bufmgr_fake.c for
    the hoops that must be jumped to use that kernel interface successfully.
    Yet we continued to use it even with KMS/DRI2/UXA, which may account for
    some hangs.

diff --git a/src/i830.h b/src/i830.h
index 7b01018..8d51f2c 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -385,6 +385,7 @@ typedef struct _I830Rec {
    /** Number of bytes to be emitted in the current BEGIN_BATCH. */
    uint32_t batch_emitting;
    dri_bo *batch_bo;
+   dri_bo *last_batch_bo;
    /** Whether we're in a section of code that can't tolerate flushing */
    Bool in_batch_atomic;
    /** Ending batch_used that was verified by i830_start_batch_atomic() */
diff --git a/src/i830_accel.c b/src/i830_accel.c
index c2f30a8..589f86d 100644
--- a/src/i830_accel.c
+++ b/src/i830_accel.c
@@ -156,36 +156,7 @@ I830Sync(ScrnInfoPtr pScrn)
    I830EmitFlush(pScrn);
 
    intel_batch_flush(pScrn, TRUE);
-
-   if (pI830->directRenderingType > DRI_NONE) {
-       struct drm_i915_irq_emit emit;
-       struct drm_i915_irq_wait wait;
-       int ret;
-
-       /* Most of the uses of I830Sync while using GEM should actually be
-	* using set_domain on a specific buffer.  We're not there yet, so fake
-	* it up using irq_emit/wait.  It's still better than spinning on
-	* register reads for idle.
-	*/
-       emit.irq_seq = &wait.irq_seq;
-       ret = drmCommandWriteRead(pI830->drmSubFD, DRM_I830_IRQ_EMIT, &emit,
-			    sizeof(emit));
-       if (ret != 0)
-	   FatalError("Failure to emit IRQ: %s\n", strerror(-ret));
-
-       do {
-	   ret = drmCommandWrite(pI830->drmSubFD, DRM_I830_IRQ_WAIT, &wait,
-				 sizeof(wait));
-       } while (ret == -EINTR);
-
-       if (ret != 0)
-	   FatalError("Failure to wait for IRQ: %s\n", strerror(-ret));
-
-       if (!pI830->memory_manager)
-	   i830_refresh_ring(pScrn);
-   } else if (!pI830->use_drm_mode) {
-       i830_wait_ring_idle(pScrn);
-   }
+   intel_batch_wait_last(pScrn);
 }
 
 void
diff --git a/src/i830_batchbuffer.c b/src/i830_batchbuffer.c
index ff5f0c2..5a9f9c5 100644
--- a/src/i830_batchbuffer.c
+++ b/src/i830_batchbuffer.c
@@ -159,8 +159,13 @@ intel_batch_teardown(ScrnInfoPtr pScrn)
 
     if (pI830->batch_ptr != NULL) {
 	dri_bo_unmap(pI830->batch_bo);
-	dri_bo_unreference(pI830->batch_bo);
 	pI830->batch_ptr = NULL;
+
+	dri_bo_unreference(pI830->batch_bo);
+	pI830->batch_bo = NULL;
+
+	dri_bo_unreference(pI830->last_batch_bo);
+	pI830->last_batch_bo = NULL;
     }
 }
 
@@ -201,7 +206,13 @@ intel_batch_flush(ScrnInfoPtr pScrn, Bool flushed)
     if (ret != 0)
 	FatalError("Failed to submit batchbuffer: %s\n", strerror(-ret));
 
-    dri_bo_unreference(pI830->batch_bo);
+    /* Save a ref to the last batch emitted, which we use for syncing
+     * in debug code.
+     */
+    dri_bo_unreference(pI830->last_batch_bo);
+    pI830->last_batch_bo = pI830->batch_bo;
+    pI830->batch_bo = NULL;
+
     intel_next_batch(pScrn);
 
     /* Mark that we need to flush whatever potential rendering we've done in the
@@ -214,3 +225,17 @@ intel_batch_flush(ScrnInfoPtr pScrn, Bool flushed)
     if (pI830->batch_flush_notify)
 	pI830->batch_flush_notify (pScrn);
 }
+
+/** Waits on the last emitted batchbuffer to be completed. */
+void
+intel_batch_wait_last(ScrnInfoPtr scrn)
+{
+    I830Ptr pI830 = I830PTR(scrn);
+
+    /* Map it CPU write, which guarantees it's done.  This is a completely
+     * non performance path, so we don't need anything better.
+     */
+    drm_intel_bo_map(pI830->last_batch_bo, TRUE);
+    drm_intel_bo_unmap(pI830->last_batch_bo);
+}
+
diff --git a/src/i830_batchbuffer.h b/src/i830_batchbuffer.h
index d011417..81e84e2 100644
--- a/src/i830_batchbuffer.h
+++ b/src/i830_batchbuffer.h
@@ -35,6 +35,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 void intel_batch_init(ScrnInfoPtr pScrn);
 void intel_batch_teardown(ScrnInfoPtr pScrn);
 void intel_batch_flush(ScrnInfoPtr pScrn, Bool flushed);
+void intel_batch_wait_last(ScrnInfoPtr pScrn);
 
 static inline int
 intel_batch_space(I830Ptr pI830)
commit 612c1f1f1859ce0cef41049d79cc473657d48612
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Apr 20 16:16:48 2009 -0700

    Remove I830_XV ifdef.
    
    The developers of the driver don't ever run or test without XV.  Don't do it.

diff --git a/src/Makefile.am b/src/Makefile.am
index c4b9ab0..221b669 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -31,8 +31,7 @@ SUBDIRS = xvmc bios_reader ch7017 ch7xxx ivch sil164 tfp410 $(REGDUMPER)
 # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
 
 AM_CFLAGS = @WARN_CFLAGS@ @XORG_CFLAGS@ @DRM_CFLAGS@ @DRI_CFLAGS@ \
-	@PCIACCESS_CFLAGS@ -I$(top_srcdir)/uxa \
-	-DI830_XV
+	@PCIACCESS_CFLAGS@ -I$(top_srcdir)/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 73b0712..7b01018 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -390,11 +390,9 @@ typedef struct _I830Rec {
    /** Ending batch_used that was verified by i830_start_batch_atomic() */
    int batch_atomic_limit;
 
-#ifdef I830_XV
    /* For Xvideo */
    i830_memory *overlay_regs;
    void *offscreenImages;          /**< remembered memory block for release */
-#endif
 #ifdef INTEL_XVMC
    /* For XvMC */
    Bool XvMCEnabled;
@@ -455,7 +453,6 @@ typedef struct _I830Rec {
    Bool XvEnabled;			/* Xv enabled for this generation. */
    Bool XvPreferOverlay;
 
-#ifdef I830_XV
    int colorKey;
    XF86VideoAdaptorPtr adaptor;
    ScreenBlockHandlerProcPtr BlockHandler;
@@ -471,7 +468,6 @@ typedef struct _I830Rec {
       drm_intel_bo *gen4_sampler_bo;
       drm_intel_bo *gen4_sip_kernel_bo;
    } video;
-#endif
 
    /* Render accel state */
    float scale_units[2][2];
@@ -671,10 +667,8 @@ i830_crtc_set_cursor_colors (xf86CrtcPtr crtc, int bg, int fg);
 extern void i830_refresh_ring(ScrnInfoPtr pScrn);
 extern void I830EmitFlush(ScrnInfoPtr pScrn);
 
-#ifdef I830_XV
 extern void I830InitVideo(ScreenPtr pScreen);
 extern void i830_crtc_dpms_video(xf86CrtcPtr crtc, Bool on);
-#endif
 
 int
 i830_crtc_pipe (xf86CrtcPtr crtc);
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 4fa61c9..b4111d3 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1664,7 +1664,6 @@ I830XvInit(ScrnInfoPtr pScrn)
 
    pI830->XvPreferOverlay = xf86ReturnOptValBool(pI830->Options, OPTION_PREFER_OVERLAY, FALSE);
 
-#ifdef I830_XV
     if (xf86GetOptValInteger(pI830->Options, OPTION_VIDEO_KEY,
 			     &(pI830->colorKey))) {
 	from = X_CONFIG;
@@ -1680,7 +1679,6 @@ I830XvInit(ScrnInfoPtr pScrn)
     }
     xf86DrvMsg(pScrn->scrnIndex, from, "video overlay key set to 0x%x\n",
 	       pI830->colorKey);
-#endif
 }
 
 /**
@@ -2821,14 +2819,11 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
    pI830->last_3d = LAST_3D_OTHER;
    pI830->overlayOn = FALSE;
 
-#ifdef I830_XV
     /*
      * Set this so that the overlay allocation is factored in when
      * appropriate.
      */
     pI830->XvEnabled = TRUE;
-#endif
-
 
    /* Need MMIO mapped to do GTT lookups during memory allocation. */
    if (!pI830->use_drm_mode)
@@ -2861,15 +2856,11 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
    if (!miSetPixmapDepths())
       return FALSE;
 
-#ifdef I830_XV
    if (pI830->accel == ACCEL_NONE) {
       xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Xv is disabled because it "
 		 "needs 2D acceleration.\n");
       pI830->XvEnabled = FALSE;
    }
-#else
-   pI830->XvEnabled = FALSE;
-#endif
 
    if (pI830->accel != ACCEL_NONE && !pI830->use_drm_mode) {
       if (pI830->memory_manager == NULL && pI830->ring.mem->size == 0) {
@@ -2983,7 +2974,6 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
 
    xf86DPMSInit(pScreen, xf86DPMSSet, 0);
 
-#ifdef I830_XV
 #ifdef INTEL_XVMC
     pI830->XvMCEnabled = FALSE;
     from =  xf86GetOptValBool(pI830->Options, OPTION_XVMC,
@@ -2994,7 +2984,6 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
    /* Init video */
    if (pI830->XvEnabled)
       I830InitVideo(pScreen);
-#endif
 
    /* Setup 3D engine, needed for rotation too */
    IntelEmitInvarientState(pScrn);
@@ -3330,11 +3319,9 @@ I830CloseScreen(int scrnIndex, ScreenPtr pScreen)
 
    i830_allocator_fini(pScrn);
 
-#ifdef I830_XV
    i965_free_video(pScrn);
    free(pI830->offscreenImages);
    pI830->offscreenImages = NULL;
-#endif
 
    dri_bufmgr_destroy(pI830->bufmgr);
    pI830->bufmgr = NULL;
diff --git a/src/i830_memory.c b/src/i830_memory.c
index 147fca3..52ec872 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -999,7 +999,6 @@ i830_allocate_ringbuffer(ScrnInfoPtr pScrn)
     return TRUE;
 }
 
-#ifdef I830_XV
 /**
  * Allocate space for overlay registers.
  */
@@ -1037,7 +1036,6 @@ i830_allocate_overlay(ScrnInfoPtr pScrn)
 
     return TRUE;
 }
-#endif
 
 static Bool
 IsTileable(ScrnInfoPtr pScrn, int pitch)
@@ -1311,10 +1309,8 @@ i830_allocate_2d_memory(ScrnInfoPtr pScrn)
 	}
     }
 
-#ifdef I830_XV
     if (!pI830->use_drm_mode)
 	i830_allocate_overlay(pScrn);
-#endif
 
     pI830->front_buffer = i830_allocate_framebuffer(pScrn);
     if (pI830->front_buffer == NULL)
commit af6892f2b873dd508994d8bbf3d67e719b535e35
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Apr 20 16:07:05 2009 -0700

    Replace i830WaitSync with just I830Sync(), as nearly all callers had it wrong.
    
    People were trying to BEGIN_BATCH()/ADVANCE_BATCH() then i830WaitSync on the
    results, which wouldn't necessarily wait and lead to various painful bugs,
    since only EXA called MarkSync and only for certain rendering operations.

diff --git a/src/i830.h b/src/i830.h
index d2307f6..73b0712 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -440,7 +440,6 @@ typedef struct _I830Rec {
 
    uxa_driver_t *uxa_driver;
    Bool need_flush;
-   Bool need_sync;
    PixmapPtr pSrcPixmap;
    int accel_pixmap_pitch_alignment;
    int accel_pixmap_offset_alignment;
@@ -758,9 +757,6 @@ void i830_hdmi_init(ScrnInfoPtr pScrn, int output_reg);
 /* i830_lvds.c */
 void i830_lvds_init(ScrnInfoPtr pScrn);
 
-extern void i830MarkSync(ScrnInfoPtr pScrn);
-extern void i830WaitSync(ScrnInfoPtr pScrn);
-
 /* i830_memory.c */
 Bool i830_bind_all_memory(ScrnInfoPtr pScrn);
 Bool i830_unbind_all_memory(ScrnInfoPtr pScrn);
diff --git a/src/i830_display.c b/src/i830_display.c
index c8e94ff..c1617e3 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -1266,8 +1266,10 @@ i830_crtc_dpms(xf86CrtcPtr crtc, int mode)
 static Bool
 i830_crtc_lock (xf86CrtcPtr crtc)
 {
-    /* Sync the engine before mode switch */
-    i830WaitSync(crtc->scrn);
+    /* Sync the engine before mode switch, to finish any outstanding
+     * WAIT_FOR_EVENTS that may rely on CRTC state.
+     */
+    I830Sync(crtc->scrn);
 
     return FALSE;
 }
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 626e658..4fa61c9 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1935,7 +1935,6 @@ i830_refresh_ring(ScrnInfoPtr pScrn)
    pI830->ring.space = pI830->ring.head - (pI830->ring.tail + 8);
    if (pI830->ring.space < 0)
       pI830->ring.space += pI830->ring.mem->size;
-   i830MarkSync(pScrn);
 }
 
 enum pipe {
@@ -3050,7 +3049,7 @@ i830AdjustFrame(int scrnIndex, int x, int y, int flags)
    if (crtc && crtc->enabled)
    {
       /* Sync the engine before adjust frame */
-      i830WaitSync(pScrn);
+      I830Sync(pScrn);
       i830PipeSetBase(crtc, crtc->desiredX + x, crtc->desiredY + y);
       crtc->x = output->initial_x + x;
       crtc->y = output->initial_y + y;
@@ -3454,26 +3453,6 @@ i830_pipe_to_crtc(ScrnInfoPtr pScrn, int pipe)
 } 
 
 void
-i830WaitSync(ScrnInfoPtr pScrn)
-{
-   I830Ptr pI830 = I830PTR(pScrn);
-
-   if (pI830->uxa_driver && pI830->need_sync) {
-      pI830->need_sync = FALSE;
-      I830Sync(pScrn);
-   }
-}
-
-void
-i830MarkSync(ScrnInfoPtr pScrn)
-{
-   I830Ptr pI830 = I830PTR(pScrn);
-
-   if (pI830->uxa_driver)
-      pI830->need_sync = TRUE;
-}
-
-void
 I830InitpScrn(ScrnInfoPtr pScrn)
 {
    pScrn->PreInit = I830PreInit;
diff --git a/src/i830_exa.c b/src/i830_exa.c
index 3ec3657..0a15de8 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -492,11 +492,6 @@ i830_uxa_prepare_access (PixmapPtr pixmap, uxa_access_t access)
 	I830Ptr i830 = I830PTR(scrn);
 	
 	intel_batch_flush(scrn, FALSE);
-	/* XXX: dri_bo_map should handle syncing for us, what's the deal? */
-	if (i830->need_sync) {
-	    I830Sync(scrn);
-	    i830->need_sync = FALSE;
-	}
 
 	/* No VT sema or GEM?  No GTT mapping. */
 	if (!scrn->vtSema || !i830->memory_manager) {
diff --git a/src/i830_memory.c b/src/i830_memory.c
index 3443146..147fca3 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -1368,10 +1368,7 @@ i830_set_tiling(ScrnInfoPtr pScrn, unsigned int offset,
 
     assert(tile_format != TILE_NONE);
 
-    if (pI830->need_sync) {
-	I830Sync(pScrn);
-	pI830->need_sync = FALSE;
-    }
+    I830Sync(pScrn);
 
     if (IS_I965G(pI830))
 	max_fence = FENCE_NEW_NR;
diff --git a/src/i830_video.c b/src/i830_video.c
index d07fb65..8d33d69 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -461,7 +461,7 @@ i830_overlay_on(ScrnInfoPtr pScrn)
     OUT_BATCH(MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP);
     OUT_BATCH(MI_NOOP);
     ADVANCE_BATCH();
-    i830WaitSync(pScrn);
+    I830Sync(pScrn);
     
     /*
      * If we turned pipe A on up above, turn it
@@ -514,7 +514,7 @@ i830_overlay_off(ScrnInfoPtr pScrn)
 
     /*
      * Wait for overlay to go idle. This has to be
-     * separated from the turning off state by a WaitSync
+     * separated from the turning off state by a Sync
      * to ensure the overlay will not read OCMD early and
      * disable the overlay before the commands here are
      * executed
@@ -524,7 +524,7 @@ i830_overlay_off(ScrnInfoPtr pScrn)
 	OUT_BATCH(MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP);
 	OUT_BATCH(MI_NOOP);
 	ADVANCE_BATCH();
-	i830WaitSync(pScrn);
+	I830Sync(pScrn);
     }
     
     /*
@@ -545,7 +545,7 @@ i830_overlay_off(ScrnInfoPtr pScrn)
 	OUT_BATCH(MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP);
 	OUT_BATCH(MI_NOOP);
 	ADVANCE_BATCH();
-	i830WaitSync(pScrn);
+	I830Sync(pScrn);
     }
     pI830->overlayOn = FALSE;
     OVERLAY_DEBUG("overlay_off\n");
commit 393abc15b76804580bfee0760ddbd1fb77e66c02
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Apr 20 15:58:35 2009 -0700

    Now that video destination pixmaps are always in BOs, no more MarkSync.

diff --git a/src/i915_video.c b/src/i915_video.c
index 93e0c86..1d1fa01 100644
--- a/src/i915_video.c
+++ b/src/i915_video.c
@@ -415,7 +415,5 @@ I915DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
    }
 
    intel_batch_end_atomic(pScrn);
-
-   i830MarkSync(pScrn);
 }
 
diff --git a/src/i965_video.c b/src/i965_video.c
index f6020d4..1d0ed74 100644
--- a/src/i965_video.c
+++ b/src/i965_video.c
@@ -375,13 +375,10 @@ i965_create_dst_surface_state(ScrnInfoPtr scrn,
     dest_surf_state->ss0.mipmap_layout_mode = 0;
     dest_surf_state->ss0.render_cache_read_mode = 0;
 
-    if (pixmap_bo != NULL)
-	dest_surf_state->ss1.base_addr =
-	    intel_emit_reloc(surf_bo, offsetof(struct brw_surface_state, ss1),
-			     pixmap_bo, 0,
-			     I915_GEM_DOMAIN_SAMPLER, 0);
-    else
-	dest_surf_state->ss1.base_addr = intel_get_pixmap_offset(pixmap);
+    dest_surf_state->ss1.base_addr =
+	intel_emit_reloc(surf_bo, offsetof(struct brw_surface_state, ss1),
+			 pixmap_bo, 0,
+			 I915_GEM_DOMAIN_SAMPLER, 0);
 
     dest_surf_state->ss2.height = scrn->virtualY - 1;
     dest_surf_state->ss2.width = scrn->virtualX - 1;
@@ -1160,7 +1157,6 @@ I965DisplayVideoTextured(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv, int id,
 	i965_post_draw_debug(pScrn);
     }
 
-    i830MarkSync(pScrn);
 #if WATCH_STATS
     i830_dump_error_state(pScrn);
 #endif
commit dc71573292c215f49716f4dc1ebc416c6b172995
Author: Eric Anholt <eric at anholt.net>
Date:   Fri Apr 17 15:13:34 2009 -0700

    Remove can_resize, which is now always true (except when a bug interfered)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 8f682d5..298c471 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -824,9 +824,6 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
 	if (scrn->virtualX == width && scrn->virtualY == height)
 		return TRUE;
 
-	if (!pI830->can_resize)
-		return FALSE;
-
 	pitch = i830_pad_drawable_width(width, pI830->cpp);
 	tiled = i830_tiled_width(pI830, &pitch, pI830->cpp);
 	xf86DrvMsg(scrn->scrnIndex, X_INFO,
@@ -896,7 +893,6 @@ static const xf86CrtcConfigFuncsRec drmmode_xf86crtc_config_funcs = {
 
 Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp)
 {
-	I830Ptr pI830 = I830PTR(pScrn);
 	xf86CrtcConfigPtr   xf86_config;
 	drmmode_ptr drmmode;
 	int i;
@@ -921,7 +917,7 @@ Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp)
 	for (i = 0; i < drmmode->mode_res->count_connectors; i++)
 		drmmode_output_init(pScrn, drmmode, i);
 
-	xf86InitialConfiguration(pScrn, pI830->can_resize);
+	xf86InitialConfiguration(pScrn, TRUE);
 
 	return TRUE;
 }
diff --git a/src/i830.h b/src/i830.h
index 84c2110..d2307f6 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -409,8 +409,6 @@ typedef struct _I830Rec {
 
    i830_memory *memory_manager;		/**< DRI memory manager aperture */
 
-   Bool can_resize;
-
    Bool need_mi_flush;
 
    Bool tiling;
diff --git a/src/i830_driver.c b/src/i830_driver.c
index a044b72..626e658 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1105,7 +1105,7 @@ i830_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
     scrn->virtualX = width;
     scrn->virtualY = height;
 #ifdef DRI2
-    if (i830->can_resize && i830->front_buffer)
+    if (i830->front_buffer)
     {
 	i830_memory *new_front, *old_front;
 	Bool	    tiled;
@@ -1599,16 +1599,8 @@ I830AccelMethodInit(ScrnInfoPtr pScrn)
     I830SetupOutputs(pScrn);
 
     SaveHWState(pScrn);
-    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);
 
-    if (!xf86InitialConfiguration (pScrn, pI830->can_resize))
+    if (!xf86InitialConfiguration (pScrn, TRUE))
     {
 	xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes.\n");
 	RestoreHWState(pScrn);
@@ -1634,7 +1626,6 @@ I830DrmModeInit(ScrnInfoPtr pScrn)
     int ret;
 
     pI830->accel = ACCEL_UXA;
-    pI830->can_resize = TRUE;
 
     bus_id = DRICreatePCIBusID(pI830->PciInfo);
 
diff --git a/src/i830_memory.c b/src/i830_memory.c
index dae8cf9..3443146 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -1097,13 +1097,6 @@ i830_allocate_framebuffer(ScrnInfoPtr pScrn)
      * rotation.
      */
     fb_height = pScrn->virtualY;
-    if (!pI830->can_resize)
-    {
-	if (!pI830->use_drm_mode && pScrn->virtualX > pScrn->virtualY)
-	    fb_height = pScrn->virtualX;
-	else
-	    fb_height = pScrn->virtualY;
-    }
 
     /* Calculate how much framebuffer memory to allocate.  For the
      * initial allocation, calculate a reasonable minimum.  This is
commit 96df22740b2cdc4f82a4a36c0f77663105d9337e
Author: Eric Anholt <eric at anholt.net>
Date:   Fri Apr 17 15:11:12 2009 -0700

    unifdef I830_USE_UXA.
    
    We only have on acceleration architecture now, and you can always build it
    if you're building the driver.

diff --git a/src/Makefile.am b/src/Makefile.am
index d4b9c8a..c4b9ab0 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_UXA
+	-DI830_XV
 
 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 314fd58..84c2110 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -73,19 +73,15 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "intel_bufmgr.h"
 #include "i915_drm.h"
 
-#ifdef I830_USE_UXA
 #include "uxa.h"
 Bool i830_uxa_init(ScreenPtr pScreen);
 void i830_uxa_create_screen_resources(ScreenPtr pScreen);
 void i830_uxa_block_handler (ScreenPtr pScreen);
 Bool i830_get_aperture_space(ScrnInfoPtr pScrn, drm_intel_bo **bo_table,
 			     int num_bos);
-#endif
 
-#if defined(I830_USE_UXA)
 dri_bo *i830_get_pixmap_bo (PixmapPtr pixmap);
 void i830_set_pixmap_bo(PixmapPtr pixmap, dri_bo *bo);
-#endif
 
 typedef struct _I830OutputRec I830OutputRec, *I830OutputPtr;
 
@@ -444,14 +440,10 @@ typedef struct _I830Rec {
 
    void (*batch_flush_notify)(ScrnInfoPtr pScrn);
 
-#ifdef I830_USE_UXA
    uxa_driver_t *uxa_driver;
    Bool need_flush;
-#endif
    Bool need_sync;
-#if defined(I830_USE_UXA)
    PixmapPtr pSrcPixmap;
-#endif
    int accel_pixmap_pitch_alignment;
    int accel_pixmap_offset_alignment;
    int accel_max_x;
diff --git a/src/i830_accel.c b/src/i830_accel.c
index b185ab1..c2f30a8 100644
--- a/src/i830_accel.c
+++ b/src/i830_accel.c
@@ -124,9 +124,7 @@ 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_UXA
-	pI830->uxa_driver = NULL;
-#endif
+	 pI830->uxa_driver = NULL;
 	 FatalError("lockup\n");
       }
 
@@ -283,9 +281,7 @@ I830AccelInit(ScreenPtr pScreen)
 
     switch (pI830->accel) {
     case ACCEL_UXA:
-#ifdef I830_USE_UXA
 	return i830_uxa_init(pScreen);
-#endif
     case ACCEL_UNINIT:
     case ACCEL_NONE:
 	break;
diff --git a/src/i830_batchbuffer.h b/src/i830_batchbuffer.h
index f16023d..d011417 100644
--- a/src/i830_batchbuffer.h
+++ b/src/i830_batchbuffer.h
@@ -100,18 +100,14 @@ intel_batch_emit_reloc_pixmap(I830Ptr pI830, PixmapPtr pPixmap,
 			      uint32_t read_domains, uint32_t write_domain,
 			      uint32_t delta)
 {
-#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
     if (bo) {
 	intel_batch_emit_reloc(pI830, bo, read_domains, write_domain, delta);
 	return;
     }
-#endif
     offset = intel_get_pixmap_offset(pPixmap);
     *(uint32_t *)(pI830->batch_ptr + pI830->batch_used) = offset + delta;
     pI830->batch_used += 4;
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 5fa76ca..a044b72 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -840,10 +840,9 @@ i830CreateScreenResources(ScreenPtr pScreen)
 
    i830_update_front_offset(pScrn);
 
-#ifdef I830_USE_UXA
    if (pI830->accel == ACCEL_UXA)
       i830_uxa_create_screen_resources(pScreen);
-#endif
+
    return TRUE;
 }
 
@@ -2456,10 +2455,8 @@ I830BlockHandler(int i,
        pI830->need_mi_flush = FALSE;
     }
 
-#ifdef I830_USE_UXA
     if (pI830->accel == ACCEL_UXA)
 	i830_uxa_block_handler (pScreen);
-#endif
 
     I830VideoBlockHandler(i, blockData, pTimeout, pReadmask);
 }
@@ -3328,13 +3325,11 @@ I830CloseScreen(int scrnIndex, ScreenPtr pScreen)
        vgaHWUnmapMem(pScrn);
    }
 
-#ifdef I830_USE_UXA
    if (pI830->uxa_driver) {
        uxa_driver_fini (pScreen);
        xfree (pI830->uxa_driver);
        pI830->uxa_driver = NULL;
    }
-#endif
    if (pI830->front_buffer) {
 	i830_set_pixmap_bo(pScreen->GetScreenPixmap(pScreen), NULL);
 	i830_free_memory(pScrn, pI830->front_buffer);
@@ -3472,17 +3467,9 @@ i830WaitSync(ScrnInfoPtr pScrn)
 {
    I830Ptr pI830 = I830PTR(pScrn);
 
-   switch (pI830->accel) {
-#ifdef I830_USE_UXA
-   case ACCEL_UXA:
-      if (pI830->uxa_driver && pI830->need_sync) {
-	 pI830->need_sync = FALSE;
-	 I830Sync(pScrn);
-      }
-      break;
-#endif
-   default:
-      break;
+   if (pI830->uxa_driver && pI830->need_sync) {
+      pI830->need_sync = FALSE;
+      I830Sync(pScrn);
    }
 }
 
@@ -3491,16 +3478,8 @@ i830MarkSync(ScrnInfoPtr pScrn)
 {
    I830Ptr pI830 = I830PTR(pScrn);
 
-   switch (pI830->accel) {
-#ifdef I830_USE_UXA
-   case ACCEL_UXA:
-      if (pI830->uxa_driver)
-	 pI830->need_sync = TRUE;
-      break;
-#endif
-   default:
-      break;
-   }
+   if (pI830->uxa_driver)
+      pI830->need_sync = TRUE;
 }
 
 void
diff --git a/src/i830_exa.c b/src/i830_exa.c
index cf39342..3ec3657 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -79,9 +79,7 @@ const int I830PatternROP[16] =
     ROP_1
 };
 
-#ifdef I830_USE_UXA
 static int uxa_pixmap_index;
-#endif
 
 /**
  * Returns whether a given pixmap is tiled or not.
@@ -455,13 +453,10 @@ i830_get_pixmap_bo(PixmapPtr pixmap)
     ScrnInfoPtr scrn = xf86Screens[screen->myNum];
     I830Ptr i830 = I830PTR(scrn);
 
-#ifdef I830_USE_UXA
-    if (i830->accel == ACCEL_UXA) {
+    if (i830->accel == ACCEL_UXA)
 	return dixLookupPrivate(&pixmap->devPrivates, &uxa_pixmap_index);
-    }
-#endif
-
-    return NULL;
+    else
+	return NULL;
 }
 
 void
@@ -473,17 +468,13 @@ i830_set_pixmap_bo(PixmapPtr pixmap, dri_bo *bo)
 
     if (old_bo)
 	dri_bo_unreference (old_bo);
-#if I830_USE_UXA
     if (i830->accel == ACCEL_UXA) {
 	if (bo != NULL)
 	    dri_bo_reference(bo);
 	dixSetPrivate(&pixmap->devPrivates, &uxa_pixmap_index, bo);
     }
-#endif
 }
 
-#if defined(I830_USE_UXA)
-
 static void
 i830_uxa_set_pixmap_bo (PixmapPtr pixmap, dri_bo *bo)
 {
@@ -736,4 +727,3 @@ i830_uxa_init (ScreenPtr pScreen)
 
     return TRUE;
 }
-#endif /* I830_USE_UXA */
commit fa81ae1637bfd7b73b43355b78c88a9b84c0393c
Author: Eric Anholt <eric at anholt.net>
Date:   Fri Apr 17 14:01:47 2009 -0700

    Remove EXA support.
    
    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.

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 9f5dd3a..314fd58 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. */
@@ -453,15 +444,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;
@@ -496,12 +484,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];
 
@@ -653,10 +641,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"
 
@@ -719,8 +703,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);
@@ -889,7 +871,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 a3772c5..b185ab1 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 93bb0ea..5fa76ca 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},
@@ -1471,7 +1457,6 @@ static const char *accel_name[] =
 {
    "unspecified",
    "no",
-   "EXA",
    "UXA",
 };
 
@@ -1564,34 +1549,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]);
     }
@@ -1669,25 +1632,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);
 
@@ -1894,33 +1842,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");
 
@@ -3235,7 +3156,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);
@@ -3322,8 +3243,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) {
@@ -3408,13 +3328,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);
@@ -3560,14 +3473,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) {
@@ -3587,14 +3492,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 e88d260..cf39342 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;
 }
@@ -779,18 +480,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) {
-	    if (bo != NULL)
-		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 c46541c..dae8cf9 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 210f8db..d07fb65 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
  */
@@ -2479,13 +2474,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,
commit 1b10745a2528622a32271f64c35fcdb7b7154d11
Author: Eric Anholt <eric at anholt.net>
Date:   Fri Jan 23 08:39:59 2009 -0800

    Remove XAA support.
    
    While EXA/UXA aren't completely good replacements (see bugzilla for
    performance and stability problems), we are pretty sure at this point that
    it's the right way to go and that having multiple acceleration architectures
    is getting in the way of producing a stable codebase.

diff --git a/man/intel.man b/man/intel.man
index 4f8db81..3e74bc2 100644
--- a/man/intel.man
+++ b/man/intel.man
@@ -147,12 +147,10 @@ have options for selecting adaptors.
 Default: Textured video adaptor is preferred.
 .TP
 .BI "Option \*qAccelMethod\*q \*q" string \*q
-Choose acceleration architecture, either "XAA", "EXA", or "UXA".  XAA is the old
-XFree86 based acceleration architecture.  EXA is a simpler
-acceleration architecture designed to better accelerate the X Render extension.
-UXA is a newer acceleration architecture built from the EXA acceleration
-code but taking advantage of kernel memory management to provide simpler,
-faster code.
+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
diff --git a/src/Makefile.am b/src/Makefile.am
index 6ab43fc..6401269 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_XAA -DI830_USE_EXA -DI830_USE_UXA
+	-DI830_XV -DI830_USE_EXA -DI830_USE_UXA
 
 intel_drv_la_LTLIBRARIES = intel_drv.la
 intel_drv_la_LDFLAGS = -module -avoid-version
@@ -112,7 +112,6 @@ intel_drv_la_SOURCES = \
 	 i915_video.c \
 	 i965_video.c \
 	 i830_exa.c \
-	 i830_xaa.c \
 	 i830_render.c \
 	 i915_render.c \
 	 i965_render.c \
diff --git a/src/i830.h b/src/i830.h
index e362d24..9f5dd3a 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -53,7 +53,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "xf86PciInfo.h"
 #include "xf86Pci.h"
 #include "i810_reg.h"
-#include "xaa.h"
 #include "xf86Cursor.h"
 #include "xf86xv.h"
 #include "vgaHW.h"
@@ -93,10 +92,6 @@ dri_bo *i830_get_pixmap_bo (PixmapPtr pixmap);
 void i830_set_pixmap_bo(PixmapPtr pixmap, dri_bo *bo);
 #endif
 
-#ifdef I830_USE_XAA
-Bool I830XAAInit(ScreenPtr pScreen);
-#endif
-
 typedef struct _I830OutputRec I830OutputRec, *I830OutputPtr;
 
 #include "common.h"
@@ -338,7 +333,6 @@ enum backlight_control {
 typedef enum accel_method {
     ACCEL_UNINIT = 0,
     ACCEL_NONE,
-    ACCEL_XAA,
     ACCEL_EXA,
     ACCEL_UXA
 } accel_method_t;
@@ -356,8 +350,6 @@ typedef struct _I830Rec {
    int cpp;
 
    unsigned int bufferOffset;		/* for I830SelectBuffer */
-   BoxRec FbMemBox;
-   int CacheLines;
 
    /* These are set in PreInit and never changed. */
    long FbMapSize;
@@ -381,7 +373,6 @@ typedef struct _I830Rec {
    /* separate small buffers for kernels that support this */
    i830_memory *cursor_mem_classic[2];
    i830_memory *cursor_mem_argb[2];
-   i830_memory *xaa_scratch;
 #ifdef I830_USE_EXA
    i830_memory *exa_offscreen;
 #endif
@@ -455,28 +446,9 @@ typedef struct _I830Rec {
 
    unsigned int BR[20];
 
-   unsigned char **ScanlineColorExpandBuffers;
-   int NumScanlineColorExpandBuffers;
-   int nextColorExpandBuf;
-
    Bool fence_used[FENCE_NEW_NR];
 
    accel_method_t accel;
-#ifdef I830_USE_XAA
-   XAAInfoRecPtr AccelInfoRec;
-
-   /* additional XAA accelerated Composite support */
-   CompositeProcPtr saved_composite;
-   Bool (*xaa_check_composite)(int op, PicturePtr pSrc, PicturePtr pMask,
-			       PicturePtr pDst);
-   Bool (*xaa_prepare_composite)(int op, PicturePtr pSrc, PicturePtr pMask,
-				 PicturePtr pDst, PixmapPtr pSrcPixmap,
-				 PixmapPtr pMaskPixmap, PixmapPtr pDstPixmap);
-   void (*xaa_composite)(PixmapPtr pDst, int xSrc, int ySrc,
-			 int xMask, int yMask, int xDst, int yDst,
-			 int w, int h);
-   void (*xaa_done_composite)(PixmapPtr pDst);
-#endif
    CloseScreenProcPtr CloseScreen;
 
    void (*batch_flush_notify)(ScrnInfoPtr pScrn);
@@ -899,9 +871,9 @@ static inline int i830_fb_compression_supported(I830Ptr pI830)
     if (IS_IGD(pI830))
 	return FALSE;
     /* fbc depends on tiled surface. And we don't support tiled
-     * front buffer with XAA now.
+     * front buffer with unaccelerated.
      */
-    if (!pI830->tiling || (IS_I965G(pI830) && pI830->accel <= ACCEL_XAA))
+    if (!pI830->tiling || (IS_I965G(pI830) && pI830->accel == ACCEL_NONE))
 	return FALSE;
     /* We have not gotten FBC to work consistently on 965GM. Our best
      * working theory right now is that FBC simply isn't reliable on
diff --git a/src/i830_accel.c b/src/i830_accel.c
index 12bb5a2..a3772c5 100644
--- a/src/i830_accel.c
+++ b/src/i830_accel.c
@@ -57,7 +57,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include <errno.h>
 
 #include "xf86.h"
-#include "xaarop.h"
 #include "i830.h"
 #include "i810_reg.h"
 #include "i830_debug.h"
@@ -137,9 +136,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_XAA
-	 pI830->AccelInfoRec = NULL;	/* Stops recursive behavior */
-#endif
 #ifdef I830_USE_EXA
 	 pI830->EXADriverPtr = NULL;
 #endif
@@ -207,8 +203,6 @@ I830Sync(ScrnInfoPtr pScrn)
    } else if (!pI830->use_drm_mode) {
        i830_wait_ring_idle(pScrn);
    }
-
-   pI830->nextColorExpandBuf = 0;
 }
 
 void
@@ -315,10 +309,6 @@ I830AccelInit(ScreenPtr pScreen)
     case ACCEL_EXA:
 	return I830EXAInit(pScreen);
 #endif
-#ifdef I830_USE_XAA
-    case ACCEL_XAA:
-	return I830XAAInit(pScreen);
-#endif
     case ACCEL_UNINIT:
     case ACCEL_NONE:
 	break;
diff --git a/src/i830_driver.c b/src/i830_driver.c
index f8373a8..93bb0ea 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -299,7 +299,6 @@ static PciChipsets I830PciChipsets[] = {
 typedef enum {
    OPTION_ACCELMETHOD,
    OPTION_NOACCEL,
-   OPTION_CACHE_LINES,
    OPTION_DRI,
    OPTION_VIDEO_KEY,
    OPTION_COLOR_KEY,
@@ -319,7 +318,6 @@ typedef enum {
 static OptionInfoRec I830Options[] = {
    {OPTION_ACCELMETHOD,	"AccelMethod",	OPTV_ANYSTR,	{0},	FALSE},
    {OPTION_NOACCEL,	"NoAccel",	OPTV_BOOLEAN,	{0},	FALSE},
-   {OPTION_CACHE_LINES,	"CacheLines",	OPTV_INTEGER,	{0},	FALSE},
    {OPTION_DRI,		"DRI",		OPTV_BOOLEAN,	{0},	TRUE},
    {OPTION_COLOR_KEY,	"ColorKey",	OPTV_INTEGER,	{0},	FALSE},
    {OPTION_VIDEO_KEY,	"VideoKey",	OPTV_INTEGER,	{0},	FALSE},
@@ -1473,7 +1471,6 @@ static const char *accel_name[] =
 {
    "unspecified",
    "no",
-   "XAA",
    "EXA",
    "UXA",
 };
@@ -1574,20 +1571,6 @@ I830AccelMethodInit(ScrnInfoPtr pScrn)
 	pI830->accel = ACCEL_NONE;
     }
 
-    /*
-     * The ugliness below:
-     * If either XAA or EXA (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
-     * if none is specified, or if the string was unrecognized.
-     *
-     * Then, just to make things more confusing, the default EXA will
-     * be overridden to UXA if KMS is available. See I830DrmModeInit.
-     *
-     * All this *will* go away when we remove XAA and EXA support from
-     * this driver. (And there will be much rejoicing.)
-     */
     if (!(pI830->accel == ACCEL_NONE)) {
 #ifdef I830_USE_UXA
 	pI830->accel = ACCEL_UXA;
@@ -1595,7 +1578,7 @@ I830AccelMethodInit(ScrnInfoPtr pScrn)
 #ifdef I830_USE_EXA
 	pI830->accel = ACCEL_EXA;
 #endif
-#if I830_USE_XAA + I830_USE_EXA + I830_USE_UXA >= 2
+#if I830_USE_EXA + I830_USE_UXA >= 2
 	from = X_DEFAULT;
 	if ((s = (char *)xf86GetOptValString(pI830->Options,
 					     OPTION_ACCELMETHOD))) {
@@ -1603,10 +1586,6 @@ I830AccelMethodInit(ScrnInfoPtr pScrn)
 		from = X_CONFIG;
 		pI830->accel = ACCEL_EXA;
 	    }
-	    else if (!xf86NameCmp(s, "XAA")) {
-		from = X_CONFIG;
-		pI830->accel = ACCEL_XAA;
-	    }
 	    else if (!xf86NameCmp(s, "UXA")) {
 		from = X_CONFIG;
 	       pI830->accel = ACCEL_UXA;
@@ -1916,16 +1895,6 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
    xf86LoaderReqSymLists(I810fbSymbols, NULL);
 
    switch (pI830->accel) {
-#ifdef I830_USE_XAA
-   case ACCEL_XAA:
-      if (!xf86LoadSubModule(pScrn, "xaa")) {
-	 PreInitCleanup(pScrn);
-	 return FALSE;
-      }
-      xf86LoaderReqSymLists(I810xaaSymbols, NULL);
-      break;
-#endif
-
 #ifdef I830_USE_EXA
    case ACCEL_EXA: {
       XF86ModReqInfo req;
@@ -2499,46 +2468,6 @@ I830PointerMoved(int index, int x, int y)
    (*pI830->PointerMoved)(index, newX, newY);
 }
 
-static Bool
-I830InitFBManager(
-    ScreenPtr pScreen,  
-    BoxPtr FullBox
-){
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-   RegionRec ScreenRegion;
-   RegionRec FullRegion;
-   BoxRec ScreenBox;
-   Bool ret;
-
-   ScreenBox.x1 = 0;
-   ScreenBox.y1 = 0;
-   ScreenBox.x2 = pScrn->displayWidth;
-   if (pScrn->virtualX > pScrn->virtualY)
-      ScreenBox.y2 = pScrn->virtualX;
-   else
-      ScreenBox.y2 = pScrn->virtualY;
-
-   if((FullBox->x1 >  ScreenBox.x1) || (FullBox->y1 >  ScreenBox.y1) ||
-      (FullBox->x2 <  ScreenBox.x2) || (FullBox->y2 <  ScreenBox.y2)) {
-	return FALSE;   
-   }
-
-   if (FullBox->y2 < FullBox->y1) return FALSE;
-   if (FullBox->x2 < FullBox->x2) return FALSE;
-
-   REGION_INIT(pScreen, &ScreenRegion, &ScreenBox, 1); 
-   REGION_INIT(pScreen, &FullRegion, FullBox, 1); 
-
-   REGION_SUBTRACT(pScreen, &FullRegion, &FullRegion, &ScreenRegion);
-
-   ret = xf86InitFBManagerRegion(pScreen, &FullRegion);
-
-   REGION_UNINIT(pScreen, &ScreenRegion);
-   REGION_UNINIT(pScreen, &FullRegion);
-    
-   return ret;
-}
-
 /**
  * Intialiazes the hardware for the 3D pipeline use in the 2D driver.
  *
@@ -2713,14 +2642,6 @@ i830_memory_init(ScrnInfoPtr pScrn)
 	    pI830->pEnt->device->videoRam ? X_CONFIG : X_DEFAULT,
 	    "VideoRam: %d KB\n", pScrn->videoRam);
 
-    if (xf86GetOptValInteger(pI830->Options, OPTION_CACHE_LINES,
-		&(pI830->CacheLines))) {
-	xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Requested %d cache lines\n",
-		pI830->CacheLines);
-    } else {
-	pI830->CacheLines = -1;
-    }
-
     /* Tiled first if we got a good displayWidth */
     if (tiled) {
 	if (i830_try_memory_allocation(pScrn))
@@ -3067,13 +2988,6 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
 
    DPRINTF(PFX, "assert( if(!I830EnterVT(scrnIndex, 0)) )\n");
 
-   if (pI830->accel <= ACCEL_XAA) {
-      if (!I830InitFBManager(pScreen, &(pI830->FbMemBox))) {
-	 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		    "Failed to init memory manager\n");
-      }
-   }
-
     if (pScrn->virtualX > pScrn->displayWidth)
 	pScrn->displayWidth = pScrn->virtualX;
 
@@ -3105,9 +3019,6 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
 
    xf86DiDGAInit (pScreen, pI830->LinearAddr + pScrn->fbOffset);
 
-   DPRINTF(PFX,
-	   "assert( if(!I830InitFBManager(pScreen, &(pI830->FbMemBox))) )\n");
-
    if (pI830->accel != ACCEL_NONE) {
       if (!I830AccelInit(pScreen)) {
 	 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -3327,9 +3238,6 @@ I830LeaveVT(int scrnIndex, int flags)
    if ((pI830->accel == ACCEL_EXA || pI830->accel == ACCEL_UXA) && IS_I965G(pI830))
       gen4_render_state_cleanup(pScrn);
 
-   if (pI830->AccelInfoRec)
-      pI830->AccelInfoRec->NeedToSync = FALSE;
-
    ret = drmDropMaster(pI830->drmSubFD);
    if (ret)
       xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
@@ -3483,9 +3391,6 @@ I830CloseScreen(int scrnIndex, ScreenPtr pScreen)
 {
    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
    I830Ptr pI830 = I830PTR(pScrn);
-#ifdef I830_USE_XAA
-   XAAInfoRecPtr infoPtr = pI830->AccelInfoRec;
-#endif
 
    pI830->closing = TRUE;
 
@@ -3503,18 +3408,6 @@ I830CloseScreen(int scrnIndex, ScreenPtr pScreen)
        vgaHWUnmapMem(pScrn);
    }
 
-   if (pI830->ScanlineColorExpandBuffers) {
-      xfree(pI830->ScanlineColorExpandBuffers);
-      pI830->ScanlineColorExpandBuffers = NULL;
-   }
-#ifdef I830_USE_XAA
-   if (infoPtr) {
-      if (infoPtr->ScanlineColorExpandBuffers)
-	 xfree(infoPtr->ScanlineColorExpandBuffers);
-      XAADestroyInfoRec(infoPtr);
-      pI830->AccelInfoRec = NULL;
-   }
-#endif
 #ifdef I830_USE_EXA
    if (pI830->EXADriverPtr) {
        exaDriverFini(pScreen);
@@ -3667,14 +3560,6 @@ i830WaitSync(ScrnInfoPtr pScrn)
    I830Ptr pI830 = I830PTR(pScrn);
 
    switch (pI830->accel) {
-#ifdef I830_USE_XAA
-   case ACCEL_XAA:
-      if (pI830->AccelInfoRec && pI830->AccelInfoRec->NeedToSync) {
-	 (*pI830->AccelInfoRec->Sync)(pScrn);
-	 pI830->AccelInfoRec->NeedToSync = FALSE;
-      }
-      break;
-#endif
 #ifdef I830_USE_EXA
    case ACCEL_EXA:
       if (pI830->EXADriverPtr) {
@@ -3702,12 +3587,6 @@ i830MarkSync(ScrnInfoPtr pScrn)
    I830Ptr pI830 = I830PTR(pScrn);
 
    switch (pI830->accel) {
-#ifdef I830_USE_XAA
-   case ACCEL_XAA:
-      if (pI830->AccelInfoRec)
-	 pI830->AccelInfoRec->NeedToSync = TRUE;
-      break;
-#endif
 #ifdef I830_USE_EXA
    case ACCEL_EXA:
       if (pI830->EXADriverPtr) {
diff --git a/src/i830_memory.c b/src/i830_memory.c
index 14b52ed..c46541c 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -64,11 +64,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  * - Ring buffer
  * - HW cursor block (either one block or four)
  * - Overlay registers
- * - XAA linear allocator (optional)
- * - XAA scratch (screen 1)
- * - XAA scratch (screen 2, only in zaphod mode)
- * - Front buffer (screen 1, more is better for XAA)
- * - Front buffer (screen 2, only in zaphod mode, more is better for XAA)
+ * - Front buffer (screen 1)
+ * - Front buffer (screen 2, only in zaphod mode)
  * - Back/depth buffer (3D only)
  * - Compatibility texture pool (optional, more is always better)
  * - New texture pool (optional, more is always better.  aperture allocation
@@ -369,7 +366,6 @@ i830_reset_allocations(ScrnInfoPtr pScrn)
 	pI830->cursor_mem_argb[p] = NULL;
     }
     pI830->front_buffer = NULL;
-    pI830->xaa_scratch = NULL;
     pI830->exa_offscreen = NULL;
     pI830->overlay_regs = NULL;
     pI830->power_context = NULL;
@@ -1015,8 +1011,7 @@ i830_allocate_ringbuffer(ScrnInfoPtr pScrn)
 
 #ifdef I830_XV
 /**
- * Allocate space for overlay registers and XAA linear allocator (if
- * requested)
+ * Allocate space for overlay registers.
  */
 static Bool
 i830_allocate_overlay(ScrnInfoPtr pScrn)
@@ -1088,13 +1083,6 @@ IsTileable(ScrnInfoPtr pScrn, int pitch)
     }
 }
 
-/* This is the 2D rendering vertical coordinate limit.  We can ignore
- * the 3D rendering limits in our 2d pixmap cache allocation, because XAA
- * doesn't do any 3D rendering to/from the cache lines when using an offset
- * at the start of framebuffer.
- */
-#define MAX_2D_HEIGHT		65536
-
 /**
  * Allocates a framebuffer for a screen.
  *
@@ -1107,7 +1095,6 @@ i830_allocate_framebuffer(ScrnInfoPtr pScrn)
     I830Ptr pI830 = I830PTR(pScrn);
     unsigned int pitch = pScrn->displayWidth * pI830->cpp;
     unsigned long minspace, avail;
-    int cacheLines, maxCacheLines;
     int align;
     long size, fb_height;
     int flags;
@@ -1128,67 +1115,17 @@ i830_allocate_framebuffer(ScrnInfoPtr pScrn)
 	    fb_height = pScrn->virtualY;
     }
 
-    pI830->FbMemBox.x1 = 0;
-    pI830->FbMemBox.x2 = pScrn->displayWidth;
-    pI830->FbMemBox.y1 = 0;
-    pI830->FbMemBox.y2 = fb_height;
-
     /* Calculate how much framebuffer memory to allocate.  For the
      * initial allocation, calculate a reasonable minimum.  This is
-     * enough for the virtual screen size, plus some pixmap cache
-     * space if we're using XAA.
+     * enough for the virtual screen size.
      */
     minspace = pitch * pScrn->virtualY;
     avail = pScrn->videoRam * 1024;
 
-    if (pI830->accel == ACCEL_XAA) {
-	maxCacheLines = (avail - minspace) / pitch;
-	/* This shouldn't happen. */
-	if (maxCacheLines < 0) {
-	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		       "Internal Error: "
-		       "maxCacheLines < 0 in i830_allocate_2d_memory()\n");
-	    maxCacheLines = 0;
-	}
-	if (maxCacheLines > (MAX_2D_HEIGHT - pScrn->virtualY))
-	    maxCacheLines = MAX_2D_HEIGHT - pScrn->virtualY;
-
-	if (pI830->CacheLines >= 0) {
-	    cacheLines = pI830->CacheLines;
-	} else {
-	    int size;
-
-	    size = 3 * pitch * pScrn->virtualY;
-	    size = ROUND_TO_PAGE(size);
-
-	    cacheLines = (size + pitch - 1) / pitch;
-	}
-	if (cacheLines > maxCacheLines)
-	    cacheLines = maxCacheLines;
-
-	pI830->FbMemBox.y2 += cacheLines;
-
-	xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-		   "Allocating %d scanlines for pixmap cache\n",
-		   cacheLines);
-    } else {
-	/* For non-XAA, we have a separate allocation for the linear allocator
-	 * which also does the pixmap cache.
-	 */
-	cacheLines = 0;
-    }
-
-    size = pitch * (fb_height + cacheLines);
-    size = ROUND_TO_PAGE(size);
+    size = ROUND_TO_PAGE(pitch * fb_height);
 
-    /* Front buffer tiling has to be disabled with G965 XAA because some of the
-     * acceleration operations (non-XY COLOR_BLT) can't be done to tiled
-     * buffers.
-     */
     if (pI830->tiling)
 	tile_format = TILE_XMAJOR;
-    if (pI830->accel == ACCEL_XAA && IS_I965G(pI830))
-	tile_format = TILE_NONE;
 
     if (!IsTileable(pScrn, pitch))
 	tile_format = TILE_NONE;
@@ -1394,9 +1331,6 @@ i830_allocate_2d_memory(ScrnInfoPtr pScrn)
     }
 
 #ifdef I830_XV
-    /* Allocate overlay register space and optional XAA linear allocator
-     * space.  The second head in zaphod mode will share the space.
-     */
     if (!pI830->use_drm_mode)
 	i830_allocate_overlay(pScrn);
 #endif
@@ -1435,29 +1369,6 @@ i830_allocate_2d_memory(ScrnInfoPtr pScrn)
     }
 #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
-	 * end up being supported with GEM anyway.
-	 */
-	pI830->xaa_scratch =
-	    i830_allocate_memory(pScrn, "xaa scratch", MAX_SCRATCH_BUFFER_SIZE,
-				 PITCH_NONE, GTT_PAGE_SIZE, NEED_LIFETIME_FIXED,
-				 TILE_NONE);
-	if (pI830->xaa_scratch == NULL) {
-	    pI830->xaa_scratch =
-		i830_allocate_memory(pScrn, "xaa scratch",
-				     MIN_SCRATCH_BUFFER_SIZE, PITCH_NONE,
-				     GTT_PAGE_SIZE, NEED_LIFETIME_FIXED,
-				     TILE_NONE);
-	    if (pI830->xaa_scratch == NULL) {
-		xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-			   "Failed to allocate scratch buffer space\n");
-		return FALSE;
-	    }
-	}
-    }
-
     return TRUE;
 }
 
diff --git a/src/i830_video.c b/src/i830_video.c
index f73c1f7..210f8db 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -70,8 +70,6 @@
 #include "i830_video.h"
 #include "xf86xv.h"
 #include <X11/extensions/Xv.h>
-#include "xaa.h"
-#include "xaalocal.h"
 #include "dixstruct.h"
 #include "fourcc.h"
 
@@ -2488,16 +2486,6 @@ I830PutImage(ScrnInfoPtr pScrn,
     }
 #endif
 
-    if (pPriv->textured && pI830->accel <= ACCEL_XAA &&
-	    (((char *)pPixmap->devPrivate.ptr < (char *)pI830->FbBase) ||
-	     ((char *)pPixmap->devPrivate.ptr >= (char *)pI830->FbBase +
-	      pI830->FbMapSize))) {
-	/* If the pixmap wasn't in framebuffer, then we have no way in XAA to
-	 * force it there.  So, we simply refuse to draw and fail.
-	 */
-	return BadAlloc;
-    }
-
     if (!pPriv->textured) {
 	i830_display_video(pScrn, crtc, destId, width, height, dstPitch,
 			   x1, y1, x2, y2, &dstBox, src_w, src_h,
diff --git a/src/i830_xaa.c b/src/i830_xaa.c
deleted file mode 100644
index a118055..0000000
--- a/src/i830_xaa.c
+++ /dev/null
@@ -1,809 +0,0 @@
-/**************************************************************************
-
-Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas.
-All Rights Reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sub license, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice (including the
-next paragraph) shall be included in all copies or substantial portions
-of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
-ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-**************************************************************************/
-
-/*
- * Reformatted with GNU indent (2.2.8), using the following options:
- *
- *    -bad -bap -c41 -cd0 -ncdb -ci6 -cli0 -cp0 -ncs -d0 -di3 -i3 -ip3 -l78
- *    -lp -npcs -psl -sob -ss -br -ce -sc -hnl
- *
- * This provides a good match with the original i810 code and preferred
- * XFree86 formatting conventions.
- *
- * When editing this driver, please follow the existing formatting, and edit
- * with <TAB> characters expanded at 8-column intervals.
- */
-
-/*
- * Authors:
- *   Keith Whitwell <keith at tungstengraphics.com>
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <assert.h>
-#include "xf86.h"
-#include "xaarop.h"
-#include "i830.h"
-#include "i810_reg.h"
-#include "mipict.h"
-
-#ifndef DO_SCANLINE_IMAGE_WRITE
-#define DO_SCANLINE_IMAGE_WRITE 0
-#endif
-
-/* I830 Accel Functions */
-static void I830SetupForMono8x8PatternFill(ScrnInfoPtr pScrn,
-					   int pattx, int patty,
-					   int fg, int bg, int rop,
-					   unsigned int planemask);
-static void I830SubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn,
-						 int pattx, int patty,
-						 int x, int y, int w, int h);
-
-static void I830SetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
-							   int fg, int bg,
-							   int rop,
-							   unsigned int mask);
-
-static void I830SubsequentScanlineCPUToScreenColorExpandFill(ScrnInfoPtr
-							     pScrn, int x,
-							     int y, int w,
-							     int h,
-							     int skipleft);
-
-static void I830SubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno);
-
-#if DO_SCANLINE_IMAGE_WRITE
-static void I830SetupForScanlineImageWrite(ScrnInfoPtr pScrn, int rop,
-					   unsigned int planemask,
-					   int trans_color, int bpp,
-					   int depth);
-static void I830SubsequentScanlineImageWriteRect(ScrnInfoPtr pScrn,
-						 int x, int y, int w, int h,
-						 int skipleft);
-static void I830SubsequentImageWriteScanline(ScrnInfoPtr pScrn, int bufno);
-#endif
-
-static void
-i830_xaa_composite(CARD8	op,
-		   PicturePtr	pSrc,
-		   PicturePtr	pMask,
-		   PicturePtr	pDst,
-		   INT16	xSrc,
-		   INT16	ySrc,
-		   INT16	xMask,
-		   INT16	yMask,
-		   INT16	xDst,
-		   INT16	yDst,
-		   CARD16	width,
-		   CARD16	height);
-
-Bool
-I830XAAInit(ScreenPtr pScreen)
-{
-    XAAInfoRecPtr infoPtr;
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-    PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
-    I830Ptr pI830 = I830PTR(pScrn);
-    int i;
-    int width = 0;
-    int nr_buffers = 0;
-    unsigned char *ptr = NULL;
-
-    if (I810_DEBUG & DEBUG_VERBOSE_ACCEL)
-	ErrorF("I830XAAInit\n");
-
-    pI830->AccelInfoRec = infoPtr = XAACreateInfoRec();
-    if (!infoPtr)
-	return FALSE;
-
-    infoPtr->Flags = LINEAR_FRAMEBUFFER | OFFSCREEN_PIXMAPS | PIXMAP_CACHE;
-
-    /* Use the same sync function as the I830.
-     */
-    infoPtr->Sync = I830Sync;
-
-    /* Everything else is different enough to justify different functions */
-    {
-	infoPtr->SolidFillFlags = NO_PLANEMASK;
-	infoPtr->SetupForSolidFill = I830SetupForSolidFill;
-	infoPtr->SubsequentSolidFillRect = I830SubsequentSolidFillRect;
-    }
-
-    {
-	infoPtr->ScreenToScreenCopyFlags = (NO_PLANEMASK | NO_TRANSPARENCY);
-
-	infoPtr->SetupForScreenToScreenCopy = I830SetupForScreenToScreenCopy;
-	infoPtr->SubsequentScreenToScreenCopy =
-	    I830SubsequentScreenToScreenCopy;
-    }
-
-    {
-	infoPtr->SetupForMono8x8PatternFill = I830SetupForMono8x8PatternFill;
-	infoPtr->SubsequentMono8x8PatternFillRect =
-	    I830SubsequentMono8x8PatternFillRect;
-
-	infoPtr->Mono8x8PatternFillFlags = (HARDWARE_PATTERN_PROGRAMMED_BITS |
-					    HARDWARE_PATTERN_SCREEN_ORIGIN |
-					    HARDWARE_PATTERN_PROGRAMMED_ORIGIN|
-					    BIT_ORDER_IN_BYTE_MSBFIRST |
-					    NO_PLANEMASK);
-
-    }
-
-    if (pI830->xaa_scratch->size != 0) {
-	width = ((pScrn->displayWidth + 31) & ~31) / 8;
-	nr_buffers = pI830->xaa_scratch->size / width;
-	ptr = pI830->FbBase + pI830->xaa_scratch->offset;
-    }
-
-    if (nr_buffers) {
-	pI830->NumScanlineColorExpandBuffers = nr_buffers;
-	pI830->ScanlineColorExpandBuffers = (unsigned char **)
-	    xnfcalloc(nr_buffers, sizeof(unsigned char *));
-
-	for (i = 0; i < nr_buffers; i++, ptr += width)
-	    pI830->ScanlineColorExpandBuffers[i] = ptr;
-
-	infoPtr->ScanlineCPUToScreenColorExpandFillFlags =
-	    (NO_PLANEMASK | ROP_NEEDS_SOURCE | BIT_ORDER_IN_BYTE_MSBFIRST);
-
-	infoPtr->ScanlineColorExpandBuffers = (unsigned char **)
-	    xnfcalloc(1, sizeof(unsigned char *));
-	infoPtr->NumScanlineColorExpandBuffers = 1;
-
-	infoPtr->ScanlineColorExpandBuffers[0] =
-	    pI830->ScanlineColorExpandBuffers[0];
-	pI830->nextColorExpandBuf = 0;
-
-	infoPtr->SetupForScanlineCPUToScreenColorExpandFill =
-	    I830SetupForScanlineCPUToScreenColorExpandFill;
-
-	infoPtr->SubsequentScanlineCPUToScreenColorExpandFill =
-	    I830SubsequentScanlineCPUToScreenColorExpandFill;
-
-	infoPtr->SubsequentColorExpandScanline =
-	    I830SubsequentColorExpandScanline;
-
-#if DO_SCANLINE_IMAGE_WRITE
-	infoPtr->NumScanlineImageWriteBuffers = 1;
-	infoPtr->ScanlineImageWriteBuffers =
-	    infoPtr->ScanlineColorExpandBuffers;
-	infoPtr->SetupForScanlineImageWrite = I830SetupForScanlineImageWrite;
-	infoPtr->SubsequentScanlineImageWriteRect =
-	    I830SubsequentScanlineImageWriteRect;
-	infoPtr->SubsequentImageWriteScanline =
-	    I830SubsequentImageWriteScanline;
-	infoPtr->ScanlineImageWriteFlags = NO_GXCOPY |
-	    NO_PLANEMASK |
-	    ROP_NEEDS_SOURCE |
-	    SCANLINE_PAD_DWORD;
-#endif
-    }
-
-    /* Set up pI830->bufferOffset */
-    I830SelectBuffer(pScrn, I830_SELECT_FRONT);
-
-    if (!XAAInit(pScreen, infoPtr))
-	return FALSE;
-
-    if (ps != NULL) {
-	if (IS_I865G(pI830) || IS_I855(pI830) ||
-	    IS_845G(pI830) || IS_I830(pI830))
-	{
-	    pI830->xaa_check_composite = i830_check_composite;
-	    pI830->xaa_prepare_composite = i830_prepare_composite;
-	    pI830->xaa_composite = i830_composite;
-	    pI830->xaa_done_composite = i830_done_composite;
-	} else if (IS_I915G(pI830) || IS_I915GM(pI830) ||
-		   IS_I945G(pI830) || IS_I945GM(pI830) || IS_G33CLASS(pI830))
-	{
-	    pI830->xaa_check_composite = i915_check_composite;
-	    pI830->xaa_prepare_composite = i915_prepare_composite;
-	    pI830->xaa_composite = i830_composite;
-	    pI830->xaa_done_composite = i830_done_composite;
-	} else {
-	    pI830->xaa_check_composite = i965_check_composite;
-	    pI830->xaa_prepare_composite = i965_prepare_composite;
-	    pI830->xaa_composite = i965_composite;
-	    pI830->xaa_done_composite = i830_done_composite;
-	}
-
-	pI830->saved_composite = ps->Composite;
-	ps->Composite = i830_xaa_composite;
-    }
-
-    return TRUE;
-}
-
-static unsigned int
-I830CheckTiling(ScrnInfoPtr pScrn)
-{
-   I830Ptr pI830 = I830PTR(pScrn);
-
-   return pI830->front_buffer->tiling != TILE_NONE;
-}
-
-void
-I830SetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop,
-		      unsigned int planemask)
-{
-    I830Ptr pI830 = I830PTR(pScrn);
-
-    if (I810_DEBUG & DEBUG_VERBOSE_ACCEL)
-	ErrorF("I830SetupForFillRectSolid color: %x rop: %x mask: %x\n",
-	       color, rop, planemask);
-
-    if (IS_I965G(pI830) && I830CheckTiling(pScrn)) {
-	pI830->BR[13] = (pScrn->displayWidth * pI830->cpp) >> 2;
-    } else {
-	pI830->BR[13] = (pScrn->displayWidth * pI830->cpp);
-    }
-
-#ifdef I830_USE_EXA
-    /* This function gets used by I830DRIInitBuffers(), and we might not have
-     * XAAGetPatternROP() available.  So just use the ROPs from our EXA code
-     * if available.
-     */
-    pI830->BR[13] |= (I830PatternROP[rop] << 16);
-#else
-    pI830->BR[13] |= (XAAGetPatternROP(rop) << 16);
-#endif
-
-    pI830->BR[16] = color;
-
-    switch (pScrn->bitsPerPixel) {
-    case 8:
-	break;
-    case 16:
-	pI830->BR[13] |= (1 << 24);
-	break;
-    case 32:
-	pI830->BR[13] |= ((1 << 25) | (1 << 24));
-	break;
-    }
-}
-
-void
-I830SubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h)
-{
-    I830Ptr pI830 = I830PTR(pScrn);
-
-    if (I810_DEBUG & DEBUG_VERBOSE_ACCEL)
-	ErrorF("I830SubsequentFillRectSolid %d,%d %dx%d\n", x, y, w, h);
-
-    {
-	BEGIN_BATCH(6);
-
-	if (pScrn->bitsPerPixel == 32) {
-	    OUT_BATCH(COLOR_BLT_CMD | COLOR_BLT_WRITE_ALPHA |
-		      COLOR_BLT_WRITE_RGB);
-	} else {
-	    OUT_BATCH(COLOR_BLT_CMD);
-	}
-	OUT_BATCH(pI830->BR[13]);
-	OUT_BATCH((h << 16) | (w * pI830->cpp));
-	OUT_BATCH(pI830->front_buffer->offset + (y * pScrn->displayWidth + x) *
-		  pI830->cpp);
-	OUT_BATCH(pI830->BR[16]);
-	OUT_BATCH(0);
-
-	ADVANCE_BATCH();
-    }
-
-    if (IS_I965G(pI830))
-      I830EmitFlush(pScrn);
-}
-
-void
-I830SetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop,
-			       unsigned int planemask, int transparency_color)
-{
-    I830Ptr pI830 = I830PTR(pScrn);
-
-    if (I810_DEBUG & DEBUG_VERBOSE_ACCEL)
-	ErrorF("I830SetupForScreenToScreenCopy %d %d %x %x %d\n",
-	       xdir, ydir, rop, planemask, transparency_color);
-
-    if (IS_I965G(pI830) && I830CheckTiling(pScrn)) {
-	pI830->BR[13] = (pScrn->displayWidth * pI830->cpp) >> 2;
-    } else {
-	pI830->BR[13] = (pScrn->displayWidth * pI830->cpp);
-    }
-
-#ifdef I830_USE_EXA
-    /* This function gets used by I830DRIInitBuffers(), and we might not have
-     * XAAGetCopyROP() available.  So just use the ROPs from our EXA code
-     * if available.
-     */
-    pI830->BR[13] |= I830CopyROP[rop] << 16;
-#else
-    pI830->BR[13] |= XAAGetCopyROP(rop) << 16;
-#endif
-
-    switch (pScrn->bitsPerPixel) {
-    case 8:
-	break;
-    case 16:
-	pI830->BR[13] |= (1 << 24);
-	break;
-    case 32:
-	pI830->BR[13] |= ((1 << 25) | (1 << 24));
-	break;
-    }
-
-}
-
-void
-I830SubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int src_x1, int src_y1,
-				 int dst_x1, int dst_y1, int w, int h)
-{
-    I830Ptr pI830 = I830PTR(pScrn);
-    int dst_x2, dst_y2;
-    unsigned int tiled = I830CheckTiling(pScrn);
-
-    if (I810_DEBUG & DEBUG_VERBOSE_ACCEL)
-	ErrorF("I830SubsequentScreenToScreenCopy %d,%d - %d,%d %dx%d\n",
-	       src_x1, src_y1, dst_x1, dst_y1, w, h);
-
-    dst_x2 = dst_x1 + w;
-    dst_y2 = dst_y1 + h;
-
-    {
-	BEGIN_BATCH(8);
-
-	if (pScrn->bitsPerPixel == 32) {
-	    OUT_BATCH(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA |
-		      XY_SRC_COPY_BLT_WRITE_RGB | tiled << 15 | tiled << 11);
-	} else {
-	    OUT_BATCH(XY_SRC_COPY_BLT_CMD | tiled << 15 | tiled << 11);
-	}
-	OUT_BATCH(pI830->BR[13]);
-	OUT_BATCH((dst_y1 << 16) | (dst_x1 & 0xffff));
-	OUT_BATCH((dst_y2 << 16) | (dst_x2 & 0xffff));
-	OUT_BATCH(pI830->front_buffer->offset);
-	OUT_BATCH((src_y1 << 16) | (src_x1 & 0xffff));
-	OUT_BATCH(pI830->BR[13] & 0xFFFF);
-	OUT_BATCH(pI830->front_buffer->offset);
-
-	ADVANCE_BATCH();
-    }
-
-    if (IS_I965G(pI830))
-      I830EmitFlush(pScrn);
-}
-
-static void
-I830SetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int pattx, int patty,
-			       int fg, int bg, int rop,
-			       unsigned int planemask)
-{
-    I830Ptr pI830 = I830PTR(pScrn);
-
-    if (I810_DEBUG & DEBUG_VERBOSE_ACCEL)
-	ErrorF("I830SetupForMono8x8PatternFill\n");
-
-    pI830->BR[16] = pattx;
-    pI830->BR[17] = patty;
-    pI830->BR[18] = bg;
-    pI830->BR[19] = fg;
-
-    if (IS_I965G(pI830) && I830CheckTiling(pScrn)) {
-	pI830->BR[13] = (pScrn->displayWidth * pI830->cpp) >> 2;
-    } else {
-	pI830->BR[13] = (pScrn->displayWidth * pI830->cpp);
-    }
-    pI830->BR[13] |= XAAGetPatternROP(rop) << 16;
-    if (bg == -1)
-	pI830->BR[13] |= (1 << 28);
-
-    switch (pScrn->bitsPerPixel) {
-    case 8:
-	break;
-    case 16:
-	pI830->BR[13] |= (1 << 24);
-	break;
-    case 32:
-	pI830->BR[13] |= ((1 << 25) | (1 << 24));
-	break;
-    }
-
-}
-
-static void
-I830SubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn, int pattx, int patty,
-				     int x, int y, int w, int h)
-{
-    I830Ptr pI830 = I830PTR(pScrn);
-    int x1, x2, y1, y2;
-    unsigned int tiled = I830CheckTiling(pScrn);
-
-    x1 = x;
-    x2 = x + w;
-    y1 = y;
-    y2 = y + h;
-
-    if (I810_DEBUG & DEBUG_VERBOSE_ACCEL)
-	ErrorF("I830SubsequentMono8x8PatternFillRect\n");
-
-    {
-	BEGIN_BATCH(10);
-
-	if (pScrn->bitsPerPixel == 32) {
-	    OUT_BATCH(XY_MONO_PAT_BLT_CMD | XY_MONO_PAT_BLT_WRITE_ALPHA |
-		      XY_MONO_PAT_BLT_WRITE_RGB | tiled << 11 |
-		      ((patty << 8) & XY_MONO_PAT_VERT_SEED) |
-		      ((pattx << 12) & XY_MONO_PAT_HORT_SEED));
-	} else {
-	    OUT_BATCH(XY_MONO_PAT_BLT_CMD | tiled << 11 |
-		      ((patty << 8) & XY_MONO_PAT_VERT_SEED) |
-		      ((pattx << 12) & XY_MONO_PAT_HORT_SEED));
-	}
-	OUT_BATCH(pI830->BR[13]);
-	OUT_BATCH((y1 << 16) | x1);
-	OUT_BATCH((y2 << 16) | x2);
-	OUT_BATCH(pI830->front_buffer->offset);
-	OUT_BATCH(pI830->BR[18]);		/* bg */
-	OUT_BATCH(pI830->BR[19]);		/* fg */
-	OUT_BATCH(pI830->BR[16]);		/* pattern data */
-	OUT_BATCH(pI830->BR[17]);
-	OUT_BATCH(0);
-	ADVANCE_BATCH();
-    }
-
-    if (IS_I965G(pI830))
-      I830EmitFlush(pScrn);
-}
-
-static void
-I830GetNextScanlineColorExpandBuffer(ScrnInfoPtr pScrn)
-{
-    I830Ptr pI830 = I830PTR(pScrn);
-    XAAInfoRecPtr infoPtr = pI830->AccelInfoRec;
-
-    if (pI830->nextColorExpandBuf == pI830->NumScanlineColorExpandBuffers)
-	I830Sync(pScrn);
-
-    infoPtr->ScanlineColorExpandBuffers[0] =
-	pI830->ScanlineColorExpandBuffers[pI830->nextColorExpandBuf];
-
-    if (I810_DEBUG & DEBUG_VERBOSE_ACCEL)
-	ErrorF("using color expand buffer %d\n", pI830->nextColorExpandBuf);
-
-    pI830->nextColorExpandBuf++;
-}
-
-static void
-I830SetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
-					       int fg, int bg, int rop,
-					       unsigned int planemask)
-{
-    I830Ptr pI830 = I830PTR(pScrn);
-
-    if (I810_DEBUG & DEBUG_VERBOSE_ACCEL)
-	ErrorF("I830SetupForScanlineScreenToScreenColorExpand %d %d %x %x\n",
-	       fg, bg, rop, planemask);
-
-    /* Fill out register values */
-    if (IS_I965G(pI830) && I830CheckTiling(pScrn)) {
-	pI830->BR[13] = (pScrn->displayWidth * pI830->cpp) >> 2;
-    } else {
-	pI830->BR[13] = (pScrn->displayWidth * pI830->cpp);
-    }
-    pI830->BR[13] |= XAAGetCopyROP(rop) << 16;
-    if (bg == -1)
-	pI830->BR[13] |= (1 << 29);
-
-    switch (pScrn->bitsPerPixel) {
-    case 8:
-	break;
-    case 16:
-	pI830->BR[13] |= (1 << 24);
-	break;
-    case 32:
-	pI830->BR[13] |= ((1 << 25) | (1 << 24));
-	break;
-    }
-
-    pI830->BR[18] = bg;
-    pI830->BR[19] = fg;
-
-    I830GetNextScanlineColorExpandBuffer(pScrn);
-}
-
-static void
-I830SubsequentScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
-						 int x, int y,
-						 int w, int h, int skipleft)
-{
-    I830Ptr pI830 = I830PTR(pScrn);
-
-    if (I810_DEBUG & DEBUG_VERBOSE_ACCEL)
-	ErrorF("I830SubsequentScanlineCPUToScreenColorExpandFill "
-	       "%d,%d %dx%x %d\n", x, y, w, h, skipleft);
-
-    /* Fill out register values */
-    pI830->BR[9] = (pI830->front_buffer->offset +
-		    (y * pScrn->displayWidth + x) * pI830->cpp);
-    pI830->BR[11] = ((1 << 16) | w);
-}
-
-static void
-I830SubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno)
-{
-    I830Ptr pI830 = I830PTR(pScrn);
-    unsigned int tiled = I830CheckTiling(pScrn);
-
-    pI830->BR[12] = (pI830->AccelInfoRec->ScanlineColorExpandBuffers[0] -
-		     pI830->FbBase);
-
-    if (I810_DEBUG & DEBUG_VERBOSE_ACCEL)
-	ErrorF("I830SubsequentColorExpandScanline %d (addr %x)\n",
-	       bufno, pI830->BR[12]);
-
-    {
-	BEGIN_BATCH(8);
-
-	if (pScrn->bitsPerPixel == 32) {
-	    OUT_BATCH(XY_MONO_SRC_BLT_CMD | XY_MONO_SRC_BLT_WRITE_ALPHA |
-		      tiled << 11 | XY_MONO_SRC_BLT_WRITE_RGB);
-	} else {
-	    OUT_BATCH(XY_MONO_SRC_BLT_CMD | tiled << 11);
-	}
-	OUT_BATCH(pI830->BR[13]);
-	OUT_BATCH(0);			/* x1 = 0, y1 = 0 */
-	OUT_BATCH(pI830->BR[11]);		/* x2 = w, y2 = 1 */
-	OUT_BATCH(pI830->BR[9]);		/* dst addr */
-	OUT_BATCH(pI830->BR[12]);		/* src addr */
-	OUT_BATCH(pI830->BR[18]);		/* bg */
-	OUT_BATCH(pI830->BR[19]);		/* fg */
-
-	ADVANCE_BATCH();
-    }
-
-    /* Advance to next scanline.
-     */
-    pI830->BR[9] += pScrn->displayWidth * pI830->cpp;
-    I830GetNextScanlineColorExpandBuffer(pScrn);
-
-    if (IS_I965G(pI830))
-      I830EmitFlush(pScrn);
-}
-
-#if DO_SCANLINE_IMAGE_WRITE
-static void
-I830SetupForScanlineImageWrite(ScrnInfoPtr pScrn, int rop,
-			       unsigned int planemask, int trans_color,
-			       int bpp, int depth)
-{
-    I830Ptr pI830 = I830PTR(pScrn);
-
-    if (I810_DEBUG & DEBUG_VERBOSE_ACCEL)
-	ErrorF("I830SetupForScanlineImageWrite %x %x\n", rop, planemask);
-
-    /* Fill out register values */
-    if (IS_I965G(pI830) && I830CheckTiling(pScrn)) {
-	pI830->BR[13] = (pScrn->displayWidth * pI830->cpp) >> 2;
-    } else {
-	pI830->BR[13] = (pScrn->displayWidth * pI830->cpp);
-    }
-    pI830->BR[13] |= XAAGetCopyROP(rop) << 16;
-
-    switch (pScrn->bitsPerPixel) {
-    case 8:
-	break;
-    case 16:
-	pI830->BR[13] |= (1 << 24);
-	break;
-    case 32:
-	pI830->BR[13] |= ((1 << 25) | (1 << 24));
-	break;
-    }
-
-    I830GetNextScanlineColorExpandBuffer(pScrn);
-}
-
-static void
-I830SubsequentScanlineImageWriteRect(ScrnInfoPtr pScrn, int x, int y,
-				     int w, int h, int skipleft)
-{
-    I830Ptr pI830 = I830PTR(pScrn);
-
-    if (I810_DEBUG & DEBUG_VERBOSE_ACCEL)
-	ErrorF("I830SubsequentScanlineImageWriteRect "
-	       "%d,%d %dx%x %d\n", x, y, w, h, skipleft);
-
-    /* Fill out register values */
-    pI830->BR[9] = (pI830->front_buffer->offset +
-		    (y * pScrn->displayWidth + x) * pI830->cpp);
-    pI830->BR[11] = ((1 << 16) | w);
-}
-
-static void
-I830SubsequentImageWriteScanline(ScrnInfoPtr pScrn, int bufno)
-{
-    I830Ptr pI830 = I830PTR(pScrn);
-    unsigned int tiled = I830CheckTiling(pScrn);
-
-    pI830->BR[12] = (pI830->AccelInfoRec->ScanlineColorExpandBuffers[0] -
-		     pI830->FbBase);
-
-    if (I810_DEBUG & DEBUG_VERBOSE_ACCEL)
-	ErrorF("I830SubsequentImageWriteScanline %d (addr %x)\n",
-	       bufno, pI830->BR[12]);
-
-    {
-	BEGIN_BATCH(8);
-
-	if (pScrn->bitsPerPixel == 32) {
-	    OUT_BATCH(XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA |
-		      tiled << 11 | XY_SRC_COPY_BLT_WRITE_RGB);
-	} else {
-	    OUT_BATCH(XY_SRC_COPY_BLT_CMD | tiled << 11);
-	}
-	OUT_BATCH(pI830->BR[13]);
-	OUT_BATCH(0);				/* x1 = 0, y1 = 0 */
-	OUT_BATCH(pI830->BR[11]);		/* x2 = w, y2 = 1 */
-	OUT_BATCH(pI830->BR[9]);			/* dst addr */
-	OUT_BATCH(0);				/* source origin (0,0) */
-	OUT_BATCH(pI830->BR[11] & 0xffff);	/* source pitch */
-	OUT_BATCH(pI830->BR[12]);		/* src addr */
-
-	ADVANCE_BATCH();
-    }
-
-    /* Advance to next scanline.
-     */
-    pI830->BR[9] += pScrn->displayWidth * pI830->cpp;
-    I830GetNextScanlineColorExpandBuffer(pScrn);
-}
-#endif /* DO_SCANLINE_IMAGE_WRITE */
-/* Support for multiscreen */
-
-/**
- * Special case acceleration for Render acceleration of rotation operations
- * by xf86Rotate.c
- */
-static void
-i830_xaa_composite(CARD8	op,
-		   PicturePtr	pSrc,
-		   PicturePtr	pMask,
-		   PicturePtr	pDst,
-		   INT16	xSrc,
-		   INT16	ySrc,
-		   INT16	xMask,
-		   INT16	yMask,
-		   INT16	xDst,
-		   INT16	yDst,
-		   CARD16	width,
-		   CARD16	height)
-{
-    ScreenPtr pScreen = pDst->pDrawable->pScreen;
-    ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-    I830Ptr pI830 = I830PTR(pScrn);
-    xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
-    PictureScreenPtr ps;
-    PixmapPtr pSrcPixmap, pDstPixmap;
-    RegionRec region;
-    BoxPtr pbox;
-    int nbox;
-    int	i;
-
-    /* Throw out cases that aren't going to be our rotation first */
-    if (pMask != NULL || op != PictOpSrc || pSrc->pDrawable == NULL)
-	goto fallback;
-
-    if (pSrc->pDrawable->type != DRAWABLE_WINDOW ||
-	pDst->pDrawable->type != DRAWABLE_PIXMAP)
-    {
-	goto fallback;
-    }
-    pSrcPixmap = (*pScreen->GetWindowPixmap) ((WindowPtr) pSrc->pDrawable);
-    pDstPixmap = (PixmapPtr)pDst->pDrawable;
-
-    /* Check if the dest is one of our shadow pixmaps */
-    for (i = 0; i < xf86_config->num_crtc; i++) {
-	xf86CrtcPtr crtc = xf86_config->crtc[i];
-
-	if (crtc->rotatedPixmap == pDstPixmap)
-	    break;
-    }
-    if (i == xf86_config->num_crtc)
-	goto fallback;
-
-    if (pSrcPixmap != pScreen->GetScreenPixmap(pScreen))
-	goto fallback;
-
-    /* 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-
-     * based Render acceleration code expects.
-     */
-    assert(pSrcPixmap->drawable.x == 0);
-    assert(pSrcPixmap->drawable.y == 0);
-    assert(pDstPixmap->drawable.x == 0);
-    assert(pDstPixmap->drawable.y == 0);
-
-    if (!miComputeCompositeRegion (&region, pSrc, NULL, pDst,
-				   xSrc, ySrc, 0, 0, xDst, yDst,
-				   width, height))
-	return;
-
-    if (!pI830->xaa_check_composite(op, pSrc, NULL, pDst)) {
-	REGION_UNINIT(pScreen, &region);
-	goto fallback;
-    }
-
-    if (!pI830->xaa_prepare_composite(op, pSrc, NULL, pDst,
-				      pSrcPixmap, NULL, pDstPixmap))
-    {
-	REGION_UNINIT(pScreen, &region);
-	goto fallback;
-    }
-
-    nbox = REGION_NUM_RECTS(&region);
-    pbox = REGION_RECTS(&region);
-
-    xSrc -= xDst;
-    ySrc -= yDst;
-
-    while (nbox--)
-    {
-	pI830->xaa_composite(pDstPixmap,
-			     pbox->x1 + xSrc,
-			     pbox->y1 + ySrc,
-			     0, 0,
-			     pbox->x1,
-			     pbox->y1,
-			     pbox->x2 - pbox->x1,
-			     pbox->y2 - pbox->y1);
-	pbox++;
-    }
-
-    REGION_UNINIT(pDst->pDrawable->pScreen, &region);
-
-    pI830->xaa_done_composite(pDstPixmap);
-    i830MarkSync(pScrn);
-
-    return;
-
-fallback:
-    /* Fallback path: Call down to the next level (XAA) */
-    ps = GetPictureScreenIfSet(pScreen);
-
-    ps->Composite = pI830->saved_composite;
-
-    ps->Composite(op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst,
-		  width, height);
-
-    pI830->saved_composite = ps->Composite;
-    ps->Composite = i830_xaa_composite;
-}
commit 30c226eeb35f034c3ddb881e77454051dc210298
Author: Eric Anholt <eric at anholt.net>
Date:   Thu Jan 22 17:54:49 2009 -0800

    Remove DRI1 support.
    
    This was blocked on wide distribution of X Server 1.6 (now in the current or
    next version of major distributions) and solutions for a couple of significant
    architectural problems (vblank sync and frontbuffer rendering, which we now
    have code or good plans for).
    
    This includes disabling XVMC which is DRI1-only currently.

diff --git a/configure.ac b/configure.ac
index 8dd04d5..18fe983 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,10 +70,10 @@ AC_ARG_ENABLE(video-debug, AC_HELP_STRING([--enable-video-debug],
               [VIDEO_DEBUG="$enableval"],
               [VIDEO_DEBUG=no])
 
-AC_ARG_ENABLE(xvmc, AC_HELP_STRING([--disable-xvmc],
-                                  [Disable XvMC support [[default=auto]]]),
-              [XVMC="$enableval"],
-              [XVMC=auto])
+dnl AC_ARG_ENABLE(xvmc, AC_HELP_STRING([--disable-xvmc],
+dnl                                   [Disable XvMC support [[default=auto]]]),
+dnl               [XVMC="$enableval"],
+dnl               [XVMC=auto])
 
 # Checks for extensions
 XORG_DRIVER_CHECK_EXT(XINERAMA, xineramaproto)
diff --git a/src/i830.h b/src/i830.h
index 26f4bda..e362d24 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -65,21 +65,18 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include <pciaccess.h>
 #endif
 
-#ifdef XF86DRI
 #include "xf86drm.h"
 #include "sarea.h"
 #define _XF86DRI_SERVER_
 #include "dri.h"
 #include "GL/glxint.h"
 #include "i830_dri.h"
-#endif
 #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
@@ -106,18 +103,6 @@ typedef struct _I830OutputRec I830OutputRec, *I830OutputPtr;
 #include "i830_sdvo.h"
 #include "i2c_vid.h"
 
-/*
- * The mode handling is based upon the VESA driver written by
- * Paulo César Pereira de Andrade <pcpa at conectiva.com.br>.
- */
-
-#ifdef XF86DRI
-#define I830_MM_MINPAGES 512
-#define I830_MM_MAXSIZE  (32*1024)
-#define I830_KERNEL_MM  (1 << 0) /* Initialize the kernel memory manager*/
-#define I830_KERNEL_TEX (1 << 1) /* Allocate texture memory pool */
-#endif
-
 #ifdef XvMCExtension
 #ifdef ENABLE_XVMC
 #define INTEL_XVMC 1
@@ -361,7 +346,6 @@ typedef enum accel_method {
 enum dri_type {
     DRI_DISABLED,
     DRI_NONE,
-    DRI_XF86DRI,
     DRI_DRI2
 };
 
@@ -445,22 +429,10 @@ typedef struct _I830Rec {
 
    i830_memory *power_context;
 
-#ifdef XF86DRI
-   i830_memory *back_buffer;
-   i830_memory *depth_buffer;
-   i830_memory *textures;		/**< Compatibility texture memory */
    i830_memory *memory_manager;		/**< DRI memory manager aperture */
-   i830_memory *hw_status;		/* for G33 hw status page alloc */
-
-   int TexGranularity;
-   int drmMinor;
-   Bool allocate_classic_textures;
 
    Bool can_resize;
 
-   Bool want_vblank_interrupts;
-#endif
-
    Bool need_mi_flush;
 
    Bool tiling;
@@ -575,18 +547,9 @@ typedef struct _I830Rec {
 
    enum dri_type directRenderingType;	/* DRI enabled this generation. */
 
-#ifdef XF86DRI
    Bool directRenderingOpen;
-   int LockHeld;
-   DRIInfoPtr pDRIInfo;
    int drmSubFD;
-   int numVisualConfigs;
-   __GLXvisualConfig *pVisualConfigs;
-   I830ConfigPrivPtr pVisualConfigsPriv;
-   drm_handle_t buffer_map;
-   drm_handle_t ring_map;
    char deviceName[64];
-#endif
 
    /* Broken-out options. */
    OptionInfoPtr Options;
@@ -779,26 +742,8 @@ i830_pipe_a_require_activate (ScrnInfoPtr scrn);
 void
 i830_pipe_a_require_deactivate (ScrnInfoPtr scrn);
 
-#ifdef XF86DRI
-extern Bool I830Allocate3DMemory(ScrnInfoPtr pScrn, const int flags);
-extern void I830SetupMemoryTiling(ScrnInfoPtr pScrn);
-extern Bool I830DRIScreenInit(ScreenPtr pScreen);
-extern Bool I830DRIDoMappings(ScreenPtr pScreen);
-extern Bool I830DRIResume(ScreenPtr pScreen);
-extern void I830DRICloseScreen(ScreenPtr pScreen);
-extern Bool I830DRIFinishScreenInit(ScreenPtr pScreen);
-extern void I830DRIUnlock(ScrnInfoPtr pScrn);
-extern Bool I830DRILock(ScrnInfoPtr pScrn);
-extern Bool I830DRISetVBlankInterrupt (ScrnInfoPtr pScrn, Bool on);
-extern Bool i830_update_dri_buffers(ScrnInfoPtr pScrn);
-extern Bool I830DRISetHWS(ScrnInfoPtr pScrn);
-extern Bool I830DRIInstIrqHandler(ScrnInfoPtr pScrn);
-#endif
-
-#ifdef DRI2
 Bool I830DRI2ScreenInit(ScreenPtr pScreen);
 void I830DRI2CloseScreen(ScreenPtr pScreen);
-#endif
 
 #ifdef XF86DRM_MODE
 extern Bool drmmode_pre_init(ScrnInfoPtr pScrn, int fd, int cpp);
diff --git a/src/i830_accel.c b/src/i830_accel.c
index cae36dc..12bb5a2 100644
--- a/src/i830_accel.c
+++ b/src/i830_accel.c
@@ -137,12 +137,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 XF86DRI
-	 if (pI830->directRenderingType == DRI_XF86DRI) {
-	    DRIUnlock(screenInfo.screens[pScrn->scrnIndex]);
-	    DRICloseScreen(screenInfo.screens[pScrn->scrnIndex]);
-	 }
-#endif
 #ifdef I830_USE_XAA
 	 pI830->AccelInfoRec = NULL;	/* Stops recursive behavior */
 #endif
@@ -180,14 +174,6 @@ I830Sync(ScrnInfoPtr pScrn)
    if (pI830->accel == ACCEL_NONE || !pScrn->vtSema || !pI830->batch_bo)
        return;
 
-#ifdef XF86DRI
-   /* VT switching tries to do this.
-    */
-   if (!pI830->LockHeld && pI830->directRenderingType == DRI_XF86DRI) {
-      return;
-   }
-#endif
-
    I830EmitFlush(pScrn);
 
    intel_batch_flush(pScrn, TRUE);
@@ -241,35 +227,6 @@ I830EmitFlush(ScrnInfoPtr pScrn)
    }
 }
 
-Bool
-I830SelectBuffer(ScrnInfoPtr pScrn, int buffer)
-{
-   I830Ptr pI830 = I830PTR(pScrn);
-
-   switch (buffer) {
-#ifdef XF86DRI
-   case I830_SELECT_BACK:
-      pI830->bufferOffset = pI830->back_buffer->offset;
-      if (pI830->back_buffer->tiling == TILE_YMAJOR)
-	 return FALSE;
-      break;
-   case I830_SELECT_DEPTH:
-      pI830->bufferOffset = pI830->depth_buffer->offset;
-      if (pI830->depth_buffer->tiling == TILE_YMAJOR)
-	 return FALSE;
-      break;
-#endif
-   default:
-   case I830_SELECT_FRONT:
-      pI830->bufferOffset = pScrn->fbOffset;
-      break;
-   }
-
-   if (I810_DEBUG & DEBUG_VERBOSE_ACCEL)
-      ErrorF("I830SelectBuffer %d --> offset %x\n",
-	     buffer, pI830->bufferOffset);
-   return TRUE;
-}
 
 #if (ALWAYS_SYNC || ALWAYS_FLUSH)
 void
diff --git a/src/i830_display.c b/src/i830_display.c
index 847dc22..c8e94ff 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -698,7 +698,6 @@ i830PipeSetBase(xf86CrtcPtr crtc, int x, int y)
     ScrnInfoPtr pScrn = crtc->scrn;
     I830Ptr pI830 = I830PTR(pScrn);
     I830CrtcPrivatePtr	intel_crtc = crtc->driver_private;
-    int pipe = intel_crtc->pipe;
     int plane = intel_crtc->plane;
     unsigned long Start, Offset, Stride;
     int dspbase = (plane == 0 ? DSPABASE : DSPBBASE);
@@ -737,30 +736,6 @@ i830PipeSetBase(xf86CrtcPtr crtc, int x, int y)
 	OUTREG(dspbase, Start + Offset);
 	POSTING_READ(dspbase);
     }
-
-#ifdef XF86DRI
-    if (pI830->directRenderingType == DRI_XF86DRI) {
-	drmI830Sarea *sPriv = (drmI830Sarea *) DRIGetSAREAPrivate(pScrn->pScreen);
-
-	if (!sPriv)
-	    return;
-
-	switch (pipe) {
-	case 0:
-	    sPriv->pipeA_x = x;
-	    sPriv->pipeA_y = y;
-	    break;
-	case 1:
-	    sPriv->pipeB_x = x;
-	    sPriv->pipeB_y = y;
-	    break;
-	default:
-	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		       "Can't update pipe %d in SAREA\n", pipe);
-	    break;
-	}
-    }
-#endif
 }
 
 /*
@@ -1062,7 +1037,7 @@ i830_use_fb_compression(xf86CrtcPtr crtc)
     return TRUE;
 }
 
-#if defined(DRM_IOCTL_MODESET_CTL) && (defined(XF86DRI) || defined(DRI2))
+#if defined(DRM_IOCTL_MODESET_CTL)
 static void i830_modeset_ctl(xf86CrtcPtr crtc, int pre)
 {
     ScrnInfoPtr pScrn = crtc->scrn;
@@ -1094,7 +1069,7 @@ static void i830_modeset_ctl(xf86CrtcPtr crtc, int dpms_state)
 {
     return;
 }
-#endif /* DRM_IOCTL_MODESET_CTL && (XF86DRI || DRI2) */
+#endif /* DRM_IOCTL_MODESET_CTL */
 
 static void
 i830_disable_vga_plane (xf86CrtcPtr crtc)
@@ -1286,54 +1261,20 @@ i830_crtc_dpms(xf86CrtcPtr crtc, int mode)
     }
 
     intel_crtc->dpms_mode = mode;
-
-#ifdef XF86DRI
-    if (pI830->directRenderingType == DRI_XF86DRI) {
-	drmI830Sarea *sPriv = (drmI830Sarea *) DRIGetSAREAPrivate(pScrn->pScreen);
-	Bool enabled = crtc->enabled && mode != DPMSModeOff;
-
-	I830DRISetVBlankInterrupt (pScrn, TRUE);
-
-	if (!sPriv)
-	    return;
-
-	switch (pipe) {
-	case 0:
-	    sPriv->pipeA_w = enabled ? crtc->mode.HDisplay : 0;
-	    sPriv->pipeA_h = enabled ? crtc->mode.VDisplay : 0;
-	    break;
-	case 1:
-	    sPriv->pipeB_w = enabled ? crtc->mode.HDisplay : 0;
-	    sPriv->pipeB_h = enabled ? crtc->mode.VDisplay : 0;
-	    break;
-	default:
-	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		       "Can't update pipe %d in SAREA\n", pipe);
-	    break;
-	}
-    }
-#endif
 }
 
 static Bool
 i830_crtc_lock (xf86CrtcPtr crtc)
 {
-   /* Sync the engine before mode switch */
-   i830WaitSync(crtc->scrn);
+    /* Sync the engine before mode switch */
+    i830WaitSync(crtc->scrn);
 
-#ifdef XF86DRI
-    return I830DRILock(crtc->scrn);
-#else
     return FALSE;
-#endif
 }
 
 static void
 i830_crtc_unlock (xf86CrtcPtr crtc)
 {
-#ifdef XF86DRI
-    I830DRIUnlock (crtc->scrn);
-#endif
 }
 
 static void
@@ -1368,11 +1309,6 @@ i830_crtc_commit (xf86CrtcPtr crtc)
     /* Reenable FB compression if possible */
     if (i830_use_fb_compression(crtc))
 	i830_enable_fb_compression(crtc);
-
-#ifdef XF86DRI
-    /* Tell DRI1 the news about new output config */
-    i830_update_dri_buffers(crtc->scrn);
-#endif
 }
 
 void
@@ -1919,10 +1855,7 @@ i830_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
     OUTREG(dspcntr_reg, dspcntr);
     /* Flush the plane changes */
     i830PipeSetBase(crtc, x, y);
-#ifdef XF86DRI
-   I830DRISetVBlankInterrupt (pScrn, TRUE);
-#endif
-    
+
     i830WaitForVblank(pScrn);
 }
 
diff --git a/src/i830_dri.c b/src/i830_dri.c
index 93bb340..745162d 100644
--- a/src/i830_dri.c
+++ b/src/i830_dri.c
@@ -89,11 +89,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include "i915_drm.h"
 
-#include "dristruct.h"
-
-#ifdef DRI2
 #include "dri2.h"
 
+#ifdef DRI2
 #if DRI2INFOREC_VERSION >= 1
 #define USE_DRI2_1_1_0
 #endif
@@ -101,1438 +99,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 extern XF86ModuleData dri2ModuleData;
 #endif
 
-static Bool I830InitVisualConfigs(ScreenPtr pScreen);
-static Bool I830CreateContext(ScreenPtr pScreen, VisualPtr visual,
-			      drm_context_t hwContext, void *pVisualConfigPriv,
-			      DRIContextType contextStore);
-static void I830DestroyContext(ScreenPtr pScreen, drm_context_t hwContext,
-			       DRIContextType contextStore);
-static void I830DRISwapContext(ScreenPtr pScreen, DRISyncType syncType,
-			       DRIContextType readContextType,
-			       void *readContextStore,
-			       DRIContextType writeContextType,
-			       void *writeContextStore);
-static void I830DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index);
-static void I830DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
-			       RegionPtr prgnSrc, CARD32 index);
-
-static void I830DRITransitionTo2d(ScreenPtr pScreen);
-static void I830DRITransitionTo3d(ScreenPtr pScreen);
-
-#if (DRIINFO_MAJOR_VERSION > 5 || \
-     (DRIINFO_MAJOR_VERSION == 5 && DRIINFO_MINOR_VERSION >= 4))
-#define DRI_DRIVER_FRAMEBUFFER_MAP 1
-#else
-#define DRI_DRIVER_FRAMEBUFFER_MAP 0
-#endif
-
-extern void GlxSetVisualConfigs(int nconfigs,
-				__GLXvisualConfig * configs,
-				void **configprivs);
-
-static Bool
-I830CleanupDma(ScrnInfoPtr pScrn)
-{
-   I830Ptr pI830 = I830PTR(pScrn);
-   drmI830Init info;
-
-   memset(&info, 0, sizeof(drmI830Init));
-   info.func = I830_CLEANUP_DMA;
-
-   if (drmCommandWrite(pI830->drmSubFD, DRM_I830_INIT,
-		       &info, sizeof(drmI830Init))) {
-      xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "I830 Dma Cleanup Failed\n");
-      return FALSE;
-   }
-
-   return TRUE;
-}
-
-static Bool
-I830InitDma(ScrnInfoPtr pScrn)
-{
-   I830Ptr pI830 = I830PTR(pScrn);
-   I830RingBuffer *ring = &pI830->ring;
-   I830DRIPtr pI830DRI = (I830DRIPtr) pI830->pDRIInfo->devPrivate;
-   drmI830Init info;
-
-   memset(&info, 0, sizeof(drmI830Init));
-   info.func = I830_INIT_DMA;
-
-   /* Initialize fields that are used in the absence of GEM */
-   if (!pI830->memory_manager && !pI830->use_drm_mode) {
-       info.ring_start = ring->mem->offset + pI830->LinearAddr;
-       info.ring_end = ring->mem->end + pI830->LinearAddr;
-       info.ring_size = ring->mem->size;
-
-       /* Not used as of the middle of GEM development. */
-       info.mmio_offset = (unsigned int)pI830DRI->regs;
-
-       /* Not used as of before GEM development */
-       info.front_offset = pI830->front_buffer->offset;
-       info.back_offset = pI830->back_buffer->offset;
-       info.depth_offset = pI830->depth_buffer->offset;
-       info.pitch = pScrn->displayWidth;
-       info.back_pitch = pScrn->displayWidth;
-       info.depth_pitch = pScrn->displayWidth;
-       info.w = pScrn->virtualX;
-       info.h = pScrn->virtualY;
-   }
-
-
-   info.sarea_priv_offset = sizeof(XF86DRISAREARec);
-
-   /* This should probably have been moved alongside offset/pitch in the sarea.
-    */
-   info.cpp = pI830->cpp;
-
-   if (drmCommandWrite(pI830->drmSubFD, DRM_I830_INIT,
-		       &info, sizeof(drmI830Init))) {
-      xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		 "I830 Dma Initialization Failed\n");
-      return FALSE;
-   }
-
-   return TRUE;
-}
-
-static Bool
-I830ResumeDma(ScrnInfoPtr pScrn)
-{
-   I830Ptr pI830 = I830PTR(pScrn);
-   drmI830Init info;
-
-   memset(&info, 0, sizeof(drmI830Init));
-   info.func = I830_RESUME_DMA;
-
-   if (drmCommandWrite(pI830->drmSubFD, DRM_I830_INIT,
-		       &info, sizeof(drmI830Init))) {
-      xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "I830 Dma Resume Failed\n");
-      return FALSE;
-   }
-
-   return TRUE;
-}
-
-static Bool
-I830SetParam(ScrnInfoPtr pScrn, int param, int value)
-{
-   I830Ptr pI830 = I830PTR(pScrn);
-   drmI830SetParam sp;
-
-   memset(&sp, 0, sizeof(sp));
-   sp.param = param;
-   sp.value = value;
-
-   if (drmCommandWrite(pI830->drmSubFD, DRM_I830_SETPARAM, &sp, sizeof(sp))) {
-      xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "I830 SetParam Failed\n");
-      return FALSE;
-   }
-
-   return TRUE;
-}
-
-Bool
-I830DRISetHWS(ScrnInfoPtr pScrn)
-{
-    I830Ptr pI830 = I830PTR(pScrn);
-    drmI830HWS hws;
-
-    hws.addr = pI830->hw_status->offset;
-
-    if (drmCommandWrite(pI830->drmSubFD, DRM_I830_HWS_PAGE_ADDR,
-		&hws, sizeof(drmI830HWS))) {
-	xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		"hw status page initialization Failed\n");
-	return FALSE;
-    }
-    return TRUE;
-}
-
-static Bool
-I830InitVisualConfigs(ScreenPtr pScreen)
-{
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-   I830Ptr pI830 = I830PTR(pScrn);
-   int numConfigs = 0;
-   __GLXvisualConfig *pConfigs = NULL;
-   I830ConfigPrivPtr pI830Configs = NULL;
-   I830ConfigPrivPtr *pI830ConfigPtrs = NULL;
-   int accum, stencil, db, depth;
-   int i;
-
-   switch (pScrn->bitsPerPixel) {
-   case 8:
-   case 24:
-      break;
-
-   case 16:
-      numConfigs = 8;
-
-      pConfigs =
-	    (__GLXvisualConfig *) xcalloc(sizeof(__GLXvisualConfig),
-					  numConfigs);
-      if (!pConfigs)
-	 return FALSE;
-
-      pI830Configs =
-	    (I830ConfigPrivPtr) xcalloc(sizeof(I830ConfigPrivRec),
-					numConfigs);
-      if (!pI830Configs) {
-	 xfree(pConfigs);
-	 return FALSE;
-      }
-
-      pI830ConfigPtrs =
-	    (I830ConfigPrivPtr *) xcalloc(sizeof(I830ConfigPrivPtr),
-					  numConfigs);
-      if (!pI830ConfigPtrs) {
-	 xfree(pConfigs);
-	 xfree(pI830Configs);
-	 return FALSE;
-      }
-
-      for (i = 0; i < numConfigs; i++)
-	 pI830ConfigPtrs[i] = &pI830Configs[i];
-
-      i = 0;
-      depth = 1;
-      for (accum = 0; accum <= 1; accum++) {
-	 for (stencil = 0; stencil <= 1; stencil++) {
-	    for (db = 1; db >= 0; db--) {
-	       pConfigs[i].vid = -1;
-	       pConfigs[i].class = -1;
-	       pConfigs[i].rgba = TRUE;
-	       pConfigs[i].redSize = 5;
-	       pConfigs[i].greenSize = 6;
-	       pConfigs[i].blueSize = 5;
-	       pConfigs[i].alphaSize = 0;
-	       pConfigs[i].redMask = 0x0000F800;
-	       pConfigs[i].greenMask = 0x000007E0;
-	       pConfigs[i].blueMask = 0x0000001F;
-	       pConfigs[i].alphaMask = 0;
-	       if (accum) {
-		  pConfigs[i].accumRedSize = 16;
-		  pConfigs[i].accumGreenSize = 16;
-		  pConfigs[i].accumBlueSize = 16;
-		  pConfigs[i].accumAlphaSize = 0;
-	       } else {
-		  pConfigs[i].accumRedSize = 0;
-		  pConfigs[i].accumGreenSize = 0;
-		  pConfigs[i].accumBlueSize = 0;
-		  pConfigs[i].accumAlphaSize = 0;
-	       }
-	       pConfigs[i].doubleBuffer = db ? TRUE : FALSE;
-	       pConfigs[i].stereo = FALSE;
-	       pConfigs[i].bufferSize = 16;
-	       if (depth)
-		  pConfigs[i].depthSize = 16;
-	       else
-		  pConfigs[i].depthSize = 0;
-	       if (stencil)
-		  pConfigs[i].stencilSize = 8;
-	       else
-		  pConfigs[i].stencilSize = 0;
-	       pConfigs[i].auxBuffers = 0;
-	       pConfigs[i].level = 0;
-	       if (stencil || accum)
-		  pConfigs[i].visualRating = GLX_SLOW_VISUAL_EXT;
-	       else
-		  pConfigs[i].visualRating = GLX_NONE_EXT;
-	       pConfigs[i].transparentPixel = GLX_NONE_EXT;
-	       pConfigs[i].transparentRed = 0;
-	       pConfigs[i].transparentGreen = 0;
-	       pConfigs[i].transparentBlue = 0;
-	       pConfigs[i].transparentAlpha = 0;
-	       pConfigs[i].transparentIndex = 0;
-	       i++;
-	    }
-	 }
-      }
-      assert(i == numConfigs);
-      break;
-
-   case 32:
-      numConfigs = 8;
-
-      pConfigs = (__GLXvisualConfig *) xcalloc(sizeof(__GLXvisualConfig),
-					       numConfigs);
-      if (!pConfigs) {
-	 return FALSE;
-      }
-
-      pI830Configs = (I830ConfigPrivPtr) xcalloc(sizeof(I830ConfigPrivRec),
-						 numConfigs);
-      if (!pI830Configs) {
-	 xfree(pConfigs);
-	 return FALSE;
-      }
-
-      pI830ConfigPtrs = (I830ConfigPrivPtr *)
-	    xcalloc(sizeof(I830ConfigPrivPtr), numConfigs);
-      if (!pI830ConfigPtrs) {
-	 xfree(pConfigs);
-	 xfree(pI830Configs);
-	 return FALSE;
-      }
-
-      for (i = 0; i < numConfigs; i++) {
-	 pI830ConfigPtrs[i] = &pI830Configs[i];
-      }
-
-      i = 0;
-      for (accum = 0; accum <= 1; accum++) {
-	 for (depth = 1; depth >= 0; depth--) {	/* and stencil */
-	    for (db = 1; db >= 0; db--) {
-	       pConfigs[i].vid = -1;
-	       pConfigs[i].class = -1;
-	       pConfigs[i].rgba = TRUE;
-	       pConfigs[i].redSize = 8;
-	       pConfigs[i].greenSize = 8;
-	       pConfigs[i].blueSize = 8;
-	       pConfigs[i].alphaSize = 8;
-	       pConfigs[i].redMask = 0x00FF0000;
-	       pConfigs[i].greenMask = 0x0000FF00;
-	       pConfigs[i].blueMask = 0x000000FF;
-	       pConfigs[i].alphaMask = 0xFF000000;
-	       if (accum) {
-		  pConfigs[i].accumRedSize = 16;
-		  pConfigs[i].accumGreenSize = 16;
-		  pConfigs[i].accumBlueSize = 16;
-		  pConfigs[i].accumAlphaSize = 16;
-	       } else {
-		  pConfigs[i].accumRedSize = 0;
-		  pConfigs[i].accumGreenSize = 0;
-		  pConfigs[i].accumBlueSize = 0;
-		  pConfigs[i].accumAlphaSize = 0;
-	       }
-	       if (db) {
-		  pConfigs[i].doubleBuffer = TRUE;
-	       } else {
-		  pConfigs[i].doubleBuffer = FALSE;
-	       }
-	       pConfigs[i].stereo = FALSE;
-	       pConfigs[i].bufferSize = 32;
-	       if (depth) {
-		  pConfigs[i].depthSize = 24;
-		  pConfigs[i].stencilSize = 8;
-	       } else {
-		  pConfigs[i].depthSize = 0;
-		  pConfigs[i].stencilSize = 0;
-	       }
-	       pConfigs[i].auxBuffers = 0;
-	       pConfigs[i].level = 0;
-	       if (accum) {
-		  pConfigs[i].visualRating = GLX_SLOW_VISUAL_EXT;
-	       } else {
-		  pConfigs[i].visualRating = GLX_NONE_EXT;
-	       }
-	       pConfigs[i].transparentPixel = GLX_NONE_EXT;
-	       pConfigs[i].transparentRed = 0;
-	       pConfigs[i].transparentGreen = 0;
-	       pConfigs[i].transparentBlue = 0;
-	       pConfigs[i].transparentAlpha = 0;
-	       pConfigs[i].transparentIndex = 0;
-	       i++;
-	    }
-	 }
-      }
-      if (i != numConfigs) {
-	 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		    "[drm] Incorrect initialization of visuals\n");
-	 return FALSE;
-      }
-      break;
-
-   }
-   pI830->numVisualConfigs = numConfigs;
-   pI830->pVisualConfigs = pConfigs;
-   pI830->pVisualConfigsPriv = pI830Configs;
-   GlxSetVisualConfigs(numConfigs, pConfigs, (void **)pI830ConfigPtrs);
-   return TRUE;
-}
-
-static Bool
-I830CheckDRIAvailable(ScrnInfoPtr pScrn)
-{
-   /* Hardware 3D rendering only implemented for 16bpp and 32 bpp */
-   if (((pScrn->bitsPerPixel / 8) != 2 && pScrn->depth != 16) &&
-       (pScrn->bitsPerPixel / 8) != 4) {
-      xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		 "[drm] Direct rendering only supported in 16 and 32 bpp modes\n");
-      return FALSE;
-   }
-
-   /* Check that the GLX, DRI, and DRM modules have been loaded by testing
-    * for known symbols in each module. */
-   if (!xf86LoaderCheckSymbol("GlxSetVisualConfigs")) {
-      xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		 "[dri] %s failed: glx not loaded\n", __FUNCTION__);
-      return FALSE;
-   }
-   if (!xf86LoaderCheckSymbol("DRIScreenInit")) {
-      xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		 "[dri] %s failed: dri not loaded\n", __FUNCTION__);
-      return FALSE;
-   }
-   if (!xf86LoaderCheckSymbol("drmAvailable")) {
-      xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		 "[dri] %s failed: libdrm not loaded\n", __FUNCTION__);
-      return FALSE;
-   }
-   if (!xf86LoaderCheckSymbol("DRIQueryVersion")) {
-      xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		 "[dri] %s failed (libdri.a too old)\n", __FUNCTION__);
-      return FALSE;
-   }
-
-   /* Check the DRI version */
-   {
-      int major, minor, patch;
-
-      DRIQueryVersion(&major, &minor, &patch);
-      if (major != DRIINFO_MAJOR_VERSION || minor < DRIINFO_MINOR_VERSION ||
-	  major < 5) {
-	 xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		    "[dri] %s failed because of a version mismatch.\n"
-		    "[dri] libDRI version is %d.%d.%d but version %d.%d.x is needed.\n"
-		    "[dri] Disabling DRI.\n",
-		    "I830CheckDRIAvailable", major, minor, patch,
-		     DRIINFO_MAJOR_VERSION, DRIINFO_MINOR_VERSION);
-	 return FALSE;
-      }
-   }
-
-   return TRUE;
-}
-
-Bool
-I830DRIScreenInit(ScreenPtr pScreen)
-{
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-   I830Ptr pI830 = I830PTR(pScrn);
-   DRIInfoPtr pDRIInfo;
-   I830DRIPtr pI830DRI;
-
-   DPRINTF(PFX, "I830DRIScreenInit\n");
-
-   if (!I830CheckDRIAvailable(pScrn))
-      return FALSE;
-
-   pDRIInfo = DRICreateInfoRec();
-   if (!pDRIInfo) {
-      xf86DrvMsg(pScreen->myNum, X_ERROR,
-		 "[dri] DRICreateInfoRec failed. Disabling DRI.\n");
-      return FALSE;
-   }
-
-   pI830->pDRIInfo = pDRIInfo;
-   pI830->LockHeld = 0;
-
-   pDRIInfo->drmDriverName = "i915";
-   if (IS_I965G(pI830))
-      pDRIInfo->clientDriverName = "i965";
-   else
-      pDRIInfo->clientDriverName = "i915";
-
-   if (xf86LoaderCheckSymbol("DRICreatePCIBusID")) {
-      pDRIInfo->busIdString = DRICreatePCIBusID(pI830->PciInfo);
-   } else {
-      pDRIInfo->busIdString = xalloc(64);
-      sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d",
-#if XSERVER_LIBPCIACCESS
-	      ((pI830->PciInfo->domain << 8) | pI830->PciInfo->bus),
-	      pI830->PciInfo->dev, pI830->PciInfo->func
-#else
-	      ((pciConfigPtr) pI830->PciInfo->thisCard)->busnum,
-	      ((pciConfigPtr) pI830->PciInfo->thisCard)->devnum,
-	      ((pciConfigPtr) pI830->PciInfo->thisCard)->funcnum
-#endif
-	      );
-   }
-   pDRIInfo->ddxDriverMajorVersion = I830_MAJOR_VERSION;
-   pDRIInfo->ddxDriverMinorVersion = I830_MINOR_VERSION;
-   pDRIInfo->ddxDriverPatchVersion = I830_PATCHLEVEL;
-   pDRIInfo->ddxDrawableTableEntry = I830_MAX_DRAWABLES;
-
-   if (SAREA_MAX_DRAWABLES < I830_MAX_DRAWABLES)
-      pDRIInfo->maxDrawableTableEntry = SAREA_MAX_DRAWABLES;
-   else
-      pDRIInfo->maxDrawableTableEntry = I830_MAX_DRAWABLES;
-
-   if (sizeof(XF86DRISAREARec) + sizeof(drmI830Sarea) > SAREA_MAX) {
-      xf86DrvMsg(pScreen->myNum, X_ERROR,
-		 "[dri] Data does not fit in SAREA\n");
-      return FALSE;
-   }
-   /* This is a hack for now.  We have to have more than a 4k page here
-    * because of the size of the state.  However, the state should be
-    * in a per-context mapping.  This will be added in the Mesa 3.5 port
-    * of the I830 driver.
-    */
-   pDRIInfo->SAREASize = SAREA_MAX;
-
-   if (!(pI830DRI = (I830DRIPtr) xcalloc(sizeof(I830DRIRec), 1))) {
-      DRIDestroyInfoRec(pI830->pDRIInfo);
-      pI830->pDRIInfo = NULL;
-      return FALSE;
-   }
-   pDRIInfo->devPrivate = pI830DRI;
-   pDRIInfo->devPrivateSize = sizeof(I830DRIRec);
-   pDRIInfo->contextSize = sizeof(I830DRIContextRec);
-
-   pDRIInfo->CreateContext = I830CreateContext;
-   pDRIInfo->DestroyContext = I830DestroyContext;
-   pDRIInfo->SwapContext = I830DRISwapContext;
-   pDRIInfo->InitBuffers = I830DRIInitBuffers;
-   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.
-    */
-   pDRIInfo->frameBufferPhysicalAddress = 0;
-   pDRIInfo->frameBufferSize = 0;
-   pDRIInfo->frameBufferStride = 0;
-   pDRIInfo->dontMapFrameBuffer = TRUE;
-#else
-   /* Supply a dummy mapping info required by DRI setup.
-    */
-   pDRIInfo->frameBufferPhysicalAddress = (char *) pI830->LinearAddr;
-   pDRIInfo->frameBufferSize = GTT_PAGE_SIZE;
-   pDRIInfo->frameBufferStride = 1;
-#endif
-
-   pDRIInfo->TransitionTo2d = I830DRITransitionTo2d;
-   pDRIInfo->TransitionTo3d = I830DRITransitionTo3d;
-
-   /* do driver-independent DRI screen initialization here */
-   if (!DRIScreenInit(pScreen, pDRIInfo, &pI830->drmSubFD)) {
-      xf86DrvMsg(pScreen->myNum, X_ERROR,
-		 "[dri] DRIScreenInit failed. Disabling DRI.\n");
-      xfree(pDRIInfo->devPrivate);
-      pDRIInfo->devPrivate = NULL;
-      DRIDestroyInfoRec(pI830->pDRIInfo);
-      pI830->pDRIInfo = NULL;
-      return FALSE;
-   }
-
-   /* Now, nuke dri.c's dummy frontbuffer map setup if we did that. */
-   if (pDRIInfo->frameBufferSize != 0) {
-       int tmp;
-       drm_handle_t fb_handle;
-       void *ptmp;
-
-       /* With the compat method, it will continue to report
-	* the wrong map out of GetDeviceInfo, which will break AIGLX.
-	*/
-       DRIGetDeviceInfo(pScreen, &fb_handle, &tmp, &tmp, &tmp, &tmp, &ptmp);
-       drmRmMap(pI830->drmSubFD, fb_handle);
-
-       xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-		  "Removed DRI frontbuffer mapping in compatibility mode.\n");
-       xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-		  "DRIGetDeviceInfo will report incorrect frontbuffer "
-		  "handle.\n");
-   }
-
-   /* Check the i915 DRM versioning */
-   {
-      drmVersionPtr version;
-
-      /* Check the DRM lib version.
-       * drmGetLibVersion was not supported in version 1.0, so check for
-       * symbol first to avoid possible crash or hang.
-       */
-      if (xf86LoaderCheckSymbol("drmGetLibVersion")) {
-	 version = drmGetLibVersion(pI830->drmSubFD);
-      } else
-      {
-	 /* drmlib version 1.0.0 didn't have the drmGetLibVersion
-	  * entry point.  Fake it by allocating a version record
-	  * via drmGetVersion and changing it to version 1.0.0
-	  */
-	 version = drmGetVersion(pI830->drmSubFD);
-	 version->version_major = 1;
-	 version->version_minor = 0;
-	 version->version_patchlevel = 0;
-      }
-
-#define REQ_MAJ 1
-#define REQ_MIN 1
-      if (version) {
-	 if (version->version_major != REQ_MAJ ||
-	     version->version_minor < REQ_MIN) {
-	    /* incompatible drm library version */
-	    xf86DrvMsg(pScreen->myNum, X_ERROR,
-		       "[dri] I830DRIScreenInit failed because of a version mismatch.\n"
-		       "[dri] libdrm.a module version is %d.%d.%d but version %d.%d.x is needed.\n"
-		       "[dri] Disabling DRI.\n",
-		       version->version_major,
-		       version->version_minor, version->version_patchlevel,
-		       REQ_MAJ, REQ_MIN);
-	    drmFreeVersion(version);
-	    I830DRICloseScreen(pScreen);
-	    return FALSE;
-	 }
-	 drmFreeVersion(version);
-      }
-
-      /* Check the i915 DRM version */
-      version = drmGetVersion(pI830->drmSubFD);
-      if (version) {
-	 if (version->version_major != 1 || version->version_minor < 3) {
-	    /* incompatible drm version */
-	    xf86DrvMsg(pScreen->myNum, X_ERROR,
-		       "[dri] %s failed because of a version mismatch.\n"
-		       "[dri] i915 kernel module version is %d.%d.%d but version 1.3 or greater is needed.\n"
-		       "[dri] Disabling DRI.\n",
-		       "I830DRIScreenInit",
-		       version->version_major,
-		       version->version_minor, version->version_patchlevel);
-	    I830DRICloseScreen(pScreen);
-	    drmFreeVersion(version);
-	    return FALSE;
-	 }
-	 /* Check whether the kernel module attached to the device isn't the
-	  * one we expected (meaning it's the old i830 module).
-	  */
-	 if (strncmp(version->name, pDRIInfo->drmDriverName,
-		     strlen(pDRIInfo->drmDriverName)))
-	 {
-	    xf86DrvMsg(pScreen->myNum, X_WARNING,
-		       "Detected i830 kernel module.  The i915 kernel module "
-		       "is required for DRI.  Aborting.\n");
-	    I830DRICloseScreen(pScreen);
-	    drmFreeVersion(version);
-	    return FALSE;
-	 }
-	 pI830->drmMinor = version->version_minor;
-	 drmFreeVersion(version);
-      }
-   }
-
-   return TRUE;
-}
-
-static void
-I830InitTextureHeap(ScrnInfoPtr pScrn)
-{
-   I830Ptr pI830 = I830PTR(pScrn);
-   drmI830MemInitHeap drmHeap;
-
-   if (pI830->textures == NULL)
-       return;
-
-   /* Start up the simple memory manager for agp space */
-   drmHeap.region = I830_MEM_REGION_AGP;
-   drmHeap.start  = 0;
-   drmHeap.size   = pI830->textures->size;
-
-   if (drmCommandWrite(pI830->drmSubFD, DRM_I830_INIT_HEAP,
-			  &drmHeap, sizeof(drmHeap))) {
-      xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		    "[drm] Failed to initialized agp heap manager\n");
-   } else {
-      xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-		    "[drm] Initialized kernel agp heap manager, %ld\n",
-		    pI830->textures->size);
-
-      I830SetParam(pScrn, I830_SETPARAM_TEX_LRU_LOG_GRANULARITY, 
-		   pI830->TexGranularity);
-   }
-}
-
-/*
- * Map registers & ring buffer
- */
-static Bool
-I830DRIMapHW(ScreenPtr pScreen)
-{
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-   I830Ptr pI830 = I830PTR(pScrn);
-   DRIInfoPtr pDRIInfo = pI830->pDRIInfo;
-   I830DRIPtr pI830DRI = pDRIInfo->devPrivate;
-
-   /* Kernel deals with direct hw access in this case */
-   if (pI830->use_drm_mode)
-       return TRUE;
-
-   DPRINTF(PFX, "I830DRIMapHW\n");
-   pI830DRI->regsSize = I830_REG_SIZE;
-   if (drmAddMap(pI830->drmSubFD, (drm_handle_t)pI830->MMIOAddr,
-		 pI830DRI->regsSize, DRM_REGISTERS, 0,
-		 (drmAddress) &pI830DRI->regs) < 0) {
-      xf86DrvMsg(pScreen->myNum, X_ERROR, "[drm] drmAddMap(regs) failed\n");
-      DRICloseScreen(pScreen);
-      return FALSE;
-   }
-   xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] Registers = 0x%08x\n",
-	      (int)pI830DRI->regs);
-
-   if (!pI830->memory_manager) {
-       if (drmAddMap(pI830->drmSubFD,
-		     (drm_handle_t)pI830->ring.mem->offset +
-		     pI830->LinearAddr,
-		     pI830->ring.mem->size, DRM_AGP, 0,
-		     (drmAddress) &pI830->ring_map) < 0) {
-	   xf86DrvMsg(pScreen->myNum, X_ERROR,
-		      "[drm] drmAddMap(ring_map) failed. Disabling DRI\n");
-	   DRICloseScreen(pScreen);
-	   return FALSE;
-       }
-       xf86DrvMsg(pScreen->myNum, X_INFO, "[drm] ring buffer = 0x%08x\n",
-		  (int)pI830->ring_map);
-   }
-
-   return TRUE;
-}
-
-/**
- * Sets up mappings for static, lifetime-fixed allocations, and inital SAREA
- * setup.
- */
-Bool
-I830DRIDoMappings(ScreenPtr pScreen)
-{
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-   I830Ptr pI830 = I830PTR(pScrn);
-   DRIInfoPtr pDRIInfo = pI830->pDRIInfo;
-   I830DRIPtr pI830DRI = pDRIInfo->devPrivate;
-   drmI830Sarea *sarea = (drmI830Sarea *) DRIGetSAREAPrivate(pScreen);
-
-   if (!I830DRIMapHW(pScreen)) {
-       DRICloseScreen(pScreen);
-       return FALSE;
-   }
-
-   if (!I830InitDma(pScrn)) {
-      DRICloseScreen(pScreen);
-      return FALSE;
-   }
-
-   if (pI830->memory_manager == NULL)
-       intel_bufmgr_fake_set_last_dispatch(pI830->bufmgr,
-					   (volatile unsigned int *)
-					   &sarea->last_dispatch);
-
-   /* init to zero to be safe */
-   sarea->front_handle = 0;
-   sarea->back_handle = 0;
-   sarea->depth_handle = 0;
-   sarea->tex_handle = 0;
-
-   /* Assign pScreen */
-   pScrn->pScreen = pScreen;
-
-   /* Need to initialize pScreen now to let RandR know. */
-   pScrn->pScreen->width = pScrn->virtualX;
-   pScrn->pScreen->height = pScrn->virtualY;
-
-   /* If we are using the kernel memory manager, we have to delay SAREA and
-    * mapping setup until our buffers are pinned at EnterVT, losing the
-    * opportunity to fail cleanly early on.
-    */
-   if (pI830->memory_manager == NULL) {
-      if (!i830_update_dri_buffers(pScrn)) {
-	 /* screen mappings probably failed */
-	 xf86DrvMsg(pScreen->myNum, X_ERROR,
-		    "[drm] drmAddMap(screen mappings) failed. "
-		    "Disabling DRI\n");
-	 DRICloseScreen(pScreen);
-	 return FALSE;
-      }
-   }
-
-   if (pI830->allocate_classic_textures)
-      I830InitTextureHeap(pScrn);
-
-   if (DEVICE_ID(pI830->PciInfo) != PCI_CHIP_845_G &&
-       DEVICE_ID(pI830->PciInfo) != PCI_CHIP_I830_M) {
-      I830SetParam(pScrn, I830_SETPARAM_USE_MI_BATCHBUFFER_START, 1 );
-   }
-
-   pI830DRI = (I830DRIPtr) pI830->pDRIInfo->devPrivate;
-   pI830DRI->deviceID = DEVICE_ID(pI830->PciInfo);
-   pI830DRI->width = pScrn->virtualX;
-   pI830DRI->height = pScrn->virtualY;
-   pI830DRI->mem = pScrn->videoRam * 1024;
-   pI830DRI->cpp = pI830->cpp;
-
-   pI830DRI->bitsPerPixel = pScrn->bitsPerPixel;
-
-   pI830DRI->sarea_priv_offset = sizeof(XF86DRISAREARec);
-
-   if (!(I830InitVisualConfigs(pScreen))) {
-      xf86DrvMsg(pScreen->myNum, X_ERROR,
-		 "[dri] I830InitVisualConfigs failed. Disabling DRI\n");
-      DRICloseScreen(pScreen);
-      return FALSE;
-   }
-
-   xf86DrvMsg(pScrn->scrnIndex, X_INFO, "[dri] visual configs initialized\n");
-   pI830->pDRIInfo->driverSwapMethod = DRI_HIDE_X_CONTEXT;
-
-   return TRUE;
-}
-
-Bool
-I830DRIInstIrqHandler(ScrnInfoPtr pScrn)
-{
-   I830Ptr pI830 = I830PTR(pScrn);
-   I830DRIPtr pI830DRI = (I830DRIPtr) pI830->pDRIInfo->devPrivate;
-
-   pI830DRI->irq = drmGetInterruptFromBusID(pI830->drmSubFD,
-#if XSERVER_LIBPCIACCESS
-					       ((pI830->PciInfo->domain << 8) |
-						pI830->PciInfo->bus),
-					       pI830->PciInfo->dev,
-					       pI830->PciInfo->func
-#else
-					       ((pciConfigPtr) pI830->
-						PciInfo->thisCard)->busnum,
-					       ((pciConfigPtr) pI830->
-						PciInfo->thisCard)->devnum,
-					       ((pciConfigPtr) pI830->
-						PciInfo->thisCard)->funcnum
-#endif
-					       );
-
-   if (drmCtlInstHandler(pI830->drmSubFD, pI830DRI->irq)) {
-       xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-	       "[drm] failure adding irq handler\n");
-       pI830DRI->irq = 0;
-       return FALSE;
-   } else
-       xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-	       "[drm] dma control initialized, using IRQ %d\n",
-	       pI830DRI->irq);
-
-   return TRUE;
-}
-
-Bool
-I830DRIResume(ScreenPtr pScreen)
-{
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-   I830Ptr pI830 = I830PTR(pScrn);
-
-   DPRINTF(PFX, "I830DRIResume\n");
-
-   I830ResumeDma(pScrn);
-
-   if (!pI830->memory_manager)
-       I830DRIInstIrqHandler(pScrn);
-
-   return TRUE;
-}
-
-void
-I830DRICloseScreen(ScreenPtr pScreen)
-{
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-   I830Ptr pI830 = I830PTR(pScrn);
-   I830DRIPtr pI830DRI = (I830DRIPtr) pI830->pDRIInfo->devPrivate;
-
-   DPRINTF(PFX, "I830DRICloseScreen\n");
-
-   if (!pI830->memory_manager && pI830DRI->irq) {
-       drmCtlUninstHandler(pI830->drmSubFD);
-       pI830DRI->irq = 0;
-   }
-
-   I830CleanupDma(pScrn);
-
-   DRICloseScreen(pScreen);
-
-   if (pI830->pDRIInfo) {
-      if (pI830->pDRIInfo->devPrivate) {
-	 xfree(pI830->pDRIInfo->devPrivate);
-	 pI830->pDRIInfo->devPrivate = NULL;
-      }
-      DRIDestroyInfoRec(pI830->pDRIInfo);
-      pI830->pDRIInfo = NULL;
-   }
-   if (pI830->pVisualConfigs)
-      xfree(pI830->pVisualConfigs);
-   if (pI830->pVisualConfigsPriv)
-      xfree(pI830->pVisualConfigsPriv);
-   pI830->directRenderingType = DRI_NONE;
-}
-
-static Bool
-I830CreateContext(ScreenPtr pScreen, VisualPtr visual,
-		  drm_context_t hwContext, void *pVisualConfigPriv,
-		  DRIContextType contextStore)
-{
-   return TRUE;
-}
-
-static void
-I830DestroyContext(ScreenPtr pScreen, drm_context_t hwContext,
-		   DRIContextType contextStore)
-{
-}
-
-Bool
-I830DRIFinishScreenInit(ScreenPtr pScreen)
-{
-   DPRINTF(PFX, "I830DRIFinishScreenInit\n");
-
-   if (!DRIFinishScreenInit(pScreen))
-      return FALSE;
-
-   /* move irq initialize later in EnterVT, as then we
-    * would finish binding possible hw status page, which
-    * requires irq ctrl ioctl not be called that early.
-    */
-   return TRUE;
-}
-
-static void
-I830DRISwapContext(ScreenPtr pScreen, DRISyncType syncType,
-		   DRIContextType oldContextType, void *oldContext,
-		   DRIContextType newContextType, void *newContext)
-{
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-   I830Ptr pI830 = I830PTR(pScrn);
-
-   if (syncType == DRI_3D_SYNC &&
-       oldContextType == DRI_2D_CONTEXT && newContextType == DRI_2D_CONTEXT) {
-
-      if (I810_DEBUG & DEBUG_VERBOSE_DRI)
-	 ErrorF("i830DRISwapContext (in)\n");
-
-      pI830->last_3d = LAST_3D_OTHER;
-
-      if (!pScrn->vtSema)
-     	 return;
-      pI830->LockHeld = 1;
-      if (!pI830->memory_manager)
-	  i830_refresh_ring(pScrn);
-
-   } else if (syncType == DRI_2D_SYNC &&
-	      oldContextType == DRI_NO_CONTEXT &&
-	      newContextType == DRI_2D_CONTEXT) {
-      if (I810_DEBUG & DEBUG_VERBOSE_DRI)
-	 ErrorF("i830DRISwapContext (out)\n");
-
-      if (!pScrn->vtSema)
-     	 return;
-      pI830->LockHeld = 0;
-   } else if (I810_DEBUG & DEBUG_VERBOSE_DRI)
-      ErrorF("i830DRISwapContext (other)\n");
-}
-
-static void
-I830DRIInitBuffers(WindowPtr pWin, RegionPtr prgn, CARD32 index)
-{
-   ScreenPtr pScreen = pWin->drawable.pScreen;
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-   BoxPtr pbox;
-   int nbox;
-   int buffer, first_buffer, last_buffer;
-
-   if (I810_DEBUG & DEBUG_VERBOSE_DRI)
-      ErrorF("I830DRIInitBuffers\n");
-
-   first_buffer = I830_SELECT_BACK;
-   last_buffer = I830_SELECT_DEPTH;
-
-   for (buffer = first_buffer; buffer <= last_buffer; buffer++) {
-      pbox = REGION_RECTS(prgn);
-      nbox = REGION_NUM_RECTS(prgn);
-
-      if (!I830SelectBuffer(pScrn, buffer))
-	 continue;
-
-      if (buffer == I830_SELECT_DEPTH) {
-	 switch (pScrn->bitsPerPixel) {
-	 case 16:
-	    I830SetupForSolidFill(pScrn, 0xffff, GXcopy, -1);
-	    break;
-	 case 32:
-	    I830SetupForSolidFill(pScrn, 0xffffff, GXcopy, -1);
-	    break;
-	 }
-      } else
-	 I830SetupForSolidFill(pScrn, 0, GXcopy, -1);
-      while (nbox--) {
-	 I830SubsequentSolidFillRect(pScrn, pbox->x1, pbox->y1,
-				     pbox->x2 - pbox->x1, pbox->y2 - pbox->y1);
-	 pbox++;
-      }
-   }
-
-   I830SelectBuffer(pScrn, I830_SELECT_FRONT);
-   i830MarkSync(pScrn);
-}
-
-/* This routine is a modified form of XAADoBitBlt with the calls to
- * ScreenToScreenBitBlt built in. My routine has the prgnSrc as source
- * instead of destination. My origin is upside down so the ydir cases
- * are reversed.
- */
-static void
-I830DRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
-		   RegionPtr prgnSrc, CARD32 index)
-{
-   ScreenPtr pScreen = pParent->drawable.pScreen;
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-   BoxPtr pboxTmp, pboxNext, pboxBase;
-   DDXPointPtr pptTmp, pptNew2 = NULL;
-   int xdir, ydir;
-
-#if 0
-   int screenwidth = pScrn->virtualX;
-   int screenheight = pScrn->virtualY;
-#else
-   int screenwidth = pScreen->width;
-   int screenheight = pScreen->height;
-#endif
-
-   BoxPtr pbox = REGION_RECTS(prgnSrc);
-   int nbox = REGION_NUM_RECTS(prgnSrc);
-
-   BoxPtr pboxNew1 = NULL;
-   BoxPtr pboxNew2 = NULL;
-   DDXPointPtr pptNew1 = NULL;
-   DDXPointPtr pptSrc = &ptOldOrg;
-
-   int dx = pParent->drawable.x - ptOldOrg.x;
-   int dy = pParent->drawable.y - ptOldOrg.y;
-   int buffer, first_buffer, last_buffer;
-
-   /* If the copy will overlap in Y, reverse the order */
-   if (dy > 0) {
-      ydir = -1;
-
-      if (nbox > 1) {
-	 /* Keep ordering in each band, reverse order of bands */
-	 pboxNew1 = (BoxPtr) xalloc(sizeof(BoxRec) * nbox);
-	 if (!pboxNew1)
-	    return;
-	 pptNew1 = (DDXPointPtr) xalloc(sizeof(DDXPointRec) * nbox);
-	 if (!pptNew1) {
-	    xfree(pboxNew1);
-	    return;
-	 }
-	 pboxBase = pboxNext = pbox + nbox - 1;
-	 while (pboxBase >= pbox) {
-	    while ((pboxNext >= pbox) && (pboxBase->y1 == pboxNext->y1))
-	       pboxNext--;
-	    pboxTmp = pboxNext + 1;
-	    pptTmp = pptSrc + (pboxTmp - pbox);
-	    while (pboxTmp <= pboxBase) {
-	       *pboxNew1++ = *pboxTmp++;
-	       *pptNew1++ = *pptTmp++;
-	    }
-	    pboxBase = pboxNext;
-	 }
-	 pboxNew1 -= nbox;
-	 pbox = pboxNew1;
-	 pptNew1 -= nbox;
-	 pptSrc = pptNew1;
-      }
-   } else {
-      /* No changes required */
-      ydir = 1;
-   }
-
-   /* If the regions will overlap in X, reverse the order */
-   if (dx > 0) {
-      xdir = -1;
-
-      if (nbox > 1) {
-	 /*reverse orderof rects in each band */
-	 pboxNew2 = (BoxPtr) xalloc(sizeof(BoxRec) * nbox);
-	 pptNew2 = (DDXPointPtr) xalloc(sizeof(DDXPointRec) * nbox);
-	 if (!pboxNew2 || !pptNew2) {
-	    if (pptNew2)
-	       xfree(pptNew2);
-	    if (pboxNew2)
-	       xfree(pboxNew2);
-	    if (pboxNew1) {
-	       xfree(pptNew1);
-	       xfree(pboxNew1);
-	    }
-	    return;
-	 }
-	 pboxBase = pboxNext = pbox;
-	 while (pboxBase < pbox + nbox) {
-	    while ((pboxNext < pbox + nbox) && (pboxNext->y1 == pboxBase->y1))
-	       pboxNext++;
-	    pboxTmp = pboxNext;
-	    pptTmp = pptSrc + (pboxTmp - pbox);
-	    while (pboxTmp != pboxBase) {
-	       *pboxNew2++ = *--pboxTmp;
-	       *pptNew2++ = *--pptTmp;
-	    }
-	    pboxBase = pboxNext;
-	 }
-	 pboxNew2 -= nbox;
-	 pbox = pboxNew2;
-	 pptNew2 -= nbox;
-	 pptSrc = pptNew2;
-      }
-   } else {
-      /* No changes are needed */
-      xdir = 1;
-   }
-
-   /* SelectBuffer isn't really a good concept for the i810.
-    */
-   I830EmitFlush(pScrn);
-   first_buffer = I830_SELECT_BACK;
-   last_buffer = I830_SELECT_DEPTH;
-
-   for (buffer = first_buffer; buffer <= last_buffer; buffer++) {
-      if (!I830SelectBuffer(pScrn, buffer))
-	 continue;
-      I830SetupForScreenToScreenCopy(pScrn, xdir, ydir, GXcopy, -1, -1);
-      pbox = REGION_RECTS(prgnSrc);
-      nbox = REGION_NUM_RECTS(prgnSrc);
-      for (; nbox--; pbox++) {
-
-	 int x1 = pbox->x1;
-	 int y1 = pbox->y1;
-	 int destx = x1 + dx;
-	 int desty = y1 + dy;
-	 int w = pbox->x2 - x1 + 1;
-	 int h = pbox->y2 - y1 + 1;
-
-	 if (destx < 0)
-	    x1 -= destx, w += destx, destx = 0;
-	 if (desty < 0)
-	    y1 -= desty, h += desty, desty = 0;
-	 if (destx + w > screenwidth)
-	    w = screenwidth - destx;
-	 if (desty + h > screenheight)
-	    h = screenheight - desty;
-	 if (w <= 0)
-	    continue;
-	 if (h <= 0)
-	    continue;
-
-	 if (I810_DEBUG & DEBUG_VERBOSE_DRI)
-	    ErrorF("MoveBuffers %d,%d %dx%d dx: %d dy: %d\n",
-		   x1, y1, w, h, dx, dy);
-
-	 I830SubsequentScreenToScreenCopy(pScrn, x1, y1, destx, desty, w, h);
-      }
-   }
-
-   I830SelectBuffer(pScrn, I830_SELECT_FRONT);
-   I830EmitFlush(pScrn);
-
-   if (pboxNew2) {
-      xfree(pptNew2);
-      xfree(pboxNew2);
-   }
-   if (pboxNew1) {
-      xfree(pptNew1);
-      xfree(pboxNew1);
-   }
-   i830MarkSync(pScrn);
-}
-
-static void
-I830DRITransitionTo3d(ScreenPtr pScreen)
-{
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-   I830Ptr pI830 = I830PTR(pScrn);
-
-   pI830->want_vblank_interrupts = TRUE;
-   I830DRISetVBlankInterrupt(pScrn, TRUE);
-}
-
-static void
-I830DRITransitionTo2d(ScreenPtr pScreen)
-{
-   ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
-   I830Ptr pI830 = I830PTR(pScrn);
-
-   pI830->want_vblank_interrupts = FALSE;
-   I830DRISetVBlankInterrupt(pScrn, FALSE);
-}
-
-static int
-i830_name_buffer (ScrnInfoPtr pScrn, i830_memory *mem)
-{
-    if (mem && mem->bo)
-    {
-	if (!mem->gem_name)
-	{
-	    int ret;
-	    ret = dri_bo_flink(mem->bo, &mem->gem_name);
-	    if (ret != 0)
-	    {
-		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-			   "[drm] failed to name buffer %d\n", -errno);
-		return -1;
-	    }
-	}
-	return mem->gem_name;
-    }
-    return -1;
-}
-
-/**
- * Update the SAREA fields with current buffer information.
- *
- * Most of the SAREA fields are already updated by i830_do_addmap().
- *
- * This does include other SAREA initialization which will actually be constant
- * over the lifetime of the server.
- */
-static void
-i830_update_sarea(ScrnInfoPtr pScrn, drmI830Sarea *sarea)
-{
-   ScreenPtr pScreen = pScrn->pScreen;
-   I830Ptr pI830 = I830PTR(pScrn);
-
-   if (pI830->directRenderingType == DRI_DRI2)
-       return;
-
-   sarea->width = pScreen->width;
-   sarea->height = pScreen->height;
-   sarea->pitch = pScrn->displayWidth;
-   sarea->virtualX = pScrn->virtualX;
-   sarea->virtualY = pScrn->virtualY;
-
-   sarea->front_tiled = (pI830->front_buffer->tiling != TILE_NONE);
-   sarea->back_tiled = (pI830->back_buffer->tiling != TILE_NONE);
-   sarea->depth_tiled = (pI830->depth_buffer->tiling != TILE_NONE);
-   sarea->rotated_tiled = FALSE;
-
-   sarea->log_tex_granularity = pI830->TexGranularity;
-
-   sarea->front_bo_handle = i830_name_buffer (pScrn, pI830->front_buffer);
-   sarea->back_bo_handle = i830_name_buffer (pScrn, pI830->back_buffer);
-   sarea->depth_bo_handle = i830_name_buffer (pScrn, pI830->depth_buffer);
-
-   /* The rotation is now handled entirely by the X Server, so just leave the
-    * DRI unaware.
-    */
-   sarea->rotation = 0;
-   sarea->rotated_offset = -1;
-   sarea->rotated_size = 0;
-   sarea->rotated_pitch = pScrn->displayWidth;
-}
-
-/**
- * Updates the DRI mapping for the given i830_memory struct, with the given
- * flags.
- */
-static int
-i830_do_addmap(ScrnInfoPtr pScrn, i830_memory *mem,
-	       drm_handle_t *sarea_handle, int *sarea_size, int *sarea_offset)
-{
-    I830Ptr pI830 = I830PTR(pScrn);
-    int size = mem->size;
-
-    if (mem == pI830->front_buffer) {
-	/* Workaround for XAA pixmap cache: Don't use front_buffer->size
-	 * and instead, calculate the visible frontbuffer size and round to
-	 * avoid irritating the assertions of older DRI drivers.
-	 */
-	size = ROUND_TO_PAGE(pScrn->displayWidth * pScrn->virtualY *
-			     pI830->cpp);
-    }
-
-    if (*sarea_handle != 0 &&
-	(*sarea_size != size || *sarea_offset != mem->offset))
-    {
-	drmRmMap(pI830->drmSubFD, *sarea_handle);
-	*sarea_handle = 0;
-	*sarea_size = 0;
-	*sarea_offset = 0;
-    }
-
-    if (*sarea_handle == 0) {
-	int ret;
-
-	ret = drmAddMap(pI830->drmSubFD,
-			(drm_handle_t)(mem->offset + pI830->LinearAddr),
-			size, DRM_AGP, 0,
-			(drmAddress) sarea_handle);
-	if (ret == 0) {
-	    xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-		       "[drm] mapped %s at 0x%08lx, handle = 0x%08x\n",
-		       mem->name, mem->offset + pI830->LinearAddr,
-		       (int)*sarea_handle);
-	    *sarea_size = size;
-	    *sarea_offset = mem->offset;
-	} else {
-	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		       "[drm] failed to map %s at 0x%08lx\n",
-		       mem->name, mem->offset + pI830->LinearAddr);
-	    return FALSE;
-	}
-    }
-
-    return TRUE;
-}
-
-/**
- * Updates the DRM mappings with the current buffer information.
- *
- * Some old DRI drivers may be unprepared for buffers actually moving at
- * runtime, which would likely result in bus errors on software fallbacks or
- * hangs or misrendering on hardware rendering.
- */
-static Bool
-i830_update_dri_mappings(ScrnInfoPtr pScrn, drmI830Sarea *sarea)
-{
-   I830Ptr pI830 = I830PTR(pScrn);
-
-   if (!i830_do_addmap(pScrn, pI830->front_buffer, &sarea->front_handle,
-		       &sarea->front_size, &sarea->front_offset)) {
-       xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Disabling DRI.\n");
-       return FALSE;
-   }
-
-   if (!i830_do_addmap(pScrn, pI830->back_buffer, &sarea->back_handle,
-		       &sarea->back_size, &sarea->back_offset)) {
-       xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Disabling DRI.\n");
-       return FALSE;
-   }
-
-   sarea->third_handle = 0;
-   sarea->third_offset = 0;
-   sarea->third_size = 0;
-
-   if (!i830_do_addmap(pScrn, pI830->depth_buffer, &sarea->depth_handle,
-		       &sarea->depth_size, &sarea->depth_offset)) {
-       xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Disabling DRI.\n");
-       return FALSE;
-   }
-
-   if (pI830->allocate_classic_textures) {
-       if (!i830_do_addmap(pScrn, pI830->textures, &sarea->tex_handle,
-			   &sarea->tex_size, &sarea->tex_offset)) {
-	   xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Disabling DRI.\n");
-	   return FALSE;
-       }
-   }
-
-   return TRUE;
-}
-
-static void
-i830_update_screen_private(ScrnInfoPtr pScrn, drmI830Sarea *sarea)
-{
-   I830Ptr pI830 = I830PTR(pScrn);
-
-   pI830->pDRIInfo->frameBufferPhysicalAddress = (char *) pI830->LinearAddr;
-   pI830->pDRIInfo->frameBufferStride = pScrn->displayWidth * pI830->cpp;
-   pI830->pDRIInfo->frameBufferSize = sarea->front_size;
-#if DRI_DRIVER_FRAMEBUFFER_MAP
-   pI830->pDRIInfo->hFrameBuffer = sarea->front_handle;
-#endif
-}
-
-/**
- * Update the SAREA fields, DRI mappings, and screen info passed through the
- * protocol.
- *
- * This gets called both at startup and after any of the buffers might have
- * been relocated.
- */
-Bool
-i830_update_dri_buffers(ScrnInfoPtr pScrn)
-{
-   ScreenPtr pScreen = pScrn->pScreen;
-   I830Ptr pI830 = I830PTR(pScrn);
-   drmI830Sarea *sarea;
-   Bool success;
-
-   if (pI830->directRenderingType != DRI_XF86DRI)
-       return TRUE;
-
-   sarea = (drmI830Sarea *) DRIGetSAREAPrivate(pScreen);
-
-   success = i830_update_dri_mappings(pScrn, sarea);
-   if (!success)
-       return FALSE;
-   i830_update_sarea(pScrn, sarea);
-   i830_update_screen_private(pScrn, sarea);
-
-   return TRUE;
-}
-
-Bool
-I830DRISetVBlankInterrupt (ScrnInfoPtr pScrn, Bool on)
-{
-    I830Ptr pI830 = I830PTR(pScrn);
-    xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
-    drmI830VBlankPipe pipe;
-
-    /* If we have no 3d running, then don't bother enabling the vblank
-     * interrupt.
-     */
-    if (!pI830->want_vblank_interrupts)
-	on = FALSE;
-
-    if (pI830->directRenderingType == DRI_XF86DRI && pI830->drmMinor >= 5) {
-	if (on) {
-	    if (xf86_config->num_crtc > 1 && xf86_config->crtc[1]->enabled)
-		if (pI830->drmMinor >= 6)
-		    pipe.pipe = DRM_I830_VBLANK_PIPE_A | DRM_I830_VBLANK_PIPE_B;
-		else
-		    pipe.pipe = DRM_I830_VBLANK_PIPE_B;
-	    else
-		pipe.pipe = DRM_I830_VBLANK_PIPE_A;
-	} else {
-	    pipe.pipe = 0;
-	}
-	if (drmCommandWrite(pI830->drmSubFD, DRM_I830_SET_VBLANK_PIPE,
-			    &pipe, sizeof (pipe))) {
-	    return FALSE;
-	}
-    }
-
-    return TRUE;
-}
-
-Bool
-I830DRILock(ScrnInfoPtr pScrn)
-{
-   I830Ptr pI830 = I830PTR(pScrn);
-
-   if (pI830->directRenderingType == DRI_XF86DRI && !pI830->LockHeld) {
-      DRILock(screenInfo.screens[pScrn->scrnIndex], 0);
-      pI830->LockHeld = 1;
-      if (!pI830->memory_manager)
-	  i830_refresh_ring(pScrn);
-      return TRUE;
-   }
-   else
-      return FALSE;
-}
-
-
-
-void
-I830DRIUnlock(ScrnInfoPtr pScrn)
-{
-   I830Ptr pI830 = I830PTR(pScrn);
-
-   if (pI830->directRenderingType == DRI_XF86DRI && pI830->LockHeld) {
-      DRIUnlock(screenInfo.screens[pScrn->scrnIndex]);
-      pI830->LockHeld = 0;
-   }
-}
-
-#ifdef DRI2
-
 typedef struct {
     PixmapPtr pPixmap;
     unsigned int attachment;
@@ -1901,5 +467,3 @@ void I830DRI2CloseScreen(ScreenPtr pScreen)
     DRI2CloseScreen(pScreen);
     pI830->directRenderingType = DRI_NONE;
 }
-
-#endif
diff --git a/src/i830_driver.c b/src/i830_driver.c
index e0dbe77..f8373a8 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -206,11 +206,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "i830_hwmc.h"
 #endif
 
-#ifdef XF86DRI
-#include "dri.h"
 #include <sys/ioctl.h>
 #include "i915_drm.h"
-#endif
 
 #ifdef XF86DRM_MODE
 #include <xf86drmMode.h>
@@ -1624,7 +1621,6 @@ I830AccelMethodInit(ScrnInfoPtr pScrn)
     if (!xf86ReturnOptValBool(pI830->Options, OPTION_DRI, TRUE))
 	pI830->directRenderingType = DRI_DISABLED;
 
-#ifdef XF86DRI
     if (pI830->accel == ACCEL_NONE) {
 	xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "DRI is disabled because it "
 		"needs 2D acceleration.\n");
@@ -1634,7 +1630,6 @@ I830AccelMethodInit(ScrnInfoPtr pScrn)
 		"runs only at depths 16 and 24.\n");
 	pI830->directRenderingType = DRI_DISABLED;
     }
-#endif /* XF86DRI */
 
     I830MapMMIO(pScrn);
 
@@ -1664,12 +1659,8 @@ I830AccelMethodInit(ScrnInfoPtr pScrn)
 
     SaveHWState(pScrn);
     pI830->can_resize = FALSE;
-    if (pI830->accel == ACCEL_UXA && pI830->directRenderingType != DRI_XF86DRI)
+    if (pI830->accel == ACCEL_UXA)
 	pI830->can_resize = TRUE;
-#if !defined(DRI2) && defined(XF86DRI)
-    /* Disable resizing so that DRI1 can initialize and give us GEM support. */
-    pI830->can_resize = FALSE;
-#endif
 
     xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 	       "Resizable framebuffer: %s (%d %d)\n",
@@ -1711,7 +1702,7 @@ I830DrmModeInit(ScrnInfoPtr pScrn)
     }
 
     pI830->can_resize = FALSE;
-    if (pI830->accel == ACCEL_UXA && pI830->directRenderingType != DRI_XF86DRI)
+    if (pI830->accel == ACCEL_UXA)
 	pI830->can_resize = TRUE;
 
     xf86DrvMsg(pScrn->scrnIndex, X_INFO,
@@ -1741,7 +1732,6 @@ I830DrmModeInit(ScrnInfoPtr pScrn)
     }
 
     pI830->directRenderingType = DRI_NONE;
-    pI830->allocate_classic_textures = FALSE;
 
     i830_init_bufmgr(pScrn);
 #endif
@@ -1973,23 +1963,11 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
        xf86SetOperatingState(resVgaMem, pI830->pEnt->index, ResDisableOpr);
    }
 
-#if defined(XF86DRI)
-   /* Load the dri module if requested. */
-   if (xf86ReturnOptValBool(pI830->Options, OPTION_DRI, FALSE) &&
-       pI830->directRenderingType != DRI_DISABLED) {
-      if (xf86LoadSubModule(pScrn, "dri")) {
-	 xf86LoaderReqSymLists(I810driSymbols, I810drmSymbols, NULL);
-      }
-   }
-#endif
-
-#if defined(DRI2)
    /* Load the dri2 module if requested. */
    if (xf86ReturnOptValBool(pI830->Options, OPTION_DRI, FALSE) &&
        pI830->directRenderingType != DRI_DISABLED) {
        xf86LoadSubModule(pScrn, "dri2");
    }
-#endif
 
    pI830->preinit = FALSE;
 
@@ -2265,9 +2243,6 @@ RestoreHWState(ScrnInfoPtr pScrn)
 
    DPRINTF(PFX, "RestoreHWState\n");
 
-#ifdef XF86DRI
-   I830DRISetVBlankInterrupt (pScrn, FALSE);
-#endif
    /* Disable outputs */
    for (i = 0; i < xf86_config->num_output; i++) {
       xf86OutputPtr   output = xf86_config->output[i];
@@ -2579,16 +2554,6 @@ IntelEmitInvarientState(ScrnInfoPtr pScrn)
    if (pI830->accel == ACCEL_NONE)
       return;
 
-#ifdef XF86DRI
-   if (pI830->directRenderingType == DRI_XF86DRI) {
-      drmI830Sarea *sarea = DRIGetSAREAPrivate(pScrn->pScreen);
-
-      /* Mark that the X Server was the last holder of the context */
-      if (sarea)
-	 sarea->ctxOwner = DRIGetContext(pScrn->pScreen);
-   }
-#endif
-
    /* If we've emitted our state since the last clobber by another client,
     * skip it.
     */
@@ -2635,10 +2600,8 @@ I830BlockHandler(int i,
 	* fashion.
 	*/
        intel_batch_flush(pScrn, flushed);
-#ifdef XF86DRI
        if (pI830->memory_manager)
 	 drmCommandNone(pI830->drmSubFD, DRM_I915_GEM_THROTTLE);
-#endif
 
        pI830->need_mi_flush = FALSE;
     }
@@ -2700,7 +2663,6 @@ i830_try_memory_allocation(ScrnInfoPtr pScrn)
 {
     I830Ptr pI830 = I830PTR(pScrn);
     Bool tiled = pI830->tiling;
-    Bool xf86dri = pI830->directRenderingType == DRI_XF86DRI;
 
     xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 	    "Attempting memory allocation with %stiled buffers.\n",
@@ -2713,9 +2675,6 @@ i830_try_memory_allocation(ScrnInfoPtr pScrn)
 	if (!i830_allocate_pwrctx(pScrn))
 	    goto failed;
 
-    if (xf86dri && !i830_allocate_3d_memory(pScrn))
-	goto failed;
-
     xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%siled allocation successful.\n",
 	    tiled ? "T" : "Unt");
     return TRUE;
@@ -2780,18 +2739,6 @@ i830_memory_init(ScrnInfoPtr pScrn)
 		"disabled\n");
     pI830->fb_compression = FALSE;
 
-    /* Try again, but leave DRI enabled */
-    if (pI830->directRenderingType == DRI_XF86DRI) {
-	if (i830_try_memory_allocation(pScrn))
-	    return TRUE;
-	else {
-	    i830_reset_allocations(pScrn);
-	    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Couldn't allocate 3D memory, "
-		    "disabling DRI.\n");
-	    pI830->directRenderingType = DRI_NONE;
-	}
-    }
-
     if (i830_try_memory_allocation(pScrn))
 	return TRUE;
 
@@ -2901,9 +2848,7 @@ I830SwapPipes(ScrnInfoPtr pScrn)
     *       alone in that case.
     * Also make sure the DRM can handle the swap.
     */
-   if (I830LVDSPresent(pScrn) && !IS_I965GM(pI830) && !IS_GM45(pI830) &&
-       (pI830->directRenderingType != DRI_XF86DRI ||
-	(pI830->directRenderingType == DRI_XF86DRI && pI830->drmMinor >= 10))) {
+   if (I830LVDSPresent(pScrn) && !IS_I965GM(pI830) && !IS_GM45(pI830)) {
        xf86DrvMsg(pScrn->scrnIndex, X_INFO, "adjusting plane->pipe mappings "
 		  "to allow for framebuffer compression\n");
        for (c = 0; c < config->num_crtc; c++) {
@@ -3008,14 +2953,6 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
        pI830->directRenderingType = DRI_DRI2;
 #endif
 
-#ifdef XF86DRI
-   /* If DRI hasn't been explicitly disabled, try to initialize it.
-    * It will be used by the memory allocator.
-    */
-   if (!pI830->can_resize && pI830->directRenderingType == DRI_NONE && I830DRIScreenInit(pScreen))
-       pI830->directRenderingType = DRI_XF86DRI;
-#endif
-
    /* Enable tiling by default */
    pI830->tiling = TRUE;
 
@@ -3115,32 +3052,8 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
    }
    i830_init_bufmgr(pScrn);
 
-#ifdef XF86DRI
-   /*
-    * Setup DRI after visuals have been established, but before fbScreenInit
-    * is called.   fbScreenInit will eventually call into the drivers
-    * InitGLXVisuals call back.
-    */
-   if (pI830->directRenderingType == DRI_XF86DRI) {
-      if (pI830->accel == ACCEL_NONE) {
-	 xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "DRI is disabled because it "
-		    "needs 2D acceleration.\n");
-	 pI830->directRenderingType = DRI_NONE;
-      }
-   }
-
-   if (pI830->directRenderingType == DRI_XF86DRI &&
-       !I830DRIDoMappings(pScreen))
-       pI830->directRenderingType = DRI_NONE;
-
-   /* If we failed for any reason, free DRI memory. */
-   if (pI830->directRenderingType != DRI_XF86DRI &&
-       pI830->back_buffer != NULL)
-       i830_free_3d_memory(pScrn);
-
    if (!pI830->use_drm_mode)
        I830SwapPipes(pScrn);
-#endif
 
    pScrn->fbOffset = pI830->front_buffer->offset;
 
@@ -3219,15 +3132,6 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
       xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 		 "Hardware cursor initialization failed\n");
 
-#ifdef XF86DRI
-   /* Must be called before EnterVT, so we can acquire the DRI lock when
-    * binding our memory.
-    */
-   if (pI830->directRenderingType == DRI_XF86DRI &&
-       !I830DRIFinishScreenInit(pScreen))
-       pI830->directRenderingType = DRI_NONE;
-#endif
-
    /* Must force it before EnterVT, so we are in control of VT and
     * later memory should be bound when allocating, e.g rotate_mem */
    pScrn->vtSema = TRUE;
@@ -3263,9 +3167,8 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
 #ifdef I830_XV
 #ifdef INTEL_XVMC
     pI830->XvMCEnabled = FALSE;
-    from =  (pI830->directRenderingType == DRI_XF86DRI &&
-	     xf86GetOptValBool(pI830->Options, OPTION_XVMC,
-			       &pI830->XvMCEnabled)) ? X_CONFIG : X_DEFAULT;
+    from =  xf86GetOptValBool(pI830->Options, OPTION_XVMC,
+			      &pI830->XvMCEnabled) ? X_CONFIG : X_DEFAULT;
     xf86DrvMsg(pScrn->scrnIndex, from, "Intel XvMC decoder %sabled\n",
 	       pI830->XvMCEnabled ? "en" : "dis");
 #endif
@@ -3277,13 +3180,8 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
    /* Setup 3D engine, needed for rotation too */
    IntelEmitInvarientState(pScrn);
 
-#if defined(XF86DRI) || defined(DRI2)
+#if defined(DRI2)
    switch (pI830->directRenderingType) {
-   case DRI_XF86DRI:
-      pI830->directRenderingOpen = TRUE;
-      xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-		 "direct rendering: XF86DRI Enabled\n");
-      break;
    case DRI_DRI2:
       pI830->directRenderingOpen = TRUE;
       xf86DrvMsg(pScrn->scrnIndex, X_INFO, "direct rendering: DRI2 Enabled\n");
@@ -3374,17 +3272,6 @@ I830LeaveVT(int scrnIndex, int flags)
 
    i830SetHotkeyControl(pScrn, HOTKEY_BIOS_SWITCH);
 
-#ifdef XF86DRI
-   if (pI830->directRenderingOpen &&
-       pI830->directRenderingType == DRI_XF86DRI) {
-      DRILock(screenInfo.screens[pScrn->scrnIndex], 0);
-
-      if (!pI830->memory_manager) {
-	  I830DRISetVBlankInterrupt (pScrn, FALSE);
-	  drmCtlUninstHandler(pI830->drmSubFD);
-      }
-   }
-#endif
 
 #ifndef HAVE_FREE_SHADOW
    for (o = 0; o < config->num_crtc; o++) {
@@ -3426,7 +3313,6 @@ I830LeaveVT(int scrnIndex, int flags)
 
    i830_unbind_all_memory(pScrn);
 
-#ifdef XF86DRI
    if (pI830->memory_manager && !pI830->use_drm_mode) {
       int ret;
 
@@ -3437,7 +3323,6 @@ I830LeaveVT(int scrnIndex, int flags)
       if (ret != 0)
 	 FatalError("DRM_I915_LEAVEVT failed: %s\n", strerror(ret));
    }
-#endif /* XF86DRI */
 
    if ((pI830->accel == ACCEL_EXA || pI830->accel == ACCEL_UXA) && IS_I965G(pI830))
       gen4_render_state_cleanup(pScrn);
@@ -3445,12 +3330,10 @@ I830LeaveVT(int scrnIndex, int flags)
    if (pI830->AccelInfoRec)
       pI830->AccelInfoRec->NeedToSync = FALSE;
 
-#ifdef XF86DRI
    ret = drmDropMaster(pI830->drmSubFD);
    if (ret)
       xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
 		 "drmDropMaster failed: %s\n", strerror(errno));
-#endif
 }
 
 /*
@@ -3466,7 +3349,6 @@ I830EnterVT(int scrnIndex, int flags)
 
    DPRINTF(PFX, "Enter VT\n");
 
-#ifdef XF86DRI
    ret = drmSetMaster(pI830->drmSubFD);
    if (ret) {
       if (errno == EINVAL) {
@@ -3478,7 +3360,6 @@ I830EnterVT(int scrnIndex, int flags)
 		    "drmSetMaster failed: %s\n", strerror(errno));
       }
    }
-#endif
 
    /*
     * Only save state once per server generation since that's what most
@@ -3512,7 +3393,6 @@ I830EnterVT(int scrnIndex, int flags)
    if (!pI830->use_drm_mode)
        i830_disable_render_standby(pScrn);
 
-#ifdef XF86DRI
    if (pI830->memory_manager && !pI830->use_drm_mode) {
       int ret;
 
@@ -3523,7 +3403,6 @@ I830EnterVT(int scrnIndex, int flags)
       if (ret != 0)
 	 FatalError("DRM_I915_ENTERVT failed: %s\n", strerror(ret));
    }
-#endif /* XF86DRI */
 
    if (!i830_bind_all_memory(pScrn))
       return FALSE;
@@ -3575,54 +3454,6 @@ I830EnterVT(int scrnIndex, int flags)
        i830DescribeOutputConfiguration(pScrn);
    }
 
-#ifdef XF86DRI
-   if (pI830->directRenderingType == DRI_XF86DRI) {
-       /* HW status is fixed, we need to set it up before any drm
-	* operation which accessing that page, like irq install, etc.
-	*/
-       if (pI830->starting && !pI830->memory_manager) {
-	   if (pI830->hw_status != NULL && !I830DRISetHWS(pScrn)) {
-		   xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-			   "Fail to setup hardware status page.\n");
-		   I830DRICloseScreen(pScrn->pScreen);
-		   return FALSE;
-	   }
-	   if (!pI830->memory_manager && !I830DRIInstIrqHandler(pScrn)) {
-	       I830DRICloseScreen(pScrn->pScreen);
-	       return FALSE;
-	   }
-       }
-
-      /* Update buffer offsets in sarea and mappings, since buffer offsets
-       * may have changed.
-       */
-      if (!i830_update_dri_buffers(pScrn))
-	 FatalError("i830_update_dri_buffers() failed\n");
-
-      I830DRISetVBlankInterrupt (pScrn, TRUE);
-
-      if (!pI830->starting) {
-         ScreenPtr pScreen = pScrn->pScreen;
-         drmI830Sarea *sarea = (drmI830Sarea *) DRIGetSAREAPrivate(pScreen);
-         int i;
-
-	 I830DRIResume(screenInfo.screens[scrnIndex]);
-
-	 if (!pI830->memory_manager)
-	    i830_refresh_ring(pScrn);
-	 I830Sync(pScrn);
-
-	 sarea->texAge++;
-	 for(i = 0; i < I830_NR_TEX_REGIONS+1 ; i++)
-	    sarea->texList[i].age = sarea->texAge;
-
-	 DPRINTF(PFX, "calling dri unlock\n");
-	 DRIUnlock(screenInfo.screens[pScrn->scrnIndex]);
-      }
-      pI830->LockHeld = 0;
-   }
-#endif
-
    /* Set the hotkey to just notify us.  We could check its results
     * periodically and attempt to do something, but it seems like we basically
     * never get results when we should, and this should all be better handled
@@ -3717,20 +3548,10 @@ I830CloseScreen(int scrnIndex, ScreenPtr pScreen)
    dri_bufmgr_destroy(pI830->bufmgr);
    pI830->bufmgr = NULL;
 
-#ifdef XF86DRI
-   if (pI830->directRenderingOpen &&
-       pI830->directRenderingType == DRI_XF86DRI) {
-      pI830->directRenderingOpen = FALSE;
-      I830DRICloseScreen(pScreen);
-   }
-#endif
-
-#ifdef DRI2
    if (pI830->directRenderingOpen && pI830->directRenderingType == DRI_DRI2) {
       pI830->directRenderingOpen = FALSE;
       I830DRI2CloseScreen(pScreen);
    }
-#endif
 
    xf86GARTCloseScreen(scrnIndex);
 
diff --git a/src/i830_exa.c b/src/i830_exa.c
index 2f74d14..e88d260 100644
--- a/src/i830_exa.c
+++ b/src/i830_exa.c
@@ -737,8 +737,6 @@ I830EXAInit(ScreenPtr pScreen)
 	}
     }
 
-    I830SelectBuffer(pScrn, I830_SELECT_FRONT);
-
     return TRUE;
 }
 
@@ -1043,26 +1041,8 @@ i830_uxa_init (ScreenPtr pScreen)
     pScreen->CreatePixmap = i830_uxa_create_pixmap;
     pScreen->DestroyPixmap = i830_uxa_destroy_pixmap;
 
-    I830SelectBuffer(scrn, I830_SELECT_FRONT);
-
     uxa_set_fallback_debug(pScreen, i830->fallback_debug);
 
     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 760e07c..14b52ed 100644
--- a/src/i830_memory.c
+++ b/src/i830_memory.c
@@ -107,9 +107,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 #include "i830.h"
 #include "i810_reg.h"
-#ifdef XF86DRI
 #include "i915_drm.h"
-#endif
 
 #define ALIGN(i,m)    (((i) + (m) - 1) & ~((m) - 1))
 
@@ -225,7 +223,6 @@ i830_bind_memory(ScrnInfoPtr pScrn, i830_memory *mem)
     if (mem == NULL || mem->bound)
 	return TRUE;
 
-#ifdef XF86DRI
     if (mem->bo != NULL) {
 	if (dri_bo_pin(mem->bo, mem->alignment) != 0) {
 	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
@@ -238,7 +235,6 @@ i830_bind_memory(ScrnInfoPtr pScrn, i830_memory *mem)
 	mem->offset = mem->bo->offset;
 	mem->end = mem->offset + mem->size;
     }
-#endif
 
     if (!mem->bound) {
 	if (!pI830->gtt_acquired)
@@ -274,7 +270,6 @@ i830_unbind_memory(ScrnInfoPtr pScrn, i830_memory *mem)
 	!pI830->kernel_exec_fencing)
 	i830_clear_tiling(pScrn, mem->fence_nr);
 
-#ifdef XF86DRI
     if (mem->bo != NULL) {
 	if (dri_bo_unpin(mem->bo) == 0) {
 	    mem->bound = FALSE;
@@ -286,7 +281,6 @@ i830_unbind_memory(ScrnInfoPtr pScrn, i830_memory *mem)
 	    return FALSE;
 	}
     }
-#endif
 
     if (mem->key == -1 || xf86UnbindGARTMemory(pScrn->scrnIndex, mem->key)) {
 	mem->bound = FALSE;
@@ -305,7 +299,6 @@ i830_free_memory(ScrnInfoPtr pScrn, i830_memory *mem)
     /* Free any AGP memory. */
     i830_unbind_memory(pScrn, mem);
 
-#ifdef XF86DRI
     if (mem->bo != NULL) {
 	I830Ptr pI830 = I830PTR(pScrn);
 	dri_bo_unreference (mem->bo);
@@ -323,7 +316,6 @@ i830_free_memory(ScrnInfoPtr pScrn, i830_memory *mem)
 	xfree(mem);
 	return;
     }
-#endif
 	    /* Disconnect from the list of allocations */
     if (mem->prev != NULL)
 	mem->prev->next = mem->next;
@@ -352,14 +344,12 @@ i830_reset_allocations(ScrnInfoPtr pScrn)
     while (pI830->memory_list->next->next != NULL) {
 	i830_memory *mem = pI830->memory_list->next;
 
-#ifdef XF86DRI
 	/* Don't reset BO allocator, which we set up at init. */
 	if (pI830->memory_manager == mem) {
 	    mem = mem->next;
 	    if (mem->next == NULL)
 		break;
 	}
-#endif	
 
 	i830_free_memory(pScrn, mem);
     }
@@ -383,30 +373,10 @@ i830_reset_allocations(ScrnInfoPtr pScrn)
     pI830->exa_offscreen = NULL;
     pI830->overlay_regs = NULL;
     pI830->power_context = NULL;
-#ifdef XF86DRI
-    pI830->back_buffer = NULL;
-    pI830->depth_buffer = NULL;
-    pI830->textures = NULL;
-#endif
     pI830->ring.mem = NULL;
     pI830->fake_bufmgr_mem = NULL;
 }
 
-void
-i830_free_3d_memory(ScrnInfoPtr pScrn)
-{
-    I830Ptr pI830 = I830PTR(pScrn);
-
-#ifdef XF86DRI
-    i830_free_memory(pScrn, pI830->back_buffer);
-    pI830->back_buffer = NULL;
-    i830_free_memory(pScrn, pI830->depth_buffer);
-    pI830->depth_buffer = NULL;
-    i830_free_memory(pScrn, pI830->textures);
-    pI830->textures = NULL;
-#endif
-}
-
 /**
  * Initialize's the driver's video memory allocator to allocate in the
  * given range.
@@ -421,13 +391,9 @@ i830_allocator_init(ScrnInfoPtr pScrn, unsigned long offset, unsigned long size)
 {
     I830Ptr pI830 = I830PTR(pScrn);
     i830_memory *start, *end;
-#ifdef XF86DRI
-    int dri_major, dri_minor, dri_patch;
     struct drm_i915_getparam gp;
     struct drm_i915_setparam sp;
     int has_gem;
-    int has_dri;
-#endif
 
     start = xcalloc(1, sizeof(*start));
     if (start == NULL)
@@ -464,18 +430,9 @@ i830_allocator_init(ScrnInfoPtr pScrn, unsigned long offset, unsigned long size)
 
     pI830->memory_list = start;
 
-#ifdef XF86DRI
     has_gem = FALSE;
-    has_dri = FALSE;
-    
-    if (pI830->directRenderingType == DRI_XF86DRI &&
-	xf86LoaderCheckSymbol ("DRIQueryVersion"))
-    {
-	DRIQueryVersion(&dri_major, &dri_minor, &dri_patch);
-	has_dri = TRUE;
-    }
 
-    if (pI830->directRenderingType >= DRI_XF86DRI)
+    if (pI830->directRenderingType >= DRI_DRI2)
     {
 	has_gem = FALSE;
 	gp.param = I915_PARAM_HAS_GEM;
@@ -490,10 +447,7 @@ i830_allocator_init(ScrnInfoPtr pScrn, unsigned long offset, unsigned long size)
      * 5.4 or newer so we can rely on the lock being held after DRIScreenInit,
      * rather than after DRIFinishScreenInit.
      */
-    if ((pI830->directRenderingType == DRI_XF86DRI && has_gem && has_dri &&
-	(dri_major > 5 || (dri_major == 5 && dri_minor >= 4))) ||
-	(pI830->directRenderingType == DRI_DRI2 && has_gem))
-    {
+    if (pI830->directRenderingType == DRI_DRI2 && has_gem) {
 	int mmsize;
 
 	/* Take over all of the graphics aperture minus enough to for
@@ -562,10 +516,7 @@ i830_allocator_init(ScrnInfoPtr pScrn, unsigned long offset, unsigned long size)
 	    i830_free_memory(pScrn, pI830->memory_manager);
 	    pI830->memory_manager = NULL;
 	}
-    } else {
-	pI830->allocate_classic_textures = TRUE;
     }
-#endif /* XF86DRI */
 
     return TRUE;
 }
@@ -580,7 +531,6 @@ i830_allocator_fini(ScrnInfoPtr pScrn)
 
     /* The memory manager is more special */
     if (pI830->memory_manager) {
-	 /* XXX drmMMTakedown(pI830->drmSubFD, DRM_BO_MEM_TT);*/
 	 i830_free_memory(pScrn, pI830->memory_manager);
 	 pI830->memory_manager = NULL;
     }
@@ -798,7 +748,6 @@ i830_allocate_agp_memory(ScrnInfoPtr pScrn, i830_memory *mem, int flags)
     return TRUE;
 }
 
-#ifdef XF86DRI
 static i830_memory *
 i830_allocate_memory_bo(ScrnInfoPtr pScrn, const char *name,
 			unsigned long size, unsigned long pitch,
@@ -886,7 +835,6 @@ i830_allocate_memory_bo(ScrnInfoPtr pScrn, const char *name,
 
     return mem;
 }
-#endif /* XF86DRI */
 
 /* Allocates video memory at the given size, pitch, alignment and tile format.
  *
@@ -913,9 +861,7 @@ i830_allocate_memory(ScrnInfoPtr pScrn, const char *name,
 		     enum tile_format tile_format)
 {
     i830_memory *mem;
-#ifdef XF86DRI
     I830Ptr pI830 = I830PTR(pScrn);
-#endif
 
     /* Manage tile alignment and size constraints */
     if (tile_format != TILE_NONE) {
@@ -935,14 +881,12 @@ i830_allocate_memory(ScrnInfoPtr pScrn, const char *name,
 	size = i830_get_fence_size(pI830, size);
 	alignment = i830_get_fence_alignment(pI830, size);
     }
-#ifdef XF86DRI
     if (pI830->use_drm_mode || (pI830->memory_manager &&
 				!(flags & NEED_PHYSICAL_ADDR) &&
 				!(flags & NEED_LIFETIME_FIXED)))
     {
 	return i830_allocate_memory_bo(pScrn, name, size, pitch, alignment, flags, tile_format);
     } else
-#endif /* XF86DRI */
     {
 	mem = i830_allocate_aperture(pScrn, name, size, pitch, alignment, flags, tile_format);
 	if (mem == NULL)
@@ -1517,167 +1461,6 @@ i830_allocate_2d_memory(ScrnInfoPtr pScrn)
     return TRUE;
 }
 
-#ifdef XF86DRI
-static unsigned int
-myLog2(unsigned int n)
-{
-    unsigned int log2 = 1;
-
-    while (n > 1) {
-	n >>= 1;
-	log2++;
-    }
-    return log2;
-}
-
-static Bool
-i830_allocate_backbuffer(ScrnInfoPtr pScrn, i830_memory **buffer,
-			 const char *name)
-{
-    I830Ptr pI830 = I830PTR(pScrn);
-    unsigned int pitch = pScrn->displayWidth * pI830->cpp;
-    unsigned long size;
-    int height;
-    enum tile_format tile_format = TILE_NONE;;
-
-    if (pI830->rotation & (RR_Rotate_0 | RR_Rotate_180))
-	height = pScrn->virtualY;
-    else
-	height = pScrn->virtualX;
-
-    /* Try to allocate on the best tile-friendly boundaries. */
-    if (pI830->tiling && IsTileable(pScrn, pitch))
-    {
-	size = ROUND_TO_PAGE(pitch * ALIGN(height, 16));
-	tile_format = TILE_XMAJOR;
-    }
-    else
-    {
-	size = ROUND_TO_PAGE(pitch * height);
-	tile_format = TILE_NONE;
-    }
-    *buffer = i830_allocate_memory(pScrn, name, size, pitch,
-				   GTT_PAGE_SIZE,
-				   ALIGN_BOTH_ENDS |
-				   ALLOW_SHARING,
-				   tile_format);
-
-    if (*buffer == NULL) {
-	xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-		   "Failed to allocate %s space.\n", name);
-	return FALSE;
-    }
-
-    return TRUE;
-}
-
-static Bool
-i830_allocate_depthbuffer(ScrnInfoPtr pScrn)
-{
-    I830Ptr pI830 = I830PTR(pScrn);
-    unsigned long size;
-    unsigned int pitch = pScrn->displayWidth * pI830->cpp;
-    int height;
-    int flags;
-    enum tile_format tile_format = TILE_NONE;
-
-    height = pScrn->virtualY;
-
-    /* First try allocating it tiled */
-    flags = ALLOW_SHARING;
-    if (pI830->tiling && IsTileable(pScrn, pitch))
-    {
-	/* The 965 requires that the depth buffer be in Y Major format, while
-	 * the rest appear to fail when handed that format.
-	 */
-	tile_format = IS_I965G(pI830) ? TILE_YMAJOR: TILE_XMAJOR;
-	height = ALIGN(height, 16);
-	flags |= ALIGN_BOTH_ENDS;
-    }
-    size = ROUND_TO_PAGE(pitch * height);
-
-    pI830->depth_buffer =
-	    i830_allocate_memory(pScrn, "depth buffer", size, pitch,
-				 GTT_PAGE_SIZE, flags, tile_format);
-
-    if (pI830->depth_buffer == NULL) {
-	xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-		   "Failed to allocate depth buffer space.\n");
-	return FALSE;
-    }
-
-    return TRUE;
-}
-
-static Bool
-i830_allocate_texture_memory(ScrnInfoPtr pScrn)
-{
-    I830Ptr pI830 = I830PTR(pScrn);
-    unsigned long size;
-    int i;
-
-    if (pI830->allocate_classic_textures) {
-	/* XXX: auto-sizing */
-	size = MB(32);
-	i = myLog2(size / I830_NR_TEX_REGIONS);
-	if (i < I830_LOG_MIN_TEX_REGION_SIZE)
-	    i = I830_LOG_MIN_TEX_REGION_SIZE;
-	pI830->TexGranularity = i;
-	/* Truncate size */
-	size >>= i;
-	size <<= i;
-	if (size < KB(512)) {
-	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-		       "Less than 512 kBytes for texture space (real %ld"
-		       "kBytes).\n",
-		       size / 1024);
-	    return FALSE;
-	}
-	/* Now that the DRM uses the sarea to get the offsets of the buffers,
-	 * and we update the classic DRM mappings and the sarea contents on
-	 * changes, the NEED_LIFETIME_FIXED is no longer true and should be
-	 * made conditional on DRM version.
-	 */
-	pI830->textures = i830_allocate_memory(pScrn, "classic textures", size,
-					       PITCH_NONE,
-					       GTT_PAGE_SIZE,
-					       ALLOW_SHARING |
-					       NEED_LIFETIME_FIXED,
-					       TILE_NONE);
-	if (pI830->textures == NULL) {
-	    xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-		       "Failed to allocate texture space.\n");
-	    return FALSE;
-	}
-    }
-
-    return TRUE;
-}
-
-static Bool
-i830_allocate_hwstatus(ScrnInfoPtr pScrn)
-{
-    I830Ptr pI830 = I830PTR(pScrn);
-    int flags;
-
-    /* The current DRM will leak the HWS mapping if we update the address
-     * after init (at best), so allocate it fixed for its lifetime
-     * (i.e. not through buffer objects).
-     */
-    flags = NEED_LIFETIME_FIXED;
-    if (HWS_NEED_NONSTOLEN(pI830))
-	    flags |= NEED_NON_STOLEN;
-    pI830->hw_status = i830_allocate_memory(pScrn, "HW status",
-	    HWSTATUS_PAGE_SIZE, PITCH_NONE, GTT_PAGE_SIZE, flags,
-					    TILE_NONE);
-    if (pI830->hw_status == NULL) {
-	xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-		"Failed to allocate hw status page.\n");
-	return FALSE;
-    }
-    return TRUE;
-}
-
 Bool
 i830_allocate_pwrctx(ScrnInfoPtr pScrn)
 {
@@ -1699,31 +1482,6 @@ i830_allocate_pwrctx(ScrnInfoPtr pScrn)
     return TRUE;
 }
 
-Bool
-i830_allocate_3d_memory(ScrnInfoPtr pScrn)
-{
-    I830Ptr pI830 = I830PTR(pScrn);
-
-    DPRINTF(PFX, "i830_allocate_3d_memory\n");
-
-    if (!pI830->memory_manager && HWS_NEED_GFX(pI830)) {
-	if (!i830_allocate_hwstatus(pScrn))
-	    return FALSE;
-    }
-
-    if (!i830_allocate_backbuffer(pScrn, &pI830->back_buffer, "back buffer"))
-	return FALSE;
-
-    if (!i830_allocate_depthbuffer(pScrn))
-	return FALSE;
-
-    if (!i830_allocate_texture_memory(pScrn))
-	return FALSE;
-
-    return TRUE;
-}
-#endif
-
 /**
  * Sets up tiled surface registers ("fences") for the hardware.
  *
diff --git a/src/i830_xaa.c b/src/i830_xaa.c
index ede7cc2..a118055 100644
--- a/src/i830_xaa.c
+++ b/src/i830_xaa.c
@@ -249,27 +249,7 @@ I830CheckTiling(ScrnInfoPtr pScrn)
 {
    I830Ptr pI830 = I830PTR(pScrn);
 
-   if (pI830->bufferOffset == pI830->front_buffer->offset &&
-       pI830->front_buffer->tiling != TILE_NONE)
-   {
-       return TRUE;
-   }
-#ifdef XF86DRI
-   if (pI830->back_buffer != NULL &&
-       pI830->bufferOffset == pI830->back_buffer->offset &&
-       pI830->back_buffer->tiling != TILE_NONE)
-   {
-       return TRUE;
-   }
-   if (pI830->depth_buffer != NULL &&
-       pI830->bufferOffset == pI830->depth_buffer->offset &&
-       pI830->depth_buffer->tiling != TILE_NONE)
-   {
-       return TRUE;
-   }
-#endif
-
-   return FALSE;
+   return pI830->front_buffer->tiling != TILE_NONE;
 }
 
 void
@@ -331,7 +311,7 @@ I830SubsequentSolidFillRect(ScrnInfoPtr pScrn, int x, int y, int w, int h)
 	}
 	OUT_BATCH(pI830->BR[13]);
 	OUT_BATCH((h << 16) | (w * pI830->cpp));
-	OUT_BATCH(pI830->bufferOffset + (y * pScrn->displayWidth + x) *
+	OUT_BATCH(pI830->front_buffer->offset + (y * pScrn->displayWidth + x) *
 		  pI830->cpp);
 	OUT_BATCH(pI830->BR[16]);
 	OUT_BATCH(0);
@@ -409,10 +389,10 @@ I830SubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int src_x1, int src_y1,
 	OUT_BATCH(pI830->BR[13]);
 	OUT_BATCH((dst_y1 << 16) | (dst_x1 & 0xffff));
 	OUT_BATCH((dst_y2 << 16) | (dst_x2 & 0xffff));
-	OUT_BATCH(pI830->bufferOffset);
+	OUT_BATCH(pI830->front_buffer->offset);
 	OUT_BATCH((src_y1 << 16) | (src_x1 & 0xffff));
 	OUT_BATCH(pI830->BR[13] & 0xFFFF);
-	OUT_BATCH(pI830->bufferOffset);
+	OUT_BATCH(pI830->front_buffer->offset);
 
 	ADVANCE_BATCH();
     }
@@ -490,7 +470,7 @@ I830SubsequentMono8x8PatternFillRect(ScrnInfoPtr pScrn, int pattx, int patty,
 	OUT_BATCH(pI830->BR[13]);
 	OUT_BATCH((y1 << 16) | x1);
 	OUT_BATCH((y2 << 16) | x2);
-	OUT_BATCH(pI830->bufferOffset);
+	OUT_BATCH(pI830->front_buffer->offset);
 	OUT_BATCH(pI830->BR[18]);		/* bg */
 	OUT_BATCH(pI830->BR[19]);		/* fg */
 	OUT_BATCH(pI830->BR[16]);		/* pattern data */
@@ -571,7 +551,7 @@ I830SubsequentScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn,
 	       "%d,%d %dx%x %d\n", x, y, w, h, skipleft);
 
     /* Fill out register values */
-    pI830->BR[9] = (pI830->bufferOffset +
+    pI830->BR[9] = (pI830->front_buffer->offset +
 		    (y * pScrn->displayWidth + x) * pI830->cpp);
     pI830->BR[11] = ((1 << 16) | w);
 }
@@ -662,7 +642,7 @@ I830SubsequentScanlineImageWriteRect(ScrnInfoPtr pScrn, int x, int y,
 	       "%d,%d %dx%x %d\n", x, y, w, h, skipleft);
 
     /* Fill out register values */
-    pI830->BR[9] = (pI830->bufferOffset +
+    pI830->BR[9] = (pI830->front_buffer->offset +
 		    (y * pScrn->displayWidth + x) * pI830->cpp);
     pI830->BR[11] = ((1 << 16) | w);
 }
commit 47591334a183881704a121ae06ebc2fadebe6f73
Author: Eric Anholt <eric at anholt.net>
Date:   Fri Apr 17 13:54:47 2009 -0700

    Remove pre-server-1.5 support.

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 9b99110..26f4bda 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -936,10 +936,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 9896d43..2f74d14 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.
  *
@@ -919,11 +907,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)
     {
@@ -968,18 +952,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)
 {
@@ -1012,13 +984,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) {
@@ -1073,11 +1040,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 3b3a350..3d2b776 100644
--- a/uxa/uxa-priv.h
+++ b/uxa/uxa-priv.h
@@ -139,10 +139,6 @@ typedef struct {
     CloseScreenProcPtr 		 SavedCloseScreen;
     GetImageProcPtr 		 SavedGetImage;
     GetSpansProcPtr 		 SavedGetSpans;
-#ifndef SERVER_1_5
-    PaintWindowBackgroundProcPtr SavedPaintWindowBackground;
-    PaintWindowBorderProcPtr	 SavedPaintWindowBorder;
-#endif
     CreatePixmapProcPtr 	 SavedCreatePixmap;
     DestroyPixmapProcPtr 	 SavedDestroyPixmap;
     CopyWindowProcPtr 		 SavedCopyWindow;
@@ -181,12 +177,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);


More information about the xorg-commit mailing list