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

xserver-xorg-video-radeonhd: Changes to 'upstream-unstable'



 .gitignore                    |    5 
 Makefile.am                   |   35 ++++++
 README                        |   19 ++-
 RadeonHD.tmpl                 |    1 
 configure.ac                  |   21 +++
 git_version.sh                |   13 +-
 man/radeonhd.man              |  204 ++++++++++++++++++++++++++++++++++---
 src/Imakefile                 |    3 
 src/rhd.h                     |   20 +++
 src/rhd_atombios.c            |   25 ++--
 src/rhd_card.h                |    3 
 src/rhd_connector.c           |   63 ++++++++++-
 src/rhd_crtc.c                |   42 ++++++-
 src/rhd_crtc.h                |    1 
 src/rhd_cursor.c              |   23 ++--
 src/rhd_dac.c                 |   12 ++
 src/rhd_driver.c              |  230 +++++++++++++++++++++++++++++++++---------
 src/rhd_edid.c                |   52 +++++++--
 src/rhd_helper.c              |   42 ++++++-
 src/rhd_i2c.c                 |   11 +-
 src/rhd_id.c                  |  103 +++++++++++-------
 src/rhd_lut.c                 |    4 
 src/rhd_lvtma.c               |   45 ++++----
 src/rhd_mc.c                  |    6 -
 src/rhd_modes.c               |   15 +-
 src/rhd_monitor.c             |   38 ++++--
 src/rhd_monitor.h             |    3 
 src/rhd_pll.c                 |   67 ++++++++++--
 src/rhd_randr.c               |  207 +++++++++++++++++++++++++++++++------
 src/rhd_regs.h                |    6 -
 src/rhd_tmds.c                |   10 +
 src/rhd_vga.c                 |    7 -
 utils/conntest/Makefile.am    |    4 
 utils/conntest/README         |    2 
 utils/conntest/rhd_conntest.c |    8 -
 35 files changed, 1074 insertions(+), 276 deletions(-)

New commits:
commit f213db06140226c843c9649cfaaea4b3d130ba16
Author: Matthias Hopf <mhopf@suse.de>
Date:   Fri Dec 21 16:43:05 2007 +0100

    Bump to 1.1.0. Add changes to README.

diff --git a/README b/README
index c42645c..8c5739e 100644
--- a/README
+++ b/README
@@ -28,8 +28,21 @@ This README file contains the following sections:
 
 
 
-Recent Changes
-==============
+Major Changes
+=============
+
+Read ChangeLog for a complete list.
+
+- Version 1.1.0
+
+  - Added Support for RS600, preliminary RV670.
+  - Allow panning in RandR mode.
+  - Preliminary (read: untested) support for HDMI connectors.
+  - Lots of bugfixes, e.g.
+    - Better monitor detection.
+    - Gamma + palette fixes.
+    - Mode stability + textmode restore.
+    - RandR mode selection fixes.
 
 - Version 1.0.0
 
@@ -50,7 +63,7 @@ More Resources
 
 The official radeonhd wiki:
    http://wiki.x.org/wiki/radeonhd
-   
+
 The mailing list on radeonhd:
    http://lists.opensuse.org/radeonhd/
 
diff --git a/configure.ac b/configure.ac
index 85e3cf7..db0432c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-radeonhd],
-        1.0.0,
+        1.1.0,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/radeonhd],
         xf86-video-radeonhd)
 

commit c036b81933391ea41b78c4ba20bde01a1939433f
Author: Matthias Hopf <mhopf@suse.de>
Date:   Thu Dec 20 17:45:28 2007 +0100

    Be a bit more strict in asking for user reports. Only on problems.
    
    We don't want reports about unknown boards if there is no problem at all.

diff --git a/src/rhd_id.c b/src/rhd_id.c
index b9daabf..9fa820a 100644
--- a/src/rhd_id.c
+++ b/src/rhd_id.c
@@ -652,7 +652,7 @@ RHDCardIdentify(ScrnInfoPtr pScrn)
 	       deviceID, subVendorID, subDeviceID);
 #ifdef ATOM_BIOS
     xf86Msg(X_NONE, "\t"
-	    "If your card does not work or does not work optimally\n\t"
+	    "If - and only if - your card does not work or does not work optimally\n\t"
 	    "please contact radeonhd@opensuse.org to help rectify this.\n\t"
 	    "Use the subject: 0x%04X:0x%04X:0x%04X: <name of board>.\n",
 	    deviceID, subVendorID, subDeviceID);

commit 064b2899884557672850f8c2b309a82395995d62
Author: Matthias Hopf <mhopf@suse.de>
Date:   Fri Dec 21 16:54:03 2007 +0100

    fglrx check didn't compile correctly with ansi wrapper enabled. Fix this.

diff --git a/src/rhd_driver.c b/src/rhd_driver.c
index 80a410b..8b02192 100644
--- a/src/rhd_driver.c
+++ b/src/rhd_driver.c
@@ -88,6 +88,7 @@
 # include <sys/stat.h>
 # include <string.h>
 # include <unistd.h>
+# define stat_t struct stat
 #endif
 
 /*
@@ -424,7 +425,7 @@ RHDPreInit(ScrnInfoPtr pScrn, int flags)
     Bool ret = FALSE;
     RHDI2CDataArg i2cArg;
     DisplayModePtr Modes;		/* Non-RandR-case only */
-    struct stat statbuf;
+    stat_t statbuf;
 
     if (flags & PROBE_DETECT)  {
         /* do dynamic mode probing */

commit b9277bfc275254be9823578819a13ceb056fc47e
Author: Matthias Hopf <mhopf@suse.de>
Date:   Fri Dec 21 16:27:51 2007 +0100

    Check for fglrx kernel module and bark if it is loaded.

diff --git a/man/radeonhd.man b/man/radeonhd.man
index e1bbd76..5039c2c 100644
--- a/man/radeonhd.man
+++ b/man/radeonhd.man
@@ -47,8 +47,9 @@ After using the
 .I fglrx
 driver, the display can get very jittery with
 .BR radeonhd .
-A reboot fixes this problem in most
-cases, sometimes a powercycle is necessary.
+Also suspend & resume will probably fail.  A reboot fixes this problem in most
+cases, sometimes a powercycle is necessary.  Unloading the kernel module is
+typically not enough.
 .PP
 A more up-to-date list can be found on the wiki page.
 .PP
diff --git a/src/rhd_driver.c b/src/rhd_driver.c
index 2ef58f3..80a410b 100644
--- a/src/rhd_driver.c
+++ b/src/rhd_driver.c
@@ -84,7 +84,10 @@
 #if HAVE_XF86_ANSIC_H
 # include "xf86_ansic.h"
 #else
+# include <sys/types.h>
+# include <sys/stat.h>
 # include <string.h>
+# include <unistd.h>
 #endif
 
 /*
@@ -167,6 +170,10 @@ static int pix24bpp = 0;
 #define _X_EXPORT
 #endif
 
+#ifdef __linux__
+# define FGLRX_SYS_PATH "/sys/module/fglrx"
+#endif
+
 _X_EXPORT DriverRec RADEONHD = {
     RHD_VERSION,
     RHD_DRIVER_NAME,
@@ -417,12 +424,22 @@ RHDPreInit(ScrnInfoPtr pScrn, int flags)
     Bool ret = FALSE;
     RHDI2CDataArg i2cArg;
     DisplayModePtr Modes;		/* Non-RandR-case only */
+    struct stat statbuf;
 
     if (flags & PROBE_DETECT)  {
         /* do dynamic mode probing */
 	return TRUE;
     }
 
+#ifdef FGLRX_SYS_PATH
+    /* check for fglrx kernel module */
+    if (stat (FGLRX_SYS_PATH, &statbuf) == 0) {
+	xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+		   "The fglrx kernel module is loaded. This can have obvious\n"
+		   "     or subtle side effects. See radeonhd(4) for details.\n");
+    }
+#endif
+
 #ifndef XSERVER_LIBPCIACCESS
     /*
      * Allocate the RhdRec driverPrivate

commit 79e016fde25a4ac713acedeb97cc4e5a6425d1ab
Author: Luc Verhaegen <libv@skynet.be>
Date:   Fri Dec 21 03:48:01 2007 +0100

    RV670: TMDSA: Electrical values for 9505.

diff --git a/src/rhd_tmds.c b/src/rhd_tmds.c
index 505e843..25eb841 100644
--- a/src/rhd_tmds.c
+++ b/src/rhd_tmds.c
@@ -160,6 +160,7 @@ static struct Rv6xxTMDSAMacro {
 } Rv6xxTMDSAMacro[] = {
     { 0x94C1, 0x00010416, 0x00010308 }, /* RV610 */
     { 0x94C3, 0x00010416, 0x00010308 }, /* RV610 */
+    { 0x9505, 0x00010416, 0x00010308 }, /* RV670: != atombios */
     { 0x9587, 0x00010416, 0x00010308 }, /* RV630 */
     { 0x9588, 0x00010416, 0x00010388 }, /* RV630 */
     { 0x9589, 0x00010416, 0x00010388 }, /* RV630 */

commit 9c010f2cb89ff3ca063a4c057f2cdce1047f2e46
Author: Luc Verhaegen <libv@skynet.be>
Date:   Fri Dec 21 01:12:37 2007 +0100

    Rv670 TMDSB electrical values.

diff --git a/src/rhd_lvtma.c b/src/rhd_lvtma.c
index d808906..84634c6 100644
--- a/src/rhd_lvtma.c
+++ b/src/rhd_lvtma.c
@@ -619,11 +619,12 @@ static struct RV6xxTMDSBMacro {
     CARD32 TX;
     CARD32 PreEmphasis;
 } RV6xxTMDSBMacro[] = {
-    { 0x94C1, 0x01030311, 0x10001A00, 0x01801015},
-    { 0x94C3, 0x01030311, 0x10001A00, 0x01801015},
-    { 0x9587, 0x01030311, 0x10001C00, 0x01C01011}, /* guess: broken atombios */
-    { 0x9588, 0x01030311, 0x10001C00, 0x01C01011},
-    { 0x9589, 0x01030311, 0x10001C00, 0x01C01011},
+    { 0x94C1, 0x01030311, 0x10001A00, 0x01801015}, /* RV610 */
+    { 0x94C3, 0x01030311, 0x10001A00, 0x01801015}, /* RV610 */
+    { 0x9505, 0x0533041A, 0x020010A0, 0x41002045}, /* RV670 */
+    { 0x9587, 0x01030311, 0x10001C00, 0x01C01011}, /* RV630 */
+    { 0x9588, 0x01030311, 0x10001C00, 0x01C01011}, /* RV630 */
+    { 0x9589, 0x01030311, 0x10001C00, 0x01C01011}, /* RV630 */
     { 0, 0, 0, 0} /* End marker */
 };
 
@@ -679,7 +680,7 @@ TMDSBSet(struct rhdOutput *Output)
 	RHDRegMask(Output, LVTMA_REG_TEST_OUTPUT, 0x00200000, 0x00200000);
     else if ((rhdPtr->ChipSet == RHD_RS600) || (rhdPtr->ChipSet == RHD_RS690))
 	RHDRegWrite(Output, LVTMA_REG_TEST_OUTPUT, 0x01120000);
-    else /* R600 and up */
+    else if (rhdPtr->ChipSet < RHD_RV670)
 	RHDRegMask(Output, LVTMA_REG_TEST_OUTPUT, 0x00100000, 0x00100000);
 
     /* Clear out some HPD events first: this should be under driver control. */

commit e5f9b2d2f646ae93552eaccbd1193778fc772c8b
Author: Luc Verhaegen <libv@skynet.be>
Date:   Thu Dec 20 18:08:40 2007 +0100

    Rv670: Add PLL control values.

diff --git a/src/rhd_pll.c b/src/rhd_pll.c
index bd1702e..8b9ac71 100644
--- a/src/rhd_pll.c
+++ b/src/rhd_pll.c
@@ -274,6 +274,52 @@ PLL2SetLow(struct rhdPLL *PLL, CARD32 RefDiv, CARD32 FBDiv, CARD32 PostDiv,
  * For R500, this is done in atombios by ASIC_RegistersInit
  * Some data table in atom should've provided this information.
  */
+
+struct PLL_Control {
+    CARD16 FeedbackDivider; /* 0xFFFF/-1 is the endmarker here */
+    CARD32 Control;
+};
+
+/* From hardcoded values. */
+static struct PLL_Control RV610PLLControl[] =
+{
+    { 0x0049, 0x159F8704 },
+    { 0x006C, 0x159B8704 },
+    { 0xFFFF, 0x159EC704 }
+};
+
+/* Some tables are provided by atombios,
+ * it's just that they are hidden away deliberately and not exposed */
+static struct PLL_Control RV670PLLControl[] =
+{
+    { 0x004A, 0x159FC704 },
+    { 0x0067, 0x159BC704 },
+    { 0x00C4, 0x159EC704 },
+    { 0x00F4, 0x1593A704 },
+    { 0x0136, 0x1595A704 },
+    { 0x01A4, 0x1596A704 },
+    { 0x022C, 0x159CE504 },
+    { 0xFFFF, 0x1591E404 }
+};
+
+/*
+ *
+ */
+static CARD32
+PLLControlTableRetrieve(struct PLL_Control *Table, CARD16 FeedbackDivider)
+{
+    int i;
+
+    for (i = 0; Table[i].FeedbackDivider == 0xFFFF; i++)
+	if (Table[i].FeedbackDivider >= FeedbackDivider)
+	    break;
+
+    return Table[i].Control;
+}
+
+/*
+ *
+ */
 static CARD32
 PLLElectrical(RHDPtr rhdPtr, CARD16 FeedbackDivider)
 {
@@ -299,13 +345,9 @@ PLLElectrical(RHDPtr rhdPtr, CARD16 FeedbackDivider)
     case RHD_M72:
     case RHD_M74:
     case RHD_M76:
-	/* charge pump and loop filter differ per FB divider */
-	if (FeedbackDivider >= 0x6C)
-	    return 0x159EC704;
-	else if (FeedbackDivider >= 0x49)
-	    return 0x159B8704;
-	else
-	    return 0x159F8704;
+	return PLLControlTableRetrieve(RV610PLLControl, FeedbackDivider);
+    case RHD_RV670:
+	return PLLControlTableRetrieve(RV670PLLControl, FeedbackDivider);
     default:
 	return 0;
     }

commit da8b68aa190ce00bb30057f86cb56079eaa29909
Author: Matthias Hopf <mhopf@suse.de>
Date:   Thu Dec 20 17:25:55 2007 +0100

    Use DDC address probing for finding connected monitors if necessary.
    
    If both HPD and Sense are not available, use DDC.

diff --git a/src/rhd_randr.c b/src/rhd_randr.c
index c6062a5..cc49ea1 100644
--- a/src/rhd_randr.c
+++ b/src/rhd_randr.c
@@ -804,6 +804,13 @@ rhdRROutputDetect(xf86OutputPtr output)
 	    else
 		return XF86OutputStatusDisconnected;
 	}
+	/* Use DDC address probing if possible otherwise */
+	if (rout->Connector->DDC) {
+	    if (xf86I2CProbeAddress(rout->Connector->DDC, 0xa0))
+		return XF86OutputStatusConnected;
+	    else
+		return XF86OutputStatusDisconnected;
+	}
 	return XF86OutputStatusUnknown;
     }
 }

commit 73aaafadb00f698ce63d52455801a4aa368ded41
Author: Matthias Hopf <mhopf@suse.de>
Date:   Thu Dec 20 17:24:27 2007 +0100

    Update supported devices table.

diff --git a/man/radeonhd.man b/man/radeonhd.man
index c312419..e1bbd76 100644
--- a/man/radeonhd.man
+++ b/man/radeonhd.man
@@ -60,8 +60,9 @@ driver supports video cards based on the following ATI chips:
 .\" The following list was generated from "X -logverbose 7" by the following command:
 .\" sed -n '/^\t[RM][A-Z0-9]\+ * : /{ s/\.$//; s/^\t\([A-Z0-9]\+\) \+: \(.*\)/.TP 8\n.B \1\n\2/; p};' /var/log/Xorg.0.log
 .\" The list replicates the output of RHDIdentify() in src/rhd_id.c.
-.TP 8
+.PP
 .PD 0
+.TP 8
 .B RV505
 Radeon X1550, X1550 64bit
 .TP 8
@@ -101,6 +102,9 @@ Radeon HD 2350, HD 2400 Pro/XT, HD 2400 Pro AGP; FireGL V4000
 .B RV630
 Radeon HD 2600 LE/Pro/XT, HD 2600 Pro/XT AGP; Gemini RV630; FireGL V3600/V5600
 .TP 8
+.B RV670
+Radeon HD 3850, HD 3870, FireGL V7700
+.TP 8
 .B M52
 Mobility Radeon X1300
 .TP 8
@@ -137,11 +141,11 @@ Mobility Radeon HD 2400 XT
 .B M76
 Mobility Radeon HD 2600; (Gemini ATI) Mobility Radeon HD 2600 XT
 .TP 8
-.B RS690
-Radeon X1200
+.B RS600
+Radeon Xpress 1200, Xpress 1250
 .TP 8
-.B RS740
-RS740, RS740M
+.B RS690
+Radeon X1200, X1250, X1270
 .PD
 .\"
 .\"

commit 765f5972a08d404ded3c118eb5d507de71950a97
Author: Matthias Hopf <mhopf@suse.de>
Date:   Thu Dec 20 16:57:45 2007 +0100

    Added description of all RandR properties.

diff --git a/man/radeonhd.man b/man/radeonhd.man
index 15c6714..c312419 100644
--- a/man/radeonhd.man
+++ b/man/radeonhd.man
@@ -262,6 +262,150 @@ Thus the default is
 (i.e. ignore).
 .\"
 .\"
+.SH RANDR OUTPUT PROPERTIES
+The following properties can be queried with
+.B xrandr --prop
+and some of them can be set with
+.BR "xrandr --output" " <output> " --set " <property> <value> ."
+Those marked with RR13 are probably merged into a RandR 1.3 standard.
+Properties marked Read-Only are provided by the driver for informational
+purpose only, those marked Static won't change during runtime.
+.TP
+.BR RANDR_SIGNAL_FORMAT "   Read-Only RR13"
+.RS
+.TP 16
+.PD 0
+.IR Type :
+string
+.TP
+.IR Range/List :
+unknown VGA TMDS LVDS FBAS FBAS-PAL FBAS-NTSC FBAS-SECAM SVideo YPbPr
+DisplayPort
+.RE
+.RS
+.PD
+.PP
+Signal format / physical protocol format that is used for the specified
+output.
+.br
+A driver MAY change this property of an output if the underlying hardware
+indicates a protocol change (e.g. TV formats).  Values with dashes
+.RI ( FBAS-PAL )
+describe more specific versions of the base values
+.RI ( FBAS )
+and SHOULD be used if known to the driver.
+.RE
+.TP
+.BR RANDR_CONNECTOR_TYPE "   Read-Only Static RR13"
+.RS
+.TP 16
+.PD 0
+.IR Type :
+string
+.TP
+.IR Range/List :
+unknown VGA DVI DVI-I DVI-A DVI-D HDMI PANEL TV TV-FBAS TV-SVideo TV-YPbPr
+TV-SCART TV-C4 DisplayPort
+.RE
+.RS
+.PD
+.PP
+Connector type, as far as known to the driver.
+.br
+Values with dashes
+.RI ( TV-FBAS )
+describe more specific versions of the base values
+.RI ( TV ).
+The former SHOULD be used if the connector is not capable of producing other
+signal formats. The later SHOULD be used if the exact connector is unknown, or
+the connector is a multi-format connector that is not described otherwise.
+.IR DVI ,
+for instance, SHOULD be handled like a
+.I DVI-I
+connector, unless additional information is available to the user agent.
+.I PANEL
+describes laptop-internal (normally LVDS) displays.
+.IR TV ,
+.IR TV-SCART ,
+.IR TV-YPbPr ,
+and
+.I TV-C4
+with signal format
+.I VGA
+are valid combinations and describe RGB TV signals.
+.RE
+.TP
+.BR RANDR_CONNECTOR_NUMBER "   Read-Only Static RR13"
+.RS
+.TP 16
+.PD 0
+.IR Type :
+int32
+.TP
+.IR Range/List :
+0-
+.RE
+.RS
+.PD
+.PP
+Outputs that route their signal to the same connector MUST have the same
+connector number. Outputs with the same connector number MUST route their
+signal to the same connector, except if it is 0, which indicates unknown
+connectivity. 1 is called the primary connector, 2 the secondary. 3 is often a
+TV connector, but that is completely driver / hardware dependent.
+.br
+Outputs with the same connector number SHOULD have the same connector type.
+Meaning and client behavior for mismatching connector types is undefined at
+the moment.
+.RE
+.TP
+.BR RANDR_OUTPUT_NUMBER "   Read-Only Static RR13"
+.RS
+.TP 16
+.PD 0
+.IR Type :
+int32
+.TP
+.IR Range/List :
+0-
+.RE
+.RS
+.PD
+.PP
+A card may route one internal output to several connectors.  Connectors that
+are driven by the same output cannot be driven by different Crtcs and are thus
+only allowed to be used in clone mode. The driver SHOULD emit an error message
+and continue as gracefully as possible if using different Crtcs for the same
+internal output is requested.
+.br
+Internal outputs are numbered from 1, 0 indicates that output routing is
+unknown.
+.RE
+.TP
+.B RANDR_PANING_AREA
+.RS
+.TP 16
+.PD 0
+.IR Type :
+string
+.TP
+.IR Format :
+.RB <width> x <height>[ + <xoffset> + <yoffset>]
+.RE
+.RS
+.PD
+.PP
+Specifies the panning area in RandR mode per output.
+.br
+It actually is a Crtc-specific property, but RandR doesn't support that yet.
+As the
+.B xrandr
+application typically always resets the framebuffer size with every action,
+.BR --fb " <width>" x <height>
+has to be added on every invocation, unless there is an additional output
+configured that is using this size as its resolution.
+.\"
+.\"
 .SH KNOWN BUGS
 As the
 .B radeonhd

commit cad8539ca12249a2c16b177e2364b77395a0dcab
Author: Luc Verhaegen <libv@skynet.be>
Date:   Thu Dec 20 16:49:17 2007 +0100

    Rv670: Add IDs and such, and beautify supported hardware printing.
    
    No real support just yet. Need a few more things for that, which will come up
    next.
    
    Reported by TommyDrum.

diff --git a/src/rhd.h b/src/rhd.h
index a6cf9d5..d620853 100644
--- a/src/rhd.h
+++ b/src/rhd.h
@@ -80,7 +80,8 @@ enum RHD_CHIPSETS {
     RHD_M72,
     RHD_M74,
     RHD_M76,
-    /* R600 integrated */
+    /* RV670 came into existence after RV6x0 and M7x */
+    RHD_RV670,
     RHD_CHIP_END
 };
 
diff --git a/src/rhd_id.c b/src/rhd_id.c
index 027fbb8..b9daabf 100644
--- a/src/rhd_id.c
+++ b/src/rhd_id.c
@@ -70,7 +70,8 @@ SymTabRec RHDChipsets[] = {
     { RHD_M72,   "M72" },
     { RHD_M74,   "M74" },
     { RHD_M76,   "M76" },
-    /* R600 integrated */
+    /* RV670 came into existence after RV6x0 and M7x */
+    { RHD_RV670, "RV670" },
     { -1,      NULL }
 };
 
@@ -195,10 +196,12 @@ const PCI_ID_LIST = {
     RHD_DEVICE_MATCH(  0x793F, RHD_RS600 ), /* Radeon Xpress 1200 */
     RHD_DEVICE_MATCH(  0x7941, RHD_RS600 ), /* Radeon Xpress 1200 */
     RHD_DEVICE_MATCH(  0x7942, RHD_RS600 ), /* Radeon Xpress 1200 (M) */
+#if 0 /* Not seen yet */
     RHD_DEVICE_MATCH(  0x796C, RHD_RS740 ), /* RS740 */
     RHD_DEVICE_MATCH(  0x796D, RHD_RS740 ), /* RS740M */
     RHD_DEVICE_MATCH(  0x796E, RHD_RS740 ), /* RS740 */
     RHD_DEVICE_MATCH(  0x796F, RHD_RS740 ), /* RS740M */
+#endif
     RHD_DEVICE_MATCH(  0x9400, RHD_R600  ), /* Radeon HD 2900 XT */
     RHD_DEVICE_MATCH(  0x9401, RHD_R600  ), /* Radeon HD 2900 XT */
     RHD_DEVICE_MATCH(  0x9402, RHD_R600  ), /* Radeon HD 2900 XT */
@@ -218,6 +221,11 @@ const PCI_ID_LIST = {
     RHD_DEVICE_MATCH(  0x94C9, RHD_M72   ), /* Mobility Radeon HD 2400 */
     RHD_DEVICE_MATCH(  0x94CB, RHD_M72   ), /* ATI RADEON E2400 */
     RHD_DEVICE_MATCH(  0x94CC, RHD_RV610 ), /* RV610 */
+    RHD_DEVICE_MATCH(  0x9500, RHD_RV670 ), /* RV670 */
+    RHD_DEVICE_MATCH(  0x9501, RHD_RV670 ), /* ATI Radeon HD3870 */
+    RHD_DEVICE_MATCH(  0x9505, RHD_RV670 ), /* ATI Radeon HD3850 */
+    RHD_DEVICE_MATCH(  0x9507, RHD_RV670 ), /* RV670 */
+    RHD_DEVICE_MATCH(  0x9511, RHD_RV670 ), /* ATI FireGL V7700 */
     RHD_DEVICE_MATCH(  0x9580, RHD_RV630 ), /* RV630 */
     RHD_DEVICE_MATCH(  0x9581, RHD_M76   ), /* Mobility Radeon HD 2600 */
     RHD_DEVICE_MATCH(  0x9583, RHD_M76   ), /* Mobility Radeon HD 2600 XT */
@@ -240,37 +248,42 @@ void
 RHDIdentify(int flags)
 {
     xf86Msg(X_INFO, "%s: X driver for the following AMD GPG (ATI) graphics devices:\n", RHD_NAME);
-    xf86Msg(X_NONE, "\t"
-	    "RV505  : Radeon X1550, X1550 64bit.\n\t"
-	    "RV515  : Radeon X1300, X1550, X1600; FireGL V3300, V3350.\n\t"
-	    "RV516  : Radeon X1300, X1550, X1550 64-bit, X1600; FireMV 2250.\n\t"
-	    "R520   : Radeon X1800; FireGL V5300, V7200, V7300, V7350.\n\t"
-	    "RV530  : Radeon X1300 XT, X1600, X1600 Pro, X1650; FireGL V3400, V5200.\n\t"
-	    "RV535  : Radeon X1300, X1650.\n\t"
-	    "RV550  : Radeon X2300 HD.\n\t"
-	    "RV560  : Radeon X1650.\n\t"
-	    "RV570  : Radeon X1950, X1950 GT; FireGL V7400.\n\t"
-	    "R580   : Radeon X1900, X1950; AMD Stream Processor.\n");
-    xf86Msg(X_NONE, "\t"
-	    "R600   : Radeon HD 2900 GT/Pro/XT; FireGL V7600/V8600/V8650.\n\t"
-	    "RV610  : Radeon HD 2350, HD 2400 Pro/XT, HD 2400 Pro AGP; FireGL V4000.\n\t"
-	    "RV630  : Radeon HD 2600 LE/Pro/XT, HD 2600 Pro/XT AGP; Gemini RV630; FireGL V3600/V5600.\n\t"
-	    "M52    : Mobility Radeon X1300.\n\t"
-	    "M54    : Mobility Radeon X1400; M54-GL.\n\t"
-	    "M56    : Mobility Radeon X1600; Mobility FireGL V5200.\n\t"
-	    "M58    : Mobility Radeon X1800, X1800 XT; Mobility FireGL V7100, V7200.\n\t"
-	    "M62    : Mobility Radeon X1350.\n\t"
-	    "M64    : Mobility Radeon X1450, X2300.\n");
-    xf86Msg(X_NONE, "\t"
-	    "M66    : Mobility Radeon X1700, X1700 XT; FireGL V5250.\n\t"
-	    "M68    : Mobility Radeon X1900.\n\t"
-	    "M71    : Mobility Radeon HD 2300.\n\t"
-	    "M72    : Mobility Radeon HD 2400; Radeon E2400.\n\t"
-	    "M74    : Mobility Radeon HD 2400 XT.\n\t"
-	    "M76    : Mobility Radeon HD 2600; (Gemini ATI) Mobility Radeon HD 2600 XT.\n\t"
-	    "RS600  : Radeon Xpress 1200.\n\t"
-	    "RS690  : Radeon X1200.\n\t"
-	    "RS740  : RS740, RS740M\n");
+    xf86Msg(X_NONE,
+	    "\tRV505 : Radeon X1550, X1550 64bit.\n"
+	    "\tRV515 : Radeon X1300, X1550, X1600; FireGL V3300, V3350.\n"
+	    "\tRV516 : Radeon X1300, X1550, X1550 64-bit, X1600; FireMV 2250.\n"
+	    "\tR520  : Radeon X1800; FireGL V5300, V7200, V7300, V7350.\n"
+	    "\tRV530 : Radeon X1300 XT, X1600, X1600 Pro, X1650; FireGL V3400, V5200.\n"
+	    "\tRV535 : Radeon X1300, X1650.\n"
+	    "\tRV550 : Radeon X2300 HD.\n"
+	    "\tRV560 : Radeon X1650.\n"
+	    "\tRV570 : Radeon X1950, X1950 GT; FireGL V7400.\n"
+	    "\tR580  : Radeon X1900, X1950; AMD Stream Processor.\n");
+    xf86Msg(X_NONE,
+	    "\tR600  : Radeon HD 2900 GT/Pro/XT; FireGL V7600/V8600/V8650.\n"
+	    "\tRV610 : Radeon HD 2350, HD 2400 Pro/XT, HD 2400 Pro AGP; FireGL V4000.\n"
+	    "\tRV630 : Radeon HD 2600 LE/Pro/XT, HD 2600 Pro/XT AGP; Gemini RV630;\n"
+	    "\t\tFireGL V3600/V5600.\n"
+	    "\tRV670 : Radeon HD 3850, HD 3870, FireGL V7700.\n");
+    xf86Msg(X_NONE,
+	    "\tM52   : Mobility Radeon X1300.\n"
+	    "\tM54   : Mobility Radeon X1400; M54-GL.\n"
+	    "\tM56   : Mobility Radeon X1600; Mobility FireGL V5200.\n"
+	    "\tM58   : Mobility Radeon X1800, X1800 XT; Mobility FireGL V7100, V7200.\n"
+	    "\tM62   : Mobility Radeon X1350.\n"
+	    "\tM64   : Mobility Radeon X1450, X2300.\n"
+	    "\tM66   : Mobility Radeon X1700, X1700 XT; FireGL V5250.\n"
+	    "\tM68   : Mobility Radeon X1900.\n");
+    xf86Msg(X_NONE,
+	    "\tM71   : Mobility Radeon HD 2300.\n"
+	    "\tM72   : Mobility Radeon HD 2400; Radeon E2400.\n"
+	    "\tM74   : Mobility Radeon HD 2400 XT.\n"
+	    "\tM76   : Mobility Radeon HD 2600\n"
+	    "\t\t(Gemini ATI) Mobility Radeon HD 2600 XT.\n");
+    xf86Msg(X_NONE,
+	    "\tRS600 : Radeon Xpress 1200, Xpress 1250.\n"
+	    "\tRS690 : Radeon X1200, X1250, X1270.\n"
+	    /* NOT YET "\tRS740  : RS740, RS740M\n" */ );
     xf86Msg(X_NONE, "\n");
 
     xf86Msg(X_INFO, "%s: version %s, built from %s\n\n",
@@ -586,6 +599,7 @@ rhdCards[] =
     /* 0x94C9 : M72 : Mobility Radeon HD 2400 */
     /* 0x94CB : M72 : ATI RADEON E2400 */
     /* 0x94CC : RV610 : RV610  */
+    /* 0x9505 : RV670 : ATI Radeon HD 3850 */
     /* 0x9580 : RV630 : RV630 */
     /* 0x9581 : M76 : Mobility Radeon HD 2600 */
     /* 0x9583 : M76 : Mobility Radeon HD 2600 XT */

commit 2b3928c642fcd65f21354f99a4f7fd9c9b24d7c4
Author: Luc Verhaegen <libv@skynet.be>
Date:   Wed Dec 19 18:43:03 2007 +0100

    RandR compate code: Add crtc gamma function.
    
    This means translating the "new" way of specifying a gamma table to the older
    better designed way that i kept in my modesetting code. Or, another victim of
    rampant NIH.
    
    Fixes the "messed up colours" issues we have been seeing after suspend/resume.

diff --git a/src/rhd_randr.c b/src/rhd_randr.c
index 6583fce..c6062a5 100644
--- a/src/rhd_randr.c
+++ b/src/rhd_randr.c
@@ -43,7 +43,6 @@
 #include "rhd.h"
 #include "rhd_randr.h"
 
-
 #if (RANDR_MAJOR == 1 && RANDR_MINOR >= 2) || RANDR_MAJOR >= 2
 
 
@@ -66,6 +65,7 @@
 #include "rhd_monitor.h"
 #include "rhd_vga.h"
 #include "rhd_pll.h"
+#include "rhd_lut.h"
 #include "rhd_mc.h"
 #include "rhd_card.h"
 
@@ -368,6 +368,36 @@ rhdRRCrtcCommit(xf86CrtcPtr crtc)
     RHDDebugRandrState(rhdPtr, Crtc->Name);
 }
 
+/*
+ * They just had to do NIH again here: Old X functionality provides a size, a
+ * list of indices, and a table of RGB unsigned shorts. RandR provides what
+ * is below. Apart from horribly breaking any attempt at being backwards
+ * compatible, this also pretty much rules out the usage of indexed colours, as
+ * each time even a single colour is changed an entirely new table has to be
+ * uploaded. Just cute. -- libv.
+ */
+static void
+rhdRRCrtcGammaSet(xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue,
+		  int size)
+{
+    struct rhdCrtc *Crtc = (struct rhdCrtc *) crtc->driver_private;
+    int indices[0x100]; /* would RandR use a size larger than 256? */
+    LOCO colors[0x100];
+    int i;
+
+    RHDDebug(Crtc->scrnIndex, "%s: %s.\n", __func__, Crtc->Name);
+
+    /* thanks so very much */
+    for (i = 0; i < size; i++) {
+	indices[i] = i;
+	colors[i].red = red[i];
+	colors[i].green = green[i];
+	colors[i].blue = blue[i];
+    }
+
+    Crtc->LUT->Set(Crtc->LUT, size, indices, colors);
+}
+
 /* Dummy, because not tested for NULL */
 static Bool
 rhdRRCrtcModeFixupDUMMY(xf86CrtcPtr    crtc, 
@@ -876,7 +906,7 @@ static const xf86CrtcFuncsRec rhdRRCrtcFuncs = {
     rhdRRCrtcLock, rhdRRCrtcUnlock,
     rhdRRCrtcModeFixupDUMMY,
     rhdRRCrtcPrepare, rhdRRCrtcModeSet, rhdRRCrtcCommit,
-    NULL,						/* CrtcGammaSet */
+    rhdRRCrtcGammaSet,
     /* rhdRRCrtcShadowAllocate,rhdRRCrtcShadowCreate,rhdRRCrtcShadowDestroy */
     NULL, NULL, NULL,
     /* SetCursorColors,SetCursorPosition,ShowCursor,HideCursor,

commit dc8f3c3dfcf370c9ebce14a087894623fe2d60ab
Author: Matthias Hopf <mhopf@suse.de>
Date:   Wed Dec 19 16:42:23 2007 +0100

    Nuke xf86DiDGAInit().
    
    We don't really want to support DGA anyway, and this call had some...
    side effects.

diff --git a/src/rhd_randr.c b/src/rhd_randr.c
index 793a2bb..6583fce 100644
--- a/src/rhd_randr.c
+++ b/src/rhd_randr.c
@@ -1135,8 +1135,6 @@ RHDRandrScreenInit(ScreenPtr pScreen)
     RHDPtr rhdPtr = RHDPTR(pScrn);
 
     RHDFUNC(rhdPtr);
-    if (!xf86DiDGAInit(pScreen, (unsigned long) rhdPtr->FbBase))
-	return FALSE;
     if (!xf86CrtcScreenInit(pScreen))
 	return FALSE;
     /* Wrap cursor for driver-level panning */

commit 861debbf8d649ce09d53d5880f819757ac9c7814
Author: Egbert Eich <eich@freedesktop.org>
Date:   Tue Dec 18 23:03:07 2007 +0100

    Make the driver build with the latest ustream git server sources again.
    
    The driver stopped building due to the removal of xf86_ansic.h and
    xf86_libc.h in the latest upstream sources.
    This patch consolidates the heterogenious handling of system functions in
    this driver. The system function wrappers remain fully supported for older
    server versions.

diff --git a/configure.ac b/configure.ac
index be420e5..85e3cf7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -66,6 +66,12 @@ AM_CONDITIONAL([HAVE_PCI_PCI_H], [test "x$have_pci_pci_h" = "xyes"])
 CFLAGS="$SAVED_CFLAGS"
 CPPFLAGS="$SAVED_CPPFLAGS"
 
+AC_CHECK_HEADER([${sdkdir}/xf86_ansic.h],
+		[AC_DEFINE([HAVE_XF86_ANSIC_H], [1],
+			   [Define to 1 if you have <${sdkdir}/xf86_ansic.h>.])
+		have_xf86_ansic_h=yes])
+AM_CONDITIONAL([HAVE_XF86_ANSIC_H], [test "x$have_xf86_ansic_h" = "xyes"])
+
 SAVED_CFLAGS="$CFLAGS"
 CFLAGS="$CFLAGS $XORG_CFLAGS"
 
diff --git a/src/Imakefile b/src/Imakefile
index 1cc0666..a8d6322 100644
--- a/src/Imakefile
+++ b/src/Imakefile
@@ -78,6 +78,8 @@ INCLUDES = -I. -I$(XF86COMSRC) -I$(XF86OSSRC) \
 
 ATOM_BIOS_INCLUDES = -I./AtomBios/includes
 ATOM_BIOS_DEFINES = -DATOM_BIOS=1
+XCOMM older versions always have xf86_ansic.h
+XF86_ANSIC_DEFINES = -DHAVE_XF86_ANSIC_H=1
 
 #ifdef ATOM_BIOS_PARSER
 ATOM_BIOS_PARSER_INCLUDES = -I./AtomBios
@@ -86,6 +88,7 @@ ATOM_BIOS_PARSER_DEFINES = -DDRIVER_PARSER -DDISABLE_EASF -DENABLE_ALL_SERVICE_F
 
 DEFINES  = $(INCLUDES) $(ATOM_BIOS_INCLUDES) $(ATOM_BIOS_PARSER_INCLUDES) \
            $(ATOM_BIOS_DEFINES) $(ATOM_BIOS_PARSER_DEFINES) \
+           $(XF86_ANSIC_DEFINES) \
            $(RHD_GIT_DEFINES) \
            $(RHD_VERSION_DEFINES)
 
diff --git a/src/rhd_atombios.c b/src/rhd_atombios.c
index d88ebae..2bfb879 100644
--- a/src/rhd_atombios.c
+++ b/src/rhd_atombios.c
@@ -28,8 +28,15 @@
 #endif
 #include "xf86.h"
 #include "xf86_OSproc.h"
-#include "xf86_ansic.h"
 #include "xf86Pci.h"
+#if HAVE_XF86_ANSIC_H
+# include "xf86_ansic.h"
+#else
+# include <unistd.h>
+# include <string.h>
+# include <stdio.h>
+#endif
+
 #include "edid.h"
 #include "rhd.h"
 #include "rhd_atombios.h"
@@ -818,7 +825,7 @@ rhdAtomLvdsTimings(atomBiosHandlePtr handle, ATOM_DTD_FORMAT *dtd)
     mode->VRefresh = (1000.0 * ((float) mode->Clock))
 	/ ((float)(((float)mode->HTotal) * ((float)mode->VTotal)));
 
-    xf86snprintf(name, NAME_LEN, "%dx%d",
+    snprintf(name, NAME_LEN, "%dx%d",
 		 mode->HDisplay, mode->VDisplay);
     mode->name = xstrdup(name);
 
@@ -1955,7 +1962,7 @@ rhdAtomConnectorInfoFromSupportedDevices(atomBiosHandlePtr handle,
 	cp[ncon].Output[0] = devices[n].ot;
 	cp[ncon].Output[1] = RHD_OUTPUT_NONE;
 	cp[ncon].Type = devices[n].con;
-	cp[ncon].Name = xf86strdup(devices[n].name);
+	cp[ncon].Name = xstrdup(devices[n].name);
 	cp[ncon].Name = RhdAppendString(cp[ncon].Name, devices[n].outputName);
 
 	if (devices[n].dual) {
diff --git a/src/rhd_connector.c b/src/rhd_connector.c
index a8dc76a..29b4ce6 100644
--- a/src/rhd_connector.c
+++ b/src/rhd_connector.c
@@ -31,7 +31,13 @@
 #include "edid.h"
 
 /* for usleep */
-#include "xf86_ansic.h"
+#if HAVE_XF86_ANSIC_H
+# include "xf86_ansic.h"
+#else
+# include <unistd.h>
+# include <string.h>
+# include <stdio.h>
+#endif
 
 #include "rhd.h"
 #include "rhd_connector.h"
@@ -165,7 +171,7 @@ rhdConnectorSynthName(struct rhdConnectorInfo *ConnectorInfo,
 	    return str;
 
 	case RHD_CONNECTOR_TV:
-	    str1 = strdup(ConnectorInfo->Name);
+	    str1 = xstrdup(ConnectorInfo->Name);
 	    str = xalloc(20);
 	    str2 = strchr(str1, ' ');
 	    if (str2) *(str2) = '\0';
diff --git a/src/rhd_crtc.c b/src/rhd_crtc.c
index 089e3ee..91c92db 100644
--- a/src/rhd_crtc.c
+++ b/src/rhd_crtc.c
@@ -30,7 +30,11 @@
 #include "xf86.h"
 
 /* for usleep */
-#include "xf86_ansic.h"
+#if HAVE_XF86_ANSIC_H
+# include "xf86_ansic.h"
+#else
+# include <unistd.h>
+#endif
 
 #include "rhd.h"
 #include "rhd_crtc.h"
diff --git a/src/rhd_cursor.c b/src/rhd_cursor.c
index 4a2d0d5..9870998 100644
--- a/src/rhd_cursor.c
+++ b/src/rhd_cursor.c
@@ -40,6 +40,11 @@
 #include "xf86Cursor.h"
 #include "cursorstr.h"
 #include "servermd.h"
+#if HAVE_XF86_ANSIC_H
+# include "xf86_ansic.h"
+#else
+#include <string.h>
+#endif
 
 /* Driver specific headers */
 #include "rhd.h"
@@ -47,11 +52,6 @@
 #include "rhd_crtc.h"
 #include "rhd_regs.h"
 
-/* System headers */
-#ifndef _XF86_ANSIC_H
-#include <string.h>
-#endif
-


Reply to: