world leader in high performance signal processing
Trace: » directfb

DirectFB

DirectFB is a thin library that provides developers with hardware graphics acceleration, input device handling and abstraction, integrated windowing system with support for translucent windows and multiple display layers on top of the Linux Framebuffer Device. It is a complete hardware abstraction layer with software fallbacks for every graphics operation that is not supported by the underlying hardware. DirectFB adds graphical power to embedded systems and sets a new standard for graphics under Linux.

Configuration

Dist Settings

To enable DirectFB support, just add the library to your user/vendor configuration.

Library Configuration  --->
  [*] Build DirectFB

Board Settings

You will probably need to setup the /etc/directfbrc and /etc/fb.modes files according to the framebuffer device you are using.

Both of these files are documented in their respective man pages, so just run:

$ man directfbrc
$ man fb.modes

Examples

Here is a short video of some of the DirectFB Examples:

The Adobe Flash Plugin is needed to display this content.

info

When the DirectFB starts, it has the option to be pretty noisy, as it prints debug/information to the console.

root:/usr/bin> ./df_dok

     =======================|  DirectFB 1.1.1  |=======================
          (c) 2001-2007  The DirectFB Organization (directfb.org)
          (c) 2000-2004  Convergence (integrated media) GmbH
        ------------------------------------------------------------

(*) DirectFB/Core: Single Application Core. (2008-01-30 12:40)
(*) Direct/Thread: Running 'VT Switcher' (CRITICAL, 260)...
(*) Direct/Thread: Running 'PS/2 Input' (INPUT, 261)...
(*) DirectFB/Input: IMPS/2 Mouse 1.0 (directfb.org)
(*) Direct/Thread: Running 'Keyboard Input' (INPUT, 262)...
(*) DirectFB/Input: Keyboard 0.9 (directfb.org)
(*) DirectFB/Graphics: Generic Software Rasterizer 0.6 (directfb.org)
(*) DirectFB/Core/WM: Default 0.3 (directfb.org)
(*) FBDev/Mode: Testing 480x272 RGB24
(*) FBDev/Mode: Preparing switch to 480x272 RGB24
(*) FBDev/Mode: Testing 480x272 RGB24
(*) FBDev/Mode: Preparing switch to 480x272 RGB24
(*) FBDev/Mode: Testing 480x272 RGB24
(*) FBDev/Mode: Preparing switch to 480x272 RGB24
(*) FBDev/Mode: Testing 480x272 RGB24
(*) FBDev/Mode: Preparing switch to 480x272 RGB24
(*) FBDev/Mode: Testing 480x272 RGB24
(*) FBDev/Mode: Preparing switch to 480x272 RGB24
(*) FBDev/Surface: Allocated 480x272 24bit RGB24 buffer at offset 0 and pitch 1440.
(*) FBDev/Mode: (Post)Setting 480x272 RGB24
(*) FBDev/Mode: Switched to 480x272 (480x272) at 24 bit RGB24 (wanted RGB24).
(!) DirectFB/FBDev: Panning display failed (x=0 y=0 ywrap=0 vbl=0)!
    --> Invalid argument
(*) FBDev/Mode: Testing 480x272 RGB24
(*) FBDev/Mode: Preparing switch to 480x272 RGB24
(*) FBDev/Mode: (Post)Setting 480x272 RGB24
(*) FBDev/Mode: Testing 480x272 RGB24
(*) FBDev/Mode: Preparing switch to 480x272 RGB24
(*) FBDev/Mode: Testing 480x272 RGB24
(*) FBDev/Mode: Preparing switch to 480x272 RGB24
(*) FBDev/Mode: Testing 480x272 RGB24
(*) FBDev/Mode: Preparing switch to 480x272 RGB24
(*) FBDev/Mode: Testing 480x272 RGB24
(*) FBDev/Mode: Preparing switch to 480x272 RGB24
(*) FBDev/Mode: Switched to 480x272 (480x272) at 24 bit RGB24 (wanted RGB24).
(!) DirectFB/FBDev: Panning display failed (x=0 y=0 ywrap=0 vbl=0)!
    --> Invalid argument
(*) FBDev/Surface: Allocated 480x272 24bit RGB24 buffer at offset 0 and pitch 1440.
(*) FBDev/Mode: (Post)Setting 480x272 RGB24
(*) FBDev/Mode: Switched to 480x272 (480x272) at 24 bit RGB24 (wanted RGB24).
(!) DirectFB/FBDev: Panning display failed (x=0 y=0 ywrap=0 vbl=0)!
    --> Invalid argument
(*) Direct/Interface: Loaded 'PNG' implementation of 'IDirectFBImageProvider'.
(*) Direct/Interface: Loaded 'FT2' implementation of 'IDirectFBFont'.
(*) Direct/Interface: Using 'GIF' implementation of 'IDirectFBImageProvider'.

These tests were run on this platform:

root:/> cat /proc/cpuinfo
processor       : 0
vendor_id       : Analog Devices
cpu family      : 0x27de000
model name      : ADSP-BF548 525(MHz CCLK) 131(MHz SCLK)
stepping        : 1
cpu MHz         : 525.000/131.250000
bogomips        : 1048.57
Calibration     : 524288000 loops
cache size      : 16 KB(L1 icache) 32 KB(L1 dcache-wb) 0 KB(L2 cache)
dbank-A/B       : cache/cache
icache setup    : 4 Sub-banks/4 Ways, 32 Lines/Way
dcache setup    : 2 Super-banks/4 Sub-banks/2 Ways, 64 Lines/Way
board name      : ADSP-BF548-EZKIT
board memory    : 65536 kB (0x00000000 -> 0x04000000)
kernel memory   : 63480 kB (0x00001000 -> 0x03dff000)

df_dok

df_dok is a benchmarking application:

root:/usr/bin> ./df_dok

Benchmarking 256x252 on 480x262 RGB24 (24bit)...

Anti-aliased Text                              3.015 secs (   40.597 KChars/sec) [100.0%]
Anti-aliased Text (blend)                      3.008 secs (   10.771 KChars/sec) [100.3%]
Fill Rectangle                                 3.172 secs (   16.270 MPixel/sec) [100.3%]
Fill Rectangle (blend)                         3.544 secs (    1.820 MPixel/sec) [100.0%]
Fill Rectangles [10]                           3.947 secs (   16.344 MPixel/sec) [100.2%]
Fill Rectangles [10] (blend)                  35.411 secs (    1.821 MPixel/sec) [100.0%]
Fill Triangles                                 3.105 secs (   15.582 MPixel/sec) [100.0%]
Fill Triangles (blend)                         3.560 secs (    1.812 MPixel/sec) [100.0%]
Draw Rectangle                                 3.006 secs (    7.518 KRects/sec) [100.3%]
Draw Rectangle (blend)                         3.037 secs (    0.987 KRects/sec) [100.0%]
Draw Lines [10]                                3.033 secs (   25.387 KLines/sec) [100.0%]
Draw Lines [10] (blend)                        3.197 secs (    4.691 KLines/sec) [100.3%]
Fill Spans                                     3.271 secs (   15.777 MPixel/sec) [100.0%]
Fill Spans (blend)                             3.563 secs (    1.810 MPixel/sec) [ 99.7%]
Blit                                           3.224 secs (   12.005 MPixel/sec) [100.3%]
Blit 180                                       3.156 secs (   12.264 MPixel/sec) [100.0%]
Blit colorkeyed                                3.431 secs (    9.401 MPixel/sec) [100.0%]
Blit destination colorkeyed                    3.572 secs (    7.224 MPixel/sec) [100.0%]
Blit with format conversion                    3.131 secs (    6.181 MPixel/sec) [100.0%]
Blit with colorizing                           4.025 secs (    4.808 MPixel/sec) [100.0%]
Blit from 32bit (blend)                        4.457 secs (    1.447 MPixel/sec) [100.2%]
Blit from 32bit (blend) with colorizing        4.847 secs (    1.330 MPixel/sec) [100.2%]
Stretch Blit                                   3.008 secs (    9.043 MPixel/sec) [100.0%]
Stretch Blit colorkeyed                        3.018 secs (    8.026 MPixel/sec) [100.3%]

Links