xserver-xorg-video-radeonhd: Changes to 'upstream-experimental'
.gitignore | 5
Makefile.am | 35
README | 102 ++
RadeonHD.am | 5
RadeonHD.tmpl | 7
configure.ac | 63 +
git_version.sh | 51 +
man/radeonhd.man | 404 +++++++++-
src/AtomBios/includes/CD_Common_Types.h | 4
src/AtomBios/includes/ObjectID.h | 36
src/AtomBios/includes/atombios.h | 254 +++++-
src/Imakefile | 13
src/Makefile.am | 13
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 | 116 ++-
src/rhd_atombios.c | 784 +++++++++++++++++----
src/rhd_atombios.h | 104 ++
src/rhd_card.h | 4
src/rhd_connector.c | 115 ++-
src/rhd_connector.h | 4
src/rhd_crtc.c | 413 ++++++++++-
src/rhd_crtc.h | 28
src/rhd_cursor.c | 23
src/rhd_dac.c | 728 +++++++++++++++----
src/rhd_ddia.c | 390 ++++++++++
src/rhd_dig.c | 1052 ++++++++++++++++++++++++++++
src/rhd_driver.c | 939 +++++++++++++++++++++----
src/rhd_edid.c | 65 +
src/rhd_helper.c | 42 -
src/rhd_i2c.c | 416 ++++++++++-
src/rhd_id.c | 247 +++++-
src/rhd_lut.c | 4
src/rhd_lvtma.c | 423 ++++++++---
src/rhd_mc.c | 133 +++
src/rhd_mc.h | 1
src/rhd_modes.c | 200 +++--
src/rhd_monitor.c | 101 ++
src/rhd_monitor.h | 3
src/rhd_output.c | 40 -
src/rhd_output.h | 38 -
src/rhd_pll.c | 763 +++++++++++++++++---
src/rhd_pll.h | 15
src/rhd_randr.c | 535 ++++++++++++--
src/rhd_regs.h | 481 ++++++++++++-
src/rhd_shadow.c | 5
src/rhd_tmds.c | 93 +-
src/rhd_vga.c | 9
utils/conntest/Imakefile | 10
utils/conntest/Makefile.am | 19
utils/conntest/README | 8
utils/conntest/rhd_conntest.c | 1180 ++++++++++++++++++++++++++++----
utils/conntest/rhd_dump.c | 457 ++++++++++++
56 files changed, 11713 insertions(+), 1352 deletions(-)
New commits:
commit 761940fde7fef72bff18a8b8e840540452cf675a
Author: Matthias Hopf <mhopf@suse.de>
Date: Mon Apr 14 17:21:48 2008 +0200
Bump to 1.2.1. Add changes to README.
diff --git a/README b/README
index 3310232..851b6d3 100644
--- a/README
+++ b/README
@@ -33,6 +33,11 @@ Major Changes
Read ChangeLog for a complete list.
+- Version 1.2.1
+
+ - Build-fixes for systems without -NDEBUG, and for rhd_dump
+ - Added two new RV670 devices.
+
- Version 1.2.0
- Added support for RV620, RV635, and R680.
diff --git a/configure.ac b/configure.ac
index 7ca71c8..89b953d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
AC_PREREQ(2.57)
AC_INIT([xf86-video-radeonhd],
- 1.2.0,
+ 1.2.1,
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/radeonhd],
xf86-video-radeonhd)
commit a898e097ca4ae26db1d0f71144df7a580f0612bd
Author: Egbert Eich <eich@freedesktop.org>
Date: Sat Apr 12 17:57:46 2008 +0200
Add build rule for rhd_dump to Imakefile for backward compatibility.
diff --git a/utils/conntest/Imakefile b/utils/conntest/Imakefile
index 0821057..36a59c2 100644
--- a/utils/conntest/Imakefile
+++ b/utils/conntest/Imakefile
@@ -1,8 +1,10 @@
#include <Server.tmpl>
#include "../../RadeonHD.tmpl"
-SRCS = rhd_conntest.c git_version.h
-OBJS = rhd_conntest.o
+SRCS_conntest = rhd_conntest.c git_version.h
+OBJS_conntest = rhd_conntest.o
+SRCS_dump = rhd_dump.c git_version.h
+OBJS_dump = rhd_dump.o
INCLUDES = -I$(TOP)/src/AtomBios/includes
@@ -12,6 +14,8 @@ DEFINES = $(INCLUDES) \
SYS_LIBS = -lpci -lz
-NormalProgramTarget(rhd_conntest,$(OBJS),,,$(SYS_LIBS))
+NormalProgramTarget(rhd_conntest,$(OBJS_conntest),,,$(SYS_LIBS))
+NormalProgramTarget(rhd_dump,$(OBJS_dump),,,$(SYS_LIBS))
AllTarget(ProgramTargetName(rhd_conntest))
+AllTarget(ProgramTargetName(rhd_dump))
DependTarget()
commit e54fda75f2fcc141825d928cf71e23dce23ae095
Author: Stefan Dirsch <sndirsch@suse.de>
Date: Sun Apr 13 11:35:31 2008 +0200
Added two new RV670 devices. Removed unsupported M86 device.
New RV670 devices added: HD 3960, FireStream 9170. Unsupported
M86 device removed: HD3650.
diff --git a/src/rhd_id.c b/src/rhd_id.c
index 9d37f96..e06f017 100644
--- a/src/rhd_id.c
+++ b/src/rhd_id.c
@@ -229,6 +229,8 @@ const PCI_ID_LIST = {
RHD_DEVICE_MATCH( 0x950F, RHD_R680 ), /* ATI Radeon HD3870 X2 */
RHD_DEVICE_MATCH( 0x9511, RHD_RV670 ), /* ATI FireGL V7700 */
RHD_DEVICE_MATCH( 0x9515, RHD_RV670 ), /* ATI Radeon HD 3850 AGP */
+ RHD_DEVICE_MATCH( 0x9517, RHD_RV670 ), /* ATI Radeon HD 3960 */
+ RHD_DEVICE_MATCH( 0x9519, RHD_RV670 ), /* FireStream 9170 */
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 */
@@ -242,7 +244,6 @@ const PCI_ID_LIST = {
RHD_DEVICE_MATCH( 0x958D, RHD_RV630 ), /* FireGL V3600 */
RHD_DEVICE_MATCH( 0x958E, RHD_RV630 ), /* ATI Radeon HD 2600 LE */
RHD_DEVICE_MATCH( 0x9590, RHD_RV635 ), /* ATI Radeon HD 3600 Series */
- RHD_DEVICE_MATCH( 0x9591, RHD_RV635 ), /* ATI Mobility Radeon HD 3650 */
RHD_DEVICE_MATCH( 0x9596, RHD_RV635 ), /* ATI Radeon HD 3650 AGP */
RHD_DEVICE_MATCH( 0x9597, RHD_RV635 ), /* ATI Radeon HD 3600 Series */
RHD_DEVICE_MATCH( 0x9598, RHD_RV635 ), /* ATI Radeon HD 3670 */
@@ -325,7 +326,7 @@ RHDIdentify(int flags)
"\tRV630 : Radeon HD 2600 LE/Pro/XT, HD 2600 Pro/XT AGP; Gemini RV630;\n"
"\t\tFireGL V3600/V5600.\n"
"\tRV635 : Radeon HD 3650, HD 3670.\n"
- "\tRV670 : Radeon HD 3850, HD 3870, FireGL V7700.\n"
+ "\tRV670 : Radeon HD 3690, 3850, HD 3870, FireGL V7700, FireStream 9170.\n"
"\tR680 : Radeon HD 3870 X2.\n");
xf86Msg(X_NONE,
"\tM52 : Mobility Radeon X1300.\n"
@@ -342,8 +343,7 @@ RHDIdentify(int flags)
"\tM74 : Mobility Radeon HD 2400 XT.\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");
+ "\tM82 : Mobility Radeon HD 3400.\n");
xf86Msg(X_NONE,
"\tRS600 : Radeon Xpress 1200, Xpress 1250.\n"
"\tRS690 : Radeon X1200, X1250, X1270.\n"
commit 19c048d38af6c96182fee7857c3e8a272f77c800
Author: Matthias Hopf <mhopf@suse.de>
Date: Fri Apr 11 14:48:21 2008 +0200
Fix broken assert() in rhd_id.c. Use ASSERT() instead of assert() everywhere.
diff --git a/src/rhd_connector.c b/src/rhd_connector.c
index e2c77cf..dd72057 100644
--- a/src/rhd_connector.c
+++ b/src/rhd_connector.c
@@ -143,7 +143,7 @@ rhdConnectorSynthName(struct rhdConnectorInfo *ConnectorInfo,
char *typec;
char *str1, *str2;
- assert(state != NULL);
+ ASSERT(state != NULL);
if (!*state) {
if (!(*state = xcalloc(sizeof(struct rhdCsState), 1)))
diff --git a/src/rhd_id.c b/src/rhd_id.c
index 3837faf..9d37f96 100644
--- a/src/rhd_id.c
+++ b/src/rhd_id.c
@@ -360,7 +360,7 @@ RHDIdentify(int flags)
enum RHD_FAMILIES
RHDFamily(enum RHD_CHIPSETS chipset)
{
- assert(chipset <= sizeof(RHDChipsetMap)/sizeof(rhdChipsetMapStruct));
+ ASSERT(chipset < sizeof(rhdChipsetMap)/sizeof(struct rhdChipsetMapStruct));
return rhdChipsetMap[chipset].family;
}
@@ -371,7 +371,7 @@ RHDFamily(enum RHD_CHIPSETS chipset)
Bool
RHDIsIGP(enum RHD_CHIPSETS chipset)
{
- assert(chipset <= sizeof(RHDChipsetMap)/sizeof(rhdChipsetMapStruct));
+ ASSERT(chipset < sizeof(rhdChipsetMap)/sizeof(struct rhdChipsetMapStruct));
return rhdChipsetMap[chipset].IGP;
}
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.
Reply to: