Thread (7 messages) 7 messages, 5 authors, 2008-09-22

Re: [PATCH] fbdev: don't allow to set a video mode via vga= if FB doesn't support it

flat view

From: Krzysztof Helt <hidden>
Date: 2008-09-22 19:50:22
Also in: lkml

On Sun, 21 Sep 2008 23:02:19 +0200
Michal Januszewski [off-list ref] wrote:
From: Michal Januszewski <spock@gentoo.org>

Currently, it is possible to set a VESA graphics mode at boot time via
the vga= parameter even when no framebuffer driver supporting this is
configured.  This could lead to the system booting with a black screen,
without a usable console.
Right.
quoted hunk ↗ jump to hunk
---
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
@@ -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 */
 	}

This one could be simpler:

  		/* It's a supported text mode */
  		is_graphic = 0;
 +#if FB_SUPPORTS_BOOT_VESA
  	} else if ((vminfo.mode_attr & 0x99) == 0x99) {
  		/* It's a graphics mode with linear frame buffer */
  		is_graphic = 1;
  		vesa_mode |= 0x4000; /* Request linear frame buffer */
 +#endif
  	} else {
  		return -1;	/* Invalid mode */
  	}


Other than this, the patch is fine to me.

Acked-by: Krzysztof Helt <redacted>

Regards,
Krzysztof

----------------------------------------------------------------------
Kredyt Hipoteczny w Banku Millennium - zdobywca Zlotego Lauru Klienta!
Sprawdz >> http://link.interia.pl/f1f15
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help