[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-video-ati: Changes to 'upstream-experimental'



 Makefile.am                         |    2 
 configure.ac                        |   41 
 man/radeon.man                      |    9 
 src/Makefile.am                     |   10 
 src/ati.c                           |   49 
 src/ati_pciids_gen.h                |    4 
 src/atipcirename.h                  |   47 
 src/drmmode_display.c               |   28 
 src/evergreen_exa.c                 |   29 
 src/evergreen_textured_videofuncs.c |   14 
 src/pcidb/ati_pciids.csv            |    4 
 src/r600_exa.c                      |   32 
 src/r600_textured_videofuncs.c      |   14 
 src/radeon.h                        |   22 
 src/radeon_chipinfo_gen.h           |    4 
 src/radeon_chipset_gen.h            |    4 
 src/radeon_dri2.c                   |  350 ++----
 src/radeon_dri2.h                   |    2 
 src/radeon_driver.c                 |    4 
 src/radeon_exa.c                    |   27 
 src/radeon_exa_funcs.c              |   31 
 src/radeon_exa_render.c             |   40 
 src/radeon_exa_shared.c             |    3 
 src/radeon_glamor.c                 |   88 -
 src/radeon_glamor.h                 |    7 
 src/radeon_glamor_wrappers.c        | 1870 ------------------------------------
 src/radeon_glamor_wrappers.h        |  178 ---
 src/radeon_kms.c                    |   53 -
 src/radeon_pci_chipset_gen.h        |    4 
 src/radeon_pci_device_match_gen.h   |    4 
 src/radeon_probe.c                  |   71 -
 src/radeon_textured_videofuncs.c    |   32 
 src/radeon_video.c                  |   86 -
 src/radeon_video.h                  |    2 
 34 files changed, 242 insertions(+), 2923 deletions(-)

New commits:
commit 21a4f3eaca98c1c54bffcdf3926c631cec9c409d
Author: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Date:   Wed Jan 30 16:55:27 2013 +0100

    radeon: bump version for release
    
    And fixup distcheck..
    
    Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>

diff --git a/Makefile.am b/Makefile.am
index 4c278ba..f4f4233 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -29,4 +29,4 @@ INSTALL:
 ChangeLog:
 	$(CHANGELOG_CMD)
 
-dist-hook: ChangeLog INSTALL
+EXTRA_DIST = ChangeLog INSTALL
diff --git a/configure.ac b/configure.ac
index d7d5c72..d73fbb8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-ati],
-        [7.0.99],
+        [7.1.0],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-ati])
 

commit 102ee4a24e4c9ba0c0b65d3ca8599dc7e0216c1e
Author: Alex Deucher <alexdeucher@gmail.com>
Date:   Fri Jan 11 09:52:32 2013 -0500

    radeon/r200: program RE_WIDTH_HEIGHT properly
    
    Values are inclusive.  Mesa already sets these
    correctly.  Also bump EXA/Xv limits from 2047 to
    2048.
    
    Signed-off-by: Alex Deucher <alexdeucher@gmail.com>

diff --git a/src/radeon_exa_render.c b/src/radeon_exa_render.c
index 263a2b4..1f6b86d 100644
--- a/src/radeon_exa_render.c
+++ b/src/radeon_exa_render.c
@@ -473,8 +473,8 @@ static Bool R100CheckComposite(int op, PicturePtr pSrcPicture,
 
     pDstPixmap = RADEONGetDrawablePixmap(pDstPicture->pDrawable);
 
-    if (pDstPixmap->drawable.width > 2047 ||
-	pDstPixmap->drawable.height > 2047) {
+    if (pDstPixmap->drawable.width > 2048 ||
+	pDstPixmap->drawable.height > 2048) {
 	RADEON_FALLBACK(("Dest w/h too large (%d,%d).\n",
 			 pDstPixmap->drawable.width,
 			 pDstPixmap->drawable.height));
@@ -486,8 +486,8 @@ static Bool R100CheckComposite(int op, PicturePtr pSrcPicture,
 	 */
 	pSrcPixmap = RADEONGetDrawablePixmap(pSrcPicture->pDrawable);
 
-	if (pSrcPixmap->drawable.width > 2047 ||
-	    pSrcPixmap->drawable.height > 2047) {
+	if (pSrcPixmap->drawable.width > 2048 ||
+	    pSrcPixmap->drawable.height > 2048) {
 	    RADEON_FALLBACK(("Source w/h too large (%d,%d).\n",
 			     pSrcPixmap->drawable.width,
 			     pSrcPixmap->drawable.height));
@@ -501,8 +501,8 @@ static Bool R100CheckComposite(int op, PicturePtr pSrcPicture,
 	if (pMaskPicture->pDrawable) {
 	    pMaskPixmap = RADEONGetDrawablePixmap(pMaskPicture->pDrawable);
 
-	    if (pMaskPixmap->drawable.width > 2047 ||
-		pMaskPixmap->drawable.height > 2047) {
+	    if (pMaskPixmap->drawable.width > 2048 ||
+		pMaskPixmap->drawable.height > 2048) {
 		RADEON_FALLBACK(("Mask w/h too large (%d,%d).\n",
 				 pMaskPixmap->drawable.width,
 				 pMaskPixmap->drawable.height));
@@ -692,8 +692,8 @@ static Bool R100PrepareComposite(int op,
     OUT_RING_REG(RADEON_RB3D_BLENDCNTL, blendcntl);
 
     OUT_RING_REG(RADEON_RE_TOP_LEFT, 0);
-    OUT_RING_REG(RADEON_RE_WIDTH_HEIGHT, (((pDst->drawable.width) << RADEON_RE_WIDTH_SHIFT) |
-					   ((pDst->drawable.height) << RADEON_RE_HEIGHT_SHIFT)));
+    OUT_RING_REG(RADEON_RE_WIDTH_HEIGHT, (((pDst->drawable.width - 1) << RADEON_RE_WIDTH_SHIFT) |
+					   ((pDst->drawable.height - 1) << RADEON_RE_HEIGHT_SHIFT)));
     ADVANCE_RING();
 
     return TRUE;
@@ -872,8 +872,8 @@ static Bool R200CheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskP
 
     pDstPixmap = RADEONGetDrawablePixmap(pDstPicture->pDrawable);
 
-    if (pDstPixmap->drawable.width > 2047 ||
-	pDstPixmap->drawable.height > 2047) {
+    if (pDstPixmap->drawable.width > 2048 ||
+	pDstPixmap->drawable.height > 2048) {
 	RADEON_FALLBACK(("Dest w/h too large (%d,%d).\n",
 			 pDstPixmap->drawable.width,
 			 pDstPixmap->drawable.height));
@@ -885,8 +885,8 @@ static Bool R200CheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskP
 	 */
 	pSrcPixmap = RADEONGetDrawablePixmap(pSrcPicture->pDrawable);
 
-	if (pSrcPixmap->drawable.width > 2047 ||
-	    pSrcPixmap->drawable.height > 2047) {
+	if (pSrcPixmap->drawable.width > 2048 ||
+	    pSrcPixmap->drawable.height > 2048) {
 	    RADEON_FALLBACK(("Source w/h too large (%d,%d).\n",
 			     pSrcPixmap->drawable.width,
 			     pSrcPixmap->drawable.height));
@@ -900,8 +900,8 @@ static Bool R200CheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskP
 	if (pMaskPicture->pDrawable) {
 	    pMaskPixmap = RADEONGetDrawablePixmap(pMaskPicture->pDrawable);
 
-	    if (pMaskPixmap->drawable.width > 2047 ||
-		pMaskPixmap->drawable.height > 2047) {
+	    if (pMaskPixmap->drawable.width > 2048 ||
+		pMaskPixmap->drawable.height > 2048) {
 		RADEON_FALLBACK(("Mask w/h too large (%d,%d).\n",
 				 pMaskPixmap->drawable.width,
 				 pMaskPixmap->drawable.height));
@@ -1063,8 +1063,8 @@ static Bool R200PrepareComposite(int op, PicturePtr pSrcPicture,
     blendcntl = RADEONGetBlendCntl(op, pMaskPicture, pDstPicture->format);
     OUT_RING_REG(RADEON_RB3D_BLENDCNTL, blendcntl);
 
-    OUT_RING_REG(RADEON_RE_WIDTH_HEIGHT, (((pDst->drawable.width) << RADEON_RE_WIDTH_SHIFT) |
-					   ((pDst->drawable.height) << RADEON_RE_HEIGHT_SHIFT)));
+    OUT_RING_REG(RADEON_RE_WIDTH_HEIGHT, (((pDst->drawable.width - 1) << RADEON_RE_WIDTH_SHIFT) |
+					   ((pDst->drawable.height - 1) << RADEON_RE_HEIGHT_SHIFT)));
 
     ADVANCE_RING();
 
diff --git a/src/radeon_textured_videofuncs.c b/src/radeon_textured_videofuncs.c
index cfac902..653de44 100644
--- a/src/radeon_textured_videofuncs.c
+++ b/src/radeon_textured_videofuncs.c
@@ -55,8 +55,8 @@ RADEONPrepareTexturedVideo(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
     uint32_t dst_pitch, dst_format;
     uint32_t colorpitch;
     int pixel_shift;
-    int scissor_w = MIN(pPixmap->drawable.width, 2047);
-    int scissor_h = MIN(pPixmap->drawable.height, 2047);
+    int scissor_w = MIN(pPixmap->drawable.width, 2048) - 1;
+    int scissor_h = MIN(pPixmap->drawable.height, 2048) - 1;
     int ret;
 
     radeon_cs_space_reset_bos(info->cs);
@@ -416,8 +416,8 @@ R200PrepareTexturedVideo(ScrnInfoPtr pScrn, RADEONPortPrivPtr pPriv)
     uint32_t dst_pitch, dst_format;
     uint32_t colorpitch;
     int pixel_shift;
-    int scissor_w = MIN(pPixmap->drawable.width, 2047);
-    int scissor_h = MIN(pPixmap->drawable.height, 2047);
+    int scissor_w = MIN(pPixmap->drawable.width, 2048) - 1;
+    int scissor_h = MIN(pPixmap->drawable.height, 2048) - 1;
     /* note: in contrast to r300, use input biasing on uv components */
     const float Loff = -0.0627;
     float uvcosf, uvsinf;

commit 47689ef8b878a56ea094e21a6090b228e67d605e
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Fri Jan 11 15:41:48 2013 +0100

    Make radeon_glamor_create_textured_pixmap() return TRUE without USE_GLAMOR.
    
    Otherwise rotation won't work when glamor support isn't built in.
    
    Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>

diff --git a/src/radeon_glamor.h b/src/radeon_glamor.h
index 40c9092..cb76ff4 100644
--- a/src/radeon_glamor.h
+++ b/src/radeon_glamor.h
@@ -80,7 +80,7 @@ static inline void radeon_glamor_free_screen(int scrnIndex, int flags) { }
 
 static inline void radeon_glamor_flush(ScrnInfoPtr pScrn) { }
 
-static inline Bool radeon_glamor_create_textured_pixmap(PixmapPtr pixmap) { return FALSE; }
+static inline Bool radeon_glamor_create_textured_pixmap(PixmapPtr pixmap) { return TRUE; }
 
 static inline void radeon_glamor_exchange_buffers(PixmapPtr src, PixmapPtr dst) {}
 

commit 1a8c05fd5559be842d8a038df73de34d4b261c15
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Fri Jan 11 13:22:24 2013 +0100

    Make CRTC shadow pixmaps usable by glamor.
    
    Fixes rotation with glamor.
    
    Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index e4757ad..0d73856 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -140,6 +140,11 @@ static PixmapPtr drmmode_create_bo_pixmap(ScrnInfoPtr pScrn,
 		}
 	}
 
+	if (!radeon_glamor_create_textured_pixmap(pixmap)) {
+		pScreen->DestroyPixmap(pixmap);
+	  	return NULL;
+	}
+
 	return pixmap;
 }
 
diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c
index c232cc2..5a7561f 100644
--- a/src/radeon_glamor.c
+++ b/src/radeon_glamor.c
@@ -131,6 +131,8 @@ radeon_glamor_create_textured_pixmap(PixmapPtr pixmap)
 		return TRUE;
 
 	priv = radeon_get_pixmap_private(pixmap);
+	if (!priv->stride)
+		priv->stride = pixmap->devKind;
 	if (glamor_egl_create_textured_pixmap(pixmap, priv->bo->handle,
 					      priv->stride))
 		return TRUE;

commit e5e22d788b103c04d3460a221a3b9dc3be69e0a4
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Thu Jan 10 17:00:16 2013 +0100

    DRI2/r[345]xx: 16 bit depth buffers use square micro tiling.
    
    Fixes piglit sanity.tests (with 3D drivers which allocate depth buffers from
    the X server).
    
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index aade98f..e4757ad 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1205,7 +1205,9 @@ int drmmode_get_height_align(ScrnInfoPtr scrn, uint32_t tiling)
 		else
 			height_align = 8;
 	} else {
-		if (tiling)
+		if (tiling & RADEON_TILING_MICRO_SQUARE)
+			height_align =  32;
+		else if (tiling)
 			height_align = 16;
 		else
 			height_align = 1;
diff --git a/src/radeon.h b/src/radeon.h
index ad50d5d..f986347 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -775,6 +775,7 @@ enum {
     RADEON_CREATE_PIXMAP_TILING_MICRO = 0x20000000,
     RADEON_CREATE_PIXMAP_DEPTH = 0x40000000, /* for r200 */
     RADEON_CREATE_PIXMAP_SZBUFFER = 0x80000000, /* for eg */
+    RADEON_CREATE_PIXMAP_TILING_MICRO_SQUARE = 0x8000000,
 };
 
 
diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index 36a44e4..443d908 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -221,7 +221,9 @@ radeon_dri2_create_buffer2(ScreenPtr pScreen,
 		}
 		if (info->ChipFamily >= CHIP_FAMILY_CEDAR)
 		    flags |= RADEON_CREATE_PIXMAP_SZBUFFER;
-	    } else
+	    } else if (cpp == 2 && info->ChipFamily >= CHIP_FAMILY_R300)
+		flags = RADEON_CREATE_PIXMAP_TILING_MACRO | RADEON_CREATE_PIXMAP_TILING_MICRO_SQUARE;
+	    else
 		flags = RADEON_CREATE_PIXMAP_TILING_MACRO | RADEON_CREATE_PIXMAP_TILING_MICRO;
 	    if (IS_R200_3D || info->ChipFamily == CHIP_FAMILY_RV200 || info->ChipFamily == CHIP_FAMILY_RADEON)
 		flags |= RADEON_CREATE_PIXMAP_DEPTH;
@@ -238,7 +240,9 @@ radeon_dri2_create_buffer2(ScreenPtr pScreen,
 		}
 		if (info->ChipFamily >= CHIP_FAMILY_CEDAR)
 		    flags |= RADEON_CREATE_PIXMAP_SZBUFFER;
-	    } else
+	    } else if (cpp == 2 && info->ChipFamily >= CHIP_FAMILY_R300)
+		flags = RADEON_CREATE_PIXMAP_TILING_MACRO | RADEON_CREATE_PIXMAP_TILING_MICRO_SQUARE;
+	    else
 		flags = RADEON_CREATE_PIXMAP_TILING_MACRO | RADEON_CREATE_PIXMAP_TILING_MICRO;
 	    if (IS_R200_3D || info->ChipFamily == CHIP_FAMILY_RV200 || info->ChipFamily == CHIP_FAMILY_RADEON)
 		flags |= RADEON_CREATE_PIXMAP_DEPTH;
@@ -265,6 +269,8 @@ radeon_dri2_create_buffer2(ScreenPtr pScreen,
 
 	if (flags & RADEON_CREATE_PIXMAP_TILING_MICRO)
 	    tiling |= RADEON_TILING_MICRO;
+	if (flags & RADEON_CREATE_PIXMAP_TILING_MICRO_SQUARE)
+	    tiling |= RADEON_TILING_MICRO_SQUARE;
 	if (flags & RADEON_CREATE_PIXMAP_TILING_MACRO)
 	    tiling |= RADEON_TILING_MACRO;
 

commit f5d2682584c74587890a9795ece7a8917214a83f
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Thu Jan 10 17:00:15 2013 +0100

    DRI2: Properly use buffer depth passed in by client.
    
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>

diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index f0c5c01..36a44e4 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -164,6 +164,26 @@ radeon_dri2_create_buffer2(ScreenPtr pScreen,
     unsigned aligned_width = drawable->width;
     unsigned height = drawable->height;
     Bool is_glamor_pixmap = FALSE;
+    int depth;
+    int cpp;
+
+    if (format) {
+	depth = format;
+
+	switch (depth) {
+	case 15:
+	    cpp = 2;
+	    break;
+	case 24:
+	    cpp = 4;
+	    break;
+	default:
+	    cpp = depth / 8;
+	}
+    } else {
+	depth = drawable->depth;
+	cpp = drawable->bitsPerPixel / 8;
+    }
 
     pixmap = pScreen->GetScreenPixmap(pScreen);
     front_width = pixmap->drawable.width;
@@ -248,14 +268,13 @@ radeon_dri2_create_buffer2(ScreenPtr pScreen,
 	if (flags & RADEON_CREATE_PIXMAP_TILING_MACRO)
 	    tiling |= RADEON_TILING_MACRO;
 
-
 	    if (aligned_width == front_width)
 		aligned_width = pScrn->virtualX;
 
 	    pixmap = (*pScreen->CreatePixmap)(pScreen,
 					      aligned_width,
 					      height,
-					      (format != 0)?format:drawable->depth,
+					      depth,
 					      flags | RADEON_CREATE_PIXMAP_DRI2);
     }
 
@@ -292,7 +311,7 @@ radeon_dri2_create_buffer2(ScreenPtr pScreen,
     buffers->attachment = attachment;
     if (pixmap) {
 	buffers->pitch = pixmap->devKind;
-	buffers->cpp = pixmap->drawable.bitsPerPixel / 8;
+	buffers->cpp = cpp;
     }
     buffers->driverPrivate = privates;
     buffers->format = format;

commit 4e35b2f530e2ca8c7b7220cacd05c661de43d20d
Author: Michel Dänzer <michel.daenzer@amd.com>
Date:   Thu Jan 10 12:10:52 2013 +0100

    Drop support for X servers older than 1.7.
    
    The main purpose is to drop DRI2 compatibility code paths which are getting
    awkward to deal with and at this point are probably only tested lightly if at
    all. xserver 1.7 was released more than 3 years ago, and 1.6.2 was already
    required before.
    
    Mostly mechanical, there's probably potential for more cleanups.
    
    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>

diff --git a/configure.ac b/configure.ac
index 0e30e4f..d7d5c72 100644
--- a/configure.ac
+++ b/configure.ac
@@ -75,7 +75,7 @@ PKG_CHECK_MODULES(LIBDRM, [libdrm >= 2.4.36])
 PKG_CHECK_MODULES(LIBDRM_RADEON, [libdrm_radeon])
 
 # Obtain compiler/linker options for the driver dependencies
-PKG_CHECK_MODULES(XORG, [xorg-server >= 1.6.2 xproto fontsproto xf86driproto $REQUIRED_MODULES])
+PKG_CHECK_MODULES(XORG, [xorg-server >= 1.7 xproto fontsproto xf86driproto $REQUIRED_MODULES])
 PKG_CHECK_MODULES(XEXT, [xextproto >= 7.0.99.1],
                   HAVE_XEXTPROTO_71="yes"; AC_DEFINE(HAVE_XEXTPROTO_71, 1, [xextproto 7.1 available]),
                   HAVE_XEXTPROTO_71="no")
@@ -112,36 +112,6 @@ if test "x$GLAMOR" != "xno"; then
 	AC_DEFINE(USE_GLAMOR, 1, [Enable glamor acceleration])
 fi
 
-AC_CHECK_DECL(xf86ModeBandwidth,
-	      [AC_DEFINE(HAVE_XF86MODEBANDWIDTH, 1, [Have xf86ModeBandwidth prototype])],
-	      [],
-	      [#include "xorg-server.h"
-	       #include "xf86Modes.h"])
-
-AC_CHECK_DECL(xf86_crtc_clip_video_helper,
-	      [AC_DEFINE(HAVE_XF86CRTCCLIPVIDEOHELPER, 1, [Have xf86_crtc_clip_video_helper prototype])],
-	      [],
-	      [#include <X11/Xmd.h>
-	       #include "xorg-server.h"
-	       #include "xf86i2c.h"
-	       #include "xf86Crtc.h"])
-
-AC_CHECK_DECL(xf86RotateFreeShadow,
-	      [AC_DEFINE(HAVE_FREE_SHADOW, 1, [have new FreeShadow API])],
-	      [],
-	      [#include <xorg-server.h>
-               #include <windowstr.h>
-	       #include <xf86Crtc.h>])
-
-AC_CHECK_DECL(pci_device_enable,
-	      [AC_DEFINE(HAVE_PCI_DEVICE_ENABLE, 1, [Have pci_device_enable prototype])],
-	      [],
-	      [#include <pciaccess.h>])
-
-AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
-	      [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
-	      [#include "xorg-server.h"])
-
 AC_CHECK_HEADERS([list.h],
 		 [have_list_h="yes"], [have_list_h="no"],
 		 [#include <X11/Xdefs.h>
@@ -157,11 +127,8 @@ fi
 
 CPPFLAGS="$SAVE_CPPFLAGS"
 
-if test "x$XSERVER_LIBPCIACCESS" = xyes; then
-    PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
-    XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
-fi
-AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
+PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
+XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
 
 # Checks for headers/macros for byte swapping
 # Known variants:
diff --git a/src/Makefile.am b/src/Makefile.am
index da94927..6b7171e 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -26,7 +26,8 @@
 # _ladir passes a dummy rpath to libtool so the thing will actually link
 # TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
 
-radeon_drv_la_LIBADD = $(LIBDRM_RADEON_LIBS)
+ati_drv_la_LIBADD = $(PCIACCESS_LIBS)
+radeon_drv_la_LIBADD = $(LIBDRM_RADEON_LIBS) $(PCIACCESS_LIBS)
 
 RADEON_KMS_SRCS=radeon_dri2.c radeon_kms.c drmmode_display.c radeon_vbo.c \
 	radeon_bo_helper.c
@@ -39,11 +40,6 @@ AM_CFLAGS = \
             @XORG_CFLAGS@ \
             @LIBUDEV_CFLAGS@
 
-if XSERVER_LIBPCIACCESS
-ati_drv_la_LIBADD = $(PCIACCESS_LIBS)
-radeon_drv_la_LIBADD += $(PCIACCESS_LIBS)
-endif
-
 if LIBUDEV
 radeon_drv_la_LIBADD += $(LIBUDEV_LIBS)
 endif
diff --git a/src/ati.c b/src/ati.c
index 256fbd8..227665e 100644
--- a/src/ati.c
+++ b/src/ati.c
@@ -57,9 +57,7 @@
 #include "config.h"
 #endif
 
-#ifdef XSERVER_LIBPCIACCESS
 #include <pciaccess.h>
-#endif
 #include "atipcirename.h"
 
 #include "ati.h"
@@ -81,8 +79,6 @@ enum
 
 static int ATIChipID(const uint16_t);
 
-#ifdef XSERVER_LIBPCIACCESS
-
 /* domain defines (stolen from xserver) */
 #if (defined(__alpha__) || defined(__ia64__)) && defined (linux)
 # define PCI_DOM_MASK 0x01fful
@@ -141,51 +137,6 @@ ati_device_get_indexed(int index)
 }
 #endif
 
-#else /* XSERVER_LIBPCIACCESS */
-
-static pciVideoPtr
-ati_device_get_from_busid(int bus, int dev, int func)
-{
-    pciVideoPtr  pVideo = NULL;
-    pciVideoPtr *xf86PciVideoInfo;
-
-    xf86PciVideoInfo = xf86GetPciVideoInfo();
-
-    if (xf86PciVideoInfo == NULL)
-        return NULL;
-
-    while ((pVideo = *xf86PciVideoInfo++) != NULL)
-    {
-        if ((pVideo->bus == bus) && (pVideo->device == dev) &&
-            (pVideo->func == func))
-            break;
-    }
-
-    return pVideo;
-}
-
-static pciVideoPtr
-ati_device_get_primary()
-{
-    pciVideoPtr  pVideo = NULL;
-    pciVideoPtr *xf86PciVideoInfo;
-
-    xf86PciVideoInfo = xf86GetPciVideoInfo();
-
-    if (xf86PciVideoInfo == NULL)
-        return NULL;
-
-    while ((pVideo = *xf86PciVideoInfo++) != NULL)
-    {
-        if (xf86IsPrimaryPci(pVideo))
-            break;
-    }
-
-    return pVideo;
-}
-
-#endif /* XSERVER_LIBPCIACCESS */
-
 void
 ati_gdev_subdriver(pointer options)
 {
diff --git a/src/atipcirename.h b/src/atipcirename.h
index de8f0a3..fa0f9ae 100644
--- a/src/atipcirename.h
+++ b/src/atipcirename.h
@@ -34,51 +34,6 @@ enum region_type {
     REGION_IO 
 };
 
-#ifndef XSERVER_LIBPCIACCESS
-
-/* pciVideoPtr */
-#define PCI_DEV_VENDOR_ID(_pcidev) ((_pcidev)->vendor)
-#define PCI_DEV_DEVICE_ID(_pcidev) ((_pcidev)->chipType)
-#define PCI_DEV_REVISION(_pcidev)  ((_pcidev)->chipRev)
-
-#define PCI_SUB_VENDOR_ID(_pcidev) ((_pcidev)->subsysVendor)
-#define PCI_SUB_DEVICE_ID(_pcidev) ((_pcidev)->subsysCard)
-
-#define PCI_DEV_TAG(_pcidev) pciTag((_pcidev)->bus,    \
-                                    (_pcidev)->device, \
-                                    (_pcidev)->func)
-#define PCI_DEV_BUS(_pcidev)       ((_pcidev)->bus)
-#define PCI_DEV_DEV(_pcidev)       ((_pcidev)->device)
-#define PCI_DEV_FUNC(_pcidev)      ((_pcidev)->func)
-
-/* pciConfigPtr */
-#define PCI_CFG_TAG(_pcidev)  (((pciConfigPtr)(_pcidev)->thisCard)->tag)
-#define PCI_CFG_BUS(_pcidev)  (((pciConfigPtr)(_pcidev)->thisCard)->busnum)
-#define PCI_CFG_DEV(_pcidev)  (((pciConfigPtr)(_pcidev)->thisCard)->devnum)
-#define PCI_CFG_FUNC(_pcidev) (((pciConfigPtr)(_pcidev)->thisCard)->funcnum)
-
-/* region addr: xfree86 uses different fields for memory regions and I/O ports */
-#define PCI_REGION_BASE(_pcidev, _b, _type)             \
-    (((_type) == REGION_MEM) ? (_pcidev)->memBase[(_b)] \
-                             : (_pcidev)->ioBase[(_b)])
-
-/* region size: xfree86 uses the log2 of the region size,
- * but with zero meaning no region, not size of one XXX */
-#define PCI_REGION_SIZE(_pcidev, _b) \
-    (((_pcidev)->size[(_b)] > 0) ? (1 << (_pcidev)->size[(_b)]) : 0)
-
-/* read/write PCI configuration space */
-#define PCI_READ_BYTE(_pcidev, _value_ptr, _offset) \
-    *(_value_ptr) = pciReadByte(PCI_CFG_TAG(_pcidev), (_offset))
-
-#define PCI_READ_LONG(_pcidev, _value_ptr, _offset) \
-    *(_value_ptr) = pciReadLong(PCI_CFG_TAG(_pcidev), (_offset))
-
-#define PCI_WRITE_LONG(_pcidev, _value, _offset) \
-    pciWriteLong(PCI_CFG_TAG(_pcidev), (_offset), (_value))
-
-#else /* XSERVER_LIBPCIACCESS */
-
 typedef struct pci_device *pciVideoPtr;
 
 #define PCI_DEV_VENDOR_ID(_pcidev) ((_pcidev)->vendor_id)
@@ -120,6 +75,4 @@ typedef struct pci_device *pciVideoPtr;
 #define ATI_DEVICE_MATCH(d, i) \
     { PCI_VENDOR_ATI, (d), PCI_MATCH_ANY, PCI_MATCH_ANY, 0, 0, (i) }
 
-#endif /* XSERVER_LIBPCIACCESS */
-
 #endif /* ATIPCIRENAME_H */
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index db106ea..aade98f 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -412,9 +412,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 		crtc->x = x;
 		crtc->y = y;
 		crtc->rotation = rotation;
-#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,5,99,0,0)
 		crtc->transformPresent = FALSE;
-#endif
 	}
 
 	output_ids = calloc(sizeof(uint32_t), xf86_config->num_output);
@@ -439,10 +437,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 		if (!xf86CrtcRotate(crtc)) {
 			goto done;
 		}
-#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,7,0,0,0)
 		crtc->funcs->gamma_set(crtc, crtc->gamma_red, crtc->gamma_green,
 				       crtc->gamma_blue, crtc->gamma_size);
-#endif
 		
 		drmmode_ConvertToKMode(crtc->scrn, &kmode, mode);
 
@@ -976,10 +972,8 @@ drmmode_output_get_property(xf86OutputPtr output, Atom property)
 static const xf86OutputFuncsRec drmmode_output_funcs = {
     .dpms = drmmode_output_dpms,
     .create_resources = drmmode_output_create_resources,
-#ifdef RANDR_12_INTERFACE
     .set_property = drmmode_output_set_property,
     .get_property = drmmode_output_get_property,
-#endif
 #if 0
 
     .save = drmmode_crt_save,
@@ -1724,11 +1718,9 @@ static void drmmode_load_palette(ScrnInfoPtr pScrn, int numColors,
           }
 
     /* Make the change through RandR */
-#ifdef RANDR_12_INTERFACE
         if (crtc->randr_crtc)
             RRCrtcGammaSet(crtc->randr_crtc, lut_r, lut_g, lut_b);
         else
-#endif
             crtc->funcs->gamma_set(crtc, lut_r, lut_g, lut_b, 256);
      }
 }
diff --git a/src/evergreen_exa.c b/src/evergreen_exa.c
index 883fa5c..bd57135 100644
--- a/src/evergreen_exa.c
+++ b/src/evergreen_exa.c
@@ -664,10 +664,8 @@ static struct formatinfo EVERGREENTexFormats[] = {
     {PICT_x8r8g8b8,	FMT_8_8_8_8},
     {PICT_a8b8g8r8,	FMT_8_8_8_8},
     {PICT_x8b8g8r8,	FMT_8_8_8_8},
-#ifdef PICT_TYPE_BGRA
     {PICT_b8g8r8a8,	FMT_8_8_8_8},
     {PICT_b8g8r8x8,	FMT_8_8_8_8},
-#endif
     {PICT_r5g6b5,	FMT_5_6_5},
     {PICT_a1r5g5b5,	FMT_1_5_5_5},
     {PICT_x1r5g5b5,     FMT_1_5_5_5},
@@ -713,10 +711,8 @@ static Bool EVERGREENGetDestFormat(PicturePtr pDstPicture, uint32_t *dst_format)
     case PICT_x8r8g8b8:
     case PICT_a8b8g8r8:
     case PICT_x8b8g8r8:
-#ifdef PICT_TYPE_BGRA
     case PICT_b8g8r8a8:
     case PICT_b8g8r8x8:
-#endif
 	*dst_format = COLOR_8_8_8_8;
 	break;
     case PICT_r5g6b5:
@@ -899,7 +895,6 @@ static Bool EVERGREENTextureSetup(PicturePtr pPict, PixmapPtr pPix,
 	pix_b = SQ_SEL_Z; /* B */
 	pix_a = SQ_SEL_1; /* A */
 	break;
-#ifdef PICT_TYPE_BGRA
     case PICT_b8g8r8a8:
 	pix_r = SQ_SEL_Y; /* R */
 	pix_g = SQ_SEL_Z; /* G */
@@ -912,7 +907,6 @@ static Bool EVERGREENTextureSetup(PicturePtr pPict, PixmapPtr pPix,
 	pix_b = SQ_SEL_W; /* B */
 	pix_a = SQ_SEL_1; /* A */
 	break;
-#endif
     case PICT_x1r5g5b5:
     case PICT_x8r8g8b8:
     case PICT_r5g6b5:
@@ -1299,12 +1293,10 @@ static Bool EVERGREENPrepareComposite(int op, PicturePtr pSrcPicture,
     case PICT_x8b8g8r8:
 	cb_conf.comp_swap = 0; /* ABGR */
 	break;
-#ifdef PICT_TYPE_BGRA
     case PICT_b8g8r8a8:
     case PICT_b8g8r8x8:
 	cb_conf.comp_swap = 3; /* BGRA */
 	break;
-#endif
     case PICT_r5g6b5:
 	cb_conf.comp_swap = 2; /* RGB */
 	break;
@@ -1905,24 +1897,13 @@ EVERGREENDrawInit(ScreenPtr pScreen)
     info->accel_state->exa->FinishAccess = RADEONFinishAccess_CS;
     info->accel_state->exa->UploadToScreen = EVERGREENUploadToScreen;
     info->accel_state->exa->DownloadFromScreen = EVERGREENDownloadFromScreen;
-#if (EXA_VERSION_MAJOR == 2 && EXA_VERSION_MINOR >= 5)
     info->accel_state->exa->CreatePixmap2 = RADEONEXACreatePixmap2;
-#endif
 #if (EXA_VERSION_MAJOR == 2 && EXA_VERSION_MINOR >= 6) 
     info->accel_state->exa->SharePixmapBacking = RADEONEXASharePixmapBacking; 
     info->accel_state->exa->SetSharedPixmapBacking = RADEONEXASetSharedPixmapBacking;
 #endif
-    info->accel_state->exa->flags = EXA_OFFSCREEN_PIXMAPS;
-#ifdef EXA_SUPPORTS_PREPARE_AUX
-    info->accel_state->exa->flags |= EXA_SUPPORTS_PREPARE_AUX;
-#endif
-
-#ifdef EXA_HANDLES_PIXMAPS
-    info->accel_state->exa->flags |= EXA_HANDLES_PIXMAPS;
-#ifdef EXA_MIXED_PIXMAPS
-    info->accel_state->exa->flags |= EXA_MIXED_PIXMAPS;
-#endif
-#endif
+    info->accel_state->exa->flags = EXA_OFFSCREEN_PIXMAPS | EXA_SUPPORTS_PREPARE_AUX |
+	EXA_HANDLES_PIXMAPS | EXA_MIXED_PIXMAPS;
     info->accel_state->exa->pixmapOffsetAlign = 256;
     info->accel_state->exa->pixmapPitchAlign = 256;
 
@@ -1931,14 +1912,8 @@ EVERGREENDrawInit(ScreenPtr pScreen)
     info->accel_state->exa->Composite = EVERGREENComposite;
     info->accel_state->exa->DoneComposite = EVERGREENDoneComposite;
 
-#if EXA_VERSION_MAJOR > 2 || (EXA_VERSION_MAJOR == 2 && EXA_VERSION_MINOR >= 3)
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting EXA maxPitchBytes\n");
-
     info->accel_state->exa->maxPitchBytes = 32768;
     info->accel_state->exa->maxX = 8192;
-#else
-    info->accel_state->exa->maxX = 8192;
-#endif
     info->accel_state->exa->maxY = 8192;
 
     /* not supported yet */
diff --git a/src/r600_exa.c b/src/r600_exa.c
index 21df084..6c0a46d 100644
--- a/src/r600_exa.c
+++ b/src/r600_exa.c
@@ -726,10 +726,8 @@ static struct formatinfo R600TexFormats[] = {
     {PICT_x8r8g8b8,	FMT_8_8_8_8},
     {PICT_a8b8g8r8,	FMT_8_8_8_8},
     {PICT_x8b8g8r8,	FMT_8_8_8_8},
-#ifdef PICT_TYPE_BGRA
     {PICT_b8g8r8a8,	FMT_8_8_8_8},
     {PICT_b8g8r8x8,	FMT_8_8_8_8},
-#endif
     {PICT_r5g6b5,	FMT_5_6_5},
     {PICT_a1r5g5b5,	FMT_1_5_5_5},
     {PICT_x1r5g5b5,     FMT_1_5_5_5},
@@ -775,10 +773,8 @@ static Bool R600GetDestFormat(PicturePtr pDstPicture, uint32_t *dst_format)
     case PICT_x8r8g8b8:
     case PICT_a8b8g8r8:
     case PICT_x8b8g8r8:
-#ifdef PICT_TYPE_BGRA
     case PICT_b8g8r8a8:
     case PICT_b8g8r8x8:
-#endif
 	*dst_format = COLOR_8_8_8_8;
 	break;
     case PICT_r5g6b5:
@@ -916,7 +912,6 @@ static Bool R600TextureSetup(PicturePtr pPict, PixmapPtr pPix,
 	pix_b = SQ_SEL_Z; /* B */
 	pix_a = SQ_SEL_1; /* A */
 	break;
-#ifdef PICT_TYPE_BGRA
     case PICT_b8g8r8a8:
 	pix_r = SQ_SEL_Y; /* R */
 	pix_g = SQ_SEL_Z; /* G */
@@ -929,7 +924,6 @@ static Bool R600TextureSetup(PicturePtr pPict, PixmapPtr pPix,
 	pix_b = SQ_SEL_W; /* B */
 	pix_a = SQ_SEL_1; /* A */
 	break;
-#endif
     case PICT_x1r5g5b5:
     case PICT_x8r8g8b8:
     case PICT_r5g6b5:
@@ -1344,12 +1338,10 @@ static Bool R600PrepareComposite(int op, PicturePtr pSrcPicture,
     case PICT_x8b8g8r8:
 	cb_conf.comp_swap = 0; /* ABGR */
 	break;
-#ifdef PICT_TYPE_BGRA
     case PICT_b8g8r8a8:
     case PICT_b8g8r8x8:
 	cb_conf.comp_swap = 3; /* BGRA */
 	break;
-#endif
     case PICT_r5g6b5:
 	cb_conf.comp_swap = 2; /* RGB */
 	break;
@@ -1878,7 +1870,6 @@ R600DrawInit(ScreenPtr pScreen)
     info->accel_state->exa->MarkSync = R600MarkSync;
     info->accel_state->exa->WaitMarker = R600Sync;
 
-#if (EXA_VERSION_MAJOR == 2 && EXA_VERSION_MINOR >= 4)
     info->accel_state->exa->CreatePixmap = RADEONEXACreatePixmap;
     info->accel_state->exa->DestroyPixmap = RADEONEXADestroyPixmap;
     info->accel_state->exa->PixmapIsOffscreen = RADEONEXAPixmapIsOffscreen;
@@ -1886,26 +1877,13 @@ R600DrawInit(ScreenPtr pScreen)
     info->accel_state->exa->FinishAccess = RADEONFinishAccess_CS;
     info->accel_state->exa->UploadToScreen = R600UploadToScreenCS;
     info->accel_state->exa->DownloadFromScreen = R600DownloadFromScreenCS;
-#if (EXA_VERSION_MAJOR == 2 && EXA_VERSION_MINOR >= 5)
     info->accel_state->exa->CreatePixmap2 = RADEONEXACreatePixmap2;
 #if (EXA_VERSION_MAJOR == 2 && EXA_VERSION_MINOR >= 6) 
     info->accel_state->exa->SharePixmapBacking = RADEONEXASharePixmapBacking; 
     info->accel_state->exa->SetSharedPixmapBacking = RADEONEXASetSharedPixmapBacking;
 #endif
-#endif
-#endif
-
-    info->accel_state->exa->flags = EXA_OFFSCREEN_PIXMAPS;
-#ifdef EXA_SUPPORTS_PREPARE_AUX
-    info->accel_state->exa->flags |= EXA_SUPPORTS_PREPARE_AUX;
-#endif
-
-#ifdef EXA_HANDLES_PIXMAPS
-    info->accel_state->exa->flags |= EXA_HANDLES_PIXMAPS;
-#ifdef EXA_MIXED_PIXMAPS
-    info->accel_state->exa->flags |= EXA_MIXED_PIXMAPS;
-#endif
-#endif
+    info->accel_state->exa->flags = EXA_OFFSCREEN_PIXMAPS | EXA_SUPPORTS_PREPARE_AUX |
+	EXA_HANDLES_PIXMAPS | EXA_MIXED_PIXMAPS;
     info->accel_state->exa->pixmapOffsetAlign = 256;
     info->accel_state->exa->pixmapPitchAlign = 256;
 
@@ -1914,14 +1892,8 @@ R600DrawInit(ScreenPtr pScreen)
     info->accel_state->exa->Composite = R600Composite;
     info->accel_state->exa->DoneComposite = R600DoneComposite;
 
-#if EXA_VERSION_MAJOR > 2 || (EXA_VERSION_MAJOR == 2 && EXA_VERSION_MINOR >= 3)
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Setting EXA maxPitchBytes\n");
-
     info->accel_state->exa->maxPitchBytes = 32768;
     info->accel_state->exa->maxX = 8192;
-#else
-    info->accel_state->exa->maxX = 8192;
-#endif
     info->accel_state->exa->maxY = 8192;
 
     /* not supported yet */
diff --git a/src/radeon.h b/src/radeon.h
index 0ae3d1e..ad50d5d 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -134,11 +134,6 @@
 # define __FUNCTION__ __func__		/* C99 */
 #endif
 
-#ifndef HAVE_XF86MODEBANDWIDTH
-extern unsigned int xf86ModeBandwidth(DisplayModePtr mode, int depth);
-#define MODE_BANDWIDTH MODE_BAD
-#endif
-
 typedef enum {
     OPTION_NOACCEL,
     OPTION_SW_CURSOR,
@@ -404,9 +399,6 @@ struct radeon_accel_state {
 typedef struct {
     EntityInfoPtr     pEnt;
     pciVideoPtr       PciInfo;
-#ifndef XSERVER_LIBPCIACCESS
-    PCITAG            PciTag;
-#endif
     int               Chipset;
     RADEONChipFamily  ChipFamily;
 
diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index 27b04e3..f0c5c01 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -56,10 +56,6 @@
 
 #include "radeon_bo_gem.h"
 
-#if DRI2INFOREC_VERSION >= 1
-#define USE_DRI2_1_1_0
-#endif
-
 #if DRI2INFOREC_VERSION >= 4 && HAVE_LIST_H
 #define USE_DRI2_SCHEDULING
 #endif
@@ -70,11 +66,7 @@
 
 #define FALLBACK_SWAP_DELAY 16
 
-#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,6,99,0, 0)
 typedef DRI2BufferPtr BufferPtr;
-#else
-typedef DRI2Buffer2Ptr BufferPtr;
-#endif
 
 struct dri2_buffer_priv {
     PixmapPtr   pixmap;
@@ -154,173 +146,6 @@ static PixmapPtr fixup_glamor(DrawablePtr drawable, PixmapPtr pixmap)
 }
 
 
-#ifndef USE_DRI2_1_1_0
-static BufferPtr
-radeon_dri2_create_buffers(DrawablePtr drawable,
-                           unsigned int *attachments,
-                           int count)
-{
-    ScreenPtr pScreen = drawable->pScreen;
-    ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
-    RADEONInfoPtr info = RADEONPTR(pScrn);
-    BufferPtr buffers;
-    struct dri2_buffer_priv *privates;
-    PixmapPtr pixmap, depth_pixmap;
-    struct radeon_bo *bo;
-    int i, r, need_enlarge = 0;
-    int flags = 0;
-    unsigned front_width;
-    uint32_t tiling = 0;
-
-    pixmap = pScreen->GetScreenPixmap(pScreen);
-    front_width = pixmap->drawable.width;
-
-    buffers = calloc(count, sizeof *buffers);
-    if (buffers == NULL) {
-        return NULL;
-    }
-    privates = calloc(count, sizeof(struct dri2_buffer_priv));
-    if (privates == NULL) {
-        free(buffers);
-        return NULL;
-    }
-
-    depth_pixmap = NULL;
-    for (i = 0; i < count; i++) {
-	Bool is_glamor_pixmap = FALSE;
-	unsigned aligned_width = drawable->width;
-	unsigned aligned_height = drawable->height;
-
-        if (attachments[i] == DRI2BufferFrontLeft) {
-            pixmap = get_drawable_pixmap(drawable);
-	    if (info->use_glamor && !radeon_get_pixmap_bo(pixmap)) {


Reply to: