liballegro/patches/020-fix-fbcon-init.patch |
1 | 1 | Index: allegro-4.4.2/src/linux/fbcon.c |
2 | 2 | =================================================================== |
3 | | +++ allegro-4.4.2/src/linux/fbcon.c 2011-06-02 11:04:18.000000000 +0200 |
| 3 | --- allegro-4.4.2.orig/src/linux/fbcon.c 2011-06-02 11:18:50.000000000 +0200 |
4 | 4 | @@ -19,6 +19,10 @@ |
5 | 5 | * See readme.txt for copyright information. |
6 | 6 | */ |
... | ... | |
13 | 13 | |
14 | 14 | #include "allegro.h" |
15 | 15 | #include "allegro/internal/aintern.h" |
16 | | @@ -263,6 +267,7 @@ |
| 16 | @@ -251,6 +255,7 @@ |
| 17 | if (__al_linux_console_graphics() != 0) { |
| 18 | ioctl(fbfd, FBIOPUT_VSCREENINFO, &orig_mode); |
| 19 | close(fbfd); |
| 20 | + fb_mode_read = FALSE; |
| 21 | return NULL; |
| 22 | } |
| 23 | |
| 24 | @@ -263,6 +268,7 @@ |
17 | 25 | case -1: |
18 | 26 | /* let's see if we can get the actual screen mode */ |
19 | 27 | /* shouldn't we be keeping the previous color depth setting? */ |
... | ... | |
21 | 29 | switch (orig_mode.bits_per_pixel) { |
22 | 30 | case 8: |
23 | 31 | case 16: |
24 | | @@ -360,9 +365,21 @@ |
| 32 | @@ -360,9 +366,21 @@ |
25 | 33 | continue; |
26 | 34 | |
27 | 35 | /* try to set the mode */ |
... | ... | |
43 | 51 | } |
44 | 52 | } |
45 | 53 | |
46 | | @@ -377,6 +394,9 @@ |
| 54 | @@ -377,6 +395,9 @@ |
47 | 55 | close(fbfd); |
48 | 56 | ustrzcpy(allegro_error, ALLEGRO_ERROR_SIZE, get_config_text("Framebuffer resolution not available")); |
49 | 57 | TRACE(PREFIX_E "Resolution %dx%d not available...\n", w, h); |
... | ... | |
53 | 61 | return NULL; |
54 | 62 | |
55 | 63 | got_a_nice_mode: |
| 64 | @@ -387,6 +408,7 @@ |
| 65 | __al_linux_console_text(); |
| 66 | close(fbfd); |
| 67 | ustrzcpy(allegro_error, ALLEGRO_ERROR_SIZE, get_config_text("Framebuffer ioctl() failed")); |
| 68 | + fb_mode_read = FALSE; |
| 69 | return NULL; |
| 70 | } |
| 71 | |
| 72 | @@ -399,6 +421,7 @@ |
| 73 | ustrzcpy(allegro_error, ALLEGRO_ERROR_SIZE, get_config_text("Can't map framebuffer")); |
| 74 | TRACE(PREFIX_E "Couldn't map framebuffer for %dx%d. Restored old " |
| 75 | "resolution.\n", w, h); |
| 76 | + fb_mode_read = FALSE; |
| 77 | return NULL; |
| 78 | } |
| 79 | |
| 80 | @@ -428,6 +451,7 @@ |
| 81 | __al_linux_console_text(); |
| 82 | close(fbfd); |
| 83 | TRACE(PREFIX_E "Couldn't make bitmap `b', sorry.\n"); |
| 84 | + fb_mode_read = FALSE; |
| 85 | return NULL; |
| 86 | } |
| 87 | |