xf86-video-ati: Branch 'master'

Alex Deucher agd5f at kemper.freedesktop.org
Sun Oct 7 16:39:57 PDT 2007


 man/radeon.man      |    8 ++++++++
 src/radeon.h        |    5 ++++-
 src/radeon_driver.c |    1 +
 src/radeon_modes.c  |   37 +++++++++++++++++++++++++++++++------
 src/radeon_output.c |    9 +++++++++
 5 files changed, 53 insertions(+), 7 deletions(-)

New commits:
diff-tree 051435610a66735fd455bbb526fa294fcfe8c0b6 (from 0b03a73b7dcb4aa192c42f2a4c842d324c358122)
Author: Alex Deucher <alex at t41p.hsd1.va.comcast.net>
Date:   Sun Oct 7 19:39:47 2007 -0400

    RADEON: still more LVDS fixes
    
    Seems some laptops need the native mode from the bios for
    LVDS while others seem to prefer a CVT mode.  Add an option
    to pick the preferred mode.  The default it to use the bios
    table timing.

diff --git a/man/radeon.man b/man/radeon.man
index 35dd701..9168254 100644
--- a/man/radeon.man
+++ b/man/radeon.man
@@ -383,6 +383,14 @@ case.  This is only useful for LVDS pane
 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 ad94cc5..7248291 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_LVDS_BIOS_NATIVE_MODE
 } RADEONOpts;
 
 
@@ -816,6 +817,8 @@ 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 03f531e..ffd48a5 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_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 ea2c229..6252ea0 100644
--- a/src/radeon_modes.c
+++ b/src/radeon_modes.c
@@ -95,20 +95,45 @@ static DisplayModePtr RADEONTVModes(xf86
 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];
 
     if (radeon_output->PanelXRes != 0 &&
 	radeon_output->PanelYRes != 0 &&
 	radeon_output->DotClock != 0) {
 
-	/* Add native panel size */
-	new = xf86CVTMode(radeon_output->PanelXRes, radeon_output->PanelYRes, 60.0, TRUE, FALSE);
+	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->type       = M_T_DRIVER | M_T_PREFERRED;
+	}
 
-	new->next       = NULL;
-	new->prev       = NULL;
+	if (new) {
+	    new->type       = M_T_DRIVER | M_T_PREFERRED;
+
+	    new->next       = NULL;
+	    new->prev       = NULL;
+	}
 
 	xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Added native panel mode: %dx%d\n",
 		   radeon_output->PanelXRes, radeon_output->PanelYRes);
@@ -159,7 +184,7 @@ static void RADEONAddScreenModes(xf86Out
 	    }
 	}
 
-	new = xf86CVTMode(width, height, 60.0, TRUE, FALSE);
+	new = xf86CVTMode(width, height, 60.0, FALSE, FALSE);
 
 	new->type      |= M_T_USERDEF;
 
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 8f9135d..0836005 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -2440,6 +2440,15 @@ 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


More information about the xorg-commit mailing list