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/radeon_modes.c | |
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/radeon_modes.c')
-rw-r--r-- | src/radeon_modes.c | 37 |
1 files changed, 31 insertions, 6 deletions
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; |