From 051435610a66735fd455bbb526fa294fcfe8c0b6 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Sun, 7 Oct 2007 19:39:47 -0400 Subject: 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. --- src/radeon_modes.c | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) (limited to 'src/radeon_modes.c') 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; -- cgit v1.2.3