This tutorial is incomplete and there are a number of issues with it.

If you can enable OpenGL ES acceleration on fb1, please share it.

Running graphical application on an external display consumes more power than usual. If the C.H.I.P crash or reboot when running one of the DirectFB/SDL examples, set the AXP-209 to no limit: sudo axp209 --no-limit

Install general build dependancies:

sudo apt-get install build-essential pkg-config

Install mali driver for OpenGL ES 2.0 acceleration:

sudo apt-get install chip-mali-modules-4.4.13-ntc-mlc chip-mali-userspace


Install dependencies:

sudo apt-get install libpng-dev libjpeg-dev libfreetype6-dev
sudo apt-get install libdrm2 libudev-dev libegl1-mesa-dev libgles1-mesa-dev libgles2-mesa-dev libgbm-dev libgegl-dev libsysfs-dev
sudo apt-get install freeglut3 freeglut3-dev

Latest master branch (1.8.0) with SSD1351 has flickering when running SDL2 demos (from test folder) and the display is black when running its own tests. Use instead the 1.7.6 version. TODO: test version 1.7.7 and 1.6.x.

tar -zxvf DIRECTFB_1_7_7.tar.gz && cd DirectFB-DIRECTFB_1_7_7/


Disable fusion with --disable-multi flag

./configure --with-gfxdrivers='gles2' --enable-static --enable-jpeg --enable-png --enable-zlib --disable-freetype --disable-x11 --enable-wayland=no --disable-idirectfbgl-egl --enable-mesa --disable-egl --disable-egl-united --enable-fbdev --with-inputdrivers=linuxinput --disable-multi --disable-multi-kernel --enable-debug-support --enable-debug --enable-trace

./configure should output that OpenGL ES 2.0 is enabled when finished:

Building Graphics Drivers:
OpenGL                    no (GLX: no)
OpenGL ES 2.0             yes (Mesa:  yes, PVR2D: no)
                                      -I/usr/include/libdrm  -DGLES2_MESA  -lGLESv2 -lEGL -ldrm -lgbm

IDirectFBGL-EGL           no

If MESA is disabled due to missing packages: *** glesv2 egl libdrm gbm packages not found -- Building without MESA support. You can check which package is not available using pkg-config --libs glesv2

Make & install:

sudo make install

Type sudo ldconfig if DirectFB lib is not detected in next steps

Add the mode generated from fbset -fb /dev/fb1 to /etc/fb.modes:

mode "128x128"
    geometry 128 128 128 128 16
    timings 0 0 0 0 0 0 0
    nonstd 1
    rgba 5/11,6/5,5/0,0/0

Add to directfbrc (/etc/directfbrc or $HOME/.directfbrc):

Prefer /etc/directfbrc as some commands will be executed as root


Test that DirectFB is working properly by running ./dfbtest_fillrect from tests folder. The display should output something similar to this:

directfb test



./configure --disable-video-dummy --disable-video-x11 --disable-video-opengl --enable-video-opengles2 --enable-video-directfb

./configure should output Video drivers : directfb opengl_es2 when finished.

I don't know exactly why, but I had to edit Makefile and remove -Werror=declaration-after-statement from EXTRA_CFLAGS to compile SDL2 with directfb support.

error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement] on some source files located in src/video/directfb/

Make & install:

sudo make install

If SDL was compiled with other driver support, you might have to set the video driver explicitly: export SDL_DIRECTFB_X11_CHECK=0 export SDL_VIDEODRIVER=DIRECTFB

You can try some SDL samples like ./testsprite2 from test folder:



Test es2_info and es2gears from mesa-utils-extra package and glmark-es2.

Compile cube_vbo with: gcc -Wall -W -o cube_vbo cube_vbo.csdl2-config --libs --cflags-lGL

Try export DISPLAY=:0.0 or export DISPLAY=:0