mirror of
git://projects.qi-hardware.com/openwrt-packages.git
synced 2025-04-21 12:27:27 +03:00
liballegro: fix fbdev driver, also package examples
This commit is contained in:
@@ -1,15 +1,21 @@
|
||||
Index: allegro-4.4.2/demos/shooter/demo.c
|
||||
===================================================================
|
||||
--- allegro-4.4.2.orig/demos/shooter/demo.c 2011-05-29 12:56:58.000000000 +0200
|
||||
+++ allegro-4.4.2/demos/shooter/demo.c 2011-05-29 13:50:44.000000000 +0200
|
||||
@@ -90,9 +90,9 @@
|
||||
+++ allegro-4.4.2/demos/shooter/demo.c 2011-05-31 15:57:29.000000000 +0200
|
||||
@@ -1,3 +1,5 @@
|
||||
+#define DEBUGMODE
|
||||
+
|
||||
#include "demo.h"
|
||||
#include "data.h"
|
||||
#include "expl.h"
|
||||
@@ -90,9 +92,9 @@
|
||||
allegro_message("Error initialising joystick\n%s\n", allegro_error);
|
||||
install_joystick(JOY_TYPE_NONE);
|
||||
}
|
||||
-
|
||||
- if (set_gfx_mode(GFX_AUTODETECT, 320, 200, 0, 0) != 0) {
|
||||
- if (set_gfx_mode(GFX_SAFE, 320, 200, 0, 0) != 0) {
|
||||
+ set_color_depth(32);
|
||||
+ /* set_color_depth(32); */
|
||||
+ if (set_gfx_mode(GFX_AUTODETECT, 320, 240, 0, 0) != 0) {
|
||||
+ if (set_gfx_mode(GFX_SAFE, 320, 240, 0, 0) != 0) {
|
||||
set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
|
||||
|
||||
55
liballegro/patches/020-fix-fbcon-init.patch
Normal file
55
liballegro/patches/020-fix-fbcon-init.patch
Normal file
@@ -0,0 +1,55 @@
|
||||
Index: allegro-4.4.2/src/linux/fbcon.c
|
||||
===================================================================
|
||||
--- allegro-4.4.2.orig/src/linux/fbcon.c 2011-05-31 15:57:15.000000000 +0200
|
||||
+++ allegro-4.4.2/src/linux/fbcon.c 2011-05-31 17:04:32.000000000 +0200
|
||||
@@ -19,6 +19,10 @@
|
||||
* See readme.txt for copyright information.
|
||||
*/
|
||||
|
||||
+/* #define DEBUGMODE */
|
||||
+
|
||||
+#include <errno.h>
|
||||
+#include <string.h>
|
||||
|
||||
#include "allegro.h"
|
||||
#include "allegro/internal/aintern.h"
|
||||
@@ -263,6 +267,7 @@
|
||||
case -1:
|
||||
/* let's see if we can get the actual screen mode */
|
||||
/* shouldn't we be keeping the previous color depth setting? */
|
||||
+ TRACE(PREFIX_I "...orig bpp %i...\n", (int)orig_mode.bits_per_pixel);
|
||||
switch (orig_mode.bits_per_pixel) {
|
||||
case 8:
|
||||
case 16:
|
||||
@@ -360,9 +365,21 @@
|
||||
continue;
|
||||
|
||||
/* try to set the mode */
|
||||
+ TRACE(PREFIX_I "...trying w %i h %i vw %i vh %i bpp %i...\n",
|
||||
+ (int)my_mode.xres, (int)my_mode.yres,
|
||||
+ (int)my_mode.xres_virtual, (int)my_mode.yres_virtual,
|
||||
+ my_mode.bits_per_pixel);
|
||||
if (ioctl(fbfd, FBIOPUT_VSCREENINFO, &my_mode) == 0) {
|
||||
+ TRACE(PREFIX_I "...ioctl ok w %i h %i vw %i vh %i bpp %i...\n",
|
||||
+ (int)my_mode.xres, (int)my_mode.yres,
|
||||
+ (int)my_mode.xres_virtual, (int)my_mode.yres_virtual,
|
||||
+ my_mode.bits_per_pixel);
|
||||
if (my_mode.bits_per_pixel == (unsigned)color_depth)
|
||||
goto got_a_nice_mode;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ TRACE(PREFIX_I "...ioctl said %i %s\n", errno, strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -377,6 +394,9 @@
|
||||
close(fbfd);
|
||||
ustrzcpy(allegro_error, ALLEGRO_ERROR_SIZE, get_config_text("Framebuffer resolution not available"));
|
||||
TRACE(PREFIX_E "Resolution %dx%d not available...\n", w, h);
|
||||
+ /* bugfix: if we don't reset fb_mode_read than the next call to
|
||||
+ set_gfx_mode() is going to fail with "bad file descriptor" */
|
||||
+ fb_mode_read = FALSE;
|
||||
return NULL;
|
||||
|
||||
got_a_nice_mode:
|
||||
Reference in New Issue
Block a user