aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/aty/atyfb_base.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/aty/atyfb_base.c')
-rw-r--r--drivers/video/aty/atyfb_base.c59
1 files changed, 44 insertions, 15 deletions
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
index 037fe9d32fe3..08edbfcfca58 100644
--- a/drivers/video/aty/atyfb_base.c
+++ b/drivers/video/aty/atyfb_base.c
@@ -292,7 +292,6 @@ static struct fb_ops atyfb_ops = {
292 .fb_fillrect = atyfb_fillrect, 292 .fb_fillrect = atyfb_fillrect,
293 .fb_copyarea = atyfb_copyarea, 293 .fb_copyarea = atyfb_copyarea,
294 .fb_imageblit = atyfb_imageblit, 294 .fb_imageblit = atyfb_imageblit,
295 .fb_cursor = soft_cursor,
296#ifdef __sparc__ 295#ifdef __sparc__
297 .fb_mmap = atyfb_mmap, 296 .fb_mmap = atyfb_mmap,
298#endif 297#endif
@@ -2157,11 +2156,38 @@ static void __init aty_calc_mem_refresh(struct atyfb_par *par, int xclk)
2157 2156
2158static struct fb_info *fb_list = NULL; 2157static struct fb_info *fb_list = NULL;
2159 2158
2159#if defined(__i386__) && defined(CONFIG_FB_ATY_GENERIC_LCD)
2160static int __devinit atyfb_get_timings_from_lcd(struct atyfb_par *par,
2161 struct fb_var_screeninfo *var)
2162{
2163 int ret = -EINVAL;
2164
2165 if (par->lcd_table != 0 && (aty_ld_lcd(LCD_GEN_CNTL, par) & LCD_ON)) {
2166 *var = default_var;
2167 var->xres = var->xres_virtual = par->lcd_hdisp;
2168 var->right_margin = par->lcd_right_margin;
2169 var->left_margin = par->lcd_hblank_len -
2170 (par->lcd_right_margin + par->lcd_hsync_dly +
2171 par->lcd_hsync_len);
2172 var->hsync_len = par->lcd_hsync_len + par->lcd_hsync_dly;
2173 var->yres = var->yres_virtual = par->lcd_vdisp;
2174 var->lower_margin = par->lcd_lower_margin;
2175 var->upper_margin = par->lcd_vblank_len -
2176 (par->lcd_lower_margin + par->lcd_vsync_len);
2177 var->vsync_len = par->lcd_vsync_len;
2178 var->pixclock = par->lcd_pixclock;
2179 ret = 0;
2180 }
2181
2182 return ret;
2183}
2184#endif /* defined(__i386__) && defined(CONFIG_FB_ATY_GENERIC_LCD) */
2185
2160static int __init aty_init(struct fb_info *info, const char *name) 2186static int __init aty_init(struct fb_info *info, const char *name)
2161{ 2187{
2162 struct atyfb_par *par = (struct atyfb_par *) info->par; 2188 struct atyfb_par *par = (struct atyfb_par *) info->par;
2163 const char *ramname = NULL, *xtal; 2189 const char *ramname = NULL, *xtal;
2164 int gtb_memsize; 2190 int gtb_memsize, has_var = 0;
2165 struct fb_var_screeninfo var; 2191 struct fb_var_screeninfo var;
2166 u8 pll_ref_div; 2192 u8 pll_ref_div;
2167 u32 i; 2193 u32 i;
@@ -2469,8 +2495,8 @@ static int __init aty_init(struct fb_info *info, const char *name)
2469 * applies to all Mac video cards 2495 * applies to all Mac video cards
2470 */ 2496 */
2471 if (mode) { 2497 if (mode) {
2472 if (!mac_find_mode(&var, info, mode, 8)) 2498 if (mac_find_mode(&var, info, mode, 8))
2473 var = default_var; 2499 has_var = 1;
2474 } else { 2500 } else {
2475 if (default_vmode == VMODE_CHOOSE) { 2501 if (default_vmode == VMODE_CHOOSE) {
2476 if (M64_HAS(G3_PB_1024x768)) 2502 if (M64_HAS(G3_PB_1024x768))
@@ -2492,20 +2518,23 @@ static int __init aty_init(struct fb_info *info, const char *name)
2492 default_vmode = VMODE_640_480_60; 2518 default_vmode = VMODE_640_480_60;
2493 if (default_cmode < CMODE_8 || default_cmode > CMODE_32) 2519 if (default_cmode < CMODE_8 || default_cmode > CMODE_32)
2494 default_cmode = CMODE_8; 2520 default_cmode = CMODE_8;
2495 if (mac_vmode_to_var(default_vmode, default_cmode, &var)) 2521 if (!mac_vmode_to_var(default_vmode, default_cmode,
2496 var = default_var; 2522 &var))
2523 has_var = 1;
2497 } 2524 }
2498 } else 2525 }
2526
2499#endif /* !CONFIG_PPC */ 2527#endif /* !CONFIG_PPC */
2500 if ( 2528
2501#if defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) 2529#if defined(__i386__) && defined(CONFIG_FB_ATY_GENERIC_LCD)
2502 /* On Sparc, unless the user gave a specific mode 2530 if (!atyfb_get_timings_from_lcd(par, &var))
2503 * specification, use the PROM probed values in 2531 has_var = 1;
2504 * default_var.
2505 */
2506 !mode ||
2507#endif 2532#endif
2508 !fb_find_mode(&var, info, mode, NULL, 0, &defmode, 8)) 2533
2534 if (mode && fb_find_mode(&var, info, mode, NULL, 0, &defmode, 8))
2535 has_var = 1;
2536
2537 if (!has_var)
2509 var = default_var; 2538 var = default_var;
2510 2539
2511 if (noaccel) 2540 if (noaccel)