aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/s3fb.c
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2007-10-16 04:29:52 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:43:22 -0400
commitd4b766a0bdab8d07b720c8d0a84292949a7d58bd (patch)
tree995e1dc7b1f0c172c4f53acad3a236138d378ce2 /drivers/video/s3fb.c
parentd7dd91ff236b90a8aca2d619554b07bcb82953c7 (diff)
svgalib: mode selection updates
This patch changes mode selection matching algorithm. It allows to choose mode with matching depth even when requested color lengths are greater than color lengths of every mode with requested color depth. It also fixes bug in s3fb - wrong error value returned when format is not supported by chip. Signed-off-by: Ondrej Zajicek <santiago@crfreenet.org> Signed-off-by: Antonino Daplas <adaplas@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/s3fb.c')
-rw-r--r--drivers/video/s3fb.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/video/s3fb.c b/drivers/video/s3fb.c
index d11735895a01..a96ac4392173 100644
--- a/drivers/video/s3fb.c
+++ b/drivers/video/s3fb.c
@@ -403,8 +403,13 @@ static int s3fb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
403 403
404 /* Find appropriate format */ 404 /* Find appropriate format */
405 rv = svga_match_format (s3fb_formats, var, NULL); 405 rv = svga_match_format (s3fb_formats, var, NULL);
406 if ((rv < 0) || ((par->chip == CHIP_988_VIRGE_VX) ? (rv == 7) : (rv == 6))) 406
407 { /* 24bpp on VIRGE VX, 32bpp on others */ 407 /* 32bpp mode is not supported on VIRGE VX,
408 24bpp is not supported on others */
409 if ((par->chip == CHIP_988_VIRGE_VX) ? (rv == 7) : (rv == 6))
410 rv = -EINVAL;
411
412 if (rv < 0) {
408 printk(KERN_ERR "fb%d: unsupported mode requested\n", info->node); 413 printk(KERN_ERR "fb%d: unsupported mode requested\n", info->node);
409 return rv; 414 return rv;
410 } 415 }