From e88b0eac8cab8b54b769fd7b4ad3b3b65a90de09 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 4 Mar 2009 02:52:36 -0500 Subject: radeon: just add some common modes for LVDS avoids needing to hack around with the edid --- src/radeon_modes.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/src/radeon_modes.c b/src/radeon_modes.c index 0a8fa001..3545cdc4 100644 --- a/src/radeon_modes.c +++ b/src/radeon_modes.c @@ -415,6 +415,56 @@ RADEONUpdatePanelSize(xf86OutputPtr output) } } +static void +radeon_add_common_modes(xf86OutputPtr output, DisplayModePtr modes) +{ + RADEONOutputPrivatePtr radeon_output = output->driver_private; + radeon_native_mode_ptr native_mode = &radeon_output->native_mode; + DisplayModePtr last = NULL; + DisplayModePtr new = NULL; + DisplayModePtr first = NULL; + int i; + /* Add some common sizes */ + int widths[10] = {640, 800, 1024, 1280, 1280, 1440, 1400, 1680, 1600, 1920}; + int heights[10] = {480, 600, 768, 960, 1024, 900, 1050, 1050, 1200, 1200}; + + for (i = 0; i < 10; i++) { + if (radeon_output->active_device & (ATOM_DEVICE_LCD_SUPPORT)) { + /* already added the native mode */ + if (widths[i] == native_mode->PanelXRes && heights[i] == native_mode->PanelYRes) + continue; + + /* Note: We allow all non-standard modes as long as they do not + * exceed the native resolution of the panel. Since these modes + * need the internal RMX unit in the video chips (and there is + * only one per card), this will only apply to the primary head. + */ + if (widths[i] < 320 || widths[i] > native_mode->PanelXRes || + heights[i] < 200 || heights[i] > native_mode->PanelYRes) + continue; + } + + new = xf86CVTMode(widths[i], heights[i], 60.0, FALSE, FALSE); + + new->type = M_T_DRIVER; + + new->next = NULL; + new->prev = last; + + if (last) last->next = new; + last = new; + if (!first) first = new; + } + + if (last) { + last->next = NULL; //first; + first->prev = NULL; //last; + } + + xf86ModesAdd(modes, first); + +} + DisplayModePtr RADEONProbeOutputModes(xf86OutputPtr output) { @@ -463,12 +513,16 @@ RADEONProbeOutputModes(xf86OutputPtr output) if (radeon_output->active_device & (ATOM_DEVICE_LCD_SUPPORT)) modes = RADEONFPNativeMode(output); /* add the screen modes */ - RADEONAddScreenModes(output, &modes); + if (modes == NULL) + RADEONAddScreenModes(output, &modes); } } } } + if (radeon_output->active_device & (ATOM_DEVICE_LCD_SUPPORT)) + radeon_add_common_modes(output, modes); + return modes; } -- cgit v1.2.3