diff options
author | Michal Januszewski <spock@gentoo.org> | 2008-10-16 01:03:51 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-16 14:21:45 -0400 |
commit | 4d31a2b74c6d063362ae10ce3be3e80d8713bf23 (patch) | |
tree | c125a2e581620a333437bcc5b3e75d24af928c58 /arch/x86/boot/video-vesa.c | |
parent | 5ab4840968cd094586f65fce978e35c66d25ac78 (diff) |
fbdev: ignore VESA modes if framebuffer does not support them
Currently, it is possible to set a graphics VESA 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.
Fix this problem by only allowing to set graphics modes at boot time if a
supporting framebuffer driver is configured.
Signed-off-by: Michal Januszewski <spock@gentoo.org>
Acked-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86/boot/video-vesa.c')
-rw-r--r-- | arch/x86/boot/video-vesa.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/x86/boot/video-vesa.c b/arch/x86/boot/video-vesa.c index 1e6fe0214c85..99b3079dc6ab 100644 --- a/arch/x86/boot/video-vesa.c +++ b/arch/x86/boot/video-vesa.c | |||
@@ -88,14 +88,11 @@ static int vesa_probe(void) | |||
88 | (vminfo.memory_layout == 4 || | 88 | (vminfo.memory_layout == 4 || |
89 | vminfo.memory_layout == 6) && | 89 | vminfo.memory_layout == 6) && |
90 | vminfo.memory_planes == 1) { | 90 | vminfo.memory_planes == 1) { |
91 | #ifdef CONFIG_FB | 91 | #ifdef CONFIG_FB_BOOT_VESA_SUPPORT |
92 | /* Graphics mode, color, linear frame buffer | 92 | /* Graphics mode, color, linear frame buffer |
93 | supported. Only register the mode if | 93 | supported. Only register the mode if |
94 | if framebuffer is configured, however, | 94 | if framebuffer is configured, however, |
95 | otherwise the user will be left without a screen. | 95 | otherwise the user will be left without a screen. */ |
96 | We don't require CONFIG_FB_VESA, however, since | ||
97 | some of the other framebuffer drivers can use | ||
98 | this mode-setting, too. */ | ||
99 | mi = GET_HEAP(struct mode_info, 1); | 96 | mi = GET_HEAP(struct mode_info, 1); |
100 | mi->mode = mode + VIDEO_FIRST_VESA; | 97 | mi->mode = mode + VIDEO_FIRST_VESA; |
101 | mi->depth = vminfo.bpp; | 98 | mi->depth = vminfo.bpp; |
@@ -133,10 +130,12 @@ static int vesa_set_mode(struct mode_info *mode) | |||
133 | if ((vminfo.mode_attr & 0x15) == 0x05) { | 130 | if ((vminfo.mode_attr & 0x15) == 0x05) { |
134 | /* It's a supported text mode */ | 131 | /* It's a supported text mode */ |
135 | is_graphic = 0; | 132 | is_graphic = 0; |
133 | #ifdef CONFIG_FB_BOOT_VESA_SUPPORT | ||
136 | } else if ((vminfo.mode_attr & 0x99) == 0x99) { | 134 | } else if ((vminfo.mode_attr & 0x99) == 0x99) { |
137 | /* It's a graphics mode with linear frame buffer */ | 135 | /* It's a graphics mode with linear frame buffer */ |
138 | is_graphic = 1; | 136 | is_graphic = 1; |
139 | vesa_mode |= 0x4000; /* Request linear frame buffer */ | 137 | vesa_mode |= 0x4000; /* Request linear frame buffer */ |
138 | #endif | ||
140 | } else { | 139 | } else { |
141 | return -1; /* Invalid mode */ | 140 | return -1; /* Invalid mode */ |
142 | } | 141 | } |