Commit 1bae852fb0beca3cc95b8de84efbc7254cae62e1

Authored by Tormod Volden
Committed by Paul Mundt
1 parent 554cc10286

savagefb: Use panel CVT mode as default

If there is no EDID but an LCD panel is detected, generate a CVT
mode from the panel resolution (at 60 Hz), and use this as a
default mode instead of the hardcoded 800x600x8 mode.

Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>

Showing 2 changed files with 17 additions and 0 deletions Side-by-side Diff

drivers/video/modedb.c
... ... @@ -1128,4 +1128,5 @@
1128 1128 EXPORT_SYMBOL(fb_find_nearest_mode);
1129 1129 EXPORT_SYMBOL(fb_videomode_to_modelist);
1130 1130 EXPORT_SYMBOL(fb_find_mode);
  1131 +EXPORT_SYMBOL(fb_find_mode_cvt);
drivers/video/savage/savagefb_driver.c
... ... @@ -2237,6 +2237,22 @@
2237 2237 &info->modelist);
2238 2238 #endif
2239 2239 info->var = savagefb_var800x600x8;
  2240 + /* if a panel was detected, default to a CVT mode instead */
  2241 + if (par->SavagePanelWidth) {
  2242 + struct fb_videomode cvt_mode;
  2243 +
  2244 + memset(&cvt_mode, 0, sizeof(cvt_mode));
  2245 + cvt_mode.xres = par->SavagePanelWidth;
  2246 + cvt_mode.yres = par->SavagePanelHeight;
  2247 + cvt_mode.refresh = 60;
  2248 + /* FIXME: if we know there is only the panel
  2249 + * we can enable reduced blanking as well */
  2250 + if (fb_find_mode_cvt(&cvt_mode, 0, 0))
  2251 + printk(KERN_WARNING "No CVT mode found for panel\n");
  2252 + else if (fb_find_mode(&info->var, info, NULL, NULL, 0,
  2253 + &cvt_mode, 0) != 3)
  2254 + info->var = savagefb_var800x600x8;
  2255 + }
2240 2256  
2241 2257 if (mode_option) {
2242 2258 fb_find_mode(&info->var, info, mode_option,