]>
Commit | Line | Data |
---|---|---|
c0396172 | 1 | http://lkml.org/lkml/2008/9/21/136 |
2 | uvesafb: don't treat mode info retrieval failures as errors | |
3 | ||
4 | http://lkml.org/lkml/2008/9/21/141 | |
5 | fbdev: don't allow to set a video mode via vga= if FB doesn't support it | |
6 | ||
7 | diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c | |
8 | index 5074422..6c2d37f 100644 | |
9 | --- a/drivers/video/uvesafb.c | |
10 | +++ b/drivers/video/uvesafb.c | |
11 | @@ -516,10 +516,12 @@ static int __devinit uvesafb_vbe_getmodes(struct uvesafb_ktask *task, | |
12 | ||
13 | err = uvesafb_exec(task); | |
14 | if (err || (task->t.regs.eax & 0xffff) != 0x004f) { | |
15 | - printk(KERN_ERR "uvesafb: Getting mode info block " | |
16 | + printk(KERN_WARNING "uvesafb: Getting mode info block " | |
17 | "for mode 0x%x failed (eax=0x%x, err=%d)\n", | |
18 | *mode, (u32)task->t.regs.eax, err); | |
19 | - return -EINVAL; | |
20 | + mode++; | |
21 | + par->vbe_modes_cnt--; | |
22 | + continue; | |
23 | } | |
24 | ||
25 | mib = task->buf; | |
26 | @@ -548,7 +550,10 @@ static int __devinit uvesafb_vbe_getmodes(struct uvesafb_ktask *task, | |
27 | mib->depth = mib->bits_per_pixel; | |
28 | } | |
29 | ||
30 | - return 0; | |
31 | + if (par->vbe_modes_cnt > 0) | |
32 | + return 0; | |
33 | + else | |
34 | + return -EINVAL; | |
35 | } | |
36 | ||
37 | /* | |
38 | diff --git a/arch/x86/boot/video-vesa.c b/arch/x86/boot/video-vesa.c | |
39 | index 401ad99..32a6045 100644 | |
40 | --- a/arch/x86/boot/video-vesa.c | |
41 | +++ b/arch/x86/boot/video-vesa.c | |
42 | @@ -88,14 +88,11 @@ static int vesa_probe(void) | |
43 | (vminfo.memory_layout == 4 || | |
44 | vminfo.memory_layout == 6) && | |
45 | vminfo.memory_planes == 1) { | |
46 | -#ifdef CONFIG_FB | |
47 | +#if FB_SUPPORTS_BOOT_VESA | |
48 | /* Graphics mode, color, linear frame buffer | |
49 | supported. Only register the mode if | |
50 | if framebuffer is configured, however, | |
51 | - otherwise the user will be left without a screen. | |
52 | - We don't require CONFIG_FB_VESA, however, since | |
53 | - some of the other framebuffer drivers can use | |
54 | - this mode-setting, too. */ | |
55 | + otherwise the user will be left without a screen. */ | |
56 | mi = GET_HEAP(struct mode_info, 1); | |
57 | mi->mode = mode + VIDEO_FIRST_VESA; | |
58 | mi->depth = vminfo.bpp; | |
59 | @@ -134,9 +131,13 @@ static int vesa_set_mode(struct mode_info *mode) | |
60 | /* It's a supported text mode */ | |
61 | is_graphic = 0; | |
62 | } else if ((vminfo.mode_attr & 0x99) == 0x99) { | |
63 | +#if FB_SUPPORTS_BOOT_VESA | |
64 | /* It's a graphics mode with linear frame buffer */ | |
65 | is_graphic = 1; | |
66 | vesa_mode |= 0x4000; /* Request linear frame buffer */ | |
67 | +#else | |
68 | + return -1; | |
69 | +#endif | |
70 | } else { | |
71 | return -1; /* Invalid mode */ | |
72 | } | |
73 | diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h | |
74 | index 1ee2c05..20fdc2f 100644 | |
75 | --- a/include/linux/screen_info.h | |
76 | +++ b/include/linux/screen_info.h | |
77 | @@ -76,6 +76,10 @@ extern struct screen_info screen_info; | |
78 | #define ORIG_VIDEO_LINES (screen_info.orig_video_lines) | |
79 | #define ORIG_VIDEO_ISVGA (screen_info.orig_video_isVGA) | |
80 | #define ORIG_VIDEO_POINTS (screen_info.orig_video_points) | |
81 | + | |
82 | +#define FB_SUPPORTS_BOOT_VESA (defined(CONFIG_FB_VESA) || \ | |
83 | + defined(CONFIG_FB_SIS) || defined(CONFIG_FB_IMAC) || \ | |
84 | + defined(CONFIG_FB_INTEL)) | |
85 | #endif /* __KERNEL__ */ | |
86 | ||
87 | #endif /* _SCREEN_INFO_H */ |