diff options
Diffstat (limited to 'drivers/video/s3fb.c')
-rw-r--r-- | drivers/video/s3fb.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c index a96ac4392173..7d53bc23b9c7 100644 --- a/drivers/video/s3fb.c +++ b/drivers/video/s3fb.c | |||
@@ -400,6 +400,7 @@ static int s3fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | |||
400 | { | 400 | { |
401 | struct s3fb_info *par = info->par; | 401 | struct s3fb_info *par = info->par; |
402 | int rv, mem, step; | 402 | int rv, mem, step; |
403 | u16 m, n, r; | ||
403 | 404 | ||
404 | /* Find appropriate format */ | 405 | /* Find appropriate format */ |
405 | rv = svga_match_format (s3fb_formats, var, NULL); | 406 | rv = svga_match_format (s3fb_formats, var, NULL); |
@@ -427,20 +428,26 @@ static int s3fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) | |||
427 | 428 | ||
428 | /* Check whether have enough memory */ | 429 | /* Check whether have enough memory */ |
429 | mem = ((var->bits_per_pixel * var->xres_virtual) >> 3) * var->yres_virtual; | 430 | mem = ((var->bits_per_pixel * var->xres_virtual) >> 3) * var->yres_virtual; |
430 | if (mem > info->screen_size) | 431 | if (mem > info->screen_size) { |
431 | { | ||
432 | printk(KERN_ERR "fb%d: not enough framebuffer memory (%d kB requested , %d kB available)\n", | 432 | printk(KERN_ERR "fb%d: not enough framebuffer memory (%d kB requested , %d kB available)\n", |
433 | info->node, mem >> 10, (unsigned int) (info->screen_size >> 10)); | 433 | info->node, mem >> 10, (unsigned int) (info->screen_size >> 10)); |
434 | return -EINVAL; | 434 | return -EINVAL; |
435 | } | 435 | } |
436 | 436 | ||
437 | rv = svga_check_timings (&s3_timing_regs, var, info->node); | 437 | rv = svga_check_timings (&s3_timing_regs, var, info->node); |
438 | if (rv < 0) | 438 | if (rv < 0) { |
439 | { | ||
440 | printk(KERN_ERR "fb%d: invalid timings requested\n", info->node); | 439 | printk(KERN_ERR "fb%d: invalid timings requested\n", info->node); |
441 | return rv; | 440 | return rv; |
442 | } | 441 | } |
443 | 442 | ||
443 | rv = svga_compute_pll(&s3_pll, PICOS2KHZ(var->pixclock), &m, &n, &r, | ||
444 | info->node); | ||
445 | if (rv < 0) { | ||
446 | printk(KERN_ERR "fb%d: invalid pixclock value requested\n", | ||
447 | info->node); | ||
448 | return rv; | ||
449 | } | ||
450 | |||
444 | return 0; | 451 | return 0; |
445 | } | 452 | } |
446 | 453 | ||