Rebased ref, commits from common ancestor:
commit cec71d9b8ad736a8752aa67ed4b0be7966c03385
Author: Brice Goglin <[EMAIL PROTECTED]>
Date:   Fri Dec 21 08:12:35 2007 +0100

    Prepare changelog and NEWS for upload to unstable

diff --git a/debian/NEWS b/debian/NEWS
index a87f599..555269e 100644
--- a/debian/NEWS
+++ b/debian/NEWS
@@ -1,4 +1,4 @@
-xserver-xorg-video-ati (1:6.7.197-1) UNRELEASED; urgency=low
+xserver-xorg-video-ati (1:6.7.197-1) unstable; urgency=low
 
   * The X.Org ATI driver supports RandR 1.2 which enables dynamic
     enabling, disabling, resizing, rotating, placing, ... of multiple
@@ -6,4 +6,4 @@ xserver-xorg-video-ati (1:6.7.197-1) UNRELEASED; urgency=low
     accordingly. See http://wiki.debian.org/XStrikeForce/HowToRandR12
     and http://www.intellinuxgraphics.org/dualhead.html for some help.
 
- -- Brice Goglin <[EMAIL PROTECTED]>  Fri, 21 Dec 2007 08:08:45 +0100
+ -- Brice Goglin <[EMAIL PROTECTED]>  Fri, 21 Dec 2007 08:12:13 +0100
diff --git a/debian/changelog b/debian/changelog
index c04bec8..da3ed99 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,11 @@
-xserver-xorg-video-ati (1:6.7.197-1) UNRELEASED; urgency=low
+xserver-xorg-video-ati (1:6.7.197-1) unstable; urgency=low
 
   * New upstream release candidate.
+  * Upload to unstable since this release candidate is supposed
+    to be much better than the old 1:6.6.193-3.
   * Add a NEWS entry pointing to some RandR 1.2 documentation.
 
- -- Brice Goglin <[EMAIL PROTECTED]>  Fri, 21 Dec 2007 08:07:30 +0100
+ -- Brice Goglin <[EMAIL PROTECTED]>  Fri, 21 Dec 2007 08:11:07 +0100
 
 xserver-xorg-video-ati (1:6.7.197~git20071219.ce4fa1ce-1) experimental; 
urgency=low
 

commit 6305cdf9fb500ccece59a9e2181942b4d50e4868
Author: Brice Goglin <[EMAIL PROTECTED]>
Date:   Fri Dec 21 08:09:08 2007 +0100

    Add a NEWS entry pointing to some RandR 1.2 documentation

diff --git a/debian/NEWS b/debian/NEWS
new file mode 100644
index 0000000..a87f599
--- /dev/null
+++ b/debian/NEWS
@@ -0,0 +1,9 @@
+xserver-xorg-video-ati (1:6.7.197-1) UNRELEASED; urgency=low
+
+  * The X.Org ATI driver supports RandR 1.2 which enables dynamic
+    enabling, disabling, resizing, rotating, placing, ... of multiple
+    outputs at runtime. You might want to update your /etc/X11/xorg.conf
+    accordingly. See http://wiki.debian.org/XStrikeForce/HowToRandR12
+    and http://www.intellinuxgraphics.org/dualhead.html for some help.
+
+ -- Brice Goglin <[EMAIL PROTECTED]>  Fri, 21 Dec 2007 08:08:45 +0100
diff --git a/debian/changelog b/debian/changelog
index 698f8e3..c04bec8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,9 @@
 xserver-xorg-video-ati (1:6.7.197-1) UNRELEASED; urgency=low
 
   * New upstream release candidate.
+  * Add a NEWS entry pointing to some RandR 1.2 documentation.
 
- -- Brice Goglin <[EMAIL PROTECTED]>  Fri, 21 Dec 2007 07:57:52 +0100
+ -- Brice Goglin <[EMAIL PROTECTED]>  Fri, 21 Dec 2007 08:07:30 +0100
 
 xserver-xorg-video-ati (1:6.7.197~git20071219.ce4fa1ce-1) experimental; 
urgency=low
 

commit e4004cadac88865f833753cd69d8770b754d0f3f
Author: Brice Goglin <[EMAIL PROTECTED]>
Date:   Fri Dec 21 07:59:15 2007 +0100

    New upstream release candidate

diff --git a/ChangeLog b/ChangeLog
index 99fef9a..a8bc3ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,51 @@
+commit eb99c3c5c9a2249cb84920f0f225e525fc3a4144
+Author: Alex Deucher <[EMAIL PROTECTED](none)>
+Date:   Thu Dec 20 18:14:38 2007 -0500
+
+    Bump for RC release
+
+commit 8d49ff1da917b7f8240267953ef6ce4ff04daecb
+Author: Alex Deucher <[EMAIL PROTECTED](none)>
+Date:   Thu Dec 20 01:09:57 2007 -0500
+
+    RADEON: check for xf86_crtc_clip_video_helper() in configure.ac
+    
+    use xf86_crtc_clip_video_helper() from the server if available.
+
+commit fb7a4e24f2da3561ef81371ca4013a4f13806e91
+Author: Adam Jackson <[EMAIL PROTECTED]>
+Date:   Wed Dec 19 19:15:19 2007 -0500
+
+    Fix RN50 mode filtering.
+    
+    The old code would attempt to limit the maximum pixel size of the screen
+    by limiting the maximum PLL frequency.  This ends up confusing the PLL
+    computation code since sometimes your maximum freq can be lower than your
+    minimum freq.  More to the point it's just wrong, maximum PLL frequency
+    isn't the same thing as maximum pixel clock, and even that isn't the same
+    thing as maximum scanout pixels per second.
+    
+    The correct thing to do is filter by the mode's effective memory bandwidth.
+
+commit c1b0b69cc50516c3b7e881b0eb46cb3cd2e9dce6
+Merge: 0e66348... ce4fa1c...
+Author: Alex Deucher <[EMAIL PROTECTED](none)>
+Date:   Wed Dec 19 11:54:50 2007 -0500
+
+    Merge branch 'master' of ssh://[EMAIL 
PROTECTED]/git/xorg/driver/xf86-video-ati
+
+commit 0e6634870d1ab38ee8c83f6bda1ba60364997853
+Author: Alex Deucher <[EMAIL PROTECTED](none)>
+Date:   Wed Dec 19 11:54:27 2007 -0500
+
+    RADEON: skip empty connectors when creating outputs
+
+commit 6afbf718c151dc3c5c59bd3136b58a93a114d798
+Author: Alex Deucher <[EMAIL PROTECTED](none)>
+Date:   Wed Dec 19 11:48:38 2007 -0500
+
+    RADEON: add support for legacy radeons with DVI and no connector table
+
 commit ce4fa1cedec0cf56b9979dfaa12a8d3a7c643df4
 Author: Arkadiusz Miskiewicz <[EMAIL PROTECTED]>
 Date:   Tue Dec 18 15:34:14 2007 -0500
diff --git a/config.h.in b/config.h.in
index 636a744..c613e6c 100644
--- a/config.h.in
+++ b/config.h.in
@@ -41,6 +41,12 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
+/* Have xf86_crtc_clip_video_helper prototype */
+#undef HAVE_XF86CRTCCLIPVIDEOHELPER
+
+/* Have xf86ModeBandwidth prototype */
+#undef HAVE_XF86MODEBANDWIDTH
+
 /* Have xf86XVFillKeyHelperDrawable prototype */
 #undef HAVE_XV_DRAWABLE_HELPER
 
diff --git a/configure b/configure
index c7ec786..479fc03 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for xf86-video-ati 6.7.196.
+# Generated by GNU Autoconf 2.61 for xf86-video-ati 6.7.197.
 #
 # Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
 #
@@ -728,8 +728,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='xf86-video-ati'
 PACKAGE_TARNAME='xf86-video-ati'
-PACKAGE_VERSION='6.7.196'
-PACKAGE_STRING='xf86-video-ati 6.7.196'
+PACKAGE_VERSION='6.7.197'
+PACKAGE_STRING='xf86-video-ati 6.7.197'
 PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
 
 ac_unique_file="Makefile.am"
@@ -1444,7 +1444,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures xf86-video-ati 6.7.196 to adapt to many kinds of 
systems.
+\`configure' configures xf86-video-ati 6.7.197 to adapt to many kinds of 
systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1514,7 +1514,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of xf86-video-ati 6.7.196:";;
+     short | recursive ) echo "Configuration of xf86-video-ati 6.7.197:";;
    esac
   cat <<\_ACEOF
 
@@ -1634,7 +1634,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-xf86-video-ati configure 6.7.196
+xf86-video-ati configure 6.7.197
 generated by GNU Autoconf 2.61
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1648,7 +1648,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by xf86-video-ati $as_me 6.7.196, which was
+It was created by xf86-video-ati $as_me 6.7.197, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
@@ -2343,7 +2343,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='xf86-video-ati'
- VERSION='6.7.196'
+ VERSION='6.7.197'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -21683,6 +21683,130 @@ _ACEOF
 fi
 
 
+{ echo "$as_me:$LINENO: checking whether xf86ModeBandwidth is declared" >&5
+echo $ECHO_N "checking whether xf86ModeBandwidth is declared... $ECHO_C" >&6; }
+if test "${ac_cv_have_decl_xf86ModeBandwidth+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include "xf86Modes.h"
+
+int
+main ()
+{
+#ifndef xf86ModeBandwidth
+  (void) xf86ModeBandwidth;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_xf86ModeBandwidth=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl_xf86ModeBandwidth=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_xf86ModeBandwidth" >&5
+echo "${ECHO_T}$ac_cv_have_decl_xf86ModeBandwidth" >&6; }
+if test $ac_cv_have_decl_xf86ModeBandwidth = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_XF86MODEBANDWIDTH 1
+_ACEOF
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking whether xf86_crtc_clip_video_helper is 
declared" >&5
+echo $ECHO_N "checking whether xf86_crtc_clip_video_helper is declared... 
$ECHO_C" >&6; }
+if test "${ac_cv_have_decl_xf86_crtc_clip_video_helper+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include "xf86Crtc.h"
+
+int
+main ()
+{
+#ifndef xf86_crtc_clip_video_helper
+  (void) xf86_crtc_clip_video_helper;
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_have_decl_xf86_crtc_clip_video_helper=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_cv_have_decl_xf86_crtc_clip_video_helper=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_have_decl_xf86_crtc_clip_video_helper" 
>&5
+echo "${ECHO_T}$ac_cv_have_decl_xf86_crtc_clip_video_helper" >&6; }
+if test $ac_cv_have_decl_xf86_crtc_clip_video_helper = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_XF86CRTCCLIPVIDEOHELPER 1
+_ACEOF
+
+fi
+
+
 { echo "$as_me:$LINENO: checking whether XSERVER_LIBPCIACCESS is declared" >&5
 echo $ECHO_N "checking whether XSERVER_LIBPCIACCESS is declared... $ECHO_C" 
>&6; }
 if test "${ac_cv_have_decl_XSERVER_LIBPCIACCESS+set}" = set; then
@@ -22645,7 +22769,7 @@ exec 6>&1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by xf86-video-ati $as_me 6.7.196, which was
+This file was extended by xf86-video-ati $as_me 6.7.197, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -22698,7 +22822,7 @@ Report bugs to <[EMAIL PROTECTED]>."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-xf86-video-ati config.status 6.7.196
+xf86-video-ati config.status 6.7.197
 configured by $0, generated by GNU Autoconf 2.61,
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; 
s/[\\""\`\$]/\\\\&/g'`\\"
 
diff --git a/debian/changelog b/debian/changelog
index b71a784..698f8e3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+xserver-xorg-video-ati (1:6.7.197-1) UNRELEASED; urgency=low
+
+  * New upstream release candidate.
+
+ -- Brice Goglin <[EMAIL PROTECTED]>  Fri, 21 Dec 2007 07:57:52 +0100
+
 xserver-xorg-video-ati (1:6.7.197~git20071219.ce4fa1ce-1) experimental; 
urgency=low
 
   * New upstream snapshot, containing commits up to ce4fa1ce.

commit eb99c3c5c9a2249cb84920f0f225e525fc3a4144
Author: Alex Deucher <[EMAIL PROTECTED](none)>
Date:   Thu Dec 20 18:14:38 2007 -0500

    Bump for RC release

diff --git a/configure.ac b/configure.ac
index ae5cb2b..48302d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-ati],
-        6.7.196,
+        6.7.197,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-ati)
 

commit 8d49ff1da917b7f8240267953ef6ce4ff04daecb
Author: Alex Deucher <[EMAIL PROTECTED](none)>
Date:   Thu Dec 20 01:09:57 2007 -0500

    RADEON: check for xf86_crtc_clip_video_helper() in configure.ac
    
    use xf86_crtc_clip_video_helper() from the server if available.

diff --git a/configure.ac b/configure.ac
index cc4d490..ae5cb2b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -209,6 +209,11 @@ AC_CHECK_DECL(xf86ModeBandwidth,
              [],
              [#include "xf86Modes.h"])
 
+AC_CHECK_DECL(xf86_crtc_clip_video_helper,
+             [AC_DEFINE(HAVE_XF86CRTCCLIPVIDEOHELPER, 1, [Have 
xf86_crtc_clip_video_helper prototype])],
+             [],
+             [#include "xf86Crtc.h"])
+
 AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
              [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
              [#include "xorg-server.h"])
diff --git a/src/radeon_video.c b/src/radeon_video.c
index 3f0209e..2b5764f 100644
--- a/src/radeon_video.c
+++ b/src/radeon_video.c
@@ -119,6 +119,7 @@ static Atom xvOvAlpha, xvGrAlpha, xvAlphaMode;
 #define GET_PORT_PRIVATE(pScrn) \
    (RADEONPortPrivPtr)((RADEONPTR(pScrn))->adaptor->pPortPrivates[0].ptr)
 
+#ifndef HAVE_XF86CRTCCLIPVIDEOHELPER
 static void
 radeon_box_intersect(BoxPtr dest, BoxPtr a, BoxPtr b)
 {
@@ -185,17 +186,17 @@ radeon_covering_crtc(ScrnInfoPtr pScrn,
 }
 
 static Bool
-radeon_clip_video_helper(ScrnInfoPtr pScrn,
-                        xf86CrtcPtr *crtc_ret,
-                        xf86CrtcPtr desired_crtc,
-                        BoxPtr      dst,
-                        INT32      *xa,
-                        INT32      *xb,
-                        INT32      *ya,
-                        INT32      *yb,
-                        RegionPtr   reg,
-                        INT32      width,
-                        INT32      height)
+radeon_crtc_clip_video_helper(ScrnInfoPtr pScrn,
+                             xf86CrtcPtr *crtc_ret,
+                             xf86CrtcPtr desired_crtc,
+                             BoxPtr      dst,
+                             INT32       *xa,
+                             INT32       *xb,
+                             INT32       *ya,
+                             INT32       *yb,
+                             RegionPtr   reg,
+                             INT32       width,
+                             INT32       height)
 {
     Bool       ret;
     RegionRec  crtc_region_local;
@@ -227,6 +228,31 @@ radeon_clip_video_helper(ScrnInfoPtr pScrn,
 
     return ret;
 }
+#endif
+
+static Bool
+radeon_crtc_clip_video(ScrnInfoPtr pScrn,
+                      xf86CrtcPtr *crtc_ret,
+                      xf86CrtcPtr desired_crtc,
+                      BoxPtr      dst,
+                      INT32       *xa,
+                      INT32       *xb,
+                      INT32       *ya,
+                      INT32       *yb,
+                      RegionPtr   reg,
+                      INT32       width,
+                      INT32       height)
+{
+#ifndef HAVE_XF86CRTCCLIPVIDEOHELPER
+    return radeon_crtc_clip_video_helper(pScrn, crtc_ret, desired_crtc,
+                                      dst, xa, xb, ya, yb,
+                                      reg, width, height);
+#else
+    return xf86_crtc_clip_video_helper(pScrn, crtc_ret, desired_crtc,
+                                      dst, xa, xb, ya, yb,
+                                      reg, width, height);
+#endif
+}
 
 #ifdef USE_EXA
 static void
@@ -2899,9 +2925,9 @@ RADEONPutImage(
    dstBox.y1 = drw_y;
    dstBox.y2 = drw_y + drw_h;
 
-   if (!radeon_clip_video_helper(pScrn, &crtc, pPriv->desired_crtc,
-                                &dstBox, &xa, &xb, &ya, &yb,
-                                clipBoxes, width, height))
+   if (!radeon_crtc_clip_video(pScrn, &crtc, pPriv->desired_crtc,
+                              &dstBox, &xa, &xb, &ya, &yb,
+                              clipBoxes, width, height))
        return Success;
 
    if (!crtc) {
@@ -3295,9 +3321,9 @@ RADEONDisplaySurface(
     dstBox.y1 = drw_y;
     dstBox.y2 = drw_y + drw_h;
 
-    if (!radeon_clip_video_helper(pScrn, &crtc, portPriv->desired_crtc,
-                                 &dstBox, &xa, &xb, &ya, &yb, clipBoxes,
-                                 surface->width, surface->height))
+    if (!radeon_crtc_clip_video(pScrn, &crtc, portPriv->desired_crtc,
+                               &dstBox, &xa, &xb, &ya, &yb, clipBoxes,
+                               surface->width, surface->height))
         return Success;
 
    if (!crtc) {
@@ -3438,9 +3464,9 @@ RADEONPutVideo(
    else
        vbi_line_width = 2000; /* might need adjustment */
 
-   if (!radeon_clip_video_helper(pScrn, &crtc, pPriv->desired_crtc,
-                                &dstBox, &xa, &xb, &ya, &yb,
-                                clipBoxes, width, height))
+   if (!radeon_crtc_clip_video(pScrn, &crtc, pPriv->desired_crtc,
+                              &dstBox, &xa, &xb, &ya, &yb,
+                              clipBoxes, width, height))
        return Success;
 
    if (!crtc) {

commit fb7a4e24f2da3561ef81371ca4013a4f13806e91
Author: Adam Jackson <[EMAIL PROTECTED]>
Date:   Wed Dec 19 19:15:19 2007 -0500

    Fix RN50 mode filtering.
    
    The old code would attempt to limit the maximum pixel size of the screen
    by limiting the maximum PLL frequency.  This ends up confusing the PLL
    computation code since sometimes your maximum freq can be lower than your
    minimum freq.  More to the point it's just wrong, maximum PLL frequency
    isn't the same thing as maximum pixel clock, and even that isn't the same
    thing as maximum scanout pixels per second.
    
    The correct thing to do is filter by the mode's effective memory bandwidth.

diff --git a/configure.ac b/configure.ac
index 1570e54..cc4d490 100644
--- a/configure.ac
+++ b/configure.ac
@@ -204,6 +204,11 @@ AC_CHECK_DECL(xf86XVFillKeyHelperDrawable,
              [],
              [#include <xf86xv.h>])
 
+AC_CHECK_DECL(xf86ModeBandwidth,
+             [AC_DEFINE(HAVE_XF86MODEBANDWIDTH, 1, [Have xf86ModeBandwidth 
prototype])],
+             [],
+             [#include "xf86Modes.h"])
+
 AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
              [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
              [#include "xorg-server.h"])
diff --git a/src/radeon.h b/src/radeon.h
index 03db360..801d616 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -41,6 +41,7 @@
 #include <unistd.h>            /* For usleep() */
 #include <sys/time.h>          /* For gettimeofday() */
 
+#include "config.h"
 #include "xf86str.h"
 #include "compiler.h"
 #include "xf86fbman.h"
@@ -97,6 +98,11 @@
 #define MIN(a,b) ((a)>(b)?(b):(a))
 #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,
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 25b2119..9f9fd90 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -1051,18 +1051,6 @@ static void RADEONGetClockInfo(ScrnInfoPtr pScrn)
         info->mclk = 200.00;
     }
 
-    if (info->ChipFamily == CHIP_FAMILY_RV100 && !pRADEONEnt->HasCRTC2) {
-        /* Avoid RN50 corruption due to memory bandwidth starvation.
-         * 18 is an empirical value based on the databook and Windows driver.
-         *
-        * Empirical value changed to 24 to raise pixel clock limit and
-        * allow higher resolution modes on capable monitors
-        */
-        pll->max_pll_freq = min(pll->max_pll_freq,
-                               24 * info->mclk * 100 / pScrn->bitsPerPixel *
-                               info->RamWidth / 16);
-    }
-
     /* card limits for computing PLLs */
     pll->min_ref_div = 2;
     pll->max_ref_div = 0x3ff;
@@ -5380,10 +5368,44 @@ Bool RADEONHandleMessage(int scrnIndex, const char* 
msgtype,
 }
 #endif
 
+#ifndef HAVE_XF86MODEBANDWIDTH
+/** Calculates the memory bandwidth (in MiB/sec) of a mode. */
+_X_HIDDEN unsigned int
+xf86ModeBandwidth(DisplayModePtr mode, int depth)
+{
+    float a_active, a_total, active_percent, pixels_per_second;
+    int bytes_per_pixel = (depth + 7) / 8;
+
+    if (!mode->HTotal || !mode->VTotal || !mode->Clock)
+       return 0;
+
+    a_active = mode->HDisplay * mode->VDisplay;
+    a_total = mode->HTotal * mode->VTotal;
+    active_percent = a_active / a_total;
+    pixels_per_second = active_percent * mode->Clock * 1000.0;
+
+    return (unsigned int)(pixels_per_second * bytes_per_pixel / (1024 * 1024));
+}
+#endif
+
 /* Used to disallow modes that are not supported by the hardware */
 ModeStatus RADEONValidMode(int scrnIndex, DisplayModePtr mode,
                                      Bool verbose, int flag)
 {
+    ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+    RADEONInfoPtr info = RADEONPTR(pScrn);
+    RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
+
+    /*
+     * RN50 has effective maximum mode bandwidth of about 300MiB/s.
+     * XXX should really do this for all chips by properly computing
+     * memory bandwidth and an overhead factor.
+     */
+    if (info->ChipFamily == CHIP_FAMILY_RV100 && !pRADEONEnt->HasCRTC2) {
+       if (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 300)
+           return MODE_BANDWIDTH;
+    }
+
     /* There are problems with double scan mode at high clocks
      * They're likely related PLL and display buffer settings.
      * Disable these modes for now.
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 9850702..64c0438 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -789,6 +789,19 @@ static int
 radeon_mode_valid(xf86OutputPtr output, DisplayModePtr pMode)
 {
     RADEONOutputPrivatePtr radeon_output = output->driver_private;
+    ScrnInfoPtr pScrn = output->scrn;
+    RADEONInfoPtr info = RADEONPTR(pScrn);
+    RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
+
+    /*
+     * RN50 has effective maximum mode bandwidth of about 300MiB/s.
+     * XXX should really do this for all chips by properly computing
+     * memory bandwidth and an overhead factor.
+     */
+    if (info->ChipFamily == CHIP_FAMILY_RV100 && !pRADEONEnt->HasCRTC2) {
+       if (xf86ModeBandwidth(pMode, pScrn->bitsPerPixel) > 300)
+           return MODE_BANDWIDTH;
+    }
 
     if (radeon_output->type == OUTPUT_STV ||
        radeon_output->type == OUTPUT_CTV) {

commit 0e6634870d1ab38ee8c83f6bda1ba60364997853
Author: Alex Deucher <[EMAIL PROTECTED](none)>
Date:   Wed Dec 19 11:54:27 2007 -0500

    RADEON: skip empty connectors when creating outputs

diff --git a/src/radeon_output.c b/src/radeon_output.c
index c60ece8..115666d 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -3217,6 +3217,10 @@ Bool RADEONSetupConnectors(ScrnInfoPtr pScrn)
 
     for (i = 0 ; i < RADEON_MAX_BIOS_CONNECTOR; i++) {
        if (info->BiosConnector[i].valid) {
+
+           if (info->BiosConnector[i].ConnectorType == CONNECTOR_NONE)
+               continue;
+
            RADEONOutputPrivatePtr radeon_output = 
xnfcalloc(sizeof(RADEONOutputPrivateRec), 1);
            if (!radeon_output) {
                return FALSE;

commit 6afbf718c151dc3c5c59bd3136b58a93a114d798
Author: Alex Deucher <[EMAIL PROTECTED](none)>
Date:   Wed Dec 19 11:48:38 2007 -0500

    RADEON: add support for legacy radeons with DVI and no connector table

diff --git a/src/radeon_bios.c b/src/radeon_bios.c
index d150c4b..7d4d12a 100644
--- a/src/radeon_bios.c
+++ b/src/radeon_bios.c
@@ -277,7 +277,21 @@ static Bool RADEONGetLegacyConnectorInfoFromBIOS 
(ScrnInfoPtr pScrn)
        }
     } else {
        xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "No Connector Info Table 
found!\n");
-       return FALSE;
+
+       /* old radeons and r128 didn't use connector tables you just check
+        * for LVDS, DVI, TV, etc. tables
+        */
+       offset = RADEON_BIOS16(info->ROMHeaderStart + 0x34);
+       if (offset) {
+           xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                      "Found DFP table, assuming DVI connector\n");
+           info->BiosConnector[0].valid = TRUE;
+           info->BiosConnector[0].ConnectorType = CONNECTOR_DVI_I;
+           info->BiosConnector[0].DACType = DAC_PRIMARY;
+           info->BiosConnector[0].TMDSType = TMDS_INT;
+           info->BiosConnector[0].DDCType = DDC_DVI;
+       } else
+           return FALSE;
     }
 
     /* check LVDS table */

commit 5d03d8bb56b4363eb8377c549a45119eae15e5f7
Author: Brice Goglin <[EMAIL PROTECTED]>
Date:   Wed Dec 19 08:44:46 2007 +0100

    New upstream snapshot

diff --git a/ChangeLog b/ChangeLog
index 84de39e..99fef9a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,359 @@
+commit ce4fa1cedec0cf56b9979dfaa12a8d3a7c643df4
+Author: Arkadiusz Miskiewicz <[EMAIL PROTECTED]>
+Date:   Tue Dec 18 15:34:14 2007 -0500
+
+    RADEON: fix fd leak in lid detect code
+
+commit 20568f66f9a9a60a33bd9a69ccc14a891c656836
+Author: Arkadiusz Miskiewicz <[EMAIL PROTECTED]>
+Date:   Tue Dec 18 15:32:10 2007 -0500
+
+    RADEON: more cleanups and warning fixes
+
+commit 1496194200adbcb044ec3977367a0908262e389c
+Author: Arkadiusz Miskiewicz <[EMAIL PROTECTED]>
+Date:   Tue Dec 18 15:29:53 2007 -0500
+
+    RADEON: driver cleanups, warning fixes
+
+commit 44d07c4ccce9acb5bd21a17acb082e91f7225764
+Author: Alex Deucher <[EMAIL PROTECTED]>
+Date:   Mon Dec 17 18:56:12 2007 -0500
+
+    RADEON: typo from last commit
+
+commit 4da3782239921eb377216d4de4a9cc5bb55e0e8a
+Author: Alex Deucher <[EMAIL PROTECTED]>
+Date:   Mon Dec 17 18:51:31 2007 -0500
+
+    RADEON: add output enable masks
+    
+    add output enable masks for outputs that drive
+    more than one connector.  Make sure we don't turn off
+    an output that's driving another connector.
+
+commit 5c5d2d19b2b032a06dd333b4ecc029aac342fb93
+Author: Alex Deucher <[EMAIL PROTECTED]>
+Date:   Mon Dec 17 18:15:55 2007 -0500
+
+    RADEON: whitespace clean-ups
+
+commit 9f1d8220315c8894a17f2cc328025dc682b0c6e0
+Author: Alex Deucher <[EMAIL PROTECTED]>
+Date:   Mon Dec 17 18:04:05 2007 -0500
+
+    RADEON: more PLL fixes
+    
+    - reduce the calculation accuracy
+    - certain LVDS panels seem to only like certain ref_divs
+    - add pll flags to handle special cases
+    - adjust the pll limits on legacy cards
+
+commit 4747c1f3cd4167b6a51d4864a297719ea48b9346
+Author: Alex Deucher <[EMAIL PROTECTED]>
+Date:   Sun Dec 16 14:07:29 2007 -0500
+
+    RADEON: Make sure LVDS_EN bit is set when enabling LVDS
+
+commit b653e5a628bfa4dfb168e96f93f41eb910f409fb
+Author: Michel Dänzer <[EMAIL PROTECTED]>
+Date:   Sat Dec 15 00:50:10 2007 +0100
+
+    radeon: Default to 1x again with non-v3 AGP cards.
+    
+    Seems more reliable in general than what was set up by firmware - fingers
+    crossed...
+
+commit 6229825fa5d6715569098afbb21a40f7a2e7e6be
+Author: Michel Dänzer <[EMAIL PROTECTED]>
+Date:   Sat Dec 15 00:48:26 2007 +0100
+
+    radeon: Warning fixes.
+    
+    The lid detection code probably wouldn't work on other non-x86 platforms
+    though...
+
+commit 818ccf0fd4b5879171c5f20526d5a58638f8fde5
+Author: Fredrik Höglund <[EMAIL PROTECTED]>
+Date:   Fri Dec 14 23:56:12 2007 +0100
+
+    RADEON: Fix the vertex coordinates for transformed pictures
+    
+    This partially fixes transformed pictures on R100/R200 based
+    cards.  The texture still doesn't appear to be clamped correctly,
+    but since that doesn't matter for rotations at perpendicular
+    angles, I'm committing this now so randr rotation and reflection
+    will work properly.
+
+commit 3cfbcf4cafbdfdb33411d16e51fb1f77cd0f93dd
+Author: Alex Deucher <[EMAIL PROTECTED]>
+Date:   Fri Dec 14 17:11:00 2007 -0500
+
+    RADEON: Fix PLL set up on certain notebooks
+    
+    Some LVDS panels require specific PLL dividers as
+    specified in the bios tables.  Make sure to use them
+    if the output is LVDS.
+
+commit a84d446fd301d456bcea8f7abdc52e5a30776412
+Author: Alex Deucher <[EMAIL PROTECTED](none)>
+Date:   Fri Dec 14 02:17:14 2007 -0500
+
+    RADEON: select fb_div0 for LVDS on RV410 (x700) mobility
+    
+    Fixes bug 8038
+    I wonder if desktop RV410 need a similar fix.
+    If your x700 laptop panel has problems after this let me know.
+
+commit 6ccf5b33d27218ae1c45ab93c122438ed536d8ba
+Author: Alex Deucher <[EMAIL PROTECTED](none)>
+Date:   Wed Dec 12 20:12:06 2007 -0500
+
+    RADEON: only enable vblanks if we want them
+    
+    should fix bug 13610
+
+commit 1668f2056f56370f1b5681c13f1e14904e301216
+Author: Alex Deucher <[EMAIL PROTECTED]>
+Date:   Wed Dec 12 19:39:08 2007 -0500
+
+    RADEON: use /proc/acpi to determine lid status
+    
+    Linux only
+
+commit 33a39947f7f79533cd90007a17d57b20126642c6
+Author: Alex Deucher <[EMAIL PROTECTED]>
+Date:   Wed Dec 12 18:50:18 2007 -0500
+
+    RADEON: fix cursors when using rotation
+    
+    allocate separate cursor buffers for each crtc
+
+commit 9e5efdecd12092031a4aebce58747cb4a6f48f28
+Author: Arkadiusz Miskiewicz <[EMAIL PROTECTED]>
+Date:   Tue Dec 11 23:53:03 2007 -0500
+
+    sparse fixes and cleanups from arekm
+
+commit f3d2ec3a5ae61215c792018320158750e7aa937c
+Author: Alex Deucher <[EMAIL PROTECTED](none)>
+Date:   Tue Dec 11 11:57:27 2007 -0500
+
+    RADEON: rewrite PLL computation
+    
+    Algorithm adapted from BeOS radeon driver with some tweaks by me.
+    Actually calulate and use the reference divider rather than using the bios 
default.
+    Also, always calculate the PLL, rather than falling back to bios dividers.
+    This should fix bugs 12913, 13590, 13533, possibly others.
+
+commit 9b125312ab6edc585e4f5931a6a6de81e13b6acc
+Author: Alex Deucher <[EMAIL PROTECTED]>
+Date:   Mon Dec 10 13:53:15 2007 -0500
+
+    RADEON: only update crtc values when RMX is active
+
+commit 3a161e1b5d80361e318ced8da5c19e797749d693
+Author: Alex Deucher <[EMAIL PROTECTED](none)>
+Date:   Mon Dec 10 00:57:26 2007 -0500
+
+    RADEON: bios PLL cleanup
+
+commit 5896ca4097d439f59f90f397939132c061c3c364
+Author: LisaWu <[EMAIL PROTECTED]>
+Date:   Fri Dec 7 09:45:05 2007 +0100
+
+    radeon: Use %u instead of %d for unsigned value.
+
+commit df44f8380268c27d3978c4e91d736f093322b8b8
+Author: Michel Dänzer <[EMAIL PROTECTED]>
+Date:   Fri Dec 7 09:41:47 2007 +0100
+
+    radeon: Use gettimeofday instead of xf86getsecs.
+
+commit 64ab1cdf343a9a69e7e9e64f0bba77c54a94e9d0
+Author: James Cloos <[EMAIL PROTECTED]>
+Date:   Thu Dec 6 15:51:12 2007 -0500
+
+    Add missing PHONY line for automatic ChangeLog generation
+
+commit 21ed435398e4a398dd8a0a5d7c1d4cc45e916332
+Author: Alex Deucher <[EMAIL PROTECTED]>
+Date:   Tue Dec 4 17:08:58 2007 -0500
+
+    RADEON: add MacModel imac-g5-isight for iMac G5 iSight
+    
+    Thanks to Étienne Bersac for helping to figure this out.
+
+commit 54bfd522405d9fdfb69d3a59e111ac3d63483dbb
+Author: Étienne Bersac <[EMAIL PROTECTED]>
+Date:   Tue Dec 4 14:22:42 2007 -0500
+
+    RADEON: fix typo
+
+commit 5022d006cfc06ca0395981526b2c2c94c6878567
+Author: Michel Dänzer <[EMAIL PROTECTED]>
+Date:   Sun Dec 2 17:27:33 2007 +0100
+
+    radeon: Further XVideo fixes.
+    
+    * Make sure pitch constraints are always met for DMA upload blits.
+    * RGB24 is not affected by endianness.
+
+commit 6ed55b70b23dfdc7b41103ea59c1df2bda5e41e6
+Author: Kusanagi Kouichi <[EMAIL PROTECTED]>
+Date:   Sun Dec 2 17:18:46 2007 +0100
+
+    radeon: Fix crash with XVideo 24bit RGB images.
+    
+    See https://bugs.freedesktop.org/show_bug.cgi?id=13274 .
+
+commit a697b590899bb7704ec4d7ae9a9c3cbbfcaef382
+Author: Michel Dänzer <[EMAIL PROTECTED]>
+Date:   Sun Dec 2 17:11:20 2007 +0100
+
+    Fix build against xserver master.
+    
+    (DE)ALLOCATE_LOCAL are gone.
+
+commit 00b4480aa2c5d7f751e34fc964f431b90b14c8d2
+Author: Alex Deucher <[EMAIL PROTECTED]>
+Date:   Sat Dec 1 14:18:40 2007 -0500
+
+    RADEON: add options for force TV out as detected and to set TV standard
+    
+    Also fix a typo in internal tv-out parsing
+
+commit 0175b79987ef4d7b0ce8238c3bdde989e504516a
+Author: Alex Deucher <[EMAIL PROTECTED](none)>
+Date:   Fri Nov 30 15:37:42 2007 -0500
+
+    RADEON: rework MacModel option
+    
+    this brings in some previous research from Michel Dänzer,
+    Sjoerd Simons, and myself.  Hopefully, the driver will pick
+    the correct MacModel in more cases.  This also changes the
+    default connector table for desktop Macs to dual DVI rather
+    than DVI+VGA as that seems to be the case more often than not.
+    External TMDS chips are handled separately now as well.
+    Eventually we should add an option to allow the user to specify


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to