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

xserver-xorg-video-ati: Changes to 'debian-experimental'



 aclocal.m4                         |    2 
 configure                          |    2 
 configure.ac                       |    2 
 debian/changelog                   |    8 +
 debian/patches/01_gen_pci_ids.diff |   12 -
 ltmain.sh                          |    2 
 man/radeon.man                     |   51 ++++++-
 src/Makefile.am                    |    9 -
 src/Makefile.in                    |   13 +
 src/ati_pciids_gen.h               |  219 +++++++++++++++++++++++++++++++
 src/atidri.c                       |   26 +--
 src/atipciids.h                    |  248 -----------------------------------
 src/pcidb/ati_pciids.csv           |  220 +++++++++++++++++++++++++++++++
 src/pcidb/parse_pci_ids.pl         |   94 +++++++++++++
 src/radeon.h                       |   30 +++-
 src/radeon_chipinfo_gen.h          |  140 +++++++++++++++++++
 src/radeon_chipset.h               |  142 --------------------
 src/radeon_chipset_gen.h           |  141 ++++++++++++++++++++
 src/radeon_crtc.c                  |    4 
 src/radeon_dri.c                   |   30 ++--
 src/radeon_driver.c                |  260 ++++---------------------------------
 src/radeon_output.c                |  212 ++++++++++++++++++++++++------
 src/radeon_pci_chipset_gen.h       |  141 ++++++++++++++++++++
 src/radeon_probe.c                 |  145 --------------------
 src/radeon_render.c                |    4 
 src/radeon_tv.c                    |    8 -
 src/radeon_video.c                 |   56 ++++---
 27 files changed, 1335 insertions(+), 886 deletions(-)

New commits:
commit 9fc5d175675a8850579dbce2786f0900621d7895
Author: Brice Goglin <bgoglin@debian.org>
Date:   Mon Dec 3 21:26:21 2007 +0100

    Prepare changelog for uploade

diff --git a/debian/changelog b/debian/changelog
index cd2a104..e63ffc6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,10 @@
-xserver-xorg-video-ati (1:6.7.196-2) UNRELEASED; urgency=low
+xserver-xorg-video-ati (1:6.7.196-2) experimental; urgency=low
 
   * New upstream snapshot, containing commits up to 5022d006.
     + Fix the washed out color, closes: #440174.
     + Update 01_gen_pci_ids.diff to use the new ati_pciids_gen.h.
 
- -- Brice Goglin <bgoglin@debian.org>  Mon, 03 Dec 2007 21:22:13 +0100
+ -- Brice Goglin <bgoglin@debian.org>  Mon, 03 Dec 2007 21:26:02 +0100
 
 xserver-xorg-video-ati (1:6.7.196-1) experimental; urgency=low
 

commit e04a087f5bacad2661ee9c7583a4561cb9a2dcfc
Author: Brice Goglin <bgoglin@debian.org>
Date:   Mon Dec 3 21:25:58 2007 +0100

    New upstream snapshot

diff --git a/aclocal.m4 b/aclocal.m4
index cdb0a74..2ab5fdd 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -18,7 +18,7 @@ you should regenerate the build system entirely.], [63])])
 
 # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
 
-# serial 51 Debian 1.5.24-1 AC_PROG_LIBTOOL
+# serial 51 Debian 1.5.24-2 AC_PROG_LIBTOOL
 
 
 # AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
diff --git a/configure b/configure
index 469bc26..daa3f53 100755
--- a/configure
+++ b/configure
@@ -21053,7 +21053,7 @@ _ACEOF
 fi
 
 
-if test "x$DRI" = xauto; then
+if test "$DRI" != no; then
 	as_ac_File=`echo "ac_cv_file_${sdkdir}/dri.h" | $as_tr_sh`
 { echo "$as_me:$LINENO: checking for ${sdkdir}/dri.h" >&5
 echo $ECHO_N "checking for ${sdkdir}/dri.h... $ECHO_C" >&6; }
diff --git a/debian/changelog b/debian/changelog
index 75623d0..cd2a104 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+xserver-xorg-video-ati (1:6.7.196-2) UNRELEASED; urgency=low
+
+  * New upstream snapshot, containing commits up to 5022d006.
+    + Fix the washed out color, closes: #440174.
+    + Update 01_gen_pci_ids.diff to use the new ati_pciids_gen.h.
+
+ -- Brice Goglin <bgoglin@debian.org>  Mon, 03 Dec 2007 21:22:13 +0100
+
 xserver-xorg-video-ati (1:6.7.196-1) experimental; urgency=low
 
   * New upstream release candidate.
diff --git a/debian/patches/01_gen_pci_ids.diff b/debian/patches/01_gen_pci_ids.diff
index 0bd0d92..f2e5606 100644
--- a/debian/patches/01_gen_pci_ids.diff
+++ b/debian/patches/01_gen_pci_ids.diff
@@ -6,13 +6,13 @@ Index: xserver-xorg-video-ati/src/Makefile.am
 ===================================================================
 --- xserver-xorg-video-ati.orig/src/Makefile.am	2007-10-06 02:44:47.000000000 +0200
 +++ xserver-xorg-video-ati/src/Makefile.am	2007-10-06 02:48:34.000000000 +0200
-@@ -192,3 +192,9 @@
- 	theatre_reg.h \
- 	atipciids.h \
- 	atipcirename.h
+@@ -197,3 +197,9 @@
+ 	radeon_pci_chipset_gen.h \
+ 	pcidb/ati_pciids.csv \
+ 	pcidb/parse_pci_ids.pl
 +
 +pcidatadir = $(datadir)/xserver-xorg/pci
 +pcidata_DATA = ati.ids
 +
-+ati.ids: atipciids.h
-+	awk '/^#define.*PCI_CHIP/ {print $$3}' ${srcdir}/atipciids.h | sed -e 's/0x/1002/' > ati.ids
++ati.ids: ati_pciids_gen.h
++	awk '/^#define.*PCI_CHIP/ {print $$3}' ${srcdir}/ati_pciids_gen.h | sed -e 's/0x/1002/' > ati.ids
diff --git a/ltmain.sh b/ltmain.sh
index f924d30..13c5494 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -43,7 +43,7 @@ EXIT_FAILURE=1
 
 PROGRAM=ltmain.sh
 PACKAGE=libtool
-VERSION="1.5.24 Debian 1.5.24-1"
+VERSION="1.5.24 Debian 1.5.24-2"
 TIMESTAMP=" (1.1220.2.456 2007/06/24 02:25:32)"
 
 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
diff --git a/src/Makefile.in b/src/Makefile.in
index a68ef76..8470c74 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -470,7 +470,6 @@ EXTRA_DIST = \
 	r128_reg.h \
 	r128_sarea.h \
 	r128_version.h \
-	radeon_chipset.h \
 	radeon_common.h \
 	radeon_commonfuncs.c \
 	radeon_dri.h \
@@ -490,7 +489,13 @@ EXTRA_DIST = \
 	theatre.h \
 	theatre_reg.h \
 	atipciids.h \
-	atipcirename.h
+	atipcirename.h \
+	ati_pciids_gen.h \
+	radeon_chipinfo_gen.h \
+	radeon_chipset_gen.h \
+	radeon_pci_chipset_gen.h \
+	pcidb/ati_pciids.csv \
+	pcidb/parse_pci_ids.pl
 
 pcidatadir = $(datadir)/xserver-xorg/pci
 pcidata_DATA = ati.ids
@@ -1081,8 +1086,8 @@ uninstall-am: uninstall-ati_drv_laLTLIBRARIES \
 	uninstall-theatre_drv_laLTLIBRARIES
 
 
-ati.ids: atipciids.h
-	awk '/^#define.*PCI_CHIP/ {print $$3}' ${srcdir}/atipciids.h | sed -e 's/0x/1002/' > ati.ids
+ati.ids: ati_pciids_gen.h
+	awk '/^#define.*PCI_CHIP/ {print $$3}' ${srcdir}/ati_pciids_gen.h | sed -e 's/0x/1002/' > ati.ids
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:

commit 5022d006cfc06ca0395981526b2c2c94c6878567
Author: Michel Dänzer <michel@tungstengraphics.com>
Date:   Sun Dec 2 17:27:33 2007 +0100

    radeon: Further XVideo fixes.
    
    * Make sure pitch constraints are always met for DMA upload blits.
    * RGB24 is not affected by endianness.

diff --git a/src/radeon_video.c b/src/radeon_video.c
index 332f2cd..3f0209e 100644
--- a/src/radeon_video.c
+++ b/src/radeon_video.c
@@ -414,11 +414,11 @@ static XF86AttributeRec Attributes[NUM_DEC_ATTRIBUTES+1] =
 
 #define FOURCC_RGB24    0x00000000
 
-#define XVIMAGE_RGB24(byte_order)   \
+#define XVIMAGE_RGB24   \
         { \
                 FOURCC_RGB24, \
                 XvRGB, \
-                byte_order, \
+                LSBFirst, \
                 { 'R', 'G', 'B', 0, \
                   0x00,0x00,0x00,0x10,0x80,0x00,0x00,0xAA,0x00,0x38,0x9B,0x71}, \
                 24, \
@@ -473,15 +473,14 @@ static XF86ImageRec Images[NUM_IMAGES] =
 {
 #if X_BYTE_ORDER == X_BIG_ENDIAN
         XVIMAGE_RGBA32(MSBFirst),
-        XVIMAGE_RGB24(MSBFirst),
         XVIMAGE_RGBT16(MSBFirst),
         XVIMAGE_RGB16(MSBFirst),
 #else
         XVIMAGE_RGBA32(LSBFirst),
-        XVIMAGE_RGB24(LSBFirst),
         XVIMAGE_RGBT16(LSBFirst),
         XVIMAGE_RGB16(LSBFirst),
 #endif
+        XVIMAGE_RGB24,
         XVIMAGE_YUY2,
         XVIMAGE_UYVY,
         XVIMAGE_YV12,
@@ -2210,8 +2209,6 @@ RADEONCopyRGB24Data(
 	int x, y;
 	unsigned int hpass;
 
-	/* XXX Fix endian flip on R300 */
-
 	RADEONHostDataParams( pScrn, dst, dstPitch, 4, &dstPitchOff, &x, &y );
 
 	while ( (dptr = ( CARD32* )RADEONHostDataBlit( pScrn, 4, w, dstPitchOff,
@@ -2224,14 +2221,11 @@ RADEONCopyRGB24Data(
 
 		for ( i = 0 ; i < w; i++, sptr += 3 )
 		{
-#if X_BYTE_ORDER == X_BIG_ENDIAN
-		    *dptr++ = (sptr[0] << 16) | (sptr[1] << 8) | sptr[2];
-#else
-		    *dptr++ = (sptr[2] << 16) | (sptr[1] << 8) | sptr[0];
-#endif
+		    dptr[i] = (sptr[2] << 16) | (sptr[1] << 8) | sptr[0];
 		}
 
 		src += srcPitch;
+		dptr += bufPitch / 4;
 	    }
 	}
 
@@ -2249,17 +2243,12 @@ RADEONCopyRGB24Data(
 				  & ~RADEON_NONSURF_AP0_SWP_16BPP);
 #endif
 
-	for(j=0;j<h;j++){
-	    dptr=(CARD32 *)(dst+j*dstPitch);
-	    sptr=src+j*srcPitch;
+	for (j = 0; j < h; j++) {
+	    dptr = (CARD32 *)(dst + j * dstPitch);
+	    sptr = src + j * srcPitch;
 
-	    for(i=w;i>0;i--){
-#if X_BYTE_ORDER == X_BIG_ENDIAN
-	      *dptr++=((sptr[0])<<16)|((sptr[1])<<8)|(sptr[2]);
-#else
-	      *dptr++=((sptr[2])<<16)|((sptr[1])<<8)|(sptr[0]);
-#endif
-	      sptr+=3;
+	    for (i = 0; i < w; i++, sptr += 3) {
+		dptr[i] = (sptr[2] << 16) | (sptr[1] << 8) | sptr[0];
 	    }
 	}
 
@@ -2933,17 +2922,17 @@ RADEONPutImage(
 
    switch(id) {
    case FOURCC_RGB24:
-   	dstPitch=(width*4+0x0f)&(~0x0f);
-	srcPitch=width*3;
+	dstPitch = width * 4;
+	srcPitch = width * 3;
 	break;
    case FOURCC_RGBA32:
-   	dstPitch=(width*4+0x0f)&(~0x0f);
-	srcPitch=width*4;
+	dstPitch = width * 4;
+	srcPitch = width * 4;
 	break;
    case FOURCC_RGB16:
    case FOURCC_RGBT16:
-   	dstPitch=(width*2+0x0f)&(~0x0f);
-	srcPitch=(width*2+3)&(~0x03);
+	dstPitch = width * 2;
+	srcPitch = (width * 2 + 3) & ~3;
 	break;
    case FOURCC_YV12:
    case FOURCC_I420:
@@ -2956,11 +2945,20 @@ RADEONPutImage(
    case FOURCC_UYVY:
    case FOURCC_YUY2:
    default:
-	dstPitch = ((width << 1) + 63) & ~63;
-	srcPitch = (width << 1);
+	dstPitch = width * 2;
+	srcPitch = width * 2;
 	break;
    }
 
+#ifdef XF86DRI
+   if (info->directRenderingEnabled && info->DMAForXv) {
+       /* The upload blit only supports multiples of 64 bytes */
+       dstPitch = (dstPitch + 63) & ~63;
+   } else
+#endif
+       /* The overlay only supports multiples of 16 bytes */
+       dstPitch = (dstPitch + 15) & ~15;
+
    new_size = dstPitch * height;
    if (id == FOURCC_YV12 || id == FOURCC_I420) {
       new_size += (dstPitch >> 1) * ((height + 1) & ~1);

commit 6ed55b70b23dfdc7b41103ea59c1df2bda5e41e6
Author: Kusanagi Kouichi <slash@ma.neweb.ne.jp>
Date:   Sun Dec 2 17:18:46 2007 +0100

    radeon: Fix crash with XVideo 24bit RGB images.
    
    See https://bugs.freedesktop.org/show_bug.cgi?id=13274 .

diff --git a/src/radeon_video.c b/src/radeon_video.c
index 26857a5..332f2cd 100644
--- a/src/radeon_video.c
+++ b/src/radeon_video.c
@@ -2199,7 +2199,7 @@ RADEONCopyRGB24Data(
   unsigned int w
 ){
     CARD32 *dptr;
-    CARD8 *sptr = 0;
+    CARD8 *sptr;
     int i,j;
     RADEONInfoPtr info = RADEONPTR(pScrn);
 #ifdef XF86DRI
@@ -2214,7 +2214,7 @@ RADEONCopyRGB24Data(
 
 	RADEONHostDataParams( pScrn, dst, dstPitch, 4, &dstPitchOff, &x, &y );
 
-	while ( (dptr = ( CARD32* )RADEONHostDataBlit( pScrn, 4, w, dstPitch,
+	while ( (dptr = ( CARD32* )RADEONHostDataBlit( pScrn, 4, w, dstPitchOff,
 						       &bufPitch, x, &y, &h,
 						       &hpass )) )
 	{
@@ -2224,11 +2224,14 @@ RADEONCopyRGB24Data(
 
 		for ( i = 0 ; i < w; i++, sptr += 3 )
 		{
-		    *dptr++ = (sptr[0] << 24) | (sptr[1] << 16) | sptr[2];
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+		    *dptr++ = (sptr[0] << 16) | (sptr[1] << 8) | sptr[2];
+#else
+		    *dptr++ = (sptr[2] << 16) | (sptr[1] << 8) | sptr[0];
+#endif
 		}
 
-		src += hpass * srcPitch;
-		dptr += hpass * bufPitch;
+		src += srcPitch;
 	    }
 	}
 
@@ -2251,8 +2254,11 @@ RADEONCopyRGB24Data(
 	    sptr=src+j*srcPitch;
 
 	    for(i=w;i>0;i--){
-	      dptr[0]=((sptr[0])<<24)|((sptr[1])<<16)|(sptr[2]);
-	      dptr++;
+#if X_BYTE_ORDER == X_BIG_ENDIAN
+	      *dptr++=((sptr[0])<<16)|((sptr[1])<<8)|(sptr[2]);
+#else
+	      *dptr++=((sptr[2])<<16)|((sptr[1])<<8)|(sptr[0]);
+#endif
 	      sptr+=3;
 	    }
 	}

commit a697b590899bb7704ec4d7ae9a9c3cbbfcaef382
Author: Michel Dänzer <michel@tungstengraphics.com>
Date:   Sun Dec 2 17:11:20 2007 +0100

    Fix build against xserver master.
    
    (DE)ALLOCATE_LOCAL are gone.

diff --git a/src/atidri.c b/src/atidri.c
index bc862a8..0da1bc5 100644
--- a/src/atidri.c
+++ b/src/atidri.c
@@ -553,11 +553,11 @@ static void ATIDRIMoveBuffers( WindowPtr pWin, DDXPointRec ptOldOrg,
 
 	if (nbox > 1) {
 	    /* Keep ordering in each band, reverse order of bands */
-	    pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec)*nbox);
+	    pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec)*nbox);
 	    if (!pboxNew1) return;
-	    pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec)*nbox);
+	    pptNew1 = (DDXPointPtr)xalloc(sizeof(DDXPointRec)*nbox);
 	    if (!pptNew1) {
-		DEALLOCATE_LOCAL(pboxNew1);
+		xfree(pboxNew1);
 		return;
 	    }
 	    pboxBase = pboxNext = pbox+nbox-1;
@@ -588,13 +588,13 @@ static void ATIDRIMoveBuffers( WindowPtr pWin, DDXPointRec ptOldOrg,
 
 	if (nbox > 1) {
 	    /* reverse order of rects in each band */
-	    pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec)*nbox);
-	    pptNew2  = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec)*nbox);
+	    pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec)*nbox);
+	    pptNew2  = (DDXPointPtr)xalloc(sizeof(DDXPointRec)*nbox);
 	    if (!pboxNew2 || !pptNew2) {
-		DEALLOCATE_LOCAL(pptNew2);
-		DEALLOCATE_LOCAL(pboxNew2);
-		DEALLOCATE_LOCAL(pptNew1);
-		DEALLOCATE_LOCAL(pboxNew1);
+		xfree(pptNew2);
+		xfree(pboxNew2);
+		xfree(pptNew1);
+		xfree(pboxNew1);
 		return;
 	    }
 	    pboxBase = pboxNext = pbox;
@@ -665,10 +665,10 @@ static void ATIDRIMoveBuffers( WindowPtr pWin, DDXPointRec ptOldOrg,
     outf(SRC_OFF_PITCH, pATI->NewHW.dst_off_pitch);
     outf(DST_OFF_PITCH, pATI->NewHW.src_off_pitch);
 
-    DEALLOCATE_LOCAL(pptNew2);
-    DEALLOCATE_LOCAL(pboxNew2);
-    DEALLOCATE_LOCAL(pptNew1);
-    DEALLOCATE_LOCAL(pboxNew1);
+    xfree(pptNew2);
+    xfree(pboxNew2);
+    xfree(pptNew1);
+    xfree(pboxNew1);
 
     ATIDRIMarkSyncInt(pScreenInfo);
 #endif
diff --git a/src/radeon_dri.c b/src/radeon_dri.c
index ed418b8..7136e4e 100644
--- a/src/radeon_dri.c
+++ b/src/radeon_dri.c
@@ -559,12 +559,12 @@ static void RADEONDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
 
 	if (nbox > 1) {
 	    /* Keep ordering in each band, reverse order of bands */
-	    pboxNew1 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec)*nbox);
+	    pboxNew1 = (BoxPtr)xalloc(sizeof(BoxRec)*nbox);
 	    if (!pboxNew1) return;
 
-	    pptNew1 = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec)*nbox);
+	    pptNew1 = (DDXPointPtr)xalloc(sizeof(DDXPointRec)*nbox);
 	    if (!pptNew1) {
-		DEALLOCATE_LOCAL(pboxNew1);
+		xfree(pboxNew1);
 		return;
 	    }
 
@@ -601,14 +601,14 @@ static void RADEONDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
 
 	if (nbox > 1) {
 	    /* reverse order of rects in each band */
-	    pboxNew2 = (BoxPtr)ALLOCATE_LOCAL(sizeof(BoxRec)*nbox);
-	    pptNew2  = (DDXPointPtr)ALLOCATE_LOCAL(sizeof(DDXPointRec)*nbox);
+	    pboxNew2 = (BoxPtr)xalloc(sizeof(BoxRec)*nbox);
+	    pptNew2  = (DDXPointPtr)xalloc(sizeof(DDXPointRec)*nbox);
 
 	    if (!pboxNew2 || !pptNew2) {
-		DEALLOCATE_LOCAL(pptNew2);
-		DEALLOCATE_LOCAL(pboxNew2);
-		DEALLOCATE_LOCAL(pptNew1);
-		DEALLOCATE_LOCAL(pboxNew1);
+		xfree(pptNew2);
+		xfree(pboxNew2);
+		xfree(pptNew1);
+		xfree(pboxNew1);
 		return;
 	    }
 
@@ -679,10 +679,10 @@ static void RADEONDRIMoveBuffers(WindowPtr pParent, DDXPointRec ptOldOrg,
 
     info->dst_pitch_offset = info->frontPitchOffset;;
 
-    DEALLOCATE_LOCAL(pptNew2);
-    DEALLOCATE_LOCAL(pboxNew2);
-    DEALLOCATE_LOCAL(pptNew1);
-    DEALLOCATE_LOCAL(pboxNew1);
+    xfree(pptNew2);
+    xfree(pboxNew2);
+    xfree(pptNew1);
+    xfree(pboxNew1);
 
     info->accel->NeedToSync = TRUE;
 #endif /* USE_XAA */

commit 00b4480aa2c5d7f751e34fc964f431b90b14c8d2
Author: Alex Deucher <alex@t41p.hsd1.va.comcast.net>
Date:   Sat Dec 1 14:18:40 2007 -0500

    RADEON: add options for force TV out as detected and to set TV standard
    
    Also fix a typo in internal tv-out parsing

diff --git a/man/radeon.man b/man/radeon.man
index 41c7242..881612a 100644
--- a/man/radeon.man
+++ b/man/radeon.man
@@ -440,6 +440,31 @@ mini                 \-\- mini-external alias
 The default value is
 .B undefined.
 .TP
+.BI "Option \*qTVStandard\*q \*q" string \*q
+.br
+Used to specify the default TV standard if you want to use something other than
+the bios default. Valid options are:
+.br
+ntsc
+.br
+pal
+.br
+pal-m
+.br
+pal-60
+.br
+ntsc-j
+.br
+scart-pal
+.br
+The default value is
+.B undefined.
+.TP
+.BI "Option \*qForceTVOut\*q \*q" boolean \*q
+Enable this option to force TV Out to always be detected as attached.
+The default is
+.B off 
+.TP
 
 .SH SEE ALSO
 __xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
diff --git a/src/radeon.h b/src/radeon.h
index f9bf343..78f756e 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -158,7 +158,9 @@ typedef enum {
     OPTION_MAC_MODEL,
 #endif
     OPTION_DEFAULT_TMDS_PLL,
-    OPTION_TVDAC_LOAD_DETECT
+    OPTION_TVDAC_LOAD_DETECT,
+    OPTION_FORCE_TVOUT,
+    OPTION_TVSTD
 } RADEONOpts;
 
 
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 0465497..3422b66 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -192,6 +192,8 @@ static const OptionInfoRec RADEONOptions[] = {
     { OPTION_MAC_MODEL,      "MacModel",         OPTV_STRING,  {0}, FALSE },
 #endif
     { OPTION_TVDAC_LOAD_DETECT, "TVDACLoadDetect", OPTV_BOOLEAN, {0}, FALSE },
+    { OPTION_FORCE_TVOUT,    "ForceTVOut",         OPTV_BOOLEAN, {0}, FALSE },
+    { OPTION_TVSTD,          "TVStandard",         OPTV_STRING,  {0}, FALSE },
     { -1,                    NULL,               OPTV_NONE,    {0}, FALSE }
 };
 
@@ -1522,7 +1524,7 @@ static Bool RADEONPreInitChipType(ScrnInfoPtr pScrn)
 	    info->IsIGP = card->igp;
 	    pRADEONEnt->HasCRTC2 = !card->nocrtc2;
 	    info->HasSingleDAC = card->singledac;
-	    info->InternalTVOut = card->nointtvout;
+	    info->InternalTVOut = !card->nointtvout;
 	    break;
 	}
     }
diff --git a/src/radeon_output.c b/src/radeon_output.c
index efe093f..4e5aded 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -634,11 +634,18 @@ void RADEONConnectorFindMonitor(ScrnInfoPtr pScrn, xf86OutputPtr output)
 
     if (radeon_output->MonType == MT_UNKNOWN) {
 	if (radeon_output->type == OUTPUT_STV || radeon_output->type == OUTPUT_CTV) {
-	    if (info->InternalTVOut) {
-		if (radeon_output->load_detection)
-		    radeon_output->MonType = radeon_detect_tv(pScrn);
+	    if (xf86ReturnOptValBool(info->Options, OPTION_FORCE_TVOUT, FALSE)) {
+		if (radeon_output->type == OUTPUT_STV)
+		    radeon_output->MonType = MT_STV;
 		else
-		    radeon_output->MonType = MT_NONE;
+		    radeon_output->MonType = MT_CTV;
+	    } else {
+		if (info->InternalTVOut) {
+		    if (radeon_output->load_detection)
+			radeon_output->MonType = radeon_detect_tv(pScrn);
+		    else
+			radeon_output->MonType = MT_NONE;
+		}
 	    }
 	} else {
 	    radeon_output->MonType = RADEONDisplayDDCConnected(pScrn, output);
@@ -1759,6 +1766,7 @@ radeon_create_resources(xf86OutputPtr output)
     INT32 range[2];
     int data, err;
     const char *s;
+    char *optstr;
 
     /* backlight control */
     if (radeon_output->type == OUTPUT_LVDS) {
@@ -1994,6 +2002,26 @@ radeon_create_resources(xf86OutputPtr output)
 	    s = "ntsc";
 	    break;
 	}
+
+	optstr = (char *)xf86GetOptValString(info->Options, OPTION_TVSTD);
+	if (optstr) {
+	    if (!strncmp("ntsc", optstr, strlen("ntsc")))
+		radeon_output->tvStd = TV_STD_NTSC;
+	    else if (!strncmp("pal", optstr, strlen("pal")))
+		radeon_output->tvStd = TV_STD_PAL;
+	    else if (!strncmp("pal-m", optstr, strlen("pal-m")))
+		radeon_output->tvStd = TV_STD_PAL_M;
+	    else if (!strncmp("pal-60", optstr, strlen("pal-60")))
+		radeon_output->tvStd = TV_STD_PAL_60;
+	    else if (!strncmp("ntsc-j", optstr, strlen("ntsc-j")))
+		radeon_output->tvStd = TV_STD_NTSC_J;
+	    else if (!strncmp("scart-pal", optstr, strlen("scart-pal")))
+		radeon_output->tvStd = TV_STD_SCART_PAL;
+	    else {
+		xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Invalid TV Standard: %s\n", optstr);
+	    }
+	}
+
 	err = RRChangeOutputProperty(output->randr_output, tv_std_atom,
 				     XA_STRING, 8, PropModeReplace, strlen(s), (pointer)s,
 				     FALSE, FALSE);

commit 0175b79987ef4d7b0ce8238c3bdde989e504516a
Author: Alex Deucher <alex@botch2.(none)>
Date:   Fri Nov 30 15:37:42 2007 -0500

    RADEON: rework MacModel option
    
    this brings in some previous research from Michel Dänzer,
    Sjoerd Simons, and myself.  Hopefully, the driver will pick
    the correct MacModel in more cases.  This also changes the
    default connector table for desktop Macs to dual DVI rather
    than DVI+VGA as that seems to be the case more often than not.
    External TMDS chips are handled separately now as well.
    Eventually we should add an option to allow the user to specify
    what external TMDS chip they need, but we don't have enough info
    yet, so we'll rely on OF to init the external chip in most cases
    for now.

diff --git a/man/radeon.man b/man/radeon.man
index 8f7b551..41c7242 100644
--- a/man/radeon.man
+++ b/man/radeon.man
@@ -421,14 +421,22 @@ a powerbook or mini with DVI that does not work properly, try the alternate
 .br
 ibook                \-\- ibooks
 .br
-powerbook-duallink   \-\- Powerbooks with external DVI
+powerbook-external   \-\- Powerbooks with external DVI
 .br
-powerbook            \-\- Powerbooks with integrated DVI
+powerbook-internal   \-\- Powerbooks with integrated DVI
 .br
-mini                 \-\- Mac Mini with external DVI
+powerbook-vga        \-\- Powerbooks with VGA rather than DVI
+.br
+powerbook-duallink   \-\- powerbook-external alias
+.br
+powerbook            \-\- powerbook-internal alias
+.br
+mini-external        \-\- Mac Mini with external DVI
 .br
 mini-internal        \-\- Mac Mini with integrated DVI
 .br
+mini                 \-\- mini-external alias
+.br
 The default value is
 .B undefined.
 .TP
diff --git a/src/radeon.h b/src/radeon.h
index 4180752..f9bf343 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -428,13 +428,19 @@ typedef enum {
        CHIP_ERRATA_PLL_DELAY           = 0x00000004
 } RADEONErrata;
 
+typedef enum {
+    RADEON_SIL_164  = 0x00000001,
+    RADEON_SIL_1178 = 0x00000002
+} RADEONExtTMDSChip;
+
 #if defined(__powerpc__)
 typedef enum {
-       RADEON_MAC_IBOOK             = 0x00000001,
-       RADEON_MAC_POWERBOOK_DL      = 0x00000002,
-       RADEON_MAC_POWERBOOK         = 0x00000004,
-       RADEON_MAC_MINI              = 0x00000008,
-       RADEON_MAC_MINI_INTERNAL     = 0x00000016
+       RADEON_MAC_IBOOK              = 0x00000001,
+       RADEON_MAC_POWERBOOK_EXTERNAL = 0x00000002,
+       RADEON_MAC_POWERBOOK_INTERNAL = 0x00000004,
+       RADEON_MAC_POWERBOOK_VGA      = 0x00000008,
+       RADEON_MAC_MINI_EXTERNAL      = 0x00000016,
+       RADEON_MAC_MINI_INTERNAL      = 0x00000032
 } RADEONMacModel;
 #endif
 
@@ -827,6 +833,7 @@ typedef struct {
 #if defined(__powerpc__)
     RADEONMacModel    MacModel;
 #endif
+    RADEONExtTMDSChip ext_tmds_chip;
 
     Rotation rotation;
     void (*PointerMoved)(int, int, int);
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 1645b5a..efe093f 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -218,22 +218,33 @@ RADEONRestoreDVOChip(ScrnInfoPtr pScrn, xf86OutputPtr output)
 	   (CARD32)~(RADEON_GPIO_A_0 | RADEON_GPIO_A_1));
 
     if (!RADEONInitExtTMDSInfoFromBIOS(output)) {
-	/* do mac stuff here */
-#if defined(__powerpc__)
 	if (radeon_output->DVOChip) {
-	    switch(info->MacModel) {
-	    case RADEON_MAC_POWERBOOK_DL:
+	    switch(info->ext_tmds_chip) {
+	    case RADEON_SIL_164:
 		RADEONDVOWriteByte(radeon_output->DVOChip, 0x08, 0x30);
 		RADEONDVOWriteByte(radeon_output->DVOChip, 0x09, 0x00);
 		RADEONDVOWriteByte(radeon_output->DVOChip, 0x0a, 0x90);
 		RADEONDVOWriteByte(radeon_output->DVOChip, 0x0c, 0x89);
 		RADEONDVOWriteByte(radeon_output->DVOChip, 0x08, 0x3b);
 		break;
+#if 0
+		/* needs work see bug 10418 */
+	    case RADEON_SIL_1178:
+		RADEONDVOWriteByte(radeon_output->DVOChip, 0x0f, 0x44);
+		RADEONDVOWriteByte(radeon_output->DVOChip, 0x0f, 0x4c);
+		RADEONDVOWriteByte(radeon_output->DVOChip, 0x0e, 0x01);
+		RADEONDVOWriteByte(radeon_output->DVOChip, 0x0a, 0x80);
+                RADEONDVOWriteByte(radeon_output->DVOChip, 0x09, 0x30);
+                RADEONDVOWriteByte(radeon_output->DVOChip, 0x0c, 0xc9);
+                RADEONDVOWriteByte(radeon_output->DVOChip, 0x0d, 0x70);
+                RADEONDVOWriteByte(radeon_output->DVOChip, 0x08, 0x32);
+                RADEONDVOWriteByte(radeon_output->DVOChip, 0x08, 0x33);
+		break;
+#endif
 	    default:
 		break;
 	    }
 	}
-#endif
     }
 }
 
@@ -2667,7 +2678,7 @@ static Bool RADEONSetupAppleConnectors(ScrnInfoPtr pScrn)
 	info->BiosConnector[2].DDCType = DDC_NONE_DETECTED;
 	info->BiosConnector[2].valid = TRUE;
 	return TRUE;
-    case RADEON_MAC_POWERBOOK_DL:
+    case RADEON_MAC_POWERBOOK_EXTERNAL:
 	info->BiosConnector[0].DDCType = DDC_DVI;
 	info->BiosConnector[0].DACType = DAC_NONE;
 	info->BiosConnector[0].TMDSType = TMDS_NONE;
@@ -2686,7 +2697,7 @@ static Bool RADEONSetupAppleConnectors(ScrnInfoPtr pScrn)
 	info->BiosConnector[2].DDCType = DDC_NONE_DETECTED;
 	info->BiosConnector[2].valid = TRUE;
 	return TRUE;
-    case RADEON_MAC_POWERBOOK:
+    case RADEON_MAC_POWERBOOK_INTERNAL:
 	info->BiosConnector[0].DDCType = DDC_DVI;
 	info->BiosConnector[0].DACType = DAC_NONE;
 	info->BiosConnector[0].TMDSType = TMDS_NONE;
@@ -2705,7 +2716,26 @@ static Bool RADEONSetupAppleConnectors(ScrnInfoPtr pScrn)
 	info->BiosConnector[2].DDCType = DDC_NONE_DETECTED;
 	info->BiosConnector[2].valid = TRUE;
 	return TRUE;
-    case RADEON_MAC_MINI:
+    case RADEON_MAC_POWERBOOK_VGA:
+	info->BiosConnector[0].DDCType = DDC_DVI;
+	info->BiosConnector[0].DACType = DAC_NONE;
+	info->BiosConnector[0].TMDSType = TMDS_NONE;
+	info->BiosConnector[0].ConnectorType = CONNECTOR_CRT;
+	info->BiosConnector[0].valid = TRUE;
+
+	info->BiosConnector[1].DDCType = DDC_VGA;
+	info->BiosConnector[1].DACType = DAC_PRIMARY;
+	info->BiosConnector[1].TMDSType = TMDS_INT;
+	info->BiosConnector[1].ConnectorType = CONNECTOR_DVI_I;
+	info->BiosConnector[1].valid = TRUE;
+
+	info->BiosConnector[2].ConnectorType = CONNECTOR_STV;
+	info->BiosConnector[2].DACType = DAC_TVDAC;
+	info->BiosConnector[2].TMDSType = TMDS_NONE;
+	info->BiosConnector[2].DDCType = DDC_NONE_DETECTED;
+	info->BiosConnector[2].valid = TRUE;
+	return TRUE;
+    case RADEON_MAC_MINI_EXTERNAL:
 	info->BiosConnector[0].DDCType = DDC_CRT2;
 	info->BiosConnector[0].DACType = DAC_TVDAC;
 	info->BiosConnector[0].TMDSType = TMDS_EXT;
@@ -2815,11 +2845,19 @@ static void RADEONSetupGenericConnectors(ScrnInfoPtr pScrn)
 	    info->BiosConnector[0].ConnectorType = CONNECTOR_DVI_I;
 	    info->BiosConnector[0].valid = TRUE;
 
+#if defined(__powerpc__)
 	    info->BiosConnector[1].DDCType = DDC_VGA;
 	    info->BiosConnector[1].DACType = DAC_PRIMARY;
 	    info->BiosConnector[1].TMDSType = TMDS_EXT;
+	    info->BiosConnector[1].ConnectorType = CONNECTOR_DVI_I;
+	    info->BiosConnector[1].valid = TRUE;
+#else
+	    info->BiosConnector[1].DDCType = DDC_VGA;
+	    info->BiosConnector[1].DACType = DAC_PRIMARY;
+	    info->BiosConnector[1].TMDSType = TMDS_NONE;
 	    info->BiosConnector[1].ConnectorType = CONNECTOR_CRT;
 	    info->BiosConnector[1].valid = TRUE;
+#endif
 	}
     }
 
@@ -2848,6 +2886,7 @@ static void RADEONSetupGenericConnectors(ScrnInfoPtr pScrn)
  * in /proc/cpuinfo (on Linux) */
 static RADEONMacModel RADEONDetectMacModel(ScrnInfoPtr pScrn)
 {
+    RADEONInfoPtr info = RADEONPTR(pScrn);
     RADEONMacModel ret = 0;
 #ifdef __linux__
     char cpuline[50];  /* 50 should be sufficient for our purposes */
@@ -2858,23 +2897,52 @@ static RADEONMacModel RADEONDetectMacModel(ScrnInfoPtr pScrn)
      * Unforunately, there doesn't seem to be any good way to figure it out.
      */
 
+    /* 
+     * PowerBook5,[1-5]: external tmds, single-link
+     * PowerBook5,[789]: external tmds, dual-link
+     * PowerBook5,6:     external tmds, single-link or dual-link
+     * need to add another option to specify the external tmds chip
+     * or find out what's used and add it.
+     */
+
+
     if (f != NULL) {
 	while (fgets(cpuline, sizeof cpuline, f)) {
 	    if (!strncmp(cpuline, "machine", strlen ("machine"))) {
-		if (strstr(cpuline, "PowerBook5,6") ||
-		    strstr(cpuline, "PowerBook5,7") ||
+		if (strstr(cpuline, "PowerBook5,1") ||
+		    strstr(cpuline, "PowerBook5,2") ||
+		    strstr(cpuline, "PowerBook5,3") ||
+		    strstr(cpuline, "PowerBook5,4") ||
+		    strstr(cpuline, "PowerBook5,5")) {
+		    ret = RADEON_MAC_POWERBOOK_EXTERNAL; /* single link */
+		    info->ext_tmds_chip = RADEON_SIL_164; /* works on 5,2 */
+		    break;
+		}
+
+		if (strstr(cpuline, "PowerBook5,6")) {
+		    ret = RADEON_MAC_POWERBOOK_EXTERNAL; /* dual or single link */
+		    break;
+		}
+
+		if (strstr(cpuline, "PowerBook5,7") ||
 		    strstr(cpuline, "PowerBook5,8") ||
 		    strstr(cpuline, "PowerBook5,9")) {
-		    ret = RADEON_MAC_POWERBOOK_DL;
+		    ret = RADEON_MAC_POWERBOOK_EXTERNAL; /* dual link */
+		    info->ext_tmds_chip = RADEON_SIL_1178; /* guess */
+		    break;
+		}
+
+		if (strstr(cpuline, "PowerBook3,3")) {
+		    ret = RADEON_MAC_POWERBOOK_VGA; /* vga rather than dvi */
 		    break;
 		}
 
 		if (strstr(cpuline, "PowerMac10,1")) {
-		    ret = RADEON_MAC_MINI_INTERNAL;
+		    ret = RADEON_MAC_MINI_INTERNAL; /* internal tmds */
 		    break;
 		}
 		if (strstr(cpuline, "PowerMac10,2")) {
-		    ret = RADEON_MAC_MINI;
+		    ret = RADEON_MAC_MINI_EXTERNAL; /* external tmds */
 		    break;
 		}
 	    } else if (!strncmp(cpuline, "detected as", strlen("detected as"))) {
@@ -2882,7 +2950,7 @@ static RADEONMacModel RADEONDetectMacModel(ScrnInfoPtr pScrn)
                     ret = RADEON_MAC_IBOOK;
 		    break;
 		} else if (strstr(cpuline, "PowerBook")) {
-		    ret = RADEON_MAC_POWERBOOK_DL;
+		    ret = RADEON_MAC_POWERBOOK_INTERNAL; /* internal tmds */
 		    break;
                 }
 
@@ -2901,10 +2969,12 @@ static RADEONMacModel RADEONDetectMacModel(ScrnInfoPtr pScrn)
 
     if (ret) {
 	xf86DrvMsg(pScrn->scrnIndex, X_DEFAULT, "Detected %s.\n",
-		   ret == RADEON_MAC_POWERBOOK_DL ? "PowerBook with external DVI" :
-		   ret == RADEON_MAC_POWERBOOK ? "PowerBook with integrated DVI" :
+		   ret == RADEON_MAC_POWERBOOK_EXTERNAL ? "PowerBook with external DVI" :
+		   ret == RADEON_MAC_POWERBOOK_INTERNAL ? "PowerBook with integrated DVI" :
+		   ret == RADEON_MAC_POWERBOOK_VGA ? "PowerBook with VGA" :
 		   ret == RADEON_MAC_IBOOK ? "iBook" :
-		   "Mac Mini");
+		   ret == RADEON_MAC_MINI_EXTERNAL ? "Mac Mini with external DVI" :
+		   "Mac Mini with integrated DVI");
 	xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 		   "If this is not correct, try Option \"MacModel\" and "
 		   "consider reporting to the\n");
@@ -2951,14 +3021,22 @@ Bool RADEONSetupConnectors(ScrnInfoPtr pScrn)
     if (optstr) {
 	if (!strncmp("ibook", optstr, strlen("ibook")))
 	    info->MacModel = RADEON_MAC_IBOOK;
-	else if (!strncmp("powerbook-duallink", optstr, strlen("powerbook-duallink")))
-	    info->MacModel = RADEON_MAC_POWERBOOK_DL;
-	else if (!strncmp("powerbook", optstr, strlen("powerbook")))
-	    info->MacModel = RADEON_MAC_POWERBOOK;
+	else if (!strncmp("powerbook-duallink", optstr, strlen("powerbook-duallink"))) /* alias */
+	    info->MacModel = RADEON_MAC_POWERBOOK_EXTERNAL;
+	else if (!strncmp("powerbook-external", optstr, strlen("powerbook-external")))
+	    info->MacModel = RADEON_MAC_POWERBOOK_EXTERNAL;
+	else if (!strncmp("powerbook-internal", optstr, strlen("powerbook-internal")))
+	    info->MacModel = RADEON_MAC_POWERBOOK_INTERNAL;
+	else if (!strncmp("powerbook-vga", optstr, strlen("powerbook-vga")))
+	    info->MacModel = RADEON_MAC_POWERBOOK_VGA;
+	else if (!strncmp("powerbook", optstr, strlen("powerbook"))) /* alias */
+	    info->MacModel = RADEON_MAC_POWERBOOK_INTERNAL;
 	else if (!strncmp("mini-internal", optstr, strlen("mini-internal")))
 	    info->MacModel = RADEON_MAC_MINI_INTERNAL;
-	else if (!strncmp("mini", optstr, strlen("mini")))
-	    info->MacModel = RADEON_MAC_MINI;
+	else if (!strncmp("mini-external", optstr, strlen("mini-external")))
+	    info->MacModel = RADEON_MAC_MINI_EXTERNAL;
+	else if (!strncmp("mini", optstr, strlen("mini"))) /* alias */
+	    info->MacModel = RADEON_MAC_MINI_EXTERNAL;
 	else {
 	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Invalid Mac Model: %s\n", optstr);
 	}

commit 9840a0fd4fc8c980533fcd4a02c55cd0d5634b6d
Author: Alex Deucher <alex@botch2.(none)>
Date:   Thu Nov 29 13:27:37 2007 -0500

    RADEON: add MacModel "mini-internal" for minis with internal TMDS
    
    Some macs (minis and powerbooks) use internal tmds, others use external tmds
    and not just for dual-link TMDS, it shows up with single-link as well.
    Unforunately, there doesn't seem to be any good way to figure it out.

diff --git a/man/radeon.man b/man/radeon.man
index f302ade..8f7b551 100644
--- a/man/radeon.man
+++ b/man/radeon.man
@@ -414,8 +414,10 @@ The default is
 .TP
 .BI "Option \*qMacModel\*q \*q" string \*q
 .br
-Used to specify Mac models for connector tables and quirks.  Only valid
- on PowerPC.
+Used to specify Mac models for connector tables and quirks.  If you have
+a powerbook or mini with DVI that does not work properly, try the alternate
+ options as Apple does not seem to provide a good way of knowing whether
+ they use internal or external TMDS for DVI.  Only valid on PowerPC.
 .br
 ibook                \-\- ibooks
 .br
@@ -423,7 +425,9 @@ powerbook-duallink   \-\- Powerbooks with external DVI
 .br
 powerbook            \-\- Powerbooks with integrated DVI
 .br
-mini                 \-\- Mac Mini
+mini                 \-\- Mac Mini with external DVI
+.br
+mini-internal        \-\- Mac Mini with integrated DVI
 .br
 The default value is
 .B undefined.
diff --git a/src/radeon.h b/src/radeon.h
index 5b91d00..4180752 100644
--- a/src/radeon.h



Reply to: