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

xserver-xorg-video-ati: Changes to 'ubuntu'



 configure.ac                                                    |    2 
 debian/changelog                                                |    9 
 debian/patches/101_select_between_classic_and_gallium_dri.patch |  167 ----
 debian/patches/series                                           |    1 
 src/ati_pciids_gen.h                                            |    1 
 src/atombios_output.c                                           |  402 +++++-----
 src/drmmode_display.c                                           |    3 
 src/evergreen_exa.c                                             |   30 
 src/pcidb/ati_pciids.csv                                        |    1 
 src/r600_exa.c                                                  |   29 
 src/radeon_chipinfo_gen.h                                       |    1 
 src/radeon_chipset_gen.h                                        |    1 
 src/radeon_exa.c                                                |   18 
 src/radeon_exa_funcs.c                                          |   46 -
 src/radeon_kms.c                                                |   10 
 src/radeon_output.c                                             |   15 
 src/radeon_pci_chipset_gen.h                                    |    1 
 src/radeon_pci_device_match_gen.h                               |    1 
 src/radeon_vbo.c                                                |   19 
 19 files changed, 325 insertions(+), 432 deletions(-)

New commits:
commit c824c2220d57d4a9ded35ddfdbc221223f995e52
Author: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Date:   Fri Feb 18 22:33:31 2011 +1100

    Bump changelog for new upstream release.
    
    Note that we don't want to merge from Debian just yet, as the
    new xsf debhelper voodoo hasn't yet made it into our Xserver

diff --git a/debian/changelog b/debian/changelog
index 71b7a8f..5bea215 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,6 @@
-xserver-xorg-video-ati (1:6.13.2+git20110124.fadee040-0ubuntu5) natty; urgency=low
+xserver-xorg-video-ati (1:6.14.0-0ubuntu1) natty; urgency=low
 
+  * New upstream release
   * Drop 101_select_between_classic_and_gallium_dri.patch.  Default to gallium
     everywhere, and rely on libGL and the Xserver to fallback when necessary
     (LP: #715939)

commit 9afcade4e35730ea84073a145647507c7f2d1cfa
Author: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Date:   Fri Feb 18 22:23:29 2011 +1100

    Drop ForceGallium xorg.conf option patch.
    
    We want to default to gallium everywhere, and let libGL
    and the Xserver fall back to classic when necessary

diff --git a/debian/changelog b/debian/changelog
index 8649015..71b7a8f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+xserver-xorg-video-ati (1:6.13.2+git20110124.fadee040-0ubuntu5) natty; urgency=low
+
+  * Drop 101_select_between_classic_and_gallium_dri.patch.  Default to gallium
+    everywhere, and rely on libGL and the Xserver to fallback when necessary
+    (LP: #715939)
+
+ -- Christopher James Halse Rogers <raof@ubuntu.com>  Fri, 18 Feb 2011 13:32:01 +1100
+
 xserver-xorg-video-ati (1:6.13.2+git20110124.fadee040-0ubuntu4) natty; urgency=low
 
   * debian/control: Bump build-depends on xserver-xorg-dev to really,
diff --git a/debian/patches/101_select_between_classic_and_gallium_dri.patch b/debian/patches/101_select_between_classic_and_gallium_dri.patch
deleted file mode 100644
index 56351c8..0000000
--- a/debian/patches/101_select_between_classic_and_gallium_dri.patch
+++ /dev/null
@@ -1,167 +0,0 @@
-From 36fb1f38e8ab0f26f2788e53f5ecbdf763595bc5 Mon Sep 17 00:00:00 2001
-From: Robert Hooker <sarvatt@ubuntu.com>
-Date: Sun, 13 Jun 2010 15:30:12 -0400
-Subject: [PATCH] Add Gallium support via an xorg.conf option, enabled by default for r300.
-
-Signed-off-by: Robert Hooker <sarvatt@ubuntu.com>
-
-Index: xserver-xorg-video-ati/src/radeon.h
-===================================================================
---- xserver-xorg-video-ati.orig/src/radeon.h	2010-11-24 18:28:01.127021001 +1100
-+++ xserver-xorg-video-ati/src/radeon.h	2010-11-24 21:34:44.289167001 +1100
-@@ -224,6 +224,7 @@
-     OPTION_FORCE_LOW_POWER,
-     OPTION_DYNAMIC_PM,
-     OPTION_NEW_PLL,
-+    OPTION_FORCE_GALLIUM,
-     OPTION_ZAPHOD_HEADS,
-     OPTION_SWAPBUFFERS_WAIT
- } RADEONOpts; 
-@@ -918,6 +919,7 @@
- 
-     /* accel */
-     Bool              RenderAccel; /* Render */
-+    Bool              useGallium;  /* Gallium */
-     Bool              allowColorTiling;
-     Bool              tilingEnabled; /* mirror of sarea->tiling_enabled */
-     struct radeon_accel_state *accel_state;
-Index: xserver-xorg-video-ati/src/radeon_dri2.c
-===================================================================
---- xserver-xorg-video-ati.orig/src/radeon_dri2.c	2010-11-24 18:28:01.647021001 +1100
-+++ xserver-xorg-video-ati/src/radeon_dri2.c	2010-11-24 21:34:44.319167001 +1100
-@@ -862,9 +862,11 @@
-     info->dri2.device_name = drmGetDeviceNameFromFd(info->dri2.drm_fd);
- 
-     if ( (info->ChipFamily >= CHIP_FAMILY_R600) ) {
--        dri2_info.driverName = R600_DRIVER_NAME;
--    } else if ( (info->ChipFamily >= CHIP_FAMILY_R300) ) {
--        dri2_info.driverName = R300_DRIVER_NAME;
-+        dri2_info.driverName = info->useGallium ? \
-+	  R600_GALLIUM_DRIVER_NAME : R600_CLASSIC_DRIVER_NAME;
-+    } else if ( info->ChipFamily >= CHIP_FAMILY_R300 ) {
-+        dri2_info.driverName = info->useGallium ? \
-+	  R300_GALLIUM_DRIVER_NAME : R300_CLASSIC_DRIVER_NAME;
-     } else if ( info->ChipFamily >= CHIP_FAMILY_R200 ) {
-         dri2_info.driverName = R200_DRIVER_NAME;
-     } else {
-Index: xserver-xorg-video-ati/src/radeon_driver.c
-===================================================================
---- xserver-xorg-video-ati.orig/src/radeon_driver.c	2010-11-24 18:28:01.657021001 +1100
-+++ xserver-xorg-video-ati/src/radeon_driver.c	2010-11-24 21:34:44.479167001 +1100
-@@ -205,6 +205,7 @@
-     { OPTION_FORCE_LOW_POWER,	"ForceLowPowerMode", OPTV_BOOLEAN, {0}, FALSE },
-     { OPTION_DYNAMIC_PM,	"DynamicPM",       OPTV_BOOLEAN, {0}, FALSE },
-     { OPTION_NEW_PLL,	        "NewPLL",        OPTV_BOOLEAN, {0}, FALSE },
-+    { OPTION_FORCE_GALLIUM,     "ForceGallium",       OPTV_BOOLEAN, {0}, FALSE },
-     { OPTION_ZAPHOD_HEADS,      "ZaphodHeads",     OPTV_STRING,  {0}, FALSE },
-     { -1,                    NULL,               OPTV_NONE,    {0}, FALSE }
- };
-@@ -3163,6 +3164,15 @@
- 	}
-     }
- 
-+    if (xf86GetOptValBool(info->Options, OPTION_FORCE_GALLIUM, &info->useGallium)) {
-+	if (info->useGallium) {
-+	    info->useGallium = FALSE;
-+	    xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
-+		       "Gallium DRI requires kernel-modesetting.  Ignoring \
-+ForceGallium option\n");
-+	}
-+    }
-+
-     if (!RADEONPreInitVRAM(pScrn))
- 	goto fail;
- 
-Index: xserver-xorg-video-ati/src/radeon_kms.c
-===================================================================
---- xserver-xorg-video-ati.orig/src/radeon_kms.c	2010-11-24 21:34:42.759167001 +1100
-+++ xserver-xorg-video-ati/src/radeon_kms.c	2010-11-24 21:36:11.000000000 +1100
-@@ -69,6 +69,7 @@
-     { OPTION_TVSTD,          "TVStandard",       OPTV_STRING,  {0}, FALSE },
-     { OPTION_EXA_VSYNC,      "EXAVSync",         OPTV_BOOLEAN, {0}, FALSE },
-     { OPTION_EXA_PIXMAPS,    "EXAPixmaps",	 OPTV_BOOLEAN,   {0}, FALSE },
-+    { OPTION_FORCE_GALLIUM,  "ForceGallium",     OPTV_BOOLEAN, {0}, FALSE },
-     { OPTION_ZAPHOD_HEADS,   "ZaphodHeads",      OPTV_STRING,  {0}, FALSE },
-     { -1,                    NULL,               OPTV_NONE,    {0}, FALSE }
- };
-@@ -577,6 +578,19 @@
- 	goto fail;
-     }
- 
-+    if (xf86GetOptValBool(info->Options, OPTION_FORCE_GALLIUM, &info->useGallium)) {
-+	xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-+		   "Overriding default DRI driver selection.  %s selected.\n",
-+		   info->useGallium ? "Gallium" : "Classic");
-+    } else {
-+	/* Default for r600+ is classic, for r300 is gallium */
-+	if (info->ChipFamily >= CHIP_FAMILY_R600) {
-+	    info->useGallium = FALSE;
-+	} else if (info->ChipFamily >= CHIP_FAMILY_R300) {
-+	    info->useGallium = TRUE;
-+	}
-+    }
-+
-     colorTilingDefault = info->ChipFamily >= CHIP_FAMILY_R300 &&
-                          info->ChipFamily <= CHIP_FAMILY_RS740;
- 
-Index: xserver-xorg-video-ati/src/radeon_version.h
-===================================================================
---- xserver-xorg-video-ati.orig/src/radeon_version.h	2010-11-24 10:59:22.207021000 +1100
-+++ xserver-xorg-video-ati/src/radeon_version.h	2010-11-24 21:34:45.409167001 +1100
-@@ -34,11 +34,13 @@
- #undef  RADEON_VERSION_STRINGIFY
- #undef  RADEON_VERSION_NAME
- 
--#define RADEON_NAME          "RADEON"
--#define RADEON_DRIVER_NAME   "radeon"
--#define R200_DRIVER_NAME     "r200"
--#define R300_DRIVER_NAME     "r300"
--#define R600_DRIVER_NAME     "r600"
-+#define RADEON_NAME               "RADEON"
-+#define RADEON_DRIVER_NAME        "radeon"
-+#define R200_DRIVER_NAME          "r200"
-+#define R300_CLASSIC_DRIVER_NAME  "r300c"
-+#define R300_GALLIUM_DRIVER_NAME  "r300"
-+#define R600_CLASSIC_DRIVER_NAME  "r600"
-+#define R600_GALLIUM_DRIVER_NAME  "r600g"
- 
- #define RADEON_VERSION_MAJOR PACKAGE_VERSION_MAJOR
- #define RADEON_VERSION_MINOR PACKAGE_VERSION_MINOR
-Index: xserver-xorg-video-ati/src/radeon_dri.c
-===================================================================
---- xserver-xorg-video-ati.orig/src/radeon_dri.c	2010-11-24 10:59:22.217021000 +1100
-+++ xserver-xorg-video-ati/src/radeon_dri.c	2010-11-24 21:34:45.539167001 +1100
-@@ -1546,9 +1546,9 @@
-     pDRIInfo->drmDriverName              = RADEON_DRIVER_NAME;
- 
-     if ( (info->ChipFamily >= CHIP_FAMILY_R600) )
--       pDRIInfo->clientDriverName        = R600_DRIVER_NAME;
-+       pDRIInfo->clientDriverName        = R600_CLASSIC_DRIVER_NAME;
-     else if ( (info->ChipFamily >= CHIP_FAMILY_R300) )
--       pDRIInfo->clientDriverName        = R300_DRIVER_NAME;
-+       pDRIInfo->clientDriverName        = R300_CLASSIC_DRIVER_NAME;
-     else if ( info->ChipFamily >= CHIP_FAMILY_R200 )
-        pDRIInfo->clientDriverName	 = R200_DRIVER_NAME;
-     else
-Index: xserver-xorg-video-ati/man/radeon.man
-===================================================================
---- xserver-xorg-video-ati.orig/man/radeon.man	2010-11-24 18:27:58.147021001 +1100
-+++ xserver-xorg-video-ati/man/radeon.man	2010-11-24 21:34:45.569167001 +1100
-@@ -615,6 +615,17 @@
- The default is
- .B on with > 32MB VRAM, off with < 32MB.
- .TP
-+.BI "Option \*qForceGallium\*q \*q" boolean \*q
-+(KMS Only) Explicitly select whether to use the Gallium or Classic DRI drivers.
-+Setting this option to
-+.B true
-+will select the Gallium driver regardless of the
-+default driver for your card.  Setting this option to
-+.B false
-+will select the
-+Classic driver regardless of the default driver for your card.
-+The default is card-specific.
-+.TP
- .BI "Option \*qZaphodHeads\*q \*q" string \*q
- Specify the randr output(s) to use with zaphod mode for a particular driver
- instance.  If you use this option you most use this option for all instances
diff --git a/debian/patches/series b/debian/patches/series
index 4fd268a..1503711 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1 @@
 100_radeon-6.9.0-bgnr-enable.patch
-101_select_between_classic_and_gallium_dri.patch

commit 0a1a0513a61f392580bde39cca4880f2c19abc8d
Author: Alex Deucher <alexdeucher@gmail.com>
Date:   Thu Feb 3 18:09:17 2011 -0500

    bump version for release
    
    Signed-off-by: Alex Deucher <alexdeucher@gmail.com>

diff --git a/configure.ac b/configure.ac
index 5dbf65a..db135a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ([2.60])
 AC_INIT([xf86-video-ati],
-        [6.13.99],
+        [6.14.0],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         [xf86-video-ati])
 

commit ef9bfb262db7004bef3704e5d914687e50d3fca4
Author: Alex Deucher <alexdeucher@gmail.com>
Date:   Tue Feb 1 19:24:44 2011 -0500

    kms/pre-6xx: fix pageflipping with tiling
    
    Use UTS/DFS to tile/untile as appropriate for sw access on
    pre-6xx.
    
    Fixes:
    https://bugs.freedesktop.org/show_bug.cgi?id=33738
    
    Signed-off-by: Alex Deucher <alexdeucher@gmail.com>

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 2ab4510..d5ad211 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1232,8 +1232,7 @@ drmmode_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
 	}
 #endif
 	if (tiling_flags)
-	    radeon_bo_set_tiling(info->front_bo,
-				 tiling_flags | RADEON_TILING_SURFACE, pitch);
+	    radeon_bo_set_tiling(info->front_bo, tiling_flags, pitch);
 
 	ret = drmModeAddFB(drmmode->fd, width, height, scrn->depth,
 			   scrn->bitsPerPixel, pitch,
diff --git a/src/radeon_exa.c b/src/radeon_exa.c
index 9df7251..3dbdcae 100644
--- a/src/radeon_exa.c
+++ b/src/radeon_exa.c
@@ -307,6 +307,7 @@ Bool RADEONPrepareAccess_CS(PixmapPtr pPix, int index)
 #endif
     Bool flush = FALSE;
     int ret;
+    uint32_t tiling_flags = 0, pitch = 0;
 
 #if X_BYTE_ORDER == X_BIG_ENDIAN
     /* May need to handle byte swapping in DownloadFrom/UploadToScreen */
@@ -318,16 +319,13 @@ Bool RADEONPrepareAccess_CS(PixmapPtr pPix, int index)
     if (!driver_priv)
       return FALSE;
 
-    if (info->ChipFamily >= CHIP_FAMILY_R600) {
-	uint32_t tiling_flags = 0, pitch = 0;
-
-	ret = radeon_bo_get_tiling(driver_priv->bo, &tiling_flags, &pitch);
-	if (ret)
-	    return FALSE;
-	/* untile in DFS/UTS */
-	if (tiling_flags & (RADEON_TILING_MACRO | RADEON_TILING_MICRO))
-	    return FALSE;
-    }
+    /* check if we are tiled */
+    ret = radeon_bo_get_tiling(driver_priv->bo, &tiling_flags, &pitch);
+    if (ret)
+	return FALSE;
+    /* untile in DFS/UTS */
+    if (tiling_flags & (RADEON_TILING_MACRO | RADEON_TILING_MICRO))
+	return FALSE;
 
     /* if we have more refs than just the BO then flush */
     if (radeon_bo_is_referenced_by_cs(driver_priv->bo, info->cs)) {
diff --git a/src/radeon_exa_funcs.c b/src/radeon_exa_funcs.c
index e80a996..e8c5571 100644
--- a/src/radeon_exa_funcs.c
+++ b/src/radeon_exa_funcs.c
@@ -474,6 +474,7 @@ RADEONUploadToScreenCS(PixmapPtr pDst, int x, int y, int w, int h,
     Bool flush = TRUE;
     Bool r;
     int i;
+    uint32_t tiling_flags = 0, pitch = 0;
 
     if (bpp < 8)
 	return FALSE;
@@ -482,6 +483,10 @@ RADEONUploadToScreenCS(PixmapPtr pDst, int x, int y, int w, int h,
     if (!driver_priv || !driver_priv->bo)
 	return FALSE;
 
+    ret = radeon_bo_get_tiling(driver_priv->bo, &tiling_flags, &pitch);
+    if (ret)
+	ErrorF("radeon_bo_get_tiling failed\n");
+
 #if X_BYTE_ORDER == X_BIG_ENDIAN
     switch (bpp) {
     case 32:
@@ -496,10 +501,12 @@ RADEONUploadToScreenCS(PixmapPtr pDst, int x, int y, int w, int h,
     /* If we know the BO won't be busy, don't bother with a scratch */
     copy_dst = driver_priv->bo;
     copy_pitch = pDst->devKind;
-    if (!radeon_bo_is_referenced_by_cs(driver_priv->bo, info->cs)) {
-	flush = FALSE;
-	if (!radeon_bo_is_busy(driver_priv->bo, &dst_domain))
-	    goto copy;
+    if (!(tiling_flags & (RADEON_TILING_MACRO | RADEON_TILING_MICRO))) {
+	if (!radeon_bo_is_referenced_by_cs(driver_priv->bo, info->cs)) {
+	    flush = FALSE;
+	    if (!radeon_bo_is_busy(driver_priv->bo, &dst_domain))
+		goto copy;
+	}
     }
 
     size = scratch_pitch * h;
@@ -573,6 +580,7 @@ RADEONDownloadFromScreenCS(PixmapPtr pSrc, int x, int y, int w,
     int ret;
     Bool flush = FALSE;
     Bool r;
+    uint32_t tiling_flags = 0, pitch = 0;
 
     if (bpp < 8)
 	return FALSE;
@@ -581,6 +589,10 @@ RADEONDownloadFromScreenCS(PixmapPtr pSrc, int x, int y, int w,
     if (!driver_priv || !driver_priv->bo)
 	return FALSE;
 
+    ret = radeon_bo_get_tiling(driver_priv->bo, &tiling_flags, &pitch);
+    if (ret)
+	ErrorF("radeon_bo_get_tiling failed\n");
+
 #if X_BYTE_ORDER == X_BIG_ENDIAN
     switch (bpp) {
     case 32:
@@ -595,22 +607,22 @@ RADEONDownloadFromScreenCS(PixmapPtr pSrc, int x, int y, int w,
     /* If we know the BO won't end up in VRAM anyway, don't bother with a scratch */
     copy_src = driver_priv->bo;
     copy_pitch = pSrc->devKind;
-    if (radeon_bo_is_referenced_by_cs(driver_priv->bo, info->cs)) {
-	src_domain = radeon_bo_get_src_domain(driver_priv->bo);
-	if ((src_domain & (RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM)) ==
-	    (RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM))
-	    src_domain = 0;
-	else /* A write may be scheduled */
-	    flush = TRUE;
-    }
+    if (!(tiling_flags & (RADEON_TILING_MACRO | RADEON_TILING_MICRO))) {
+	if (radeon_bo_is_referenced_by_cs(driver_priv->bo, info->cs)) {
+	    src_domain = radeon_bo_get_src_domain(driver_priv->bo);
+	    if ((src_domain & (RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM)) ==
+		(RADEON_GEM_DOMAIN_GTT | RADEON_GEM_DOMAIN_VRAM))
+		src_domain = 0;
+	    else /* A write may be scheduled */
+		flush = TRUE;
+	}
 
-    if (!src_domain)
-	radeon_bo_is_busy(driver_priv->bo, &src_domain);
+	if (!src_domain)
+	    radeon_bo_is_busy(driver_priv->bo, &src_domain);
 
-    if (src_domain & ~(uint32_t)RADEON_GEM_DOMAIN_VRAM) {
-	goto copy;
+	if (src_domain & ~(uint32_t)RADEON_GEM_DOMAIN_VRAM)
+	    goto copy;
     }
-
     size = scratch_pitch * h;
     scratch = radeon_bo_open(info->bufmgr, 0, size, 0, RADEON_GEM_DOMAIN_GTT, 0);
     if (scratch == NULL) {

commit bb16dd77321e5a64a3cb2d2ca9982117799ac1a8
Author: Alex Deucher <alexdeucher@gmail.com>
Date:   Tue Feb 1 19:20:00 2011 -0500

    kms/r6xx+: fix tiling and pageflipping harder
    
    Thanks for Michel for final fix.  Fixes:
    https://bugs.freedesktop.org/show_bug.cgi?id=33738
    for r6xx+ asics.  A similar approach for pre-r6xx
    asics is pending.
    
    Signed-off-by: Alex Deucher <alexdeucher@gmail.com>

diff --git a/src/evergreen_exa.c b/src/evergreen_exa.c
index 93fa267..2eb698d 100644
--- a/src/evergreen_exa.c
+++ b/src/evergreen_exa.c
@@ -1534,19 +1534,28 @@ EVERGREENUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h,
     Bool r;
     int i;
     struct r600_accel_object src_obj, dst_obj;
+    uint32_t tiling_flags = 0, pitch = 0;
 
     if (bpp < 8)
 	return FALSE;
 
     driver_priv = exaGetPixmapDriverPrivate(pDst);
+    if (!driver_priv || !driver_priv->bo)
+	return FALSE;
+
+    ret = radeon_bo_get_tiling(driver_priv->bo, &tiling_flags, &pitch);
+    if (ret)
+	ErrorF("radeon_bo_get_tiling failed\n");
 
     /* If we know the BO won't be busy, don't bother with a scratch */
     copy_dst = driver_priv->bo;
     copy_pitch = pDst->devKind;
-    if (!radeon_bo_is_referenced_by_cs(driver_priv->bo, info->cs)) {
-	flush = FALSE;
-	if (!radeon_bo_is_busy(driver_priv->bo, &dst_domain))
-	    goto copy;
+    if (!(tiling_flags & (RADEON_TILING_MACRO | RADEON_TILING_MICRO))) {
+	if (!radeon_bo_is_referenced_by_cs(driver_priv->bo, info->cs)) {
+	    flush = FALSE;
+	    if (!radeon_bo_is_busy(driver_priv->bo, &dst_domain))
+		goto copy;
+	}
     }
 
     size = scratch_pitch * h;
@@ -1646,6 +1655,8 @@ EVERGREENDownloadFromScreen(PixmapPtr pSrc, int x, int y, int w,
 	return FALSE;
 
     driver_priv = exaGetPixmapDriverPrivate(pSrc);
+    if (!driver_priv || !driver_priv->bo)
+	return FALSE;
 
     ret = radeon_bo_get_tiling(driver_priv->bo, &tiling_flags, &pitch);
     if (ret)
@@ -1663,13 +1674,14 @@ EVERGREENDownloadFromScreen(PixmapPtr pSrc, int x, int y, int w,
 	    else /* A write may be scheduled */
 		flush = TRUE;
 	}
-    }
 
-    if (!src_domain)
-	radeon_bo_is_busy(driver_priv->bo, &src_domain);
+	if (!src_domain)
+	    radeon_bo_is_busy(driver_priv->bo, &src_domain);
 
-    if (src_domain & ~(uint32_t)RADEON_GEM_DOMAIN_VRAM)
-	goto copy;
+	if (src_domain & ~(uint32_t)RADEON_GEM_DOMAIN_VRAM)
+	    goto copy;
+
+    }
 
     if (info->ChipFamily == CHIP_FAMILY_PALM)
 	goto copy;
diff --git a/src/r600_exa.c b/src/r600_exa.c
index f652ab6..5fc41ad 100644
--- a/src/r600_exa.c
+++ b/src/r600_exa.c
@@ -1785,19 +1785,28 @@ R600UploadToScreenCS(PixmapPtr pDst, int x, int y, int w, int h,
     Bool r;
     int i;
     struct r600_accel_object src_obj, dst_obj;
+    uint32_t tiling_flags = 0, pitch = 0;
 
     if (bpp < 8)
 	return FALSE;
 
     driver_priv = exaGetPixmapDriverPrivate(pDst);
+    if (!driver_priv || !driver_priv->bo)
+	return FALSE;
+
+    ret = radeon_bo_get_tiling(driver_priv->bo, &tiling_flags, &pitch);
+    if (ret)
+	ErrorF("radeon_bo_get_tiling failed\n");
 
     /* If we know the BO won't be busy, don't bother with a scratch */
     copy_dst = driver_priv->bo;
     copy_pitch = pDst->devKind;
-    if (!radeon_bo_is_referenced_by_cs(driver_priv->bo, info->cs)) {
-	flush = FALSE;
-	if (!radeon_bo_is_busy(driver_priv->bo, &dst_domain))
-	    goto copy;
+    if (!(tiling_flags & (RADEON_TILING_MACRO | RADEON_TILING_MICRO))) {
+	if (!radeon_bo_is_referenced_by_cs(driver_priv->bo, info->cs)) {
+	    flush = FALSE;
+	    if (!radeon_bo_is_busy(driver_priv->bo, &dst_domain))
+		goto copy;
+	}
     }
 
     size = scratch_pitch * h;
@@ -1897,6 +1906,8 @@ R600DownloadFromScreenCS(PixmapPtr pSrc, int x, int y, int w,
 	return FALSE;
 
     driver_priv = exaGetPixmapDriverPrivate(pSrc);
+    if (!driver_priv || !driver_priv->bo)
+	return FALSE;
 
     ret = radeon_bo_get_tiling(driver_priv->bo, &tiling_flags, &pitch);
     if (ret)
@@ -1914,13 +1925,13 @@ R600DownloadFromScreenCS(PixmapPtr pSrc, int x, int y, int w,
 	    else /* A write may be scheduled */
 		flush = TRUE;
 	}
-    }
 
-    if (!src_domain)
-	radeon_bo_is_busy(driver_priv->bo, &src_domain);
+	if (!src_domain)
+	    radeon_bo_is_busy(driver_priv->bo, &src_domain);
 
-    if (src_domain & ~(uint32_t)RADEON_GEM_DOMAIN_VRAM)
-	goto copy;
+	if (src_domain & ~(uint32_t)RADEON_GEM_DOMAIN_VRAM)
+	    goto copy;
+    }
 
     size = scratch_pitch * h;
     scratch = radeon_bo_open(info->bufmgr, 0, size, 0, RADEON_GEM_DOMAIN_GTT, 0);

commit 9c124f781049ef11a8b19894a29b7f62975b3011
Author: Alex Deucher <alexdeucher@gmail.com>
Date:   Tue Feb 1 18:59:40 2011 -0500

    radeon: remove device 0x4243
    
    0x4243 is a PCI bridge, not a gpu.
    
    See:
    https://bugs.freedesktop.org/show_bug.cgi?id=33815
    
    Signed-off-by: Alex Deucher <alexdeucher@gmail.com>

diff --git a/src/ati_pciids_gen.h b/src/ati_pciids_gen.h
index 5e5ced6..f7b7569 100644
--- a/src/ati_pciids_gen.h
+++ b/src/ati_pciids_gen.h
@@ -25,7 +25,6 @@
 #define PCI_CHIP_MACH32 0x4158
 #define PCI_CHIP_RS250_4237 0x4237
 #define PCI_CHIP_R200_BB 0x4242
-#define PCI_CHIP_R200_BC 0x4243
 #define PCI_CHIP_RS100_4336 0x4336
 #define PCI_CHIP_RS200_4337 0x4337
 #define PCI_CHIP_MACH64CT 0x4354
diff --git a/src/pcidb/ati_pciids.csv b/src/pcidb/ati_pciids.csv
index 1f4756a..e8bfb4c 100644
--- a/src/pcidb/ati_pciids.csv
+++ b/src/pcidb/ati_pciids.csv
@@ -26,7 +26,6 @@
 "0x4158","MACH32","MACH32",,,,,,
 "0x4237","RS250_4237","RS200",,1,,,1,"ATI Radeon 7000 IGP (A4+) 4237"
 "0x4242","R200_BB","R200",,,,1,,"ATI Radeon 8500 AIW BB (AGP)"
-"0x4243","R200_BC","R200",,,,1,,"ATI Radeon 8500 AIW BC (AGP)"
 "0x4336","RS100_4336","RS100",1,1,,,1,"ATI Radeon IGP320M (U1) 4336"
 "0x4337","RS200_4337","RS200",1,1,,,1,"ATI Radeon IGP330M/340M/350M (U2) 4337"
 "0x4354","MACH64CT","MACH64",,,,,,
diff --git a/src/radeon_chipinfo_gen.h b/src/radeon_chipinfo_gen.h
index 352fa99..a90fae7 100644
--- a/src/radeon_chipinfo_gen.h
+++ b/src/radeon_chipinfo_gen.h
@@ -26,7 +26,6 @@ static RADEONCardInfo RADEONCards[] = {
  { 0x4156, CHIP_FAMILY_RV350, 0, 0, 0, 0, 0 },
  { 0x4237, CHIP_FAMILY_RS200, 0, 1, 0, 0, 1 },
  { 0x4242, CHIP_FAMILY_R200, 0, 0, 0, 1, 0 },
- { 0x4243, CHIP_FAMILY_R200, 0, 0, 0, 1, 0 },
  { 0x4336, CHIP_FAMILY_RS100, 1, 1, 0, 0, 1 },
  { 0x4337, CHIP_FAMILY_RS200, 1, 1, 0, 0, 1 },
  { 0x4437, CHIP_FAMILY_RS200, 1, 1, 0, 0, 1 },
diff --git a/src/radeon_chipset_gen.h b/src/radeon_chipset_gen.h
index 09a957e..2af046c 100644
--- a/src/radeon_chipset_gen.h
+++ b/src/radeon_chipset_gen.h
@@ -26,7 +26,6 @@ static SymTabRec RADEONChipsets[] = {
   { PCI_CHIP_RV350_AV, "ATI FireGL RV360 AV (AGP)" },
   { PCI_CHIP_RS250_4237, "ATI Radeon 7000 IGP (A4+) 4237" },
   { PCI_CHIP_R200_BB, "ATI Radeon 8500 AIW BB (AGP)" },
-  { PCI_CHIP_R200_BC, "ATI Radeon 8500 AIW BC (AGP)" },
   { PCI_CHIP_RS100_4336, "ATI Radeon IGP320M (U1) 4336" },
   { PCI_CHIP_RS200_4337, "ATI Radeon IGP330M/340M/350M (U2) 4337" },
   { PCI_CHIP_RS250_4437, "ATI Radeon Mobility 7000 IGP 4437" },
diff --git a/src/radeon_pci_chipset_gen.h b/src/radeon_pci_chipset_gen.h
index d6b3b11..b4b2a79 100644
--- a/src/radeon_pci_chipset_gen.h
+++ b/src/radeon_pci_chipset_gen.h
@@ -26,7 +26,6 @@ PciChipsets RADEONPciChipsets[] = {
  { PCI_CHIP_RV350_AV, PCI_CHIP_RV350_AV, RES_SHARED_VGA },
  { PCI_CHIP_RS250_4237, PCI_CHIP_RS250_4237, RES_SHARED_VGA },
  { PCI_CHIP_R200_BB, PCI_CHIP_R200_BB, RES_SHARED_VGA },
- { PCI_CHIP_R200_BC, PCI_CHIP_R200_BC, RES_SHARED_VGA },
  { PCI_CHIP_RS100_4336, PCI_CHIP_RS100_4336, RES_SHARED_VGA },
  { PCI_CHIP_RS200_4337, PCI_CHIP_RS200_4337, RES_SHARED_VGA },
  { PCI_CHIP_RS250_4437, PCI_CHIP_RS250_4437, RES_SHARED_VGA },
diff --git a/src/radeon_pci_device_match_gen.h b/src/radeon_pci_device_match_gen.h
index dc34586..aa50306 100644
--- a/src/radeon_pci_device_match_gen.h
+++ b/src/radeon_pci_device_match_gen.h
@@ -26,7 +26,6 @@ static const struct pci_id_match radeon_device_match[] = {
  ATI_DEVICE_MATCH( PCI_CHIP_RV350_AV, 0 ),
  ATI_DEVICE_MATCH( PCI_CHIP_RS250_4237, 0 ),
  ATI_DEVICE_MATCH( PCI_CHIP_R200_BB, 0 ),
- ATI_DEVICE_MATCH( PCI_CHIP_R200_BC, 0 ),
  ATI_DEVICE_MATCH( PCI_CHIP_RS100_4336, 0 ),
  ATI_DEVICE_MATCH( PCI_CHIP_RS200_4337, 0 ),
  ATI_DEVICE_MATCH( PCI_CHIP_RS250_4437, 0 ),

commit 66eb81b62e5ae8e1d7bd44ed8a179e5ec1ca69af
Author: Michel Dänzer <daenzer@vmware.com>
Date:   Mon Jan 31 12:26:20 2011 +0100

    UMS: Slightly improve xserver version check.
    
    This will ensure the xserver definitions necessary to compile the new code are
    there. xf86CrtcSetMode will be unresolved at runtime with a few xserver
    commits, but I'm afraid this is the best we can do.
    
    See https://bugs.freedesktop.org/show_bug.cgi?id=33719 .

diff --git a/src/radeon_output.c b/src/radeon_output.c
index 83aa7c3..877d711 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -1618,7 +1618,7 @@ radeon_set_mode_for_property(xf86OutputPtr output)
 	xf86CrtcPtr crtc = output->crtc;
 
 	if (crtc->enabled) {
-#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,9,99,1,0)
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,9,99,901,0)
 	    xf86CrtcSetRec crtc_set_rec;
 
 	    crtc_set_rec.flags = (XF86CrtcSetMode |

commit 3dc28c86eb57cac819e4ed650acfe1f7df6ef565
Author: Alex Deucher <alexdeucher@gmail.com>
Date:   Thu Jan 27 13:09:26 2011 -0500

    ums: fix build against xserver >= 1.10
    
    xf86CrtcSetMode was removed in:
    http://cgit.freedesktop.org/xorg/xserver/commit/?id=8b35118c03590a7ad3786d3284bafb3f40fcb8cc

diff --git a/src/radeon_output.c b/src/radeon_output.c
index 689a592..83aa7c3 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -1618,8 +1618,23 @@ radeon_set_mode_for_property(xf86OutputPtr output)
 	xf86CrtcPtr crtc = output->crtc;
 
 	if (crtc->enabled) {
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,9,99,1,0)
+	    xf86CrtcSetRec crtc_set_rec;
+
+	    crtc_set_rec.flags = (XF86CrtcSetMode |
+				  XF86CrtcSetOutput |
+				  XF86CrtcSetOrigin |
+				  XF86CrtcSetRotation);
+	    crtc_set_rec.mode = &crtc->desiredMode;
+	    crtc_set_rec.rotation = crtc->desiredRotation;
+	    crtc_set_rec.transform = NULL;
+	    crtc_set_rec.x = crtc->desiredX;
+	    crtc_set_rec.y = crtc->desiredY;
+	    if (!xf86CrtcSet(crtc, &crtc_set_rec)) {
+#else
 	    if (!xf86CrtcSetMode(crtc, &crtc->desiredMode, crtc->desiredRotation,
 				 crtc->desiredX, crtc->desiredY)) {
+#endif
 		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 			   "Failed to set mode after propery change!\n");
 		return FALSE;

commit f58e1354b78bf6b70120bddfe1566da3b0723f72
Author: Jerome Glisse <jglisse@redhat.com>
Date:   Wed Jan 26 16:13:30 2011 -0500

    dp: fix displayport support by syncing with KMS code
    
    Warning the dp clock value are divided by 10 in ddx (10 times
    bigger than kernel value) this is somethings very picky.
    
    Signed-off-by: Jerome Glisse <jglisse@redhat.com>

diff --git a/src/atombios_output.c b/src/atombios_output.c
index cad506e..af0e59a 100644
--- a/src/atombios_output.c
+++ b/src/atombios_output.c
@@ -65,7 +65,114 @@ const char *device_name[12] = {
     "DFP5",
 };
 
+#define AUX_NATIVE_WRITE                    0x8
+#define AUX_NATIVE_READ                     0x9
+
+#define AUX_I2C_WRITE                       0x0
+#define AUX_I2C_READ                        0x1
+#define AUX_I2C_STATUS                      0x2
+#define AUX_I2C_MOT                         0x4
+
+#define DP_DPCD_REV                         0x0
+#define DP_MAX_LINK_RATE                    0x1
+#define DP_MAX_LANE_COUNT                   0x2
+#define DP_MAX_DOWNSPREAD                   0x3
+#define DP_NORP                             0x4
+#define DP_DOWNSTREAMPORT_PRESENT           0x5
+#define DP_MAIN_LINK_CHANNEL_CONFIG         0x6
+#define DP_DP11_DOWNSTREAM_PORT_COUNT       0x7
+
+/* from intel i830_dp.h */
+#define DP_LINK_BW_SET                      0x100
+//# define DP_LINK_BW_1_62                    0x06
+//# define DP_LINK_BW_2_7                     0x0a
+#define DP_LANE_COUNT_SET                   0x101
+# define DP_LANE_COUNT_MASK                 0x0f
+# define DP_LANE_COUNT_ENHANCED_FRAME_EN    (1 << 7)
+
+#define DP_TRAINING_PATTERN_SET             0x102
+
+# define DP_TRAINING_PATTERN_DISABLE        0
+# define DP_TRAINING_PATTERN_1              1
+# define DP_TRAINING_PATTERN_2              2
+# define DP_TRAINING_PATTERN_MASK           0x3
+
+# define DP_LINK_QUAL_PATTERN_DISABLE       (0 << 2)
+# define DP_LINK_QUAL_PATTERN_D10_2         (1 << 2)
+# define DP_LINK_QUAL_PATTERN_ERROR_RATE    (2 << 2)
+# define DP_LINK_QUAL_PATTERN_PRBS7         (3 << 2)
+# define DP_LINK_QUAL_PATTERN_MASK          (3 << 2)
+# define DP_RECOVERED_CLOCK_OUT_EN          (1 << 4)
+# define DP_LINK_SCRAMBLING_DISABLE         (1 << 5)
+
+# define DP_SYMBOL_ERROR_COUNT_BOTH         (0 << 6)
+# define DP_SYMBOL_ERROR_COUNT_DISPARITY    (1 << 6)
+# define DP_SYMBOL_ERROR_COUNT_SYMBOL       (2 << 6)
+# define DP_SYMBOL_ERROR_COUNT_MASK         (3 << 6)
+
+#define DP_TRAINING_LANE0_SET               0x103
+#define DP_TRAINING_LANE1_SET               0x104
+#define DP_TRAINING_LANE2_SET               0x105
+#define DP_TRAINING_LANE3_SET               0x106
+# define DP_TRAIN_VOLTAGE_SWING_MASK        0x3
+# define DP_TRAIN_VOLTAGE_SWING_SHIFT       0
+# define DP_TRAIN_MAX_SWING_REACHED         (1 << 2)
+# define DP_TRAIN_VOLTAGE_SWING_400         (0 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_600         (1 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_800         (2 << 0)
+# define DP_TRAIN_VOLTAGE_SWING_1200        (3 << 0)
+
+# define DP_TRAIN_PRE_EMPHASIS_MASK         (3 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_0            (0 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_3_5          (1 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_6            (2 << 3)
+# define DP_TRAIN_PRE_EMPHASIS_9_5          (3 << 3)
+
+# define DP_TRAIN_PRE_EMPHASIS_SHIFT        3
+# define DP_TRAIN_MAX_PRE_EMPHASIS_REACHED  (1 << 5)
+#define DP_DOWNSPREAD_CTRL                  0x107
+# define DP_SPREAD_AMP_0_5                  (1 << 4)
+
+#define DP_MAIN_LINK_CHANNEL_CODING_SET     0x108
+# define DP_SET_ANSI_8B10B                  (1 << 0)
+
+#define DP_LANE0_1_STATUS                   0x202
+#define DP_LANE2_3_STATUS                   0x203
+
+# define DP_LANE_CR_DONE                    (1 << 0)
+# define DP_LANE_CHANNEL_EQ_DONE            (1 << 1)
+# define DP_LANE_SYMBOL_LOCKED              (1 << 2)
+
+#define DP_LANE_ALIGN_STATUS_UPDATED        0x204
+#define DP_INTERLANE_ALIGN_DONE             (1 << 0)
+#define DP_DOWNSTREAM_PORT_STATUS_CHANGED   (1 << 6)
+#define DP_LINK_STATUS_UPDATED              (1 << 7)
+
+#define DP_SINK_STATUS                      0x205
+
+#define DP_RECEIVE_PORT_0_STATUS            (1 << 0)
+#define DP_RECEIVE_PORT_1_STATUS            (1 << 1)
+
+#define DP_ADJUST_REQUEST_LANE0_1           0x206
+#define DP_ADJUST_REQUEST_LANE2_3           0x207
+
+#define DP_ADJUST_VOLTAGE_SWING_LANE0_MASK  0x03
+#define DP_ADJUST_VOLTAGE_SWING_LANE0_SHIFT 0
+#define DP_ADJUST_PRE_EMPHASIS_LANE0_MASK   0x0c
+#define DP_ADJUST_PRE_EMPHASIS_LANE0_SHIFT  2
+#define DP_ADJUST_VOLTAGE_SWING_LANE1_MASK  0x30
+#define DP_ADJUST_VOLTAGE_SWING_LANE1_SHIFT 4
+#define DP_ADJUST_PRE_EMPHASIS_LANE1_MASK   0xc0
+#define DP_ADJUST_PRE_EMPHASIS_LANE1_SHIFT  6
+
+#define DP_LINK_STATUS_SIZE                 6
+#define DP_LINK_CONFIGURATION_SIZE          9
+
+#define DP_SET_POWER_D0  0x1
+#define DP_SET_POWER_D3  0x2
+
 static void do_displayport_link_train(xf86OutputPtr output);
+static void atombios_pick_dig_encoder(xf86OutputPtr output);
 
 static int
 atombios_output_dac_setup(xf86OutputPtr output, int action)
@@ -487,40 +594,68 @@ static const int num_dp_clocks = sizeof(dp_clocks) / sizeof(int);
 
 # define DP_LINK_BW_1_62                    0x06
 # define DP_LINK_BW_2_7                     0x0a
+static int radeon_dp_max_lane_count(xf86OutputPtr output);
 
 static int
-dp_lanes_for_mode_clock(RADEONOutputPrivatePtr radeon_output,
-			int mode_clock)
+dp_lanes_for_mode_clock(xf86OutputPtr output, int mode_clock)
 {
+    RADEONOutputPrivatePtr radeon_output = output->driver_private;
     int i;
     int max_link_bw = radeon_output->dpcd[1];
+    int max_lane_count = radeon_dp_max_lane_count(output);
 
     switch (max_link_bw) {
     case DP_LINK_BW_1_62:
     default:
 	for (i = 0; i < num_dp_clocks; i++) {
-	    if (i % 2)
-		continue;
-	    if (dp_clocks[i] > (mode_clock / 10)) {
-		if (i < 2)
-		    return 1;
-		else if (i < 4)
-		    return 2;
-		else
-		    return 4;
-	    }
+		if (i % 2)
+			continue;
+		switch (max_lane_count) {
+		case 1:
+			if (i > 1)
+				return 0;
+			break;
+		case 2:
+			if (i > 3)
+				return 0;
+			break;
+		case 4:
+		default:
+			break;
+		}
+		if (dp_clocks[i] > (mode_clock/10)) {
+			if (i < 2)
+				return 1;
+			else if (i < 4)
+				return 2;
+			else
+				return 4;
+		}
 	}
 	break;
     case DP_LINK_BW_2_7:
 	for (i = 0; i < num_dp_clocks; i++) {
-	    if (dp_clocks[i] > (mode_clock / 10)) {
-		if (i < 2)
-		    return 1;
-		else if (i < 4)
-		    return 2;
-		else
-		    return 4;
-	    }
+		switch (max_lane_count) {
+		case 1:
+			if (i > 1)
+				return 0;
+			break;
+		case 2:
+			if (i > 3)
+				return 0;
+			break;
+		case 4:
+		default:
+			break;
+		}
+		if (dp_clocks[i] > (mode_clock/10)) {
+			if (i < 2)
+				return 1;
+			else if (i < 4)
+				return 2;
+			else
+				return 4;
+		}
 	}
         break;
     }
@@ -529,21 +664,54 @@ dp_lanes_for_mode_clock(RADEONOutputPrivatePtr radeon_output,
 }
 
 static int
-dp_link_clock_for_mode_clock(RADEONOutputPrivatePtr radeon_output,
-			     int mode_clock)
+dp_link_clock_for_mode_clock(xf86OutputPtr output, int mode_clock)
 {
+    RADEONOutputPrivatePtr radeon_output = output->driver_private;
     int i;
     int max_link_bw = radeon_output->dpcd[1];
+    int max_lane_count = radeon_dp_max_lane_count(output);
 
     switch (max_link_bw) {
     case DP_LINK_BW_1_62:
     default:
-	return 16200;
+	for (i = 0; i < num_dp_clocks; i++) {
+		if (i % 2)
+			continue;
+		switch (max_lane_count) {
+		case 1:
+			if (i > 1)
+				return 0;
+			break;
+		case 2:
+			if (i > 3)
+				return 0;
+			break;
+		case 4:
+		default:
+			break;
+		}
+		if (dp_clocks[i] > (mode_clock/10))
+			return 16200;
+	}
 	break;
     case DP_LINK_BW_2_7:
-	for (i = 0; i < num_dp_clocks; i++)
-	    if (dp_clocks[i] > (mode_clock / 10))
-		return (i % 2) ? 27000 : 16200;
+	for (i = 0; i < num_dp_clocks; i++) {
+		switch (max_lane_count) {
+		case 1:
+			if (i > 1)
+				return 0;
+			break;
+		case 2:
+			if (i > 3)
+				return 0;
+			break;
+		case 4:
+		default:
+			break;


Reply to: