diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2009-03-04 02:52:36 -0500 |
---|---|---|
committer | Alex Deucher <alexdeucher@gmail.com> | 2009-03-04 02:52:36 -0500 |
commit | e88b0eac8cab8b54b769fd7b4ad3b3b65a90de09 (patch) | |
tree | 4edd01d79a75571bab0a31a4dde986ea27e6ab8d /src | |
parent | 2bb319fd80d20a3d4e5cc9416891bc7e4c3e431e (diff) |
radeon: just add some common modes for LVDS
avoids needing to hack around with the edid
Diffstat (limited to 'src')
-rw-r--r-- | src/radeon_modes.c | 56 |
1 files changed, 55 insertions, 1 deletions
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; } |