Skip to contentSkip to conversation

svgalib: mode selection updates

PATCH New Ondrej Zajicek 1 participant 1 message Oct 1, 2007 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---

drivers/video/s3fb.c +7 -2
diff -uprN -X linux-2.6.22/Documentation/dontdiff linux-2.6.22/drivers/video/s3fb.c linux-2.6.22-p1/drivers/video/s3fb.c
@@ -403,8 +403,13 @@ static int s3fb_check_var(struct fb_var_
 
 	/* Find appropriate format */
 	rv = svga_match_format (s3fb_formats, var, NULL);
-	if ((rv < 0) || ((par->chip == CHIP_988_VIRGE_VX) ? (rv == 7) : (rv == 6)))
-	{		/* 24bpp on VIRGE VX, 32bpp on others */
+
+	/* 32bpp mode is not supported on VIRGE VX,
+	   24bpp is not supported on others */
+	if ((par->chip == CHIP_988_VIRGE_VX) ? (rv == 7) : (rv == 6))
+		rv = -EINVAL;
+
+	if (rv < 0) {
 		printk(KERN_ERR "fb%d: unsupported mode requested\n", info->node);
 		return rv;
 	}
drivers/video/svgalib.c +29 -17

63 lines not on this page · raw message

Signature · 10 lines
Elen sila lumenn' omentielvo

Ondrej 'SanTiago' Zajicek (email: [email protected], jabber: [email protected])
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/