SOURCES: kernel-vesa-upstream.patch (NEW) - fix uvesafb_vbe_getmodes() for ...

pluto pluto at pld-linux.org
Mon Sep 22 13:37:02 CEST 2008


Author: pluto                        Date: Mon Sep 22 11:37:02 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- fix uvesafb_vbe_getmodes() for some broken bioses.
- prevent black-screen-of-death when vga=.. is passed w/o any builtin vesa driver.

---- Files affected:
SOURCES:
   kernel-vesa-upstream.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: SOURCES/kernel-vesa-upstream.patch
diff -u /dev/null SOURCES/kernel-vesa-upstream.patch:1.1
--- /dev/null	Mon Sep 22 13:37:03 2008
+++ SOURCES/kernel-vesa-upstream.patch	Mon Sep 22 13:36:57 2008
@@ -0,0 +1,87 @@
+http://lkml.org/lkml/2008/9/21/136
+uvesafb: don't treat mode info retrieval failures as errors
+
+http://lkml.org/lkml/2008/9/21/141
+fbdev: don't allow to set a video mode via vga= if FB doesn't support it
+
+diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
+index 5074422..6c2d37f 100644
+--- a/drivers/video/uvesafb.c
++++ b/drivers/video/uvesafb.c
+@@ -516,10 +516,12 @@ static int __devinit uvesafb_vbe_getmodes(struct uvesafb_ktask *task,
+ 
+ 		err = uvesafb_exec(task);
+ 		if (err || (task->t.regs.eax & 0xffff) != 0x004f) {
+-			printk(KERN_ERR "uvesafb: Getting mode info block "
++			printk(KERN_WARNING "uvesafb: Getting mode info block "
+ 				"for mode 0x%x failed (eax=0x%x, err=%d)\n",
+ 				*mode, (u32)task->t.regs.eax, err);
+-			return -EINVAL;
++			mode++;
++			par->vbe_modes_cnt--;
++			continue;
+ 		}
+ 
+ 		mib = task->buf;
+@@ -548,7 +550,10 @@ static int __devinit uvesafb_vbe_getmodes(struct uvesafb_ktask *task,
+ 			mib->depth = mib->bits_per_pixel;
+ 	}
+ 
+-	return 0;
++	if (par->vbe_modes_cnt > 0)
++		return 0;
++	else
++		return -EINVAL;
+ }
+ 
+ /*
+diff --git a/arch/x86/boot/video-vesa.c b/arch/x86/boot/video-vesa.c
+index 401ad99..32a6045 100644
+--- a/arch/x86/boot/video-vesa.c
++++ b/arch/x86/boot/video-vesa.c
+@@ -88,14 +88,11 @@ static int vesa_probe(void)
+ 			   (vminfo.memory_layout == 4 ||
+ 			    vminfo.memory_layout == 6) &&
+ 			   vminfo.memory_planes == 1) {
+-#ifdef CONFIG_FB
++#if FB_SUPPORTS_BOOT_VESA
+ 			/* Graphics mode, color, linear frame buffer
+ 			   supported.  Only register the mode if
+ 			   if framebuffer is configured, however,
+-			   otherwise the user will be left without a screen.
+-			   We don't require CONFIG_FB_VESA, however, since
+-			   some of the other framebuffer drivers can use
+-			   this mode-setting, too. */
++			   otherwise the user will be left without a screen. */
+ 			mi = GET_HEAP(struct mode_info, 1);
+ 			mi->mode = mode + VIDEO_FIRST_VESA;
+ 			mi->depth = vminfo.bpp;
+@@ -134,9 +131,13 @@ static int vesa_set_mode(struct mode_info *mode)
+ 		/* It's a supported text mode */
+ 		is_graphic = 0;
+ 	} else if ((vminfo.mode_attr & 0x99) == 0x99) {
++#if FB_SUPPORTS_BOOT_VESA
+ 		/* It's a graphics mode with linear frame buffer */
+ 		is_graphic = 1;
+ 		vesa_mode |= 0x4000; /* Request linear frame buffer */
++#else
++		return -1;
++#endif
+ 	} else {
+ 		return -1;	/* Invalid mode */
+ 	}
+diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h
+index 1ee2c05..20fdc2f 100644
+--- a/include/linux/screen_info.h
++++ b/include/linux/screen_info.h
+@@ -76,6 +76,10 @@ extern struct screen_info screen_info;
+ #define ORIG_VIDEO_LINES	(screen_info.orig_video_lines)
+ #define ORIG_VIDEO_ISVGA	(screen_info.orig_video_isVGA)
+ #define ORIG_VIDEO_POINTS       (screen_info.orig_video_points)
++
++#define FB_SUPPORTS_BOOT_VESA (defined(CONFIG_FB_VESA) || \
++		defined(CONFIG_FB_SIS) || defined(CONFIG_FB_IMAC) || \
++		defined(CONFIG_FB_INTEL))
+ #endif /* __KERNEL__ */
+ 
+ #endif /* _SCREEN_INFO_H */
================================================================


More information about the pld-cvs-commit mailing list