diff options
author | Alex Deucher <alex@t41p.hsd1.va.comcast.net> | 2007-10-07 19:39:47 -0400 |
---|---|---|
committer | Alex Deucher <alex@t41p.hsd1.va.comcast.net> | 2007-10-07 19:39:47 -0400 |
commit | 051435610a66735fd455bbb526fa294fcfe8c0b6 (patch) | |
tree | 9f001ba1feae6d10e2327cea09be2e8e74494679 /src | |
parent | 0b03a73b7dcb4aa192c42f2a4c842d324c358122 (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/radeon.h | 5 | ||||
-rw-r--r-- | src/radeon_driver.c | 1 | ||||
-rw-r--r-- | src/radeon_modes.c | 37 | ||||
-rw-r--r-- | src/radeon_output.c | 9 |
4 files changed, 45 insertions, 7 deletions
diff --git a/src/radeon.h b/src/radeon.h index ad94cc51..7248291f 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 03f531e9..ffd48a5c 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 ea2c2291..6252ea05 100644 --- a/src/radeon_modes.c +++ b/src/radeon_modes.c @@ -95,20 +95,45 @@ 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]; 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->type = M_T_DRIVER | M_T_PREFERRED; + 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->next = NULL; - new->prev = NULL; + 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); + + } + + 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(xf86OutputPtr output, DisplayModePtr *modeList) } } - 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 8f9135d8..08360052 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 |