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

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



 README                                  |   14 
 RadeonHD.am                             |    5 
 RadeonHD.tmpl                           |    6 
 configure.ac                            |   44 +
 git_version.sh                          |   35 
 man/radeonhd.man                        |   97 +-
 src/AtomBios/includes/CD_Common_Types.h |    4 
 src/AtomBios/includes/ObjectID.h        |   36 
 src/AtomBios/includes/atombios.h        |  254 +++++-
 src/Imakefile                           |   10 
 src/Makefile.am                         |   12 
 src/r5xx_2dregs.h                       |  288 +++++++
 src/r5xx_accel.c                        |  441 ++++++++++++
 src/r5xx_accel.h                        |   86 ++
 src/r5xx_exa.c                          |  491 +++++++++++++
 src/r5xx_xaa.c                          |  779 +++++++++++++++++++++
 src/rhd.h                               |   93 ++
 src/rhd_atombios.c                      |  773 +++++++++++++++++----
 src/rhd_atombios.h                      |  104 ++
 src/rhd_card.h                          |    3 
 src/rhd_connector.c                     |   54 +
 src/rhd_connector.h                     |    4 
 src/rhd_crtc.c                          |  333 ++++++++-
 src/rhd_crtc.h                          |   26 
 src/rhd_dac.c                           |  718 +++++++++++++++----
 src/rhd_ddia.c                          |  390 ++++++++++
 src/rhd_dig.c                           | 1052 ++++++++++++++++++++++++++++
 src/rhd_driver.c                        |  647 ++++++++++++++---
 src/rhd_edid.c                          |   11 
 src/rhd_i2c.c                           |  388 +++++++++-
 src/rhd_id.c                            |  140 +++
 src/rhd_lvtma.c                         |  401 ++++++++--
 src/rhd_mc.c                            |   80 +-
 src/rhd_mc.h                            |    1 
 src/rhd_modes.c                         |  189 +++--
 src/rhd_monitor.c                       |   61 +
 src/rhd_output.c                        |   40 -
 src/rhd_output.h                        |   38 -
 src/rhd_pll.c                           |  796 +++++++++++++++++----
 src/rhd_pll.h                           |   15 
 src/rhd_randr.c                         |  175 +++-
 src/rhd_regs.h                          |  467 ++++++++++++
 src/rhd_shadow.c                        |    5 
 src/rhd_tmds.c                          |   78 +-
 src/rhd_vga.c                           |    2 
 utils/conntest/Makefile.am              |    8 
 utils/conntest/README                   |    6 
 utils/conntest/rhd_conntest.c           | 1174 ++++++++++++++++++++++++++++----
 utils/conntest/rhd_dump.c               |  457 ++++++++++++
 49 files changed, 10178 insertions(+), 1153 deletions(-)

New commits:
commit 9d131f9035b3b0ff7755dda708e16326aa156e83
Author: Matthias Hopf <mhopf@suse.de>
Date:   Thu Apr 10 21:20:42 2008 +0200

    Bump to 1.2.0. Add changes to README.

diff --git a/README b/README
index 8c5739e..3310232 100644
--- a/README
+++ b/README
@@ -33,6 +33,20 @@ Major Changes
 
 Read ChangeLog for a complete list.
 
+- Version 1.2.0
+
+  - Added support for RV620, RV635, and R680.
+  - Added 2D acceleration for R5xx (including RS6xx), both XAA and EXA.
+  - Added support for DDIA block (second digital output) on RS690.
+  - Added support for interlaced modes
+  - Added additional layers for splitting outputs into encoders and
+    transmitters as needed for new hardware.
+  - Added support for DragonFly BSD.
+  - Improved RandR corner cases.
+  - Improved handling of secondary cards.
+  - Implemented foundation work for future TV support.
+  - Huge number of bugfixes and minor updates.
+
 - Version 1.1.0
 
   - Added Support for RS600, preliminary RV670.
diff --git a/configure.ac b/configure.ac
index 2cce985..7ca71c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-radeonhd],
-        1.1.0,
+        1.2.0,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/radeonhd],
         xf86-video-radeonhd)
 

commit 7560240b9935d86570be0ea46f85a6f5c9630cf9
Author: Matthias Hopf <mhopf@suse.de>
Date:   Thu Apr 10 21:20:09 2008 +0200

    Update + fix supported chips list, both in source and manpage.

diff --git a/man/radeonhd.man b/man/radeonhd.man
index d9c05e3..4d8f2b3 100644
--- a/man/radeonhd.man
+++ b/man/radeonhd.man
@@ -60,6 +60,7 @@ The
 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
+.\" TODO: Note that this line doesn't deal with multi-line output correctly
 .\" The list replicates the output of RHDIdentify() in src/rhd_id.c.
 .PP
 .PD 0
@@ -100,12 +101,21 @@ Radeon HD 2900 GT/Pro/XT; FireGL V7600/V8600/V8650
 .B RV610
 Radeon HD 2350, HD 2400 Pro/XT, HD 2400 Pro AGP; FireGL V4000
 .TP 8
+.B RV620
+Radeon HD 3450, HD 3470
+.TP 8
 .B RV630
 Radeon HD 2600 LE/Pro/XT, HD 2600 Pro/XT AGP; Gemini RV630; FireGL V3600/V5600
 .TP 8
+.B RV635
+Radeon HD 3650, HD 3670
+.TP 8
 .B RV670
 Radeon HD 3850, HD 3870, FireGL V7700
 .TP 8
+.B R680
+Radeon HD 3870 X2
+.TP 8
 .B M52
 Mobility Radeon X1300
 .TP 8
@@ -142,6 +152,12 @@ Mobility Radeon HD 2400 XT
 .B M76
 Mobility Radeon HD 2600; (Gemini ATI) Mobility Radeon HD 2600 XT
 .TP 8
+.B M82
+Mobility Radeon HD 3400
+.TP 8
+.B M86
+Mobility Radeon HD 3600
+.TP 8
 .B RS600
 Radeon Xpress 1200, Xpress 1250
 .TP 8
diff --git a/src/rhd_id.c b/src/rhd_id.c
index 0e99ad6..3837faf 100644
--- a/src/rhd_id.c
+++ b/src/rhd_id.c
@@ -340,10 +340,10 @@ RHDIdentify(int flags)
 	    "\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"
+	    "\tM76   : Mobility Radeon HD 2600;\n"
+	    "\t\t(Gemini ATI) Mobility Radeon HD 2600 XT.\n"
 	    "\tM82   : Mobility Radeon HD 3400.\n"
-	    "\tM86   : Mobility Radeon HD 3600.\n"
-	    "\t\t(Gemini ATI) Mobility Radeon HD 2600 XT.\n");
+	    "\tM86   : Mobility Radeon HD 3600.\n");
     xf86Msg(X_NONE,
 	    "\tRS600 : Radeon Xpress 1200, Xpress 1250.\n"
 	    "\tRS690 : Radeon X1200, X1250, X1270.\n"

commit 595050167523f0121b3bf0efeed42e6ca403d1a4
Author: Egbert Eich <eich@freedesktop.org>
Date:   Thu Apr 10 07:41:07 2008 +0200

    Add a very basic register dump utility.

diff --git a/utils/conntest/rhd_dump.c b/utils/conntest/rhd_dump.c
index 4c94c4e..8974d10 100644
--- a/utils/conntest/rhd_dump.c
+++ b/utils/conntest/rhd_dump.c
@@ -357,7 +357,7 @@ main(int argc, char *argv[])
     CARD32 start = DEFAULT_START, end = DEFAULT_END;
     int i;
     unsigned int j;
-    
+
 
     printf("%s: v%s, %s\n",
 	   "rhd_conntest", PACKAGE_VERSION, GIT_MESSAGE);

commit b0563cbde992594f5d66d308c1ef5fdb7b110a7e
Author: Egbert Eich <eich@freedesktop.org>
Date:   Thu Apr 10 20:34:19 2008 +0200

    Add a very basic register dump utility.

diff --git a/utils/conntest/Makefile.am b/utils/conntest/Makefile.am
index 6350ef9..b7cc322 100644
--- a/utils/conntest/Makefile.am
+++ b/utils/conntest/Makefile.am
@@ -4,10 +4,10 @@ include $(top_srcdir)/RadeonHD.am
 
 EXTRA_DIST = README Imakefile
 
-EXTRA_PROGRAMS = rhd_conntest
+EXTRA_PROGRAMS = rhd_conntest rhd_dump
 if HAVE_PCI_PCI_H
 if HAVE_ZLIB
-noinst_PROGRAMS = rhd_conntest
+noinst_PROGRAMS = rhd_conntest rhd_dump
 endif
 endif
 
@@ -25,3 +25,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/src/AtomBios/includes
 rhd_conntest_SOURCES = rhd_conntest.c
 nodist_rhd_conntest_SOURCES = git_version.h
 rhd_conntest_LDADD   = @PCIUTILS_LIBS@
+
+rhd_dump_SOURCES = rhd_dump.c
+nodist_rhd_dump_SOURCES = git_version.h
+rhd_dump_LDADD = @PCIUTILS_LIBS@
\ No newline at end of file
diff --git a/utils/conntest/rhd_dump.c b/utils/conntest/rhd_dump.c
new file mode 100644
index 0000000..4c94c4e
--- /dev/null
+++ b/utils/conntest/rhd_dump.c
@@ -0,0 +1,457 @@
+/*
+ * Copyright 2007, 2008  Luc Verhaegen <lverhaegen@novell.com>
+ * Copyright 2007, 2008  Matthias Hopf <mhopf@novell.com>
+ * Copyright 2007, 2008  Egbert Eich   <eich@novell.com>
+ * Copyright 2007, 2008  Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+/* #define DEBUG */
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <errno.h>
+#include <string.h>
+#include <sys/mman.h>
+#include <pci/pci.h>
+#include <unistd.h>
+#include <stdlib.h>
+
+#define DEFAULT_START 0x7200
+#define DEFAULT_END   0x7300
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+#include "git_version.h"
+
+#ifndef ULONG
+typedef unsigned int ULONG;
+# define ULONG ULONG
+#endif
+#ifndef UCHAR
+typedef unsigned char UCHAR;
+# define UCHAR UCHAR
+#endif
+#ifndef USHORT
+typedef unsigned short USHORT;
+# define USHORT USHORT
+#endif
+
+#include "atombios.h"
+
+typedef int Bool;
+#define FALSE 0
+#define TRUE 1
+typedef unsigned char CARD8;
+typedef unsigned short CARD16;
+typedef unsigned int CARD32;
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define SHORT(x) (x)
+#else
+#define SHORT(x) (((x & 0xff) << 8) | ((x & 0xff) >> 8))
+#endif
+
+#define DEV_MEM "/dev/mem"
+
+typedef enum _chipType {
+    RHD_R500 = 1,
+    RHD_RS690,
+    RHD_R600,
+    RHD_RV620
+} chipType;
+
+/* for RHD_R500/R600 */
+chipType ChipType;
+
+/*
+ * Match pci ids against data and some callbacks
+ */
+struct RHDDevice {
+    CARD16 vendor;
+    CARD16 device;
+    int bar;
+    chipType type;
+} rhdDevices[] = {
+
+    { 0x1002, 0x7100, 2, RHD_R500},
+    { 0x1002, 0x7101, 2, RHD_R500},
+    { 0x1002, 0x7102, 2, RHD_R500},
+    { 0x1002, 0x7103, 2, RHD_R500},
+    { 0x1002, 0x7104, 2, RHD_R500},
+    { 0x1002, 0x7105, 2, RHD_R500},
+    { 0x1002, 0x7106, 2, RHD_R500},
+    { 0x1002, 0x7108, 2, RHD_R500},
+    { 0x1002, 0x7109, 2, RHD_R500},
+    { 0x1002, 0x710A, 2, RHD_R500},
+    { 0x1002, 0x710B, 2, RHD_R500},
+    { 0x1002, 0x710C, 2, RHD_R500},
+    { 0x1002, 0x710E, 2, RHD_R500},
+    { 0x1002, 0x710F, 2, RHD_R500},
+    { 0x1002, 0x7140, 2, RHD_R500},
+    { 0x1002, 0x7141, 2, RHD_R500},
+    { 0x1002, 0x7142, 2, RHD_R500},
+    { 0x1002, 0x7143, 2, RHD_R500},
+    { 0x1002, 0x7144, 2, RHD_R500},
+    { 0x1002, 0x7145, 2, RHD_R500},
+    { 0x1002, 0x7146, 2, RHD_R500},
+    { 0x1002, 0x7147, 2, RHD_R500},
+    { 0x1002, 0x7149, 2, RHD_R500},
+    { 0x1002, 0x714A, 2, RHD_R500},
+    { 0x1002, 0x714B, 2, RHD_R500},
+    { 0x1002, 0x714C, 2, RHD_R500},
+    { 0x1002, 0x714D, 2, RHD_R500},
+    { 0x1002, 0x714E, 2, RHD_R500},
+    { 0x1002, 0x714F, 2, RHD_R500},
+    { 0x1002, 0x7151, 2, RHD_R500},
+    { 0x1002, 0x7152, 2, RHD_R500},
+    { 0x1002, 0x7153, 2, RHD_R500},
+    { 0x1002, 0x715E, 2, RHD_R500},
+    { 0x1002, 0x715F, 2, RHD_R500},
+    { 0x1002, 0x7180, 2, RHD_R500},
+    { 0x1002, 0x7181, 2, RHD_R500},
+    { 0x1002, 0x7183, 2, RHD_R500},
+    { 0x1002, 0x7186, 2, RHD_R500},
+    { 0x1002, 0x7187, 2, RHD_R500},
+    { 0x1002, 0x7188, 2, RHD_R500},
+    { 0x1002, 0x718A, 2, RHD_R500},
+    { 0x1002, 0x718B, 2, RHD_R500},
+    { 0x1002, 0x718C, 2, RHD_R500},
+    { 0x1002, 0x718D, 2, RHD_R500},
+    { 0x1002, 0x718F, 2, RHD_R500},
+    { 0x1002, 0x7193, 2, RHD_R500},
+    { 0x1002, 0x7196, 2, RHD_R500},
+    { 0x1002, 0x719B, 2, RHD_R500},
+    { 0x1002, 0x719F, 2, RHD_R500},
+    { 0x1002, 0x71C0, 2, RHD_R500},
+    { 0x1002, 0x71C1, 2, RHD_R500},
+    { 0x1002, 0x71C2, 2, RHD_R500},
+    { 0x1002, 0x71C3, 2, RHD_R500},
+    { 0x1002, 0x71C4, 2, RHD_R500},
+    { 0x1002, 0x71C5, 2, RHD_R500},
+    { 0x1002, 0x71C6, 2, RHD_R500},
+    { 0x1002, 0x71C7, 2, RHD_R500},
+    { 0x1002, 0x71CD, 2, RHD_R500},
+    { 0x1002, 0x71CE, 2, RHD_R500},
+    { 0x1002, 0x71D2, 2, RHD_R500},
+    { 0x1002, 0x71D4, 2, RHD_R500},
+    { 0x1002, 0x71D5, 2, RHD_R500},
+    { 0x1002, 0x71D6, 2, RHD_R500},
+    { 0x1002, 0x71DA, 2, RHD_R500},
+    { 0x1002, 0x71DE, 2, RHD_R500},
+    { 0x1002, 0x7200, 2, RHD_R500},
+    { 0x1002, 0x7210, 2, RHD_R500},
+    { 0x1002, 0x7211, 2, RHD_R500},
+    { 0x1002, 0x7240, 2, RHD_R500},
+    { 0x1002, 0x7243, 2, RHD_R500},
+    { 0x1002, 0x7244, 2, RHD_R500},
+    { 0x1002, 0x7245, 2, RHD_R500},
+    { 0x1002, 0x7246, 2, RHD_R500},
+    { 0x1002, 0x7247, 2, RHD_R500},
+    { 0x1002, 0x7248, 2, RHD_R500},
+    { 0x1002, 0x7249, 2, RHD_R500},
+    { 0x1002, 0x724A, 2, RHD_R500},
+    { 0x1002, 0x724B, 2, RHD_R500},
+    { 0x1002, 0x724C, 2, RHD_R500},
+    { 0x1002, 0x724D, 2, RHD_R500},
+    { 0x1002, 0x724E, 2, RHD_R500},
+    { 0x1002, 0x724F, 2, RHD_R500},
+    { 0x1002, 0x7280, 2, RHD_R500},
+    { 0x1002, 0x7281, 2, RHD_R500},
+    { 0x1002, 0x7283, 2, RHD_R500},
+    { 0x1002, 0x7284, 2, RHD_R500},
+    { 0x1002, 0x7287, 2, RHD_R500},
+    { 0x1002, 0x7288, 2, RHD_R500},
+    { 0x1002, 0x7289, 2, RHD_R500},
+    { 0x1002, 0x728B, 2, RHD_R500},
+    { 0x1002, 0x728C, 2, RHD_R500},
+    { 0x1002, 0x7290, 2, RHD_R500},
+    { 0x1002, 0x7291, 2, RHD_R500},
+    { 0x1002, 0x7293, 2, RHD_R500},
+    { 0x1002, 0x7297, 2, RHD_R500},
+    { 0x1002, 0x791E, 2, RHD_RS690},
+    { 0x1002, 0x791F, 2, RHD_RS690},
+    { 0x1002, 0x793F, 2, RHD_RS690},
+    { 0x1002, 0x7941, 2, RHD_RS690},
+    { 0x1002, 0x7942, 2, RHD_RS690},
+    { 0x1002, 0x796C, 2, RHD_R500},
+    { 0x1002, 0x796D, 2, RHD_R500},
+    { 0x1002, 0x796E, 2, RHD_R500},
+    { 0x1002, 0x796F, 2, RHD_R500},
+    { 0x1002, 0x9400, 2, RHD_R600},
+    { 0x1002, 0x9401, 2, RHD_R600},
+    { 0x1002, 0x9402, 2, RHD_R600},
+    { 0x1002, 0x9403, 2, RHD_R600},
+    { 0x1002, 0x9405, 2, RHD_R600},
+    { 0x1002, 0x940A, 2, RHD_R600},
+    { 0x1002, 0x940B, 2, RHD_R600},
+    { 0x1002, 0x940F, 2, RHD_R600},
+    { 0x1002, 0x94C0, 2, RHD_R600},
+    { 0x1002, 0x94C1, 2, RHD_R600},
+    { 0x1002, 0x94C3, 2, RHD_R600},
+    { 0x1002, 0x94C4, 2, RHD_R600},
+    { 0x1002, 0x94C5, 2, RHD_R600},
+    { 0x1002, 0x94C6, 2, RHD_R600},
+    { 0x1002, 0x94C7, 2, RHD_R600},
+    { 0x1002, 0x94C8, 2, RHD_R600},
+    { 0x1002, 0x94C9, 2, RHD_R600},
+    { 0x1002, 0x94CB, 2, RHD_R600},
+    { 0x1002, 0x94CC, 2, RHD_R600},
+    { 0x1002, 0x9500, 2, RHD_R600},
+    { 0x1002, 0x9501, 2, RHD_R600},
+    { 0x1002, 0x9505, 2, RHD_R600},
+    { 0x1002, 0x9507, 2, RHD_R600},
+    { 0x1002, 0x950F, 2, RHD_R600},
+    { 0x1002, 0x9511, 2, RHD_R600},
+    { 0x1002, 0x9580, 2, RHD_R600},
+    { 0x1002, 0x9581, 2, RHD_R600},
+    { 0x1002, 0x9583, 2, RHD_R600},
+    { 0x1002, 0x9586, 2, RHD_R600},
+    { 0x1002, 0x9587, 2, RHD_R600},
+    { 0x1002, 0x9588, 2, RHD_R600},
+    { 0x1002, 0x9589, 2, RHD_R600},
+    { 0x1002, 0x958A, 2, RHD_R600},
+    { 0x1002, 0x958B, 2, RHD_R600},
+    { 0x1002, 0x958C, 2, RHD_R600},
+    { 0x1002, 0x958D, 2, RHD_R600},
+    { 0x1002, 0x958E, 2, RHD_R600},
+    { 0x1002, 0x9598, 2, RHD_RV620},
+    { 0x1002, 0x95C5, 2, RHD_RV620},
+    { 0x1002, 0x9612, 2, RHD_RV620},
+    { 0, 0, 0, 0 }
+};
+
+/*
+ *
+ */
+static struct pci_dev *
+DeviceLocate(struct pci_dev *devices, int bus, int dev, int func)
+{
+    struct pci_dev *device;
+
+    for (device = devices; device; device = device->next)
+	if ((device->bus == bus) && (device->dev == dev) &&
+	    (device->func == func))
+	    return device;
+    return NULL;
+}
+
+/*
+ *
+ */
+static struct RHDDevice *
+DeviceMatch(struct pci_dev *device)
+{
+    int i;
+
+    for (i = 0; rhdDevices[i].vendor; i++)
+	if ((rhdDevices[i].vendor == device->vendor_id) &&
+	    (rhdDevices[i].device == device->device_id))
+	    return (rhdDevices + i);
+
+    return NULL;
+}
+
+/*
+ *
+ */
+static void *
+MapBar(struct pci_dev *device, int ioBar, int devMem)
+{
+    void *map;
+
+    if (!device->base_addr[ioBar] || !device->size[ioBar])
+	return NULL;
+
+    map = mmap(0, device->size[ioBar], PROT_WRITE | PROT_READ, MAP_SHARED,
+	       devMem, device->base_addr[ioBar]);
+    /* printf("Mapped IO at 0x%08llX (BAR %1d: 0x%08llX)\n",
+       device->base_addr[io_bar], io_bar, device->size[io_bar]); */
+
+    return map;
+}
+
+/*
+ *
+ */
+CARD32
+RegRead(void *map, int offset)
+{
+    CARD32 ret = *(volatile CARD32 *)((CARD8 *) map + offset);
+#ifdef DEBUG
+    fprintf(stderr, "0x%x = RegRead(0x%x)\n",ret,offset);
+#endif
+    return ret;
+}
+
+/*
+ *
+ */
+void
+RegWrite(void *map, int offset, CARD32 value)
+{
+#ifdef DEBUG
+    fprintf(stderr, "RegWrite(0x%x, 0x%x)\n",offset,value);
+#endif
+    *(volatile CARD32 *)((CARD8 *) map + offset) = value;
+}
+
+/*
+ *
+ */
+void
+RegMask(void *map, int offset, CARD32 value, CARD32 mask)
+{
+    CARD32 tmp;
+
+    tmp = RegRead(map, offset);
+    tmp &= ~mask;
+    tmp |= (value & mask);
+    RegWrite(map, offset, tmp);
+}
+
+void
+print_help(const char* progname, const char* message, const char* msgarg)
+{
+	if (message != NULL)
+	    fprintf(stderr, "%s %s\n", message, msgarg);
+	fprintf(stderr, "Usage: %s [start,end] PCI-tag\n"
+			"       PCI-tag: bus:dev.func\n\n",
+		progname);
+}
+
+
+/*
+ *
+ */
+int
+main(int argc, char *argv[])
+{
+    struct pci_dev *device = NULL;
+    struct pci_access *pciAccess;
+    struct RHDDevice *rhdDevice = NULL;
+    int devMem;
+    void *io;
+    int bus, dev, func;
+    int ret;
+    int saved_errno;
+    Bool deviceSet = FALSE;
+    CARD32 start = DEFAULT_START, end = DEFAULT_END;
+    int i;
+    unsigned int j;
+    
+
+    printf("%s: v%s, %s\n",
+	   "rhd_conntest", PACKAGE_VERSION, GIT_MESSAGE);
+
+    /* init libpci */
+    pciAccess = pci_alloc();
+    pci_init(pciAccess);
+    pci_scan_bus(pciAccess);
+
+    if (argc < 2) {
+	print_help(argv[0], "Missing argument: please provide a PCI tag\n",
+		   "");
+	return 1;
+    }
+
+    for (i = 1; i < argc; i++) {
+	if (!strncmp("-r",argv[i],3)) {
+	    if (++i < argc)
+		ret = sscanf(argv[i], "%x,%x", &start, &end);
+	    else {
+		i--;
+		ret = 0;
+	    }
+	    if (ret != 2) {
+		print_help(argv[0], "Unable to read range: ", argv[i]);
+		return 1;
+	    }
+	    if (start & 0x3) {
+		fprintf(stderr, "%s: range start 0x%4.4X not four byte aligned\n",argv[0], start);
+		return 1;
+	    }
+	}
+	else if (!strncmp("-",argv[i],1)) {
+	    print_help(argv[0], "Unknown option", argv[i]);
+	    return 1;
+	} else {
+	    ret = sscanf(argv[i], "%x:%x.%x", &bus, &dev, &func);
+	    if (ret != 3) {
+		ret = sscanf(argv[i], "%x:%x:%x", &bus, &dev, &func);
+		if (ret != 3) {
+		    ret = sscanf(argv[i], "%d:%d.%d", &bus, &dev, &func);
+		    if (ret != 3)
+			ret = sscanf(argv[i], "%d:%d:%d", &bus, &dev, &func);
+		}
+	    }
+	    if (ret != 3) {
+	        print_help(argv[0], "Unable to parse the PCI tag argument: ",
+			   argv[i]);
+	        return 1;
+	    }
+	    deviceSet = TRUE;
+	}
+    }
+
+    if (deviceSet) {
+	/* find our toy */
+	device = DeviceLocate(pciAccess->devices, bus, dev, func);
+	if (!device) {
+	    fprintf(stderr, "Unable to find PCI device at %02X:%02X.%02X.\n",
+		    bus, dev, func);
+	    return 1;
+	}
+
+	rhdDevice = DeviceMatch(device);
+	if (!rhdDevice) {
+	    fprintf(stderr,
+		    "Unknown device: 0x%04X:0x%04X (%02X:%02X.%02X).\n",
+		    device->vendor_id, device->device_id, bus, dev, func);
+	    return 1;
+	}
+    }
+
+    /* make sure we can actually read DEV_MEM before we do anything else */
+    devMem = open(DEV_MEM, O_RDWR);
+    if (devMem < 0) {
+	fprintf(stderr, "Unable to open "DEV_MEM": %s.\n", strerror(errno));
+	return errno;
+    }
+
+    io = MapBar(device, rhdDevice->bar, devMem);
+    saved_errno = errno;
+    close (devMem);
+    if (!io) {
+	fprintf(stderr, "Unable to map IO memory: %s.\n",
+		strerror(saved_errno));
+	return 1;
+    }
+
+    ChipType = rhdDevice->type;
+
+    for (j = start; j <= end; j+=4) {
+	CARD32 val = RegRead(io, j);
+	printf("0x%4.4X: 0x%8.8X\n",j, val);
+    }
+
+    return 0;
+}

commit 89c10062a3207c1f194a6a610684da2c1a40ef66
Author: Egbert Eich <eich@freedesktop.org>
Date:   Thu Apr 10 07:40:26 2008 +0200

    Minor cleanups.

diff --git a/utils/conntest/rhd_conntest.c b/utils/conntest/rhd_conntest.c
index 4d69da3..ca29767 100644
--- a/utils/conntest/rhd_conntest.c
+++ b/utils/conntest/rhd_conntest.c
@@ -65,10 +65,6 @@ typedef int Bool;
 typedef unsigned char CARD8;
 typedef unsigned short CARD16;
 typedef unsigned int CARD32;
-#define VBIOS_BASE 0xC0000
-#define VBIOS_MAXSIZE 0x10000
-#define DEV_MEM "/dev/mem"
-#define TARGET_HW_I2C_CLOCK 25 /*  kHz */
 
 #if __BYTE_ORDER == __LITTLE_ENDIAN
 #define SHORT(x) (x)
@@ -76,6 +72,11 @@ typedef unsigned int CARD32;
 #define SHORT(x) (((x & 0xff) << 8) | ((x & 0xff) >> 8))
 #endif
 
+#define VBIOS_BASE 0xC0000
+#define VBIOS_MAXSIZE 0x10000
+#define DEV_MEM "/dev/mem"
+#define TARGET_HW_I2C_CLOCK 25 /*  kHz */
+
 /* Some register names */
 enum {
     /* DAC A */
@@ -253,7 +254,7 @@ typedef enum dacOutput {
     DAC_COMPONENT
 } dacOutput;
 
-/* for RHD_R500/R600 */
+/* for RHD_R500/R600/RS690/RV620 */
 chipType ChipType;
 
 typedef struct _tableVersion
@@ -2414,7 +2415,8 @@ main(int argc, char *argv[])
     int bus, dev, func;
     int ret;
     int saved_errno;
-    Bool dumpBios = FALSE, deviceSet = FALSE, scanDDCBus = FALSE;
+    Bool deviceSet = FALSE;
+    Bool dumpBios = FALSE, scanDDCBus = FALSE;
     unsigned long DumpI2CData = 0;
     int i;
     unsigned char *rombase;

commit bb652740fc287eba2421e9bbc048f004549cb059
Author: Hans Ulrich Niedermann <hun@n-dimensional.de>
Date:   Thu Apr 10 15:29:14 2008 +0200

    git_version scripts: add licensing information.

diff --git a/RadeonHD.am b/RadeonHD.am
index 7324275..5c12cf6 100644
--- a/RadeonHD.am
+++ b/RadeonHD.am
@@ -1,3 +1,8 @@
+# Copyright (c) 2007 Hans Ulrich Niedermann <hun@n-dimensional.de>
+#
+# This Makefile fragment is free software; the author(s) give(s)
+# unlimited permission to copy, distribute and modify it.
+
 # The stamp file which is never created ensures that git_version.h is updated
 # before every build. Having git_version.h in foo_SOURCES ensures a recompile
 # of foo-bar.c if it is newer than the foo-bar.o file. Using noinst_foo_SOURCES
diff --git a/RadeonHD.tmpl b/RadeonHD.tmpl
index f80a5e7..2b798e2 100644
--- a/RadeonHD.tmpl
+++ b/RadeonHD.tmpl
@@ -1,5 +1,11 @@
 /* imake template for radeonhd driver -*- makefile -*- */
 
+/* Copyright (c) 2007 Hans Ulrich Niedermann <hun@n-dimensional.de>
+ *
+ * This Makefile fragment is free software; the author(s) give(s)
+ * unlimited permission to copy, distribute and modify it.
+ */
+
 VER_GREP                   = grep -A 4 AC_INIT $(TOP)/configure.ac
 VER_SED                    = sed -n '2s/[^0-9]*\([0-9][^,]*\).*/\1/p'
 VER_CUT                    = cut -d . -f
diff --git a/git_version.sh b/git_version.sh
index 96311a6..69eb0f2 100644
--- a/git_version.sh
+++ b/git_version.sh
@@ -5,13 +5,46 @@
 # Copyright (c) 2006-2007 Luc Verhaegen <libv@skynet.be>
 # Copyright (C) 2007 Hans Ulrich Niedermann <hun@n-dimensional.de>
 #
-# The author thanks the nice people on #git for the assistance!
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+# OTHER DEALINGS IN THE SOFTWARE.
+#
+# This script is based on the one written for xf86-video-unichrome by
+# Luc Verhaegen, but was rewritten almost completely by Hans Ulrich
+# Niedermann. The script contains a few bug fixes from Egbert Eich,
+# Matthias Hopf, Joerg Sonnenberger, and possibly others.
+#
+# The author thanks the nice people on #git for the assistance.
 #
 # Simple testing of this script:
 #   /sbin/busybox sh git_version.sh --example > moo.c \
 #     && gcc -Wall -Wextra -Wno-unused -o moo moo.c \
 #     && ./moo
 #   (bash should also do)
+#
+# For how to hook this up to your automake- and/or imake-based build
+# system, best take a look at how the RadeonHD.am and/or RadeonHD.tmpl
+# work in the xf86-video-radeonhd build system. For non-recursive make,
+# you can probably make things a little bit simpler.
+#
+# KNOWN BUGS:
+#  * Uses hyphenated ("git-foo-bar") program names, which git upstream
+#    have declared deprecated.
+#
 
 # Help messages
 USAGE="[<option>...]"

commit 60dc7e0453167b956a1fb0cc9db89aa22196b1cf
Author: Egbert Eich <eich@freedesktop.org>
Date:   Mon Apr 7 23:23:22 2008 +0200

    Add a hard coded connector table for an MSI HD2600PRO AGP.
    
    Full ID of the card: MSI RX2600PRO-T2D512Z/D2.
    The connector information for this chip lists HPD0 instead of HPD2.

diff --git a/src/rhd_id.c b/src/rhd_id.c
index bacc2dc..0e99ad6 100644
--- a/src/rhd_id.c
+++ b/src/rhd_id.c
@@ -421,6 +421,15 @@ RHDIsIGP(enum RHD_CHIPSETS chipset)
     { RHD_CONNECTOR_VGA, "VGA", RHD_DDC_0, RHD_HPD_NONE, \
 	{ RHD_OUTPUT_NONE, RHD_OUTPUT_DACA }}}
 
+/* MSI RX2600PRO-T2D512Z/D2 */
+#define DVI_BA12_TV_B0_DVI_AB01 \
+ { { RHD_CONNECTOR_DVI, "DUAL_LINK_DVI_I DFP1 CRT2", RHD_DDC_1, RHD_HPD_2, \
+	 { RHD_OUTPUT_TMDSA, RHD_OUTPUT_DACB }}, \
+   { RHD_CONNECTOR_TV, "7PIN_DIN TV1 CV", RHD_DDC_NONE, RHD_HPD_NONE, \
+	 { RHD_OUTPUT_DACB, RHD_OUTPUT_NONE }}, \
+   { RHD_CONNECTOR_DVI, "DUAL_LINK_DVI_I CRT1 DFP2", RHD_DDC_0, RHD_HPD_1, \
+	 { RHD_OUTPUT_LVTMA, RHD_OUTPUT_DACA }}}
+
 #if defined(USE_ID_CONNECTORS) || !defined(ATOM_BIOS)
 
 #define VGA_A0_DVI_BA10 \
@@ -709,6 +718,7 @@ rhdCards[] =
     /* 0x9586 : RV630 : ATI Radeon HD 2600 XT AGP */
     /* 0x9587 : RV630 : ATI Radeon HD 2600 Pro AGP */
     { 0x9587, 0x1002, 0x0028, "Sapphire Radeon HD 2600 PRO AGP", RHD_CARD_FLAG_NONE, DVI_BA10_TV_B0_VGA_A0 },
+    { 0x9587, 0x1462, 0x0028, "MSI HD2600PRO AGP", RHD_CARD_FLAG_NONE, DVI_BA12_TV_B0_DVI_AB01 },
     /* 0x9588 : RV630 : Radeon HD 2600 XT */
     { 0x9588, 0x1002, 0x2542, "ATI Radeon HD 2600XT DDR4", RHD_CARD_FLAG_NONE, DVI_BA10_DVI_AB01 },
     { 0x9588, 0x1448, 0x216C, "Gigabyte HD 2600 XT 256MB DDR3", RHD_CARD_FLAG_NONE, DVI_BA10_DVI_AB01 },

commit 8048353d9580e3930b9f1bfc47581284dc2ab100
Author: Egbert Eich <eich@freedesktop.org>
Date:   Mon Apr 7 22:44:24 2008 +0200

    Remove unneeded use of pciTag when using libpciaccess.

diff --git a/src/rhd.h b/src/rhd.h
index 61bbc89..2e898ac 100644
--- a/src/rhd.h
+++ b/src/rhd.h
@@ -178,9 +178,9 @@ typedef struct RHDRec {
     struct pci_device   *NBPciInfo;
 #else
     pciVideoRec         *PciInfo;
+    PCITAG              PciTag;
     PCITAG		NBPciTag;
 #endif
-    PCITAG              PciTag;
     unsigned int	PciDeviceID;
     int			entityIndex;
     struct rhdCard      *Card;
diff --git a/src/rhd_atombios.c b/src/rhd_atombios.c
index 152279f..21aa156 100644
--- a/src/rhd_atombios.c
+++ b/src/rhd_atombios.c
@@ -320,7 +320,6 @@ typedef struct _atomBiosHandle {
     atomDataTablesPtr atomDataPtr;
     pointer *scratchBase;
     CARD32 fbBase;
-    PCITAG PciTag;
     unsigned int BIOSImageSize;
     unsigned char *codeTable;
 } atomBiosHandleRec;
@@ -875,7 +874,6 @@ rhdAtomInit(atomBiosHandlePtr unused1, AtomBiosRequestID unused2,
     handle->BIOSBase = ptr;
     handle->atomDataPtr = atomDataPtr;
     handle->scrnIndex = scrnIndex;
-    handle->PciTag = rhdPtr->PciTag;
     handle->BIOSImageSize = BIOSImageSize;
     handle->codeTable = codeTable;
 
@@ -2790,7 +2788,7 @@ CailWritePCIConfigData(VOID*CAIL,VOID*src,UINT32 idx,UINT16 size)
 VOID
 CailReadPCIConfigData(VOID*CAIL, VOID* ret, UINT32 idx,UINT16 size)
 {
-    PCITAG tag = ((atomBiosHandlePtr)CAIL)->PciTag;
+    PCITAG tag = RHDPTRI((atomBiosHandlePtr)CAIL)->PciTag;
 
     CAILFUNC(CAIL);
 
@@ -2818,7 +2816,7 @@ CailReadPCIConfigData(VOID*CAIL, VOID* ret, UINT32 idx,UINT16 size)
 VOID
 CailWritePCIConfigData(VOID*CAIL,VOID*src,UINT32 idx,UINT16 size)
 {
-    PCITAG tag = ((atomBiosHandlePtr)CAIL)->PciTag;
+    PCITAG tag = RHDPTRI((atomBiosHandlePtr)CAIL)->PciTag;
 
     CAILFUNC(CAIL);
     DEBUGP(ErrorF("%s(%x,%x)\n",__func__,idx,(*(unsigned int*)src)));
diff --git a/src/rhd_driver.c b/src/rhd_driver.c
index ed8a801..aead94f 100644
--- a/src/rhd_driver.c
+++ b/src/rhd_driver.c
@@ -376,9 +376,6 @@ RHDPciProbe(DriverPtr drv, int entityNum,
 	rhdPtr = RHDPTR(pScrn);
 
 	rhdPtr->PciInfo = dev;
-	rhdPtr->PciTag = pciTag(dev->bus,
-				dev->dev,
-				dev->func);
 	rhdPtr->ChipSet = matchData;
     }
 

commit 3076447f027eb0e358304b4d5ffd337626e2b9a5
Author: Egbert Eich <eich@freedesktop.org>
Date:   Mon Apr 7 22:45:28 2008 +0200

    Fix MC access for RS 690.
    
    The MC registers are accessed thru PCI config space of the NB.
    Since we know nothing about RS600 it is excluded for now.

diff --git a/src/rhd_driver.c b/src/rhd_driver.c
index e90cbfb..ed8a801 100644
--- a/src/rhd_driver.c
+++ b/src/rhd_driver.c
@@ -2132,8 +2132,14 @@ _RHDReadMC(int scrnIndex, CARD32 addr)
 	_RHDRegWrite(scrnIndex, MC_IND_INDEX, addr);
 	ret = _RHDRegRead(scrnIndex, MC_IND_DATA);
     } else {
-	_RHDRegWrite(scrnIndex, RS69_MC_INDEX, addr);
-	ret = _RHDRegRead(scrnIndex, RS69_MC_DATA);
+#ifdef XSERVER_LIBPCIACCESS
+	CARD32 data = addr & ~RS69_C_IND_WR_EN;
+	pci_device_cfg_write(rhdPtr->NBPciInfo, &(data), RS69_MC_INDEX, 4, NULL);
+	pci_device_cfg_read(rhdPtr->NBPciInfo, &ret, RS69_MC_DATA, 4, NULL);
+#else
+	pciWriteLong(rhdPtr->NBPciTag, RS69_MC_INDEX, addr & ~RS69_C_IND_WR_EN);
+	ret = pciReadLong(rhdPtr->NBPciTag, RS69_MC_DATA);
+#endif
     }
 
     RHDDebug(scrnIndex,"%s(0x%08X) = 0x%08X\n",__func__,(unsigned int)addr,
@@ -2150,11 +2156,18 @@ _RHDWriteMC(int scrnIndex, CARD32 addr, CARD32 data)
 	     (unsigned int)data);
 
     if (rhdPtr->ChipSet < RHD_RS690) {
-	_RHDRegWrite(scrnIndex, MC_IND_INDEX, addr);
+	_RHDRegWrite(scrnIndex, MC_IND_INDEX, addr | MC_IND_WR_EN);
 	_RHDRegWrite(scrnIndex, MC_IND_DATA, data);
     } else {
-	_RHDRegWrite(scrnIndex, RS69_MC_INDEX, addr);
-	_RHDRegWrite(scrnIndex, RS69_MC_DATA, data);
+#ifdef XSERVER_LIBPCIACCESS
+	CARD32 tmp = addr & ~RS69_C_IND_WR_EN;
+	pci_device_cfg_write(rhdPtr->NBPciInfo, &tmp, RS69_MC_INDEX, 4, NULL);
+	pci_device_cfg_write(rhdPtr->NBPciInfo, &data, RS69_MC_DATA, 4, NULL);
+#else
+	pciWriteLong(rhdPtr->NBPciTag, RS69_MC_INDEX, addr | RS69_C_IND_WR_EN);
+	pciWriteLong(rhdPtr->NBPciTag, RS69_MC_DATA, data);
+#endif
+
     }
 }
 
diff --git a/src/rhd_mc.c b/src/rhd_mc.c
index b8cff39..9b59ee3 100644
--- a/src/rhd_mc.c
+++ b/src/rhd_mc.c
@@ -55,6 +55,10 @@ RHDMCInit(RHDPtr rhdPtr)
 
     RHDFUNC(rhdPtr);
 
+    /* we know nothing about RS600, yet */
+    if (rhdPtr->ChipSet == RHD_RS600)


Reply to: