From 083916af2f6cc347da4d535f615cc211a194f910 Mon Sep 17 00:00:00 2001 From: Francisco Alecrim Date: Sun, 15 Nov 2009 11:47:29 -0400 Subject: [PATCH 056/118] tslib: force full screen update Fixing tslib to work with omap framebuffer in manual update Signed-off-by: Francisco Alecrim Signed-off-by: Rodrigo Vivi --- recipes/tslib/tslib.inc | 6 +- .../tslib/tslib/fix_omap_update_full_screen.patch | 85 ++++++++++++++++++++ 2 files changed, 90 insertions(+), 1 deletions(-) create mode 100644 recipes/tslib/tslib/fix_omap_update_full_screen.patch diff --git a/recipes/tslib/tslib.inc b/recipes/tslib/tslib.inc index 6f126c6..589b59c 100644 --- a/recipes/tslib/tslib.inc +++ b/recipes/tslib/tslib.inc @@ -3,7 +3,7 @@ HOMEPAGE = "http://tslib.berlios.de/" AUTHOR = "Russell King w/ plugins by Chris Larson et. al." SECTION = "base" LICENSE = "LGPL" -INC_PR = "r24" +INC_PR = "r25" SRC_URI += "\ file://ts.conf \ @@ -17,6 +17,10 @@ SRC_URI_append_mnci += "\ file://event1.patch;patch=1 \ " +SRC_URI_append_nokiait += "\ + file://fix_omap_update_full_screen.patch;patch=1 \ +" + inherit autotools pkgconfig EXTRA_OECONF = "--enable-shared" diff --git a/recipes/tslib/tslib/fix_omap_update_full_screen.patch b/recipes/tslib/tslib/fix_omap_update_full_screen.patch new file mode 100644 index 0000000..c6747bd --- /dev/null +++ b/recipes/tslib/tslib/fix_omap_update_full_screen.patch @@ -0,0 +1,85 @@ +diff -ruN tslib-1.0.orig/tests/fbutils.c tslib-1.0/tests/fbutils.c +--- tslib-1.0.orig/tests/fbutils.c 2006-08-24 18:02:55.000000000 -0300 ++++ tslib-1.0/tests/fbutils.c 2008-03-13 19:39:52.000000000 -0300 +@@ -24,6 +24,8 @@ + #include + #include + #include ++#include ++#include + + #include "font.h" + #include "fbutils.h" +@@ -49,6 +51,14 @@ + static char *fbdevice = NULL; + static char *consoledevice = NULL; + ++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) ++static struct omapfb_update_window update; ++#define UPDATE_WINDOW OMAPFB_UPDATE_WINDOW ++#else ++static struct omapfb_update_window_old update; ++#define UPDATE_WINDOW OMAPFB_UPDATE_WINDOW_OLD ++#endif ++ + int open_framebuffer(void) + { + struct vt_stat vts; +@@ -389,3 +399,15 @@ + } + } + } ++ ++void update_full_screen() { ++ update.x = 0; ++ update.y = 0; ++ update.width = xres; ++ update.height = yres; ++ ++ // FIXME: This value cannot be hard coded: ++ update.format = OMAPFB_COLOR_RGB565; ++ ++ ioctl(fb_fd, UPDATE_WINDOW, &update); ++} +diff -ruN tslib-1.0.orig/tests/fbutils.h tslib-1.0/tests/fbutils.h +--- tslib-1.0.orig/tests/fbutils.h 2006-08-24 18:02:55.000000000 -0300 ++++ tslib-1.0/tests/fbutils.h 2008-03-13 18:18:18.000000000 -0300 +@@ -33,5 +33,6 @@ + void line (int x1, int y1, int x2, int y2, unsigned colidx); + void rect (int x1, int y1, int x2, int y2, unsigned colidx); + void fillrect (int x1, int y1, int x2, int y2, unsigned colidx); ++void update_full_screen(); + + #endif /* _FBUTILS_H */ +diff -ruN tslib-1.0.orig/tests/ts_calibrate.c tslib-1.0/tests/ts_calibrate.c +--- tslib-1.0.orig/tests/ts_calibrate.c 2006-08-24 18:02:55.000000000 -0300 ++++ tslib-1.0/tests/ts_calibrate.c 2008-03-13 18:55:38.000000000 -0300 +@@ -145,16 +145,20 @@ + last_y <<= 16; + for (i = 0; i < NR_STEPS; i++) { + put_cross (last_x >> 16, last_y >> 16, 2 | XORMODE); ++ update_full_screen(); + usleep (1000); + put_cross (last_x >> 16, last_y >> 16, 2 | XORMODE); ++ update_full_screen(); + last_x += dx; + last_y += dy; + } + } + + put_cross(x, y, 2 | XORMODE); ++ update_full_screen(); + getxy (ts, &cal->x [index], &cal->y [index]); + put_cross(x, y, 2 | XORMODE); ++ update_full_screen(); + + last_x = cal->xfb [index] = x; + last_y = cal->yfb [index] = y; +@@ -207,6 +211,7 @@ + "TSLIB calibration utility", 1); + put_string_center (xres / 2, yres / 4 + 20, + "Touch crosshair to calibrate", 2); ++ update_full_screen(); + + printf("xres = %d, yres = %d\n", xres, yres); + -- 1.6.3.3