2 things.

(1) the most simple solution to your problem is to use full-screen windows.
Then you will have 3 surfaces: window App-A, window App-B, framebuffer.
You can switch these by e.g. changing the opacity from 255 to 0 and around; this also has the nifty side-effect that if your surfaces have different configurations, e.g. like a different pixel format, the framebuffer will be reconfigured automatically to the correct parameters on switching the opacity. Note that windows require a "flip" before the content is shown/copied to the framebuffer.

(2) looks like the mmap didn't work for the slave.. The world->ABI is the first parameter that the slave reads from the shared memory area. Hopefully somebody else can comment on this!

hth
Niels

Allen Black wrote:
Hi everyone,

I'm very much a newbie to to the DirectFB / Fusion / linux-fusion kernel module community... And I'm trying to do something that I think should be very simple considering the vast capabilities of DirectFB et al... But I've yet to find any example code or explanatory documentation that specifically addresses my desired usage...

I have two applications that need to share a single framebuffer device... Let's call then "App-A" and "App-B"... Each application is quite simple, consisting of a single layer and several windows used as "buttons" to detect DWET_BUTTOWNDOWN events from a touchscreen...


Here's the sequence of events I'd like to be able to execute successfully:

1. Start App-A, have it be the Fusion Master in Fusion World 0, and then draw it's several windows/buttons to the framebuffer...

2. Start App-B, have it be a Fusion Slave in Fusion World 0, but then wait before doing any drawing...

3. Touch a particular window/button that App-A has drawn, and have this cause App-A to:

3a. Clear the screen/layer/framebuffer
3b. "Signal" (in some manner, maybe a semaphore / fusion skirmish?) App-B that it should now start drawing its windows/buttons
3c. Wait to be "signaled" from App-B

And then similarly...

4. (by this time, App-B has already drawn its several windows/buttons to the framebuffer)

5. Touch a particular window/button that App-B has drawn, and have this cause App-B to:

5a. Clear the screen/layer/framebuffer
5b. "Signal" App-A that it should now start drawing its windows/buttons
5c. Wait to be "signaled" again from App-A

And so on, back and forth from App-A to App-B forever...


At this point, I have my applications running fine "individually" in DirectFB Single Application Core mode... And I can run each of them "individually" in Multi Application Core mode too... But I really don't understand if I need to add some calls to the Fusion library to my application code or if I need to be doing something with the DirectFB library (which itself obviously uses Fusion) to coordinate my two applications...

I'll also mention that I'm using the latest versions of DirectFB (v1.4.1) and the linux-fusion kernel module (v8.1.1) on a Coldfire V4 embedded platform...


Currently, this is the output when I start my "App-A":

r...@freescale:/usr/local/UCP# allens_directfb_demo_a

  ~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.4.1 |~~~~~~~~~~~~~~~~~~~~~~~~~~
       (c) 2001-2009  The world wide DirectFB Open Source Community
       (c) 2000-2004  Convergence (integrated media) GmbH
     ----------------------------------------------------------------

(*) DirectFB/Core: Multi Application Core. (2009-07-08 19:35)
(*) Fusion/SHM: Using MADV_REMOVE (2.6.25.0 >= 2.6.19.2)
(*) Direct/Thread: Started 'Fusion Dispatch' (706) [MESSAGING OTHER/OTHER 0/0] <2088960>... (*) Direct/Thread: Started 'VT Switcher' (711) [CRITICAL OTHER/OTHER 0/0] <2088960>... (*) Direct/Thread: Started 'VT Flusher' (712) [DEFAULT OTHER/OTHER 0/0] <2088960>... (*) DirectFB/FBDev: Found 's1d13xxxfb' (ID 0) with frame buffer at 0x44040000, 160k (MMIO 0x44000000, 128k) (*) Direct/Thread: Started 'tslib Input' (713) [INPUT OTHER/OTHER 0/0] <2088960>...
(*) DirectFB/Input: tslib touchscreen 0 0.1 (tslib)
(*) DirectFB/Graphics: Generic Software Rasterizer 0.6 (directfb.org)
(*) DirectFB/Core/WM: Default 0.3 (directfb.org)
(!!!) *** WARNING [Non-flipping window surface and no 'autoflip-window' option used] *** [idirectfbsurface_window.c:319 in IDirectFBSurfa]
(*) Direct/Interface: Loaded 'FT2' implementation of 'IDirectFBFont'.


And this is the output when I start my "App-B" (with "App-A" already running):

r...@freescale:/usr/local/UCP# allens_directfb_demo_b

  ~~~~~~~~~~~~~~~~~~~~~~~~~~| DirectFB 1.4.1 |~~~~~~~~~~~~~~~~~~~~~~~~~~
       (c) 2001-2009  The world wide DirectFB Open Source Community
       (c) 2000-2004  Convergence (integrated media) GmbH
     ----------------------------------------------------------------

(*) DirectFB/Core: Multi Application Core. (2009-07-08 19:35)
(*) Fusion/SHM: Using MADV_REMOVE (2.6.25.0 >= 2.6.19.2)
(!) Fusion/Init: World ABI (0) doesn't match own (45)!
(!) [  714:    0.000] --> Caught signal 11 (at 0x34, invalid address) <--
Aborted


Thanks for any help or suggestions you can give!
Allen Black

_______________________________________________
directfb-users mailing list
directfb-users@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users



--

.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/                 |
"------------------------------------------"
_______________________________________________
directfb-users mailing list
directfb-users@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to