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

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



 configure.ac        |    4 
 man/radeon.man      |   19 +++-
 src/atiprint.c      |    1 
 src/atiprobe.c      |    1 
 src/radeon.h        |    6 -
 src/radeon_bios.c   |   17 ++++
 src/radeon_crtc.c   |   48 +++++++----
 src/radeon_cursor.c |   51 +++++-------
 src/radeon_driver.c |   54 ++++++++----
 src/radeon_modes.c  |   59 ++++---------
 src/radeon_output.c |  221 +++++++++++++++++++++++++++++++++++-----------------
 11 files changed, 301 insertions(+), 180 deletions(-)

New commits:
commit b865886d00907899297ae864358eb26d9980975d
Author: Alex Deucher <alex@t41p.hsd1.va.comcast.net>
Date:   Sun Nov 11 20:38:41 2007 -0500

    bump for RC release

diff --git a/configure.ac b/configure.ac
index 5216eff..450d951 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-ati],
-        6.7.195,
+        6.7.196,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-ati)
 

commit 37af2f6b52c8f217b205486742a6b46a864da8ed
Author: Michel Dänzer <michel@tungstengraphics.com>
Date:   Mon Nov 5 10:58:25 2007 +0100

    radeon: Use indirect register access for (un)hiding the cursor.
    
    This avoids hangs that occur when touching these registers while the card is
    busy with some cards.

diff --git a/src/radeon_cursor.c b/src/radeon_cursor.c
index f19f2bc..b8cfffd 100644
--- a/src/radeon_cursor.c
+++ b/src/radeon_cursor.c
@@ -98,12 +98,19 @@ radeon_crtc_show_cursor (xf86CrtcPtr crtc)
     RADEONInfoPtr      info       = RADEONPTR(pScrn);
     unsigned char     *RADEONMMIO = info->MMIO;
 
-    if (crtc_id == 0) 
-	OUTREGP(RADEON_CRTC_GEN_CNTL, RADEON_CRTC_CUR_EN | 2 << 20, 
-		~(RADEON_CRTC_CUR_EN | RADEON_CRTC_CUR_MODE_MASK));
-    else if (crtc_id == 1)
-	OUTREGP(RADEON_CRTC2_GEN_CNTL, RADEON_CRTC2_CUR_EN | 2 << 20,
-		~(RADEON_CRTC2_CUR_EN | RADEON_CRTC2_CUR_MODE_MASK));
+    switch (crtc_id) {
+    case 0:
+	OUTREG(RADEON_MM_INDEX, RADEON_CRTC_GEN_CNTL);
+	break;
+    case 1:
+	OUTREG(RADEON_MM_INDEX, RADEON_CRTC2_GEN_CNTL);
+	break;
+    default:
+	return;
+    }
+
+    OUTREGP(RADEON_MM_DATA, RADEON_CRTC_CUR_EN | 2 << 20, 
+	    ~(RADEON_CRTC_CUR_EN | RADEON_CRTC_CUR_MODE_MASK));
 }
 
 void
@@ -115,12 +122,18 @@ radeon_crtc_hide_cursor (xf86CrtcPtr crtc)
     RADEONInfoPtr      info       = RADEONPTR(pScrn);
     unsigned char     *RADEONMMIO = info->MMIO;
 
-    if (crtc_id == 0)
-	OUTREGP(RADEON_CRTC_GEN_CNTL, 0, ~RADEON_CRTC_CUR_EN);
-    else if (crtc_id == 1)
-	OUTREGP(RADEON_CRTC2_GEN_CNTL, 0, ~RADEON_CRTC2_CUR_EN);
-
+    switch (crtc_id) {
+    case 0:
+	OUTREG(RADEON_MM_INDEX, RADEON_CRTC_GEN_CNTL);
+	break;
+    case 1:
+	OUTREG(RADEON_MM_INDEX, RADEON_CRTC2_GEN_CNTL);
+	break;
+    default:
+	return;
+    }
 
+    OUTREGP(RADEON_MM_DATA, 0, ~RADEON_CRTC_CUR_EN);
 }
 
 void

commit 5659e2f1b08e44d0c4f21a403e91b4801ef78f62
Author: Michel Dänzer <michel@tungstengraphics.com>
Date:   Mon Nov 5 10:32:04 2007 +0100

    radeon: Fix build warning on powerpc.

diff --git a/src/radeon_output.c b/src/radeon_output.c
index e9a709f..599a89c 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -668,8 +668,6 @@ void RADEONConnectorFindMonitor(ScrnInfoPtr pScrn, xf86OutputPtr output)
 
 static RADEONMonitorType RADEONPortCheckNonDDC(ScrnInfoPtr pScrn, xf86OutputPtr output)
 {
-    RADEONInfoPtr info       = RADEONPTR(pScrn);
-    unsigned char *RADEONMMIO = info->MMIO;
     RADEONOutputPrivatePtr radeon_output = output->driver_private;
     RADEONMonitorType MonType = MT_NONE;
 
@@ -677,7 +675,11 @@ static RADEONMonitorType RADEONPortCheckNonDDC(ScrnInfoPtr pScrn, xf86OutputPtr
 #if defined(__powerpc__)
 	/* not sure on ppc, OF? */
 #else
+	RADEONInfoPtr info       = RADEONPTR(pScrn);
+
 	if (!info->IsAtomBios) {
+	    unsigned char *RADEONMMIO = info->MMIO;
+
 	    /* see if the lid is closed -- only works at boot */
 	    if (INREG(RADEON_BIOS_6_SCRATCH) & 0x10)
 		MonType = MT_NONE;

commit d41d73f5f9d8baee7137e94da2c7852ea0412180
Author: Michel Dänzer <michel@tungstengraphics.com>
Date:   Mon Nov 5 10:30:23 2007 +0100

    Revert "radeon: Reinstate sync in radeon_crtc_show/hide_cursor."
    
    This reverts commit 0241cac643fa1c08a45ea44f5c670b290e760ad8.
    
    Taking the DRI lock in paths called from the SIGIO handler isn't safe. For
    example, the SIGIO handler may be called while the lock is held by an AIGLX
    context, resulting in deadlock. See e.g.
    https://bugs.freedesktop.org/show_bug.cgi?id=13005 .

diff --git a/src/radeon_cursor.c b/src/radeon_cursor.c
index 3e60d23..f19f2bc 100644
--- a/src/radeon_cursor.c
+++ b/src/radeon_cursor.c
@@ -98,22 +98,12 @@ radeon_crtc_show_cursor (xf86CrtcPtr crtc)
     RADEONInfoPtr      info       = RADEONPTR(pScrn);
     unsigned char     *RADEONMMIO = info->MMIO;
 
-#ifdef XF86DRI
-    if (info->CPStarted && pScrn->pScreen) DRILock(pScrn->pScreen, 0);
-#endif
-
-    RADEON_SYNC(info, pScrn);
-
     if (crtc_id == 0) 
 	OUTREGP(RADEON_CRTC_GEN_CNTL, RADEON_CRTC_CUR_EN | 2 << 20, 
 		~(RADEON_CRTC_CUR_EN | RADEON_CRTC_CUR_MODE_MASK));
     else if (crtc_id == 1)
 	OUTREGP(RADEON_CRTC2_GEN_CNTL, RADEON_CRTC2_CUR_EN | 2 << 20,
 		~(RADEON_CRTC2_CUR_EN | RADEON_CRTC2_CUR_MODE_MASK));
-
-#ifdef XF86DRI
-    if (info->CPStarted && pScrn->pScreen) DRIUnlock(pScrn->pScreen);
-#endif
 }
 
 void
@@ -125,20 +115,12 @@ radeon_crtc_hide_cursor (xf86CrtcPtr crtc)
     RADEONInfoPtr      info       = RADEONPTR(pScrn);
     unsigned char     *RADEONMMIO = info->MMIO;
 
-#ifdef XF86DRI
-    if (info->CPStarted && pScrn->pScreen) DRILock(pScrn->pScreen, 0);
-#endif
-
-    RADEON_SYNC(info, pScrn);
-
     if (crtc_id == 0)
 	OUTREGP(RADEON_CRTC_GEN_CNTL, 0, ~RADEON_CRTC_CUR_EN);
     else if (crtc_id == 1)
 	OUTREGP(RADEON_CRTC2_GEN_CNTL, 0, ~RADEON_CRTC2_CUR_EN);
 
-#ifdef XF86DRI
-    if (info->CPStarted && pScrn->pScreen) DRIUnlock(pScrn->pScreen);
-#endif
+
 }
 
 void

commit aaafc6a8f33d4736c37c43d3fd5e43085a2590fb
Author: Brice Goglin <bgoglin@debian.org>
Date:   Sun Oct 28 21:10:32 2007 +0100

    Fix typo in 'disposing cursor'
    
    Bug #12984.

diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index a243c9f..e027379 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -5927,7 +5927,7 @@ static Bool RADEONCloseScreen(int scrnIndex, ScreenPtr pScreen)
 #endif /* USE_XAA */
 
     xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG,
-		   "Disposing cusor info\n");
+		   "Disposing cursor info\n");
     if (info->cursor) xf86DestroyCursorInfoRec(info->cursor);
     info->cursor = NULL;
 

commit a5c55c418319c1315ad73c305ef48b44fe1d9580
Author: Alex Deucher <alex@t41p.hsd1.va.comcast.net>
Date:   Sat Oct 27 19:46:11 2007 -0400

    RADEON: disable FP DETECT for DVI.
    
    These bits don't seem to be reliable or routed right
    in all cases.

diff --git a/src/radeon_output.c b/src/radeon_output.c
index 9cfc2c4..e9a709f 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -686,7 +686,7 @@ static RADEONMonitorType RADEONPortCheckNonDDC(ScrnInfoPtr pScrn, xf86OutputPtr
 	} else
 #endif
 	    MonType = MT_LCD;
-    } else if (radeon_output->type == OUTPUT_DVI) {
+    } /*else if (radeon_output->type == OUTPUT_DVI) {
 	if (radeon_output->TMDSType == TMDS_INT) {
 	    if (INREG(RADEON_FP_GEN_CNTL) & RADEON_FP_DETECT_SENSE)
 		MonType = MT_DFP;
@@ -694,7 +694,7 @@ static RADEONMonitorType RADEONPortCheckNonDDC(ScrnInfoPtr pScrn, xf86OutputPtr
 	    if (INREG(RADEON_FP2_GEN_CNTL) & RADEON_FP2_DETECT_SENSE)
 		MonType = MT_DFP;
 	}
-    }
+	}*/
 
     xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 	       "Detected Monitor Type: %d\n", MonType);

commit 49cf7cb3db36ce7734f7e314a040a240191d6477
Author: Alex Deucher <alex@t41p.hsd1.va.comcast.net>
Date:   Thu Oct 25 21:23:09 2007 -0400

    RADEON: Fix IgnoreEDID option

diff --git a/src/radeon_output.c b/src/radeon_output.c
index 4f39493..9cfc2c4 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -344,7 +344,8 @@ RADEONDisplayDDCConnected(ScrnInfoPtr pScrn, xf86OutputPtr output)
 	   ~(RADEON_GPIO_EN_0 | RADEON_GPIO_EN_1));
 
     if (MonInfo) {
-	xf86OutputSetEDID (output, MonInfo);
+	if (!xf86ReturnOptValBool(info->Options, OPTION_IGNORE_EDID, FALSE))
+	    xf86OutputSetEDID(output, MonInfo);
 	if ((info->IsAtomBios && radeon_output->ConnectorType == CONNECTOR_LVDS_ATOM) ||
 	    (!info->IsAtomBios && radeon_output->ConnectorType == CONNECTOR_PROPRIETARY)) {
 	    MonType = MT_LCD;

commit 70bbc0cfe699588f8ae4123efca0e1baffc91000
Author: Alex Deucher <alex@t41p.hsd1.va.comcast.net>
Date:   Thu Oct 25 20:56:11 2007 -0400

    RADEON: clean up mode handling and improve reliability of DDC
    
    - Reduce the number of times we do DDC and don't
    skip the magical GPIO dance when doing DDC.
    - If no DDC modes are found, add the screen modes

diff --git a/src/radeon_modes.c b/src/radeon_modes.c
index 45e5169..3c4badd 100644
--- a/src/radeon_modes.c
+++ b/src/radeon_modes.c
@@ -95,7 +95,6 @@ static DisplayModePtr RADEONTVModes(xf86OutputPtr output)
 static DisplayModePtr RADEONFPNativeMode(xf86OutputPtr output)
 {
     ScrnInfoPtr pScrn = output->scrn;
-    RADEONInfoPtr info = RADEONPTR(pScrn);
     RADEONOutputPrivatePtr radeon_output = output->driver_private;
     DisplayModePtr  new   = NULL;
     char            stmp[32];
@@ -210,39 +209,22 @@ DisplayModePtr
 RADEONProbeOutputModes(xf86OutputPtr output)
 {
     RADEONOutputPrivatePtr radeon_output = output->driver_private;
-    xf86MonPtr		    edid_mon;
     DisplayModePtr	    modes = NULL;
 
     ErrorF("in RADEONProbeOutputModes\n");
 
     if (output->status == XF86OutputStatusConnected) {
-	if (radeon_output->type == OUTPUT_DVI || radeon_output->type == OUTPUT_VGA) {
-	    if (output->MonInfo) {
-		edid_mon = xf86OutputGetEDID (output, radeon_output->pI2CBus);
-		xf86OutputSetEDID (output, edid_mon);
-
-		modes = xf86OutputGetEDIDModes (output);
-		return modes;
-	    }
-	}
 	if (radeon_output->type == OUTPUT_STV || radeon_output->type == OUTPUT_CTV) {
 	    modes = RADEONTVModes(output);
-	    return modes;
-	}
-	if (radeon_output->type == OUTPUT_LVDS) {
-	    /* okay we got DDC info */
-	    if (output->MonInfo) {
-		edid_mon = xf86OutputGetEDID (output, radeon_output->pI2CBus);
-		xf86OutputSetEDID (output, edid_mon);
-
+	} else {
+	    if (output->MonInfo)
 		modes = xf86OutputGetEDIDModes (output);
-	    }
 	    if (modes == NULL) {
-		modes = RADEONFPNativeMode(output);
+		if (radeon_output->type == OUTPUT_LVDS)
+		    modes = RADEONFPNativeMode(output);
 		/* add the screen modes */
 		RADEONAddScreenModes(output, &modes);
 	    }
-	    return modes;
 	}
     }
 
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 39cbdb9..4f39493 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -270,7 +270,7 @@ RADEONDisplayDDCConnected(ScrnInfoPtr pScrn, xf86OutputPtr output)
     unsigned char *RADEONMMIO = info->MMIO;
     unsigned long DDCReg;
     RADEONMonitorType MonType = MT_NONE;
-    xf86MonPtr* MonInfo = &output->MonInfo;
+    xf86MonPtr MonInfo = NULL;
     RADEONOutputPrivatePtr radeon_output = output->driver_private;
     RADEONDDCType DDCType = radeon_output->DDCType;
     int i, j;
@@ -310,7 +310,8 @@ RADEONDisplayDDCConnected(ScrnInfoPtr pScrn, xf86OutputPtr output)
 	    OUTREG(DDCReg,
 		   INREG(DDCReg) & ~(RADEON_GPIO_EN_0));
 	    usleep(15000);
-	    *MonInfo = xf86DoEDID_DDC2(pScrn->scrnIndex, radeon_output->pI2CBus);
+
+	    MonInfo = xf86DoEDID_DDC2(pScrn->scrnIndex, radeon_output->pI2CBus);
 
 	    OUTREG(DDCReg, INREG(DDCReg) | RADEON_GPIO_EN_1);
 	    OUTREG(DDCReg, INREG(DDCReg) | RADEON_GPIO_EN_0);
@@ -330,10 +331,10 @@ RADEONDisplayDDCConnected(ScrnInfoPtr pScrn, xf86OutputPtr output)
 	    OUTREG(DDCReg, INREG(DDCReg) | RADEON_GPIO_EN_1);
 	    OUTREG(DDCReg, INREG(DDCReg) | RADEON_GPIO_EN_0);
 	    usleep(15000);
-	    if(*MonInfo)  break;
+	    if (MonInfo)  break;
 	}
     } else if (radeon_output->pI2CBus && info->ddc2 && ((DDCReg == RADEON_LCD_GPIO_MASK) || (DDCReg == RADEON_MDGPIO_EN_REG))) {
-         *MonInfo = xf86DoEDID_DDC2(pScrn->scrnIndex, radeon_output->pI2CBus);
+         MonInfo = xf86DoEDID_DDC2(pScrn->scrnIndex, radeon_output->pI2CBus);
     } else {
 	xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "DDC2/I2C is not properly initialized\n");
 	MonType = MT_NONE;
@@ -342,7 +343,8 @@ RADEONDisplayDDCConnected(ScrnInfoPtr pScrn, xf86OutputPtr output)
     OUTREG(DDCReg, INREG(DDCReg) &
 	   ~(RADEON_GPIO_EN_0 | RADEON_GPIO_EN_1));
 
-    if (*MonInfo) {
+    if (MonInfo) {
+	xf86OutputSetEDID (output, MonInfo);
 	if ((info->IsAtomBios && radeon_output->ConnectorType == CONNECTOR_LVDS_ATOM) ||
 	    (!info->IsAtomBios && radeon_output->ConnectorType == CONNECTOR_PROPRIETARY)) {
 	    MonType = MT_LCD;
@@ -350,7 +352,7 @@ RADEONDisplayDDCConnected(ScrnInfoPtr pScrn, xf86OutputPtr output)
 		 (!info->IsAtomBios && radeon_output->ConnectorType == CONNECTOR_DVI_D)) {
 	    MonType = MT_DFP;
 	} else if (radeon_output->type == OUTPUT_DVI &&
-		   ((*MonInfo)->rawData[0x14] & 0x80)) { /* if it's digital and DVI */
+		   (MonInfo->rawData[0x14] & 0x80)) { /* if it's digital and DVI */
 	    MonType = MT_DFP;
 	} else {
 	    MonType = MT_CRT;

commit 1a4f590c2ac071f0c348f38e9f26fa6093722453
Author: Alex Deucher <alex@t41p.hsd1.va.comcast.net>
Date:   Thu Oct 25 19:25:36 2007 -0400

    RADEON: document DefaultTMDSPLL option

diff --git a/man/radeon.man b/man/radeon.man
index 48d7cb2..5d31eb1 100644
--- a/man/radeon.man
+++ b/man/radeon.man
@@ -390,6 +390,14 @@ TV DAC so it is disabled by default.
 The default is
 .B off.
 .TP
+.BI "Option \*DefaultTMDSPLL\*q \*q" boolean \*q
+Use the default driver provided TMDS PLL values rather than the ones
+provided by the bios. This option has no effect on Mac cards.  Enable 
+this option if you are having problems with a DVI monitor using the 
+internal TMDS controller.
+The default is
+.B off.
+.TP
 .BI "Option \*qDRI\*q \*q" boolean \*q
 Enable DRI support.  This option allows you to enable to disable the DRI.  
 The default is

commit 2d26e0d0bcf25e210dc7771e76638dcfafcc2356
Author: Alex Deucher <alex@t41p.hsd1.va.comcast.net>
Date:   Thu Oct 25 19:18:18 2007 -0400

    RADEON: Add driver option to force TV DAC load detection on

diff --git a/man/radeon.man b/man/radeon.man
index 35dd701..48d7cb2 100644
--- a/man/radeon.man
+++ b/man/radeon.man
@@ -383,6 +383,13 @@ case.  This is only useful for LVDS panels (laptop internal panels).
 The default is
 .B on.
 .TP
+.BI "Option \*TVDACLoadDetect\*q \*q" boolean \*q
+Enable load detection on the TV DAC.  The TV DAC is used to drive both 
+TV-OUT and analog monitors. Load detection is often unreliable in the 
+TV DAC so it is disabled by default.
+The default is
+.B off.
+.TP
 .BI "Option \*qDRI\*q \*q" boolean \*q
 Enable DRI support.  This option allows you to enable to disable the DRI.  
 The default is
diff --git a/src/radeon.h b/src/radeon.h
index 7f9ff76..532f04c 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -157,7 +157,8 @@ typedef enum {
 #if defined(__powerpc__)
     OPTION_MAC_MODEL,
 #endif
-    OPTION_DEFAULT_TMDS_PLL
+    OPTION_DEFAULT_TMDS_PLL,
+    OPTION_TVDAC_LOAD_DETECT
 } RADEONOpts;
 
 
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 8ebdd96..a243c9f 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -190,6 +190,7 @@ static const OptionInfoRec RADEONOptions[] = {
 #if defined(__powerpc__)
     { OPTION_MAC_MODEL,      "MacModel",         OPTV_STRING,  {0}, FALSE },
 #endif
+    { OPTION_TVDAC_LOAD_DETECT, "TVDACLoadDetect", OPTV_BOOLEAN, {0}, FALSE },
     { -1,                    NULL,               OPTV_NONE,    {0}, FALSE }
 };
 
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 214167f..39cbdb9 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -1771,13 +1771,15 @@ radeon_create_resources(xf86OutputPtr output)
 	if (err != 0) {
 	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 		       "RRConfigureOutputProperty error, %d\n", err);
-	}	
+	}
 
 	if (radeon_output->DACType == DAC_PRIMARY)
 	    data = 1; /* primary dac, only drives vga */
 	/*else if (radeon_output->DACType == DAC_TVDAC &&
 		 info->tvdac_use_count < 2)
 		 data = 1;*/ /* only one output with tvdac */
+	else if (xf86ReturnOptValBool(info->Options, OPTION_TVDAC_LOAD_DETECT, FALSE))
+	    data = 1; /* user forces on tv dac load detection */
 	else
 	    data = 0; /* shared tvdac between vga/dvi/tv */
 

commit a9306b7986467c0794c91625ad2ece597b718462
Author: Alex Deucher <alex@botch2.(none)>
Date:   Thu Oct 18 20:06:58 2007 -0400

    RADEON: fix possible crash in radeon_crtc_mode_set()
    
    when radeon_crtc_mode_set() is called during ScreenInit(),
    we don't have pScrn->pScreen yet.

diff --git a/src/radeon_crtc.c b/src/radeon_crtc.c
index eeb1c6c..de24273 100644
--- a/src/radeon_crtc.c
+++ b/src/radeon_crtc.c
@@ -802,10 +802,11 @@ radeon_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
 #ifdef XF86DRI
 	if (info->directRenderingEnabled && (info->tilingEnabled != tilingOld)) {
 	    RADEONSAREAPrivPtr pSAREAPriv;
-	  if (RADEONDRISetParam(pScrn, RADEON_SETPARAM_SWITCH_TILING, (info->tilingEnabled ? 1 : 0)) < 0)
-	      xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
-			 "[drm] failed changing tiling status\n");
-	    pSAREAPriv = DRIGetSAREAPrivate(pScrn->pScreen);
+	    if (RADEONDRISetParam(pScrn, RADEON_SETPARAM_SWITCH_TILING, (info->tilingEnabled ? 1 : 0)) < 0)
+		xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+			   "[drm] failed changing tiling status\n");
+	    /* if this is called during ScreenInit() we don't have pScrn->pScreen yet */
+	    pSAREAPriv = DRIGetSAREAPrivate(screenInfo.screens[pScrn->scrnIndex]);
 	    info->tilingEnabled = pSAREAPriv->tiling_enabled ? TRUE : FALSE;
 	}
 #endif
@@ -911,9 +912,12 @@ radeon_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
 
     if (info->tilingEnabled != tilingOld) {
 	/* need to redraw front buffer, I guess this can be considered a hack ? */
-	xf86EnableDisableFBAccess(pScrn->scrnIndex, FALSE);
+	/* if this is called during ScreenInit() we don't have pScrn->pScreen yet */
+	if (pScrn->pScreen)
+	    xf86EnableDisableFBAccess(pScrn->scrnIndex, FALSE);
 	RADEONChangeSurfaces(pScrn);
-	xf86EnableDisableFBAccess(pScrn->scrnIndex, TRUE);
+	if (pScrn->pScreen)
+	    xf86EnableDisableFBAccess(pScrn->scrnIndex, TRUE);
 	/* xf86SetRootClip would do, but can't access that here */
     }
 

commit 115b4b65ef679a46d90b7fc8ac22ace37038b3fc
Author: Alex Deucher <alex@t41p.hsd1.va.comcast.net>
Date:   Wed Oct 17 20:25:47 2007 -0400

    RADEON: Remove LVDSBiosNativeMode Option
    
    Shouldn't be needed any longer as I've finally sorted out
    the LVDS issues due to the crtc setup.

diff --git a/man/radeon.man b/man/radeon.man
index 9168254..35dd701 100644
--- a/man/radeon.man
+++ b/man/radeon.man
@@ -383,14 +383,6 @@ case.  This is only useful for LVDS panels (laptop internal panels).
 The default is
 .B on.
 .TP
-.BI "Option \*qLVDSBiosNativeMode\*q \*q" boolean \*q
-On some laptops, the LVDS mode from the timing tables in the bios does 
-not work properly.  In those cases, a CVT mode seems to work better.  
-If you get a blank screen or have LVDS display problems, disable this 
-option to use a CVT mode.  
-The default is
-.B on.
-.TP
 .BI "Option \*qDRI\*q \*q" boolean \*q
 Enable DRI support.  This option allows you to enable to disable the DRI.  
 The default is
diff --git a/src/radeon.h b/src/radeon.h
index 6ee43b2..7f9ff76 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -157,8 +157,7 @@ typedef enum {
 #if defined(__powerpc__)
     OPTION_MAC_MODEL,
 #endif
-    OPTION_DEFAULT_TMDS_PLL,
-    OPTION_LVDS_BIOS_NATIVE_MODE
+    OPTION_DEFAULT_TMDS_PLL
 } RADEONOpts;
 
 
@@ -817,8 +816,6 @@ typedef struct {
     RADEONMacModel    MacModel;
 #endif
 
-    Bool              LVDSBiosNativeMode;
-
     Rotation rotation;
     void (*PointerMoved)(int, int, int);
     CreateScreenResourcesProcPtr CreateScreenResources;
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 9bb1933..8ebdd96 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -190,7 +190,6 @@ static const OptionInfoRec RADEONOptions[] = {
 #if defined(__powerpc__)
     { OPTION_MAC_MODEL,      "MacModel",         OPTV_STRING,  {0}, FALSE },
 #endif
-    { OPTION_LVDS_BIOS_NATIVE_MODE, "LVDSBiosNativeMode", OPTV_BOOLEAN, {0}, TRUE },
     { -1,                    NULL,               OPTV_NONE,    {0}, FALSE }
 };
 
diff --git a/src/radeon_modes.c b/src/radeon_modes.c
index e01c1e1..45e5169 100644
--- a/src/radeon_modes.c
+++ b/src/radeon_modes.c
@@ -104,29 +104,22 @@ static DisplayModePtr RADEONFPNativeMode(xf86OutputPtr output)
 	radeon_output->PanelYRes != 0 &&
 	radeon_output->DotClock != 0) {
 
-	if (info->LVDSBiosNativeMode) {
-	    new             = xnfcalloc(1, sizeof (DisplayModeRec));
-	    sprintf(stmp, "%dx%d", radeon_output->PanelXRes, radeon_output->PanelYRes);
-	    new->name       = xnfalloc(strlen(stmp) + 1);
-	    strcpy(new->name, stmp);
-	    new->HDisplay   = radeon_output->PanelXRes;
-	    new->VDisplay   = radeon_output->PanelYRes;
-
-	    new->HTotal     = new->HDisplay + radeon_output->HBlank;
-	    new->HSyncStart = new->HDisplay + radeon_output->HOverPlus;
-	    new->HSyncEnd   = new->HSyncStart + radeon_output->HSyncWidth;
-	    new->VTotal     = new->VDisplay + radeon_output->VBlank;
-	    new->VSyncStart = new->VDisplay + radeon_output->VOverPlus;
-	    new->VSyncEnd   = new->VSyncStart + radeon_output->VSyncWidth;
-
-	    new->Clock      = radeon_output->DotClock;
-	    new->Flags      = 0;
-
-	} else {
-	    /* Add native panel size */
-	    new = xf86CVTMode(radeon_output->PanelXRes, radeon_output->PanelYRes, 60.0, FALSE, FALSE);
-
-	}
+	new             = xnfcalloc(1, sizeof (DisplayModeRec));
+	sprintf(stmp, "%dx%d", radeon_output->PanelXRes, radeon_output->PanelYRes);
+	new->name       = xnfalloc(strlen(stmp) + 1);
+	strcpy(new->name, stmp);
+	new->HDisplay   = radeon_output->PanelXRes;
+	new->VDisplay   = radeon_output->PanelYRes;
+
+	new->HTotal     = new->HDisplay + radeon_output->HBlank;
+	new->HSyncStart = new->HDisplay + radeon_output->HOverPlus;
+	new->HSyncEnd   = new->HSyncStart + radeon_output->HSyncWidth;
+	new->VTotal     = new->VDisplay + radeon_output->VBlank;
+	new->VSyncStart = new->VDisplay + radeon_output->VOverPlus;
+	new->VSyncEnd   = new->VSyncStart + radeon_output->VSyncWidth;
+
+	new->Clock      = radeon_output->DotClock;
+	new->Flags      = 0;
 
 	if (new) {
 	    new->type       = M_T_DRIVER | M_T_PREFERRED;
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 6acbb53..214167f 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -2450,15 +2450,6 @@ RADEONGetLVDSInfo (xf86OutputPtr output)
 	}
     }
 
-    info->LVDSBiosNativeMode = TRUE;
-    if (!xf86ReturnOptValBool(info->Options, OPTION_LVDS_BIOS_NATIVE_MODE, TRUE)) {
-	info->LVDSBiosNativeMode = FALSE;
-	xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using CVT mode for LVDS\n");
-    } else {
-	xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Using LVDS Native Mode\n");
-    }
-
-
     /* The panel size we collected from BIOS may not be the
      * maximum size supported by the panel.  If not, we update
      * it now.  These will be used if no matching mode can be

commit f2eb5c1cc69a4f7b0754ec6b2efde4fa1650ab6d
Author: Alex Deucher <alex@t41p.hsd1.va.comcast.net>
Date:   Tue Oct 16 18:54:28 2007 -0400

    RADEON: finish fixing LVDS/RMX
    
    For panels, both the mode and crtc values need to be updated based
    on the native mode timing.  This shoudl fix any remaining problems
    with RMX.

diff --git a/src/radeon_output.c b/src/radeon_output.c
index e2f26e7..6acbb53 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -777,15 +777,25 @@ radeon_mode_fixup(xf86OutputPtr output, DisplayModePtr mode,
     }
 
     /* update timing for LVDS and DFP if RMX is active */
-    if (radeon_output->Flags & RADEON_USE_RMX) {
-	adjusted_mode->CrtcHTotal     = mode->CrtcHDisplay + radeon_output->HBlank;
-	adjusted_mode->CrtcHSyncStart = mode->CrtcHDisplay + radeon_output->HOverPlus;
-	adjusted_mode->CrtcHSyncEnd   = mode->CrtcHSyncStart + radeon_output->HSyncWidth;
-	adjusted_mode->CrtcVTotal     = mode->CrtcVDisplay + radeon_output->VBlank;
-	adjusted_mode->CrtcVSyncStart = mode->CrtcVDisplay + radeon_output->VOverPlus;
-	adjusted_mode->CrtcVSyncEnd   = mode->CrtcVSyncStart + radeon_output->VSyncWidth;
-	adjusted_mode->Clock          = radeon_output->DotClock;
-	adjusted_mode->Flags          = radeon_output->Flags;
+    if ((radeon_output->MonType == MT_LCD) || (radeon_output->Flags & RADEON_USE_RMX)) {
+	/* set to the panel's native mode */
+	adjusted_mode->HTotal = radeon_output->PanelXRes + radeon_output->HBlank;
+	adjusted_mode->HSyncStart = radeon_output->PanelXRes + radeon_output->HOverPlus;
+	adjusted_mode->HSyncEnd = adjusted_mode->HSyncStart + radeon_output->HSyncWidth;
+	adjusted_mode->VTotal = radeon_output->PanelYRes + radeon_output->VBlank;
+	adjusted_mode->VSyncStart = radeon_output->PanelYRes + radeon_output->VOverPlus;
+	adjusted_mode->VSyncEnd = adjusted_mode->VSyncStart + radeon_output->VSyncWidth;
+	/* update crtc values */
+	xf86SetModeCrtc(adjusted_mode, INTERLACE_HALVE_V);
+	/* adjust crtc values */
+	adjusted_mode->CrtcHTotal = adjusted_mode->CrtcHDisplay + radeon_output->HBlank;
+	adjusted_mode->CrtcHSyncStart = adjusted_mode->CrtcHDisplay + radeon_output->HOverPlus;
+	adjusted_mode->CrtcHSyncEnd = adjusted_mode->CrtcHSyncStart + radeon_output->HSyncWidth;
+	adjusted_mode->CrtcVTotal = adjusted_mode->CrtcVDisplay + radeon_output->VBlank;
+	adjusted_mode->CrtcVSyncStart = adjusted_mode->CrtcVDisplay + radeon_output->VOverPlus;
+	adjusted_mode->CrtcVSyncEnd = adjusted_mode->CrtcVSyncStart + radeon_output->VSyncWidth;
+	adjusted_mode->Clock = radeon_output->DotClock;
+	adjusted_mode->Flags = radeon_output->Flags;
     }
 
     return TRUE;

commit 93561688087493fccb7ac387d728feec61212180
Author: Michel Dänzer <michel@tungstengraphics.com>
Date:   Tue Oct 16 10:57:06 2007 +0200

    radeon: Handle 64 bit PCI resource bases better.

diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 40e1d98..9bb1933 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -1758,11 +1758,11 @@ static Bool RADEONPreInitChipType(ScrnInfoPtr pScrn)
 
 
     from               = X_PROBED;
-    info->LinearAddr   = PCI_REGION_BASE(info->PciInfo, 0, REGION_MEM) & 0xfe000000;
+    info->LinearAddr   = PCI_REGION_BASE(info->PciInfo, 0, REGION_MEM) & ~0x1ffffffUL;
     pScrn->memPhysBase = info->LinearAddr;
     if (dev->MemBase) {
 	xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-		   "Linear address override, using 0x%08lx instead of 0x%08lx\n",
+		   "Linear address override, using 0x%016lx instead of 0x%016lx\n",
 		   dev->MemBase,
 		   info->LinearAddr);
 	info->LinearAddr = dev->MemBase;
@@ -1773,7 +1773,7 @@ static Bool RADEONPreInitChipType(ScrnInfoPtr pScrn)
 	return FALSE;
     }
     xf86DrvMsg(pScrn->scrnIndex, from,
-	       "Linear framebuffer at 0x%08lx\n", info->LinearAddr);
+	       "Linear framebuffer at 0x%016lx\n", info->LinearAddr);
 
 #ifndef XSERVER_LIBPCIACCESS
 				/* BIOS */
@@ -2589,7 +2589,7 @@ _X_EXPORT Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags)
     info->PciTag  = pciTag(PCI_DEV_BUS(info->PciInfo),
 			   PCI_DEV_DEV(info->PciInfo),
 			   PCI_DEV_FUNC(info->PciInfo));
-    info->MMIOAddr = PCI_REGION_BASE(info->PciInfo, 2, REGION_MEM) & 0xffffff00;
+    info->MMIOAddr = PCI_REGION_BASE(info->PciInfo, 2, REGION_MEM) & ~0xffUL;
     info->MMIOSize = PCI_REGION_SIZE(info->PciInfo, 2);
     if (info->pEnt->device->IOBase) {
 	xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
@@ -2602,7 +2602,7 @@ _X_EXPORT Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags)
 	goto fail1;
     }
     xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-	       "MMIO registers at 0x%08lx: size %ldKB\n", info->MMIOAddr, info->MMIOSize / 1024);
+	       "MMIO registers at 0x%016lx: size %ldKB\n", info->MMIOAddr, info->MMIOSize / 1024);
 
     if(!RADEONMapMMIO(pScrn)) {
 	xf86DrvMsg(pScrn->scrnIndex, X_ERROR,

commit 08945fc8a14ba57e32350e85daa3354619e9e72e
Author: Alex Deucher <alex@botch2.(none)>
Date:   Mon Oct 15 21:12:46 2007 -0400

    RADEON: allow the user to set any tv standard
    
    allow the user to set any tv standard rather than
    limiting it to what the bios says is supported.

diff --git a/src/radeon_output.c b/src/radeon_output.c
index 45a605d..e2f26e7 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -1936,7 +1936,7 @@ radeon_create_resources(xf86OutputPtr output)
 	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 		       "RRConfigureOutputProperty error, %d\n", err);
 	}
-	/* Set the current value of the backlight property */
+	/* Set the current value of the property */
 	switch (radeon_output->default_tvStd) {
 	case TV_STD_PAL:
 	    s = "pal";
@@ -2106,47 +2106,23 @@ radeon_set_property(xf86OutputPtr output, Atom property,
 	    return FALSE;
 	s = (char*)value->data;
 	if (value->size == strlen("ntsc") && !strncmp("ntsc", s, strlen("ntsc"))) {
-	    if (radeon_output->SupportedTVStds & TV_STD_NTSC) {
-		radeon_output->tvStd = TV_STD_NTSC;
-		return TRUE;
-	    } else {
-		return FALSE;
-	    }
+	    radeon_output->tvStd = TV_STD_NTSC;
+	    return TRUE;
 	} else if (value->size == strlen("pal") && !strncmp("pal", s, strlen("pal"))) {
-	    if (radeon_output->SupportedTVStds & TV_STD_PAL) {
-		radeon_output->tvStd = TV_STD_PAL;
-		return TRUE;
-	    } else {
-		return FALSE;
-	    }
+	    radeon_output->tvStd = TV_STD_PAL;
+	    return TRUE;
 	} else if (value->size == strlen("pal-m") && !strncmp("pal-m", s, strlen("pal-m"))) {
-	    if (radeon_output->SupportedTVStds & TV_STD_PAL_M) {
-		radeon_output->tvStd = TV_STD_PAL_M;
-		return TRUE;
-	    } else {
-		return FALSE;
-	    }
+	    radeon_output->tvStd = TV_STD_PAL_M;
+	    return TRUE;
 	} else if (value->size == strlen("pal-60") && !strncmp("pal-60", s, strlen("pal-60"))) {
-	    if (radeon_output->SupportedTVStds & TV_STD_PAL_60) {
-		radeon_output->tvStd = TV_STD_PAL_60;
-		return TRUE;
-	    } else {
-		return FALSE;
-	    }
+	    radeon_output->tvStd = TV_STD_PAL_60;
+	    return TRUE;
 	} else if (value->size == strlen("ntsc-j") && !strncmp("ntsc-j", s, strlen("ntsc-j"))) {
-	    if (radeon_output->SupportedTVStds & TV_STD_NTSC_J) {
-		radeon_output->tvStd = TV_STD_NTSC_J;
-		return TRUE;
-	    } else {
-		return FALSE;
-	    }
+	    radeon_output->tvStd = TV_STD_NTSC_J;
+	    return TRUE;
 	} else if (value->size == strlen("scart-pal") && !strncmp("scart-pal", s, strlen("scart-pal"))) {
-	    if (radeon_output->SupportedTVStds & TV_STD_SCART_PAL) {
-		radeon_output->tvStd = TV_STD_SCART_PAL;
-		return TRUE;
-	    } else {
-		return FALSE;
-	    }
+	    radeon_output->tvStd = TV_STD_SCART_PAL;
+	    return TRUE;
 	}
 	return FALSE;
     }

commit 571548b2b95ce289f26a77c11deb6266f0b18516
Author: Alex Deucher <alex@botch2.(none)>
Date:   Mon Oct 15 20:33:56 2007 -0400

    RADEON: use native timing for RMX
    
    RMX should work again with native timings after the previous
    patch.

diff --git a/src/radeon_output.c b/src/radeon_output.c
index a5b1393..45a605d 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -776,10 +776,14 @@ radeon_mode_fixup(xf86OutputPtr output, DisplayModePtr mode,
 	}
     }
 
-    /* update clock for LVDS always and DFP if RMX is active */
-    if ((radeon_output->MonType == MT_LCD) ||
-	((radeon_output->MonType == MT_DFP) &&
-	 (radeon_output->Flags & RADEON_USE_RMX))) {
+    /* update timing for LVDS and DFP if RMX is active */
+    if (radeon_output->Flags & RADEON_USE_RMX) {
+	adjusted_mode->CrtcHTotal     = mode->CrtcHDisplay + radeon_output->HBlank;
+	adjusted_mode->CrtcHSyncStart = mode->CrtcHDisplay + radeon_output->HOverPlus;
+	adjusted_mode->CrtcHSyncEnd   = mode->CrtcHSyncStart + radeon_output->HSyncWidth;
+	adjusted_mode->CrtcVTotal     = mode->CrtcVDisplay + radeon_output->VBlank;
+	adjusted_mode->CrtcVSyncStart = mode->CrtcVDisplay + radeon_output->VOverPlus;
+	adjusted_mode->CrtcVSyncEnd   = mode->CrtcVSyncStart + radeon_output->VSyncWidth;
 	adjusted_mode->Clock          = radeon_output->DotClock;
 	adjusted_mode->Flags          = radeon_output->Flags;
     }

commit 2f87bff293a343b40c1be096933a5ae126632468
Author: Alex Deucher <alex@botch2.(none)>
Date:   Mon Oct 15 20:06:28 2007 -0400

    RADEON: Fix subtle change in crtc reg init
    
    At some point we changed how hsync_wid and vsync_wid were clipped.
    Previously we used the field size as a mask when building the
    register.  This got changed to setting the value to the field
    size if it was greater.  this probably explains number stange
    mode bugs.

diff --git a/src/radeon_crtc.c b/src/radeon_crtc.c
index 4637763..eeb1c6c 100644
--- a/src/radeon_crtc.c
+++ b/src/radeon_crtc.c
@@ -348,11 +348,10 @@ RADEONInitCrtcRegisters(xf86CrtcPtr crtc, RADEONSavePtr save,
 
     hsync_wid = (mode->CrtcHSyncEnd - mode->CrtcHSyncStart) / 8;
     if (!hsync_wid)       hsync_wid = 1;
-    if (hsync_wid > 0x3f) hsync_wid = 0x3f;
     hsync_start = mode->CrtcHSyncStart - 8;
 
     save->crtc_h_sync_strt_wid = ((hsync_start & 0x1fff)
-				  | (hsync_wid << 16)
+				  | ((hsync_wid & 0x3f) << 16)
 				  | ((mode->Flags & V_NHSYNC)
 				     ? RADEON_CRTC_H_SYNC_POL
 				     : 0));
@@ -363,10 +362,9 @@ RADEONInitCrtcRegisters(xf86CrtcPtr crtc, RADEONSavePtr save,
 
     vsync_wid = mode->CrtcVSyncEnd - mode->CrtcVSyncStart;
     if (!vsync_wid)       vsync_wid = 1;
-    if (vsync_wid > 0x1f) vsync_wid = 0x1f;
 
     save->crtc_v_sync_strt_wid = (((mode->CrtcVSyncStart - 1) & 0xfff)
-				  | (vsync_wid << 16)
+				  | ((vsync_wid & 0x1f) << 16)
 				  | ((mode->Flags & V_NVSYNC)
 				     ? RADEON_CRTC_V_SYNC_POL
 				     : 0));
@@ -545,11 +543,10 @@ RADEONInitCrtc2Registers(xf86CrtcPtr crtc, RADEONSavePtr save,
 
     hsync_wid = (mode->CrtcHSyncEnd - mode->CrtcHSyncStart) / 8;
     if (!hsync_wid)       hsync_wid = 1;
-    if (hsync_wid > 0x3f) hsync_wid = 0x3f;
     hsync_start = mode->CrtcHSyncStart - 8;
 
     save->crtc2_h_sync_strt_wid = ((hsync_start & 0x1fff)
-				   | (hsync_wid << 16)
+				   | ((hsync_wid & 0x3f) << 16)
 				   | ((mode->Flags & V_NHSYNC)
 				      ? RADEON_CRTC_H_SYNC_POL
 				      : 0));
@@ -560,10 +557,9 @@ RADEONInitCrtc2Registers(xf86CrtcPtr crtc, RADEONSavePtr save,
 
     vsync_wid = mode->CrtcVSyncEnd - mode->CrtcVSyncStart;
     if (!vsync_wid)       vsync_wid = 1;
-    if (vsync_wid > 0x1f) vsync_wid = 0x1f;
 
     save->crtc2_v_sync_strt_wid = (((mode->CrtcVSyncStart - 1) & 0xfff)
-				   | (vsync_wid << 16)
+				   | ((vsync_wid & 0x1f) << 16)
 				   | ((mode->Flags & V_NVSYNC)
 				      ? RADEON_CRTC2_V_SYNC_POL
 				      : 0));

commit fd5bb7bb5e968127b87102320eccc1222f205e5a
Author: Michel Dänzer <michel@tungstengraphics.com>
Date:   Sat Oct 13 18:56:43 2007 +0200

    radeon: Improve detection of default value for Option "MacModel" on Linux.
    
    * Detect all PowerBooks with dual link DVI (according to developer.apple.com)
      and both Mac Mini G4 models. Other PowerBooks and iBooks should be covered
      by the 'detected as' line in /proc/cpuinfo.
    * Give specific instructions for overriding and reporting incorrect detection.
    * Only perform detection when Option "MacModel" isn't present with a valid
      value.
    * Close /proc/cpuinfo file handle when done with it.
    * Coding style cleanups.

diff --git a/src/radeon_output.c b/src/radeon_output.c
index 0325d84..a5b1393 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -2832,42 +2832,76 @@ static void RADEONSetupGenericConnectors(ScrnInfoPtr pScrn)
 }
 
 #if defined(__powerpc__)
+
 /*
  * Returns RADEONMacModel or 0 based on lines 'detected as' and 'machine'
- * in /proc/cpuinfo file */
-static RADEONMacModel getMacModel (void){
-    RADEONMacModel dviConn = 0;
-    int macmodel = 0;
-    char cpuline[50];  /* 50 should be sufficient for /proc/cpuinfo lines */
+ * in /proc/cpuinfo (on Linux) */
+static RADEONMacModel RADEONDetectMacModel(ScrnInfoPtr pScrn)
+{
+    RADEONMacModel ret = 0;
+#ifdef __linux__
+    char cpuline[50];  /* 50 should be sufficient for our purposes */
     FILE *f = fopen ("/proc/cpuinfo", "r");
-    if (f != NULL){
-        while (fgets (cpuline, sizeof cpuline, f)){
-            char *start;
-            if (!strncmp (cpuline, "machine", strlen ("machine"))){
-                if ((start = strstr (cpuline, "PowerBook")) != NULL)
-                    macmodel = *(start + strlen ("PowerBook")) - '0';
-                /* macmodel cannot be used here, because 'machine' line arrives before 'detected as' line */
-            }else if (!strncmp (cpuline, "detected as", strlen ("detected as"))){
-                if (strstr (cpuline, "iBook"))
-                    dviConn = RADEON_MAC_IBOOK;



Reply to: