Hi
I got some information about how to build DirectFB with Touchscreen support.
I have not tried yet, so I'm not sure it will be the same, or some modifications needs to be done, but I think it will be a useful to post the information here, so maybe you get some clues about what is missing.
Also consider that this is for sabrelite BSP 12.01
How to build DirectFB with touch support from scratch in BSP 12.01
Select the following packages in ./ltib -c:
- Gpu-viv-bin-mx6q
- Do not select any DirectFB packages J
Apply the DirectFB patch (attached)
Install automake 1.7.6 in your host machine (attached)
For tslib
Do $./ltib –m prep –p tslib
To fix “couldnt load module pthres” error when running dfbinfo, modify ltib/rpm/BUILD/tslib-1.0/plugins/Makefile.am by adding the following lines:
line 108:
variance_la_SOURCES = variance.c
variance_la_LDFLAGS = -module $(LTVSN)
>>variance_la_LIBADD = $(top_builddir)/src/libts.la
dejitter_la_SOURCES = dejitter.c
dejitter_la_LDFLAGS = -module $(LTVSN)
>>dejitter_la_LIBADD = $(top_builddir)/src/libts.la
linear_la_SOURCES = linear.c
linear_la_LDFLAGS = -module $(LTVSN)
>>linear_la_LIBADD = $(top_builddir)/src/libts.la
pthres_la_SOURCES = pthres.c
pthres_la_LDFLAGS = -module $(LTVSN)
>>pthres_la_LIBADD = $(top_builddir)/src/libts.la
Then do scbuild and MAKE SURE the command automake-1.7 is successfully called. This will regenerate the makefile so DirectFB can see tslib (hence use it)
Do scdeploy
For DirectFB
We need to make sure the /usr/lib/directfb-1.4-0/inputdrivers/libdirectfb_tslib.so is being created. First edit DirectFB.spec located in ltib/dist/lfs-5.1/DirectFB:
This could be done more elegantly, but for lines 28 and on, add this:
if [ -n "$PKG_DIRECTFB_WANT_TS" ]
then
TSOPTS="--with-inputdrivers=tslib"
else
TSOPTS="--with-inputdrivers=tslib"
Then do ./ltib –p DirectFB –m prep and in ltib/rpm/BUILD/DirectFB-1.0.4/configure change every “tslib-0.0” to “tslib-1.0”.
Do scbuild and scdeploy, then make sure libdirectfb_tslib.so is there.
Now you can boot ltib and do the following (on your target):
$ export TSLIB_TSDEVICE=/dev/input/ts0
$ modprobe galcore
$ /usr/bin/dfbinfo
You should see something like this (important bits highlighted in yellow):
root@freescale ~$ dfbinfo
~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.4.0 |~~~~~~~~~~~~~~~~~~~~~~~~~~
(c) 2001-2009 The world wide DirectFB Open Source Community
(c) 2000-2004 Convergence (integrated media) GmbH
----------------------------------------------------------------
(*) DirectFB/Core: Single Application Core. (2012-04-09 19:05)
(*) Direct/Memcpy: Using libc memcpy()
(*) Direct/Thread: Started 'VT Switcher' (2529) [CRITICAL OTHER/OTHER 0/0] <8388608>...
(*) Direct/Thread: Started 'VT Flusher' (-1) [DEFAULT OTHER/OTHER 0/0] <8388608>...
(*) DirectFB/FBDev: Found 'DISP4 BG' (ID 0) with frame buffer at 0x18800000, 3072k (MMIO 0x00000000, 0k)
(*) Direct/Thread: Started 'Linux Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>...
(*) DirectFB/Input: gpio-keys (1) 0.1 (directfb.org)
(*) Direct/Thread: Started 'Linux Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>...
(*) DirectFB/Input: eGalax Touch Screen (2) 0.1 (directfb.org)
(*) Direct/Thread: Started 'Keyboard Input' (-1) [INPUT OTHER/OTHER 0/0] <8388608>...
(*) DirectFB/Input: Keyboard 0.9 (directfb.org)
(*) Direct/Thread: Started 'tslib Input' (2534) [INPUT OTHER/OTHER 0/0] <8388608>...
(*) DirectFB/Input: tslib touchscreen 0 0.1 (tslib)
(*) Using the default feature settings.
(*) DirectFB/Graphics: Vivante unknown chip model 1.0 (Vivante)
(*) DirectFB/Core/WM: Default 0.3 (directfb.org)
(*) FBDev/Mode: Setting 1024x768 RGB16
(*) FBDev/Mode: Switched to 1024x768 (virtual 1024x1536) at 16 bit (RGB16), pitch 2048
(*) FBDev/Surface: Allocated 1024x768 16 bit RGB16 buffer (index 0) at offset 0 and pitch 2048.
(*) FBDev/Surface: Allocated 1024x768 16 bit RGB16 buffer (index 1) at offset 1572864 and pitch 2048.
Screen (00) FBDev Primary Screen (primary screen)
Caps: VSYNC POWER_MANAGEMENT
Layer (00) FBDev Primary Layer (primary layer)
Type: GRAPHICS
Caps: SURFACE BRIGHTNESS CONTRAST SATURATION
Input (10) gpio-keys
Type:
Caps:
Input (01) eGalax Touch Screen (primary mouse)
Type: MOUSE
Caps: AXES
Max. Axis: 1
Input (00) Keyboard (primary keyboard)
Type: KEYBOARD
Caps: KEYS
Min. Keycode: 0
Max. Keycode: 127
Input (11) tslib touchscreen 0
Type: MOUSE
Caps: AXES BUTTONS
Max. Axis: 1
Max. Button: 0
To correctly build the DirectFB-examples package, you need to do the following:
- Modify DirectFB-examples.spec file located in ltib/dist/lfs-5.1/DirectFB
- Add –DDIRECTFB_ENABLE_DEPRECATED to export DIRECTFB_CFLAGS="-D_REENTRANT -D_GNU_SOURCE -DDIRECTFB_ENABLE_DEPRECATED -I$DEV_IMAGE/%{_prefix}/include/directfb"
- Enter the following command: $./ltib –m prep –p DirectFB-examples
- Edit the file “ve.c” under …/ltib/rpm/BUILD/DirectFB-examples-0.9.23/src,
- Comment line 652: //D_HEAVYDEBUG( "VB/Adding: %7.3f, %7.3f, %7.3f [%.3f, %.3f]\n", x, y, z, s, t );
- Comment lines 863 to 866:
- //if (count == 4)
- //D_HEAVYDEBUG( "VB/Build: %d, %d, %d, %d\n", input[0], input[1], input[2], input[3] );
- //else
- //D_HEAVYDEBUG( "VB/Build: %d, %d, %d\n", input[0], input[1], input[2] );
- Enter the following command: $./ltib –m scbuild –p DirectFB-examples
- Enter the following command: $./ltib –m scdeploy –p DirectFB-examples
Now boot your setup and run a test application:
$ export TSLIB_TSDEVICE=/dev/input/ts0
$ modprobe galcore
$ /usr/bin/df_input