diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/aty/atyfb_base.c | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index 80600da29137..4c46706188fe 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c | |||
@@ -109,9 +109,18 @@ | |||
109 | #define GUI_RESERVE (1 * PAGE_SIZE) | 109 | #define GUI_RESERVE (1 * PAGE_SIZE) |
110 | 110 | ||
111 | /* FIXME: remove the FAIL definition */ | 111 | /* FIXME: remove the FAIL definition */ |
112 | #define FAIL(msg) do { printk(KERN_CRIT "atyfb: " msg "\n"); return -EINVAL; } while (0) | 112 | #define FAIL(msg) do { \ |
113 | #define FAIL_MAX(msg, x, _max_) do { if(x > _max_) { printk(KERN_CRIT "atyfb: " msg " %x(%x)\n", x, _max_); return -EINVAL; } } while (0) | 113 | if (!(var->activate & FB_ACTIVATE_TEST)) \ |
114 | 114 | printk(KERN_CRIT "atyfb: " msg "\n"); \ | |
115 | return -EINVAL; \ | ||
116 | } while (0) | ||
117 | #define FAIL_MAX(msg, x, _max_) do { \ | ||
118 | if (x > _max_) { \ | ||
119 | if (!(var->activate & FB_ACTIVATE_TEST)) \ | ||
120 | printk(KERN_CRIT "atyfb: " msg " %x(%x)\n", x, _max_); \ | ||
121 | return -EINVAL; \ | ||
122 | } \ | ||
123 | } while (0) | ||
115 | #ifdef DEBUG | 124 | #ifdef DEBUG |
116 | #define DPRINTK(fmt, args...) printk(KERN_DEBUG "atyfb: " fmt, ## args) | 125 | #define DPRINTK(fmt, args...) printk(KERN_DEBUG "atyfb: " fmt, ## args) |
117 | #else | 126 | #else |
@@ -840,11 +849,14 @@ static int aty_var_to_crtc(const struct fb_info *info, | |||
840 | know if one is connected. So it's better to fail then. | 849 | know if one is connected. So it's better to fail then. |
841 | */ | 850 | */ |
842 | if (crtc->lcd_gen_cntl & CRT_ON) { | 851 | if (crtc->lcd_gen_cntl & CRT_ON) { |
843 | PRINTKI("Disable LCD panel, because video mode does not fit.\n"); | 852 | if (!(var->activate & FB_ACTIVATE_TEST)) |
853 | PRINTKI("Disable LCD panel, because video mode does not fit.\n"); | ||
844 | crtc->lcd_gen_cntl &= ~LCD_ON; | 854 | crtc->lcd_gen_cntl &= ~LCD_ON; |
845 | /*aty_st_lcd(LCD_GEN_CNTL, crtc->lcd_gen_cntl, par);*/ | 855 | /*aty_st_lcd(LCD_GEN_CNTL, crtc->lcd_gen_cntl, par);*/ |
846 | } else { | 856 | } else { |
847 | FAIL("Video mode exceeds size of LCD panel.\nConnect this computer to a conventional monitor if you really need this mode."); | 857 | if (!(var->activate & FB_ACTIVATE_TEST)) |
858 | PRINTKE("Video mode exceeds size of LCD panel.\nConnect this computer to a conventional monitor if you really need this mode.\n"); | ||
859 | return -EINVAL; | ||
848 | } | 860 | } |
849 | } | 861 | } |
850 | } | 862 | } |
@@ -1184,7 +1196,8 @@ static int aty_crtc_to_var(const struct crtc *crtc, struct fb_var_screeninfo *va | |||
1184 | var->transp.length = 8; | 1196 | var->transp.length = 8; |
1185 | break; | 1197 | break; |
1186 | default: | 1198 | default: |
1187 | FAIL("Invalid pixel width"); | 1199 | PRINTKE("Invalid pixel width\n"); |
1200 | return -EINVAL; | ||
1188 | } | 1201 | } |
1189 | 1202 | ||
1190 | /* output */ | 1203 | /* output */ |
@@ -1241,7 +1254,8 @@ static int atyfb_set_par(struct fb_info *info) | |||
1241 | pixclock = atyfb_get_pixclock(var, par); | 1254 | pixclock = atyfb_get_pixclock(var, par); |
1242 | 1255 | ||
1243 | if (pixclock == 0) { | 1256 | if (pixclock == 0) { |
1244 | FAIL("Invalid pixclock"); | 1257 | PRINTKE("Invalid pixclock\n"); |
1258 | return -EINVAL; | ||
1245 | } else { | 1259 | } else { |
1246 | if((err = par->pll_ops->var_to_pll(info, pixclock, var->bits_per_pixel, &par->pll))) | 1260 | if((err = par->pll_ops->var_to_pll(info, pixclock, var->bits_per_pixel, &par->pll))) |
1247 | return err; | 1261 | return err; |
@@ -1446,7 +1460,9 @@ static int atyfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | |||
1446 | pixclock = atyfb_get_pixclock(var, par); | 1460 | pixclock = atyfb_get_pixclock(var, par); |
1447 | 1461 | ||
1448 | if (pixclock == 0) { | 1462 | if (pixclock == 0) { |
1449 | FAIL("Invalid pixclock"); | 1463 | if (!(var->activate & FB_ACTIVATE_TEST)) |
1464 | PRINTKE("Invalid pixclock\n"); | ||
1465 | return -EINVAL; | ||
1450 | } else { | 1466 | } else { |
1451 | if((err = par->pll_ops->var_to_pll(info, pixclock, var->bits_per_pixel, &pll))) | 1467 | if((err = par->pll_ops->var_to_pll(info, pixclock, var->bits_per_pixel, &pll))) |
1452 | return err; | 1468 | return err; |