From bc95471091366916c88b486027f1933f5918bad1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20K=C3=BChling?= Date: Wed, 9 Feb 2011 22:27:47 +0100 Subject: [PATCH] svgalib: fix mode detection (used to detect non-existent 24-bit modes) --- .../patches/110-fbdev-fix-mode-check.patch | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 svgalib/patches/110-fbdev-fix-mode-check.patch diff --git a/svgalib/patches/110-fbdev-fix-mode-check.patch b/svgalib/patches/110-fbdev-fix-mode-check.patch new file mode 100644 index 0000000..07b61c8 --- /dev/null +++ b/svgalib/patches/110-fbdev-fix-mode-check.patch @@ -0,0 +1,29 @@ +Index: svgalib-1.4.3/src/fbdev.c +=================================================================== +--- svgalib-1.4.3.orig/src/fbdev.c 2011-02-09 21:45:00.000000000 +0100 ++++ svgalib-1.4.3/src/fbdev.c 2011-02-09 21:46:42.000000000 +0100 +@@ -273,11 +273,13 @@ + { + struct fb_var_screeninfo info; + unsigned g; ++ int bpp; + + if (fbdev_screeninfo(&info, mode)) + return 0; + + g = info.green.length; ++ bpp = info.bits_per_pixel; + + info.activate = FB_ACTIVATE_TEST; + if (ioctl(fbdev_fd, FBIOPUT_VSCREENINFO, &info)) +@@ -287,6 +289,10 @@ + info.green.length != g) + return 0; + ++ /* sometimes sets 32-bit modes when 24-bit is requested */ ++ if (info.bits_per_pixel != bpp) ++ return 0; ++ + /* We may need to add more checks here. */ + + return SVGADRV;