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

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



 configure.ac             |   22 
 man/ati.man              |    4 
 man/radeon.man           |   16 
 src/Makefile.am          |   33 
 src/ati.c                |  632 ++++++++++++++
 src/ati.h                |   72 +
 src/atiaccel.c           |  120 --
 src/atiaccel.h           |   35 
 src/atiadapter.c         |   57 -
 src/atiadapter.h         |   59 -
 src/atiadjust.c          |  101 --
 src/atibank.c            |  304 ------
 src/atibank.h            |   44 
 src/atibus.c             |   80 -
 src/atibus.h             |    9 
 src/atichip.c            |  592 -------------
 src/atichip.h            |   98 --
 src/aticlock.c           | 1196 --------------------------
 src/aticlock.h           |   21 
 src/aticonfig.c          |  277 ++++--
 src/aticonfig.h          |   32 
 src/aticonsole.c         |   58 -
 src/aticursor.c          |   78 -
 src/aticursor.h          |    2 
 src/atidac.c             |  147 ---
 src/atidga.c             |   17 
 src/atidri.c             |    4 
 src/atidsp.c             |   29 
 src/atifillin.c          |   48 -
 src/atifillin.h          |   42 
 src/atii2c.c             |    9 
 src/atiident.c           |  137 ---
 src/atiident.h           |   52 -
 src/atiio.h              |   82 -
 src/atiload.c            |   29 
 src/atiload.h            |    6 
 src/atilock.c            |   82 -
 src/atimach64.c          |  134 +--
 src/atimach64accel.c     |   36 
 src/atimach64accel.h     |    2 
 src/atimach64cursor.c    |   44 
 src/atimach64cursor.h    |   30 
 src/atimach64exa.c       |    9 
 src/atimach64io.h        |   17 
 src/atimach64probe.c     |  198 ++++
 src/atimach64probe.h     |   34 
 src/atimach64render.c    |    9 
 src/atimach64xv.c        |  277 ++++--
 src/atimach64xv.h        |   36 
 src/atimisc.c            |    7 
 src/atimode.c            |  252 -----
 src/atimodule.c          |   39 
 src/atimono.h            |   42 
 src/atioption.c          |  266 -----
 src/atioption.h          |   13 
 src/atipreinit.c         | 1299 +++--------------------------
 src/atiprint.c           |   68 -
 src/atiprobe.c           | 2088 ++---------------------------------------------
 src/atiprobe.h           |    2 
 src/atiscreen.c          |   70 -
 src/atistruct.h          |   40 
 src/ativalid.c           |   79 -
 src/ativga.c             |  361 --------
 src/ativga.h             |    2 
 src/ativgaio.h           |    4 
 src/atividmem.c          |   65 -
 src/atiwonder.c          |  149 ---
 src/atiwonder.h          |    1 
 src/atiwonderio.c        |   23 
 src/atixv.c              |  168 ---
 src/r128_dri.c           |    4 
 src/r128_driver.c        |   36 
 src/r128_probe.c         |   33 
 src/r128_probe.h         |    2 
 src/radeon.h             |   70 +
 src/radeon_accel.c       |   38 
 src/radeon_accelfuncs.c  |   10 
 src/radeon_bios.c        |   26 
 src/radeon_common.h      |    8 
 src/radeon_commonfuncs.c |   14 
 src/radeon_cursor.c      |   64 -
 src/radeon_display.c     |  666 ++++++--------
 src/radeon_dri.c         |  149 ++-
 src/radeon_dri.h         |    2 
 src/radeon_driver.c      |  731 +++++++++-------
 src/radeon_exa.c         |   19 
 src/radeon_exa_funcs.c   |   23 
 src/radeon_mergedfb.c    |   55 -
 src/radeon_mm_i2c.c      |   84 -
 src/radeon_modes.c       |  106 +-
 src/radeon_probe.c       |   33 
 src/radeon_probe.h       |    8 
 src/radeon_reg.h         |   23 
 src/radeon_video.c       |   46 -
 94 files changed, 3099 insertions(+), 9641 deletions(-)

New commits:
commit 84a37d0ed01a2eee80ee30b79ddfd7906decaff1
Author: Michel Dänzer <michel@tungstengraphics.com>
Date:   Fri Aug 24 09:39:58 2007 +0200

    Revert "radeon: Round down RMX stretch ratios."
    
    This reverts commit 6b736a5c25d968bb09e229e0fbb82162e8447783.
    
    See https://bugs.freedesktop.org/show_bug.cgi?id=8983#c6 and
    https://bugzilla.novell.com/show_bug.cgi?id=220724 .

diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 418b39d..2288126 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -5796,23 +5796,21 @@ static void RADEONInitRMXRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save,
     if (Hratio == 1.0 || !(mode->Flags & RADEON_USE_RMX)) {
 	save->fp_horz_stretch |= ((xres/8-1)<<16);
     } else {
-	save->fp_horz_stretch |= ((((unsigned long)
-				    (Hratio * RADEON_HORZ_STRETCH_RATIO_MAX)) &
-				   RADEON_HORZ_STRETCH_RATIO_MASK) |
-				  RADEON_HORZ_STRETCH_BLEND |
-				  RADEON_HORZ_STRETCH_ENABLE |
-				  ((info->PanelXRes/8-1)<<16));
+	save->fp_horz_stretch |= ((((unsigned long)(Hratio * RADEON_HORZ_STRETCH_RATIO_MAX +
+				     0.5)) & RADEON_HORZ_STRETCH_RATIO_MASK) |
+				    RADEON_HORZ_STRETCH_BLEND |
+				    RADEON_HORZ_STRETCH_ENABLE |
+				    ((info->PanelXRes/8-1)<<16));
     }
 
     if (Vratio == 1.0 || !(mode->Flags & RADEON_USE_RMX)) {
 	save->fp_vert_stretch |= ((yres-1)<<12);
     } else {
-	save->fp_vert_stretch |= ((((unsigned long)
-				    (Vratio * RADEON_VERT_STRETCH_RATIO_MAX)) &
-				   RADEON_VERT_STRETCH_RATIO_MASK) |
-				  RADEON_VERT_STRETCH_ENABLE |
-				  RADEON_VERT_STRETCH_BLEND |
-				  ((info->PanelYRes-1)<<12));
+	save->fp_vert_stretch |= ((((unsigned long)(Vratio * RADEON_VERT_STRETCH_RATIO_MAX +
+						0.5)) & RADEON_VERT_STRETCH_RATIO_MASK) |
+				      RADEON_VERT_STRETCH_ENABLE |
+				      RADEON_VERT_STRETCH_BLEND |
+				      ((info->PanelYRes-1)<<12));
     }
 
 }

commit d0f900c857585804fedd501bcf0a603fead271ce
Author: Alon Ziv <alonz@nolaviz.org>
Date:   Mon Jul 30 22:47:59 2007 +0300

    radeon: Sane handling of timeouts in WaitForVerticalSync(2).
    
    RADEONWaitForVerticalSync() and RADEONWaitForVerticalSync2() need to wait
    for a timeout specified in milliseconds; looping around usleep() causes
    the timeout to be unnecessarily long, as the OS may sleep longer than
    requested (on Linux the minimum actual sleep value may be several ms).
    
    The new logic uses gettimeofday() in the loop to see when the (absolute)
    timeout has arrived.
    
    Signed-off-by: Alon Ziv <alonz@nolaviz.org>

diff --git a/src/radeon.h b/src/radeon.h
index b19b017..9e70ab5 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -39,6 +39,8 @@
 
 #include <stdlib.h>		/* For abs() */
 #include <unistd.h>		/* For usleep() */
+#include <sys/time.h>		/* For
+#include <time.h>		 * gettimeofday() */
 
 #include "xf86str.h"
 #include "compiler.h"
@@ -189,6 +191,8 @@ typedef struct _region {
 #define RADEON_IDLE_RETRY      16 /* Fall out of idle loops after this count */
 #define RADEON_TIMEOUT    2000000 /* Fall out of wait loops after this count */
 
+#define RADEON_VSYNC_TIMEOUT	20000 /* Maximum wait for VSYNC (in usecs) */
+
 /* Buffer are aligned on 4096 byte boundaries */
 #define RADEON_BUFFER_ALIGN 0x00000fff
 #define RADEON_VBIOS_SIZE 0x00010000
@@ -1175,4 +1179,21 @@ static __inline__ void RADEON_SYNC(RADEONInfoPtr info, ScrnInfoPtr pScrn)
 #endif
 }
 
+static __inline__ void radeon_init_timeout(struct timeval *endtime,
+    unsigned int timeout)
+{
+    gettimeofday(endtime, NULL);
+    endtime->tv_usec += timeout;
+    endtime->tv_sec += endtime->tv_usec / 1000000;
+    endtime->tv_usec %= 1000000;
+}
+
+static __inline__ int radeon_timedout(const struct timeval *endtime)
+{
+    struct timeval now;
+    gettimeofday(&now, NULL);
+    return now.tv_sec == endtime->tv_sec ?
+        now.tv_usec > endtime->tv_usec : now.tv_sec > endtime->tv_sec;
+}
+
 #endif /* _RADEON_H_ */
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 894131f..418b39d 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -759,7 +759,7 @@ void RADEONWaitForVerticalSync(ScrnInfoPtr pScrn)
     RADEONInfoPtr  info       = RADEONPTR(pScrn);
     unsigned char *RADEONMMIO = info->MMIO;
     CARD32         crtc_gen_cntl;
-    int            i;
+    struct timeval timeout;
 
     crtc_gen_cntl = INREG(RADEON_CRTC_GEN_CNTL);
     if ((crtc_gen_cntl & RADEON_CRTC_DISP_REQ_EN_B) ||
@@ -770,10 +770,10 @@ void RADEONWaitForVerticalSync(ScrnInfoPtr pScrn)
     OUTREG(RADEON_CRTC_STATUS, RADEON_CRTC_VBLANK_SAVE_CLEAR);
 
     /* Wait for it to go back up */
-    for (i = 0; i < RADEON_TIMEOUT/1000; i++) {
-	if (INREG(RADEON_CRTC_STATUS) & RADEON_CRTC_VBLANK_SAVE) break;
-	usleep(1);
-    }
+    radeon_init_timeout(&timeout, RADEON_VSYNC_TIMEOUT);
+    while (!(INREG(RADEON_CRTC_STATUS) & RADEON_CRTC_VBLANK_SAVE) &&
+        !radeon_timedout(&timeout))
+	usleep(100);
 }
 
 /* Wait for vertical sync on secondary CRTC */
@@ -782,7 +782,7 @@ void RADEONWaitForVerticalSync2(ScrnInfoPtr pScrn)
     RADEONInfoPtr  info       = RADEONPTR(pScrn);
     unsigned char *RADEONMMIO = info->MMIO;
     CARD32         crtc2_gen_cntl;
-    int            i;
+    struct timeval timeout;
  
     crtc2_gen_cntl = INREG(RADEON_CRTC2_GEN_CNTL);
     if ((crtc2_gen_cntl & RADEON_CRTC2_DISP_REQ_EN_B) ||
@@ -793,10 +793,10 @@ void RADEONWaitForVerticalSync2(ScrnInfoPtr pScrn)
     OUTREG(RADEON_CRTC2_STATUS, RADEON_CRTC2_VBLANK_SAVE_CLEAR);
 
     /* Wait for it to go back up */
-    for (i = 0; i < RADEON_TIMEOUT/1000; i++) {
-	if (INREG(RADEON_CRTC2_STATUS) & RADEON_CRTC2_VBLANK_SAVE) break;
-	usleep(1);
-    }
+    radeon_init_timeout(&timeout, RADEON_VSYNC_TIMEOUT);
+    while (!(INREG(RADEON_CRTC2_STATUS) & RADEON_CRTC2_VBLANK_SAVE) &&
+        !radeon_timedout(&timeout))
+	usleep(100);
 }
 
 

commit 732880bfaab2224fd6d38086237e17de843def7d
Author: Michel Dänzer <michel@tungstengraphics.com>
Date:   Wed Aug 22 15:32:23 2007 +0200

    radeon: Remove declarations of unused variables.

diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 8d868f5..894131f 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -1994,7 +1994,7 @@ static Bool RADEONPreInitModes(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
     int            modesFound;
     RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
     char           *s;
-    RADEONConnector *connector;
+
     /* This option has two purposes:
      *
      * 1. For CRT, if this option is on, xf86ValidateModes (to
@@ -5135,7 +5135,6 @@ static void RADEONRestoreMode(ScrnInfoPtr pScrn, RADEONSavePtr restore)
     RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
     RADEONController* pCRTC1 = pRADEONEnt->Controller[0];
     RADEONController* pCRTC2 = pRADEONEnt->Controller[1];
-    RADEONConnector *pPort;
 
     xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
 		   "RADEONRestoreMode(%p)\n", restore);

commit 6b736a5c25d968bb09e229e0fbb82162e8447783
Author: Sascha Sommer <saschasommer@freenet.de>
Date:   Wed Aug 22 15:28:58 2007 +0200

    radeon: Round down RMX stretch ratios.
    
    Fixes issues with RMX scaling, see
    https://bugs.freedesktop.org/show_bug.cgi?id=8983 .

diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 466fd46..8d868f5 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -5797,21 +5797,23 @@ static void RADEONInitRMXRegisters(ScrnInfoPtr pScrn, RADEONSavePtr save,
     if (Hratio == 1.0 || !(mode->Flags & RADEON_USE_RMX)) {
 	save->fp_horz_stretch |= ((xres/8-1)<<16);
     } else {
-	save->fp_horz_stretch |= ((((unsigned long)(Hratio * RADEON_HORZ_STRETCH_RATIO_MAX +
-				     0.5)) & RADEON_HORZ_STRETCH_RATIO_MASK) |
-				    RADEON_HORZ_STRETCH_BLEND |
-				    RADEON_HORZ_STRETCH_ENABLE |
-				    ((info->PanelXRes/8-1)<<16));
+	save->fp_horz_stretch |= ((((unsigned long)
+				    (Hratio * RADEON_HORZ_STRETCH_RATIO_MAX)) &
+				   RADEON_HORZ_STRETCH_RATIO_MASK) |
+				  RADEON_HORZ_STRETCH_BLEND |
+				  RADEON_HORZ_STRETCH_ENABLE |
+				  ((info->PanelXRes/8-1)<<16));
     }
 
     if (Vratio == 1.0 || !(mode->Flags & RADEON_USE_RMX)) {
 	save->fp_vert_stretch |= ((yres-1)<<12);
     } else {
-	save->fp_vert_stretch |= ((((unsigned long)(Vratio * RADEON_VERT_STRETCH_RATIO_MAX +
-						0.5)) & RADEON_VERT_STRETCH_RATIO_MASK) |
-				      RADEON_VERT_STRETCH_ENABLE |
-				      RADEON_VERT_STRETCH_BLEND |
-				      ((info->PanelYRes-1)<<12));
+	save->fp_vert_stretch |= ((((unsigned long)
+				    (Vratio * RADEON_VERT_STRETCH_RATIO_MAX)) &
+				   RADEON_VERT_STRETCH_RATIO_MASK) |
+				  RADEON_VERT_STRETCH_ENABLE |
+				  RADEON_VERT_STRETCH_BLEND |
+				  ((info->PanelYRes-1)<<12));
     }
 
 }

commit 26aacfd90e2502c6e2a6c10761b4b2da7971b2bc
Author: Henry Zhao <henry.zhao@sun.com>
Date:   Thu Aug 23 19:10:03 2007 +1000

    radeon: bug 11725: fix mergedfb transient vertical bar

diff --git a/src/radeon_mergedfb.c b/src/radeon_mergedfb.c
index abbc160..c786aac 100644
--- a/src/radeon_mergedfb.c
+++ b/src/radeon_mergedfb.c
@@ -2019,7 +2019,7 @@ RADEONSetCursorPositionMerged(ScrnInfoPtr pScrn, int x, int y)
     DisplayModePtr mode1 = CDMPTR->CRT1;
     DisplayModePtr mode2 = CDMPTR->CRT2;
     int            x1, y1, x2, y2;
-    int                total_y1    = pScrn->frameY1 - pScrn->frameY0;
+    int                total_y1    = info->CRT1frameY1 - info->CRT1frameY0;
     int                total_y2    = pScrn2->frameY1 - pScrn2->frameY0;
 
     if (x < 0)                        xorigin = -x+1;

commit 3334c247540b113f9c4a5ce1879d8648a45a959a
Author: Dave Airlie <airlied@linux.ie>
Date:   Thu Aug 23 18:46:41 2007 +1000

    radeon: bug 11899 + debian 435040 - test for usefbdev before calling int10

diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 74323c9..466fd46 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -6871,7 +6871,7 @@ Bool RADEONEnterVT(int scrnIndex, int flags)
     xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
 		   "RADEONEnterVT\n");
 
-    if (INREG(RADEON_CONFIG_MEMSIZE) == 0) { /* Softboot V_BIOS */
+    if (!info->FBDev && (INREG(RADEON_CONFIG_MEMSIZE) == 0)) { /* Softboot V_BIOS */
        xf86Int10InfoPtr pInt;
        xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
                   "zero MEMSIZE, probably at D3cold. Re-POSTing via int10.\n");

commit 8e3a6f83016cd8c4cfd43ceee4cbf0a8dc018b2a
Author: Roland Bär <roland@verifysoft.de>
Date:   Thu Aug 23 18:37:35 2007 +1000

    radeon: bug 11861 - dead code removal in radeon_video.c

diff --git a/src/radeon_video.c b/src/radeon_video.c
index 2f8bec5..4d59306 100644
--- a/src/radeon_video.c
+++ b/src/radeon_video.c
@@ -3376,7 +3376,8 @@ RADEONPutVideo(
    id = FOURCC_YUY2;
    
    top = ya>>16;
-
+#if 0
+   /* setting the ID above makes this useful - needs revisiting */
    switch(id) {
    case FOURCC_YV12:
    case FOURCC_I420:
@@ -3394,6 +3395,10 @@ RADEONPutVideo(
         srcPitch = (width<<1);
         break;
    }
+#else
+   dstPitch = ((width<<1) + 15) & ~15;
+   srcPitch = (width<<1);
+#endif
 
    new_size = dstPitch * height;
    new_size = new_size + 0x1f; /* for aligning */

commit 05c90280e2e17348ceacf760451c9c9e45fd70e5
Author: Roland Bär <roland@verifysoft.de>
Date:   Thu Aug 23 18:33:34 2007 +1000

    radeon: bug 11860 fix some mem leaks

diff --git a/src/radeon_modes.c b/src/radeon_modes.c
index e1635e0..3315eec 100644
--- a/src/radeon_modes.c
+++ b/src/radeon_modes.c
@@ -777,8 +777,10 @@ int RADEONValidateMergeModes(ScrnInfoPtr pScrn1)
 		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 			   "No valid mode found for this DFP/LCD\n");
 	    }
+            xfree(clockRanges);
 	    return 0;
 	}
     }
+    xfree(clockRanges);
     return modesFound;
 }
diff --git a/src/radeon_probe.c b/src/radeon_probe.c
index d7ff643..c697f65 100644
--- a/src/radeon_probe.c
+++ b/src/radeon_probe.c
@@ -303,6 +303,7 @@ RADEONProbe(DriverPtr drv, int flags)
 		foundScreen          = TRUE;
 	    }
 
+            xfree(pEnt);
 	    pEnt = xf86GetEntityInfo(usedChips[i]);
 
             /* create a RADEONEntity for all chips, even with

commit a0d0fcd3bab765b4db25e04884fd8a342abb9c66
Author: iLisa Wu <liswu@ati.com>
Date:   Mon Aug 20 15:44:07 2007 +0200

    Fix crash with no valid mode in xorg.conf's modelist and empty Virtual
    
    If the resolution defined in xorg.conf failed to find a matching mode in the
    supported modelist, and no virtual desktop dimensions are defined the xorg.conf
    either, virtual X and Y dimension will be set to 0 which will cause Xserver
    crash.
    
    (Novell bugzilla #296856, closed)

diff --git a/src/radeon_modes.c b/src/radeon_modes.c
index 1a63971..e1635e0 100644
--- a/src/radeon_modes.c
+++ b/src/radeon_modes.c
@@ -299,6 +299,8 @@ int RADEONValidateDDCModes(ScrnInfoPtr pScrn1, char **ppModeName,
     DisplayModePtr  first      = NULL;
     DisplayModePtr  ddcModes   = NULL;
     int             count      = 0;
+    int             maxXRes    = 0;
+    int             maxYRes    = 0;
     int             i, width, height;
     ScrnInfoPtr pScrn = pScrn1;
 
@@ -334,13 +336,13 @@ int RADEONValidateDDCModes(ScrnInfoPtr pScrn1, char **ppModeName,
 		p->Flags     |= RADEON_USE_RMX;
 	    }
 
-	    maxVirtX = MAX(maxVirtX, p->HDisplay);
-	    maxVirtY = MAX(maxVirtY, p->VDisplay);
+	    maxXRes = maxVirtX = MAX(maxVirtX, p->HDisplay);
+	    maxYRes = maxVirtY = MAX(maxVirtY, p->VDisplay);
 	    count++;
 
 	    last = p;
 	}
-
+    
 	/* Match up modes that are specified in the XF86Config file */
 	if (ppModeName[0]) {
 	    DisplayModePtr  next;
@@ -378,9 +380,21 @@ int RADEONValidateDDCModes(ScrnInfoPtr pScrn1, char **ppModeName,
 			    break;
 			}
 		    }
+		    if (!p) {
+			xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+				   " %dx%d is not supported by the device\n",
+				   width, height);
+		    }
 		}
 	    }
-
+	    /* just for sanity check, if maxVirtX and maxVirtY are not
+	     * specified, set max resolution that panel support for the max
+	     * virtual dimensions */
+	    if ((!maxVirtX) || (!maxVirtY)) {
+		maxVirtX = maxXRes;
+		maxVirtY = maxYRes;
+	    }
+	    
 	    /*
 	     * Add remaining DDC modes if they're smaller than the user
 	     * specified modes

commit d0895f67e327bb268fd59fcfd8fc22678d804f57
Author: Luc Verhaegen <libv@skynet.be>
Date:   Thu Aug 9 12:11:40 2007 +0200

    AGPFastWrite risk reduction.
    
    Actively warn the user in the log about the effects of AGPFastWrite and
    sanitise AGPFastWrite handling while we're here.

diff --git a/src/radeon.h b/src/radeon.h
index 5f3f4ab..b19b017 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -611,7 +611,6 @@ typedef struct {
     unsigned long     gartOffset;
     unsigned char     *AGP;             /* Map */
     int               agpMode;
-    int               agpFastWrite;
 
     CARD32            pciCommand;
 
diff --git a/src/radeon_dri.c b/src/radeon_dri.c
index 11f7140..315b204 100644
--- a/src/radeon_dri.c
+++ b/src/radeon_dri.c
@@ -748,28 +748,6 @@ static Bool RADEONSetAgpMode(RADEONInfoPtr info, ScreenPtr pScreen)
 
     xf86DrvMsg(pScreen->myNum, from, "Using AGP %dx\n", info->agpMode);
 
-    info->agpFastWrite = 0; // Always off by default as it sucks
-
-    from = xf86GetOptValInteger(info->Options, OPTION_AGP_FW,
-				&info->agpFastWrite) ? X_CONFIG : X_DEFAULT;
-
-    if (info->agpFastWrite &&
-	(vendor == PCI_VENDOR_AMD) &&
-	(device == PCI_CHIP_AMD761)) {
-
-	/* Disable fast write for AMD 761 chipset, since they cause
-	 * lockups when enabled.
-	 */
-	info->agpFastWrite = FALSE;
-	from = X_DEFAULT;
-	xf86DrvMsg(pScreen->myNum, X_WARNING,
-		   "[agp] Not enabling Fast Writes on AMD 761 chipset to avoid "
-		   "lockups");
-    }
-
-    xf86DrvMsg(pScreen->myNum, from, "AGP Fast Writes %sabled\n",
-	       info->agpFastWrite ? "en" : "dis");
-
     mode &= ~RADEON_AGP_MODE_MASK;
     if (is_v3) {
 	/* only set one mode bit for AGPv3 */
@@ -788,8 +766,26 @@ static Bool RADEONSetAgpMode(RADEONInfoPtr info, ScreenPtr pScreen)
 	}
     }
 
-    if (info->agpFastWrite) mode |= RADEON_AGP_FW_MODE;
-    else mode &= ~RADEON_AGP_FW_MODE;
+    /* AGP Fast Writes.
+     * TODO: take into account that certain agp modes don't support fast
+     * writes at all */
+    mode &= ~RADEON_AGP_FW_MODE; /* Disable per default */
+    if (xf86ReturnOptValBool(info->Options, OPTION_AGP_FW, FALSE)) {
+	xf86DrvMsg(pScreen->myNum, X_WARNING,
+		   "WARNING: Using the AGPFastWrite option is not recommended.\n");
+	xf86Msg(X_NONE, "\tThis option does not provide much of a noticable speed"
+		" boost, while it\n\twill probably hard lock your machine."
+		" All bets are off!\n");
+
+	/* Black list some host/AGP bridges. */
+	if ((vendor == PCI_VENDOR_AMD) && (device == PCI_CHIP_AMD761))
+	    xf86DrvMsg(pScreen->myNum, X_PROBED, "Ignoring AGPFastWrite option "
+		       "for the AMD 761 northbridge.\n");
+	else {
+	    xf86DrvMsg(pScreen->myNum, X_CONFIG, "Enabling AGP Fast Writes.\n");
+	    mode |= RADEON_AGP_FW_MODE;
+	}
+    } /* Don't mention this otherwise, so that people don't get funny ideas */
 
     xf86DrvMsg(pScreen->myNum, X_INFO,
 	       "[agp] Mode 0x%08lx [AGP 0x%04x/0x%04x; Card 0x%04x/0x%04x]\n",

commit 1de52d91ff3a04b9b587b858e1e5be40d3a7fd0a
Author: Dave Airlie <airlied@linux.ie>
Date:   Sat Aug 4 17:58:58 2007 +1000

    update configure.ac for 6.6.193 release

diff --git a/configure.ac b/configure.ac
index f444afb..441e723 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-ati],
-        6.6.192,
+        6.6.193,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-ati)
 

commit 371001c0433db1d17e468f3ea99ea57f922145a3
Author: Dave Airlie <airlied@linux.ie>
Date:   Sat Aug 4 17:51:19 2007 +1000

    radeon: remove unused variables

diff --git a/src/radeon_display.c b/src/radeon_display.c
index 95e669d..02f5960 100644
--- a/src/radeon_display.c
+++ b/src/radeon_display.c
@@ -2071,7 +2071,6 @@ RADEONCRTC2Blank(RADEONInfoPtr info, Bool Blank)
 void RADEONBlank(ScrnInfoPtr pScrn, Bool Blank)
 {
     RADEONInfoPtr  info       = RADEONPTR(pScrn);
-    unsigned char *RADEONMMIO = info->MMIO;
     RADEONEntPtr pRADEONEnt   = RADEONEntPriv(pScrn);
 
     if (!pRADEONEnt->HasSecondary ||
@@ -2223,7 +2222,6 @@ RADEONDisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode, int
 {
     RADEONInfoPtr  info       = RADEONPTR(pScrn);
     RADEONEntPtr pRADEONEnt   = RADEONEntPriv(pScrn);
-    RADEONConnector *pPort;
 
     if (!pScrn->vtSema)
 	return;

commit 90946c53d7a4b23d03270ad6da0450759a11de3d
Author: Dave Airlie <airlied@linux.ie>
Date:   Sat Aug 4 17:51:06 2007 +1000

    ati: add -Wall for gcc
    
    As per luc's "suggestion" in Novell bug.
    
    This may generate warnings on 64-bit until we get rid of CARD32

diff --git a/configure.ac b/configure.ac
index 8b29d8d..f444afb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -39,6 +39,10 @@ AC_DISABLE_STATIC
 AC_PROG_LIBTOOL
 AC_PROG_CC
 
+if test "x$GCC" = "xyes"; then
+	CFLAGS="$CFLAGS -Wall"
+fi
+
 AH_TOP([#include "xorg-server.h"])
 
 AC_ARG_WITH(xorg-module-dir,

commit e30a145934df8f6a7f71290d6c75e4239f9d52f7
Author: Dave Airlie <airlied@linux.ie>
Date:   Sat Aug 4 17:44:46 2007 +1000

    radeon: cleanup some pieces of the dpms/blank register programming

diff --git a/src/radeon_display.c b/src/radeon_display.c
index 0bf7271..95e669d 100644
--- a/src/radeon_display.c
+++ b/src/radeon_display.c
@@ -2020,33 +2020,26 @@ RADEONOutputsBlank(ScrnInfoPtr pScrn, RADEONConnector *pPort, Bool Blank)
 {
     RADEONInfoPtr  info       = RADEONPTR(pScrn);
     unsigned char *RADEONMMIO = info->MMIO;
+    CARD32 val;
 
     switch(pPort->MonType) {
     case MT_LCD:
-	if (Blank)
-	    OUTREGP(RADEON_LVDS_GEN_CNTL, RADEON_LVDS_DISPLAY_DIS, ~RADEON_LVDS_DISPLAY_DIS);
-	else
-	    OUTREGP(RADEON_LVDS_GEN_CNTL, 0, ~RADEON_LVDS_DISPLAY_DIS);
+	val = (Blank == TRUE) ? RADEON_LVDS_DISPLAY_DIS : 0;
+	OUTREGP(RADEON_LVDS_GEN_CNTL, val, ~RADEON_LVDS_DISPLAY_DIS);
         break;
     case MT_CRT:
 	if ((info->ChipFamily == CHIP_FAMILY_R200) && (pPort->DACType == DAC_TVDAC)) {
-	    if (Blank)
-		OUTREGP(RADEON_FP2_GEN_CNTL, RADEON_FP2_BLANK_EN, ~RADEON_FP2_BLANK_EN);
-	    else
-		OUTREGP(RADEON_FP2_GEN_CNTL, 0, ~RADEON_FP2_BLANK_EN);
+	    val = (Blank == TRUE) ? RADEON_FP2_BLANK_EN : 0;
+	    OUTREGP(RADEON_FP2_GEN_CNTL, val, ~RADEON_FP2_BLANK_EN);
 	}
         break;
     case MT_DFP:
 	if (pPort->TMDSType == TMDS_EXT) {
-	    if (Blank)
-		OUTREGP(RADEON_FP2_GEN_CNTL, RADEON_FP2_BLANK_EN, ~RADEON_FP2_BLANK_EN);
-	    else
-		OUTREGP(RADEON_FP2_GEN_CNTL, 0, ~RADEON_FP2_BLANK_EN);
+	    val = Blank ? RADEON_FP2_BLANK_EN : 0;
+	    OUTREGP(RADEON_FP2_GEN_CNTL, val, ~RADEON_FP2_BLANK_EN);
 	} else {
-	    if (Blank)
-		OUTREGP(RADEON_FP_GEN_CNTL, RADEON_FP_BLANK_EN, ~RADEON_FP_BLANK_EN);
-	    else
-		OUTREGP(RADEON_FP_GEN_CNTL, 0, ~RADEON_FP_BLANK_EN);
+	    val = Blank ? RADEON_FP_BLANK_EN : 0;
+	    OUTREGP(RADEON_FP_GEN_CNTL, val, ~RADEON_FP_BLANK_EN);
 	}
         break;
     case MT_NONE:
@@ -2059,28 +2052,19 @@ static void
 RADEONCRTC1Blank(RADEONInfoPtr info, Bool Blank)
 {
     unsigned char *RADEONMMIO = info->MMIO;
-    
-    if (Blank)
-	OUTREGP(RADEON_CRTC_EXT_CNTL,
-		RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_VSYNC_DIS | RADEON_CRTC_HSYNC_DIS,
-		~(RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_VSYNC_DIS | RADEON_CRTC_HSYNC_DIS));
-    else
-	OUTREGP(RADEON_CRTC_EXT_CNTL, 0,
-		~(RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_VSYNC_DIS | RADEON_CRTC_HSYNC_DIS));
+    CARD32 val = (Blank == TRUE) ? (RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_VSYNC_DIS | RADEON_CRTC_HSYNC_DIS) : 0;
+
+    OUTREGP(RADEON_CRTC_EXT_CNTL, val,
+	    ~(RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_VSYNC_DIS | RADEON_CRTC_HSYNC_DIS));
 }
 
 static void
 RADEONCRTC2Blank(RADEONInfoPtr info, Bool Blank)
 {
     unsigned char *RADEONMMIO = info->MMIO;
-    
-    if (Blank)
-	OUTREGP(RADEON_CRTC2_GEN_CNTL,
-		RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS | RADEON_CRTC2_HSYNC_DIS,
-		~(RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS | RADEON_CRTC2_HSYNC_DIS));
-    else
-	OUTREGP(RADEON_CRTC2_GEN_CNTL, 0,
-		~(RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS | RADEON_CRTC2_HSYNC_DIS));
+    CARD32 val = (Blank == TRUE) ? (RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS | RADEON_CRTC2_HSYNC_DIS) : 0;
+    OUTREGP(RADEON_CRTC2_GEN_CNTL, val,
+	    ~(RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS | RADEON_CRTC2_HSYNC_DIS));
 }
 
 /* Blank screen */
@@ -2178,63 +2162,58 @@ void
 RADEONCRTC1DPMS(RADEONInfoPtr info, int Mode)
 {
     unsigned char *RADEONMMIO = info->MMIO;
-
+    CARD32 val;
     switch (Mode) {
 	case DPMSModeOn:
 	    /* Screen: On; HSync: On, VSync: On */
-	    OUTREGP(RADEON_CRTC_EXT_CNTL, 0,
-		    ~(RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_HSYNC_DIS | RADEON_CRTC_VSYNC_DIS));
+	    val = 0;
 	    break;
 	case DPMSModeStandby:
 	    /* Screen: Off; HSync: Off, VSync: On */
-	    OUTREGP(RADEON_CRTC_EXT_CNTL, (RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_HSYNC_DIS),
-		    ~(RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_HSYNC_DIS | RADEON_CRTC_VSYNC_DIS));
+	    val = (RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_HSYNC_DIS);
 	    break;
 	case DPMSModeSuspend:
 	    /* Screen: Off; HSync: On, VSync: Off */
-	    OUTREGP(RADEON_CRTC_EXT_CNTL, (RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_VSYNC_DIS),
-		    ~(RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_HSYNC_DIS | RADEON_CRTC_VSYNC_DIS));
+	    val = (RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_VSYNC_DIS);
 	    break;
 	case DPMSModeOff:
 	default:
 	    /* Screen: Off; HSync: Off, VSync: Off */
-	    OUTREGP(RADEON_CRTC_EXT_CNTL,
-		    (RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_HSYNC_DIS | RADEON_CRTC_VSYNC_DIS),
-		    ~(RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_HSYNC_DIS | RADEON_CRTC_VSYNC_DIS));
+	    val = (RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_HSYNC_DIS | RADEON_CRTC_VSYNC_DIS);
 	    break;
     }
+    OUTREGP(RADEON_CRTC_EXT_CNTL, val,
+	    ~(RADEON_CRTC_DISPLAY_DIS | RADEON_CRTC_HSYNC_DIS | RADEON_CRTC_VSYNC_DIS));
+
 }
 
 void
 RADEONCRTC2DPMS(RADEONInfoPtr info, int Mode)
 {
     unsigned char *RADEONMMIO = info->MMIO;
-    
+    CARD32 val;
     switch (Mode) {
 	case DPMSModeOn:
 	    /* Screen: On; HSync: On, VSync: On */
-	    OUTREGP(RADEON_CRTC2_GEN_CNTL, 0,
-		    ~(RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS | RADEON_CRTC2_HSYNC_DIS));
+	    val = 0;
 	    break;
 	case DPMSModeStandby:
 	    /* Screen: Off; HSync: Off, VSync: On */
-	    OUTREGP(RADEON_CRTC2_GEN_CNTL, (RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_HSYNC_DIS),
-		    ~(RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS | RADEON_CRTC2_HSYNC_DIS));
+	    val = (RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_HSYNC_DIS);
 	    break;
 	case DPMSModeSuspend:
 	    /* Screen: Off; HSync: On, VSync: Off */
-	    OUTREGP(RADEON_CRTC2_GEN_CNTL, (RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS),
-		    ~(RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS | RADEON_CRTC2_HSYNC_DIS));
+	    val = (RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS);
 	    break;
 	case DPMSModeOff:
 	default:
 	    /* Screen: Off; HSync: Off, VSync: Off */
-	    OUTREGP(RADEON_CRTC2_GEN_CNTL,
-		    (RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS | RADEON_CRTC2_HSYNC_DIS),
-		    ~(RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS | RADEON_CRTC2_HSYNC_DIS));
+	    val = (RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS | RADEON_CRTC2_HSYNC_DIS);
 	    break;
 	    
     }
+    OUTREGP(RADEON_CRTC2_GEN_CNTL, val,
+	    ~(RADEON_CRTC2_DISP_DIS | RADEON_CRTC2_VSYNC_DIS | RADEON_CRTC2_HSYNC_DIS));    
 }
 
 

commit a156db5e8b037ed12a448f70045453baf9d0c504
Author: Luc Verhaegen <libv@skynet.be>
Date:   Sat Aug 4 17:37:18 2007 +1000

    Clean up PortInfo to CRTC mapping
    
    Also sanitise blanking and DPMS functions
    
    Fixes from Novell Bug 264720, and fd.o 10772

diff --git a/src/radeon.h b/src/radeon.h
index a22e481..5f3f4ab 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -904,14 +904,12 @@ extern void        RADEONEnableDisplay(ScrnInfoPtr pScrn, RADEONConnector* pPort
 extern void        RADEONDisableDisplays(ScrnInfoPtr pScrn);
 extern void        RADEONGetPanelInfo(ScrnInfoPtr pScrn);
 extern void        RADEONGetTVDacAdjInfo(ScrnInfoPtr pScrn);
-extern void        RADEONUnblank(ScrnInfoPtr pScrn);
-extern void        RADEONBlank(ScrnInfoPtr pScrn);
+extern void        RADEONBlank(ScrnInfoPtr pScrn, Bool Blank);
 extern void        RADEONDisplayPowerManagementSet(ScrnInfoPtr pScrn,
 						   int PowerManagementMode,
 						   int flags);
 extern Bool RADEONAllocateControllers(ScrnInfoPtr pScrn);
 extern Bool RADEONAllocateConnectors(ScrnInfoPtr pScrn);
-extern RADEONConnector *RADEONGetCrtcConnector(ScrnInfoPtr pScrn, int crtc_num);
 extern int RADEONValidateMergeModes(ScrnInfoPtr pScrn);
 extern int RADEONValidateDDCModes(ScrnInfoPtr pScrn1, char **ppModeName,
 				  RADEONMonitorType DisplayType, int crtc2);
diff --git a/src/radeon_display.c b/src/radeon_display.c
index 6ae8862..0bf7271 100644
--- a/src/radeon_display.c
+++ b/src/radeon_display.c
@@ -941,6 +941,16 @@ void RADEONGetTVDacAdjInfo(ScrnInfoPtr pScrn)
     }
 }
 
+static void
+RADEONConnectorReverse(RADEONEntPtr pRADEONEnt)
+{
+    RADEONConnector *connector;
+
+    connector = pRADEONEnt->PortInfo[0];
+    pRADEONEnt->PortInfo[0] = pRADEONEnt->PortInfo[1];
+    pRADEONEnt->PortInfo[1] = connector;
+}
+
 /*
  * initialise the static data sos we don't have to re-do at randr change */
 void RADEONSetupConnectors(ScrnInfoPtr pScrn)
@@ -998,12 +1008,9 @@ void RADEONSetupConnectors(ScrnInfoPtr pScrn)
     }
 
     /* always make TMDS_INT port first*/
-    if (pRADEONEnt->PortInfo[1]->TMDSType == TMDS_INT) {
-        RADEONConnector *connector;
-        connector = pRADEONEnt->PortInfo[0];
-        pRADEONEnt->PortInfo[0] = pRADEONEnt->PortInfo[1];
-        pRADEONEnt->PortInfo[1] = connector;
-    } else if ((pRADEONEnt->PortInfo[0]->TMDSType != TMDS_INT &&
+    if (pRADEONEnt->PortInfo[1]->TMDSType == TMDS_INT)
+	RADEONConnectorReverse(pRADEONEnt);
+    else if ((pRADEONEnt->PortInfo[0]->TMDSType != TMDS_INT &&
                 pRADEONEnt->PortInfo[1]->TMDSType != TMDS_INT)) {
         /* no TMDS_INT port, make primary DAC port first */
 	/* On my Inspiron 8600 both internal and external ports are
@@ -1011,10 +1018,7 @@ void RADEONSetupConnectors(ScrnInfoPtr pScrn)
 	   swap when the first port is not DAC_PRIMARY */
         if ((!(pRADEONEnt->PortInfo[0]->ConnectorType == CONNECTOR_PROPRIETARY)) &&  (pRADEONEnt->PortInfo[1]->DACType == DAC_PRIMARY) &&
 	     (pRADEONEnt->PortInfo[0]->DACType != DAC_PRIMARY)) {
-            RADEONConnector *connector;
-            connector = pRADEONEnt->PortInfo[0];
-            pRADEONEnt->PortInfo[0] = pRADEONEnt->PortInfo[1];
-            pRADEONEnt->PortInfo[1] = connector;
+	    RADEONConnectorReverse(pRADEONEnt);
         }
     }
 
@@ -1269,10 +1273,7 @@ static void RADEONQueryConnectedDisplays(ScrnInfoPtr pScrn)
 	    pRADEONEnt->PortInfo[1]->DACType = DAC_UNKNOWN;
 	    pRADEONEnt->PortInfo[1]->TMDSType = TMDS_UNKNOWN;
 	    pRADEONEnt->PortInfo[1]->ConnectorType = CONNECTOR_NONE;
-	    
-	    pRADEONEnt->PortInfo[0]->crtc_num = 1;
-	    pRADEONEnt->PortInfo[1]->crtc_num = 2;
-	    
+
 	    return;
 	}
 	
@@ -1307,16 +1308,12 @@ Bool RADEONMapControllers(ScrnInfoPtr pScrn)
     RADEONEntPtr pRADEONEnt   = RADEONEntPriv(pScrn);
     unsigned char *RADEONMMIO = info->MMIO;
     Bool head_reversed = FALSE;
-    RADEONConnector *connector;
 
     info->MergeType = MT_NONE;
 
     if (!info->IsSecondary) {
       RADEONQueryConnectedDisplays(pScrn);
 
-      pRADEONEnt->PortInfo[0]->crtc_num = 1;
-      pRADEONEnt->PortInfo[1]->crtc_num = 2;
-
       xf86DrvMsg(pScrn->scrnIndex, X_INFO, 
 		 "Port1:\n Monitor   -- %s\n Connector -- %s\n DAC Type  -- %s\n TMDS Type -- %s\n DDC Type  -- %s\n", 
 		 MonTypeName[pRADEONEnt->PortInfo[0]->MonType+1], 
@@ -1341,8 +1338,8 @@ Bool RADEONMapControllers(ScrnInfoPtr pScrn)
 	if (pRADEONEnt->PortInfo[0]->MonType == MT_NONE) {
 	    if (pRADEONEnt->PortInfo[1]->MonType != MT_NONE) {
 		/* Only one detected on secondary, let it to be primary */
-		pRADEONEnt->PortInfo[0]->crtc_num = 2;
-		pRADEONEnt->PortInfo[1]->crtc_num = 1;
+		if (!head_reversed)
+		    RADEONConnectorReverse(pRADEONEnt);
 		head_reversed = TRUE;
 	    } else {
 		/* None detected, Default to a CRT connected */
@@ -1354,10 +1351,10 @@ Bool RADEONMapControllers(ScrnInfoPtr pScrn)
 	    (pRADEONEnt->PortInfo[1]->MonType == MT_CRT)) {
 	    if (!(INREG(RADEON_LVDS_GEN_CNTL) & RADEON_LVDS_ON)) {
 		/* LCD is switched off, don't turn it on, otherwise it may casue lockup due to SS issue. */
-		pRADEONEnt->PortInfo[0]->crtc_num = 2;
-		pRADEONEnt->PortInfo[1]->crtc_num = 1;
-		pRADEONEnt->PortInfo[0]->MonType = MT_NONE;
+		if (!head_reversed)
+		    RADEONConnectorReverse(pRADEONEnt);
 		head_reversed = TRUE;
+		pRADEONEnt->PortInfo[0]->MonType = MT_NONE;
 		xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "LCD is switched off, only CRT will be used\n");
 	    }
 	}
@@ -1371,8 +1368,8 @@ Bool RADEONMapControllers(ScrnInfoPtr pScrn)
 		    */
 		    xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Reverse Display cannot be used for mobility chip\n");
 		} else {
-		    pRADEONEnt->PortInfo[0]->crtc_num = 2;
-		    pRADEONEnt->PortInfo[1]->crtc_num = 1;
+		    if (!head_reversed)
+			RADEONConnectorReverse(pRADEONEnt);
 		    head_reversed = TRUE;
 		    xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Primary and Secondary mapping is reversed\n");
 		}
@@ -1386,46 +1383,33 @@ Bool RADEONMapControllers(ScrnInfoPtr pScrn)
 
     if(pRADEONEnt->HasCRTC2) {
 	if(info->IsSecondary) {
-	    connector = RADEONGetCrtcConnector(pScrn, 2);
   	    pRADEONEnt->Controller[1]->binding = 2;
-	    if (connector) {
-		info->DisplayType = connector->MonType;
-		pScrn->monitor->DDC = connector->MonInfo;
-	    }
+	    info->DisplayType = pRADEONEnt->PortInfo[1]->MonType;
+	    pScrn->monitor->DDC = pRADEONEnt->PortInfo[1]->MonInfo;
 	} else {
-	    connector = RADEONGetCrtcConnector(pScrn, 1);
   	    pRADEONEnt->Controller[0]->binding = 1;
-	    if (connector) {
-		info->DisplayType = connector->MonType; 
-		pScrn->monitor->DDC = connector->MonInfo;
-	    }
+	    info->DisplayType = pRADEONEnt->PortInfo[0]->MonType;
+	    pScrn->monitor->DDC = pRADEONEnt->PortInfo[0]->MonInfo;



Reply to: