On this page you will find usefull informations to have a working Linux Framebuffer on your board.
Linux Framebuffer is the lowest level (standardized) API for userspace programs to access video capabilities of the system you're running on. It allows you to directly "draw" your graphics in the video memory. Some higher level librairies can be put on top of the Framebuffer for more portability: SDL, Qt/Embedded, GTK, DirectFB, etc...
Instructions to configure Linux kernel were moved to Talk:FrameBuffer and are only given as references or if you want to change the default LCD.
- Framebuffer device can be accessed with /dev/fb0.
- You can activate some tools from the Buildroot's menuconfig:
$ make menuconfig
Package Selection for the target ... Graphic libraries and applications (graphic/text) ---> ... [*] fbgrab [*] fbtest [*] fbv ... ---> Graphic libraries and applications (graphic/text) ---> fbset/fbv/fbgrab
- For example to grab a snapshot of the framebuffer:
# fbgrab /tmp/snapshot.png
- For example to display an image using standard image file formats PNG, GIF...:
# fbv myimage.png
- To stop blinking cursor:
# echo 0 > /sys/class/graphics/fbcon/cursor_blink
also possible at boot time (with 3.x recent kernels):
BIOS> setenv extrabootargs vt.global_cursor_default=0
- To make it blinking again:
# echo 1 > /sys/class/graphics/fbcon/cursor_blink
- To have a login on LCD, add these line in /etc/inittab of your rootfs:
# Set up a getty on LCD tty1::respawn:/sbin/getty 38400 tty1
- To grab a screenshot of a running Framebuffer application, use FBGrab
- To enter in Framebuffer sleep mode:
# echo 1 > /sys/class/graphics/fb0/blank
- To leave Framebuffer sleep power mode:
# echo 0 > /sys/class/graphics/fb0/blank
- To set "sleep mode"/screensaver entering time (where X is a time in minute; 0 = never):
# echo -e '\033[9;X]' > /dev/tty1 (from serial console)
# echo -e '\033[9;X]' (from framebuffer console)
or to set it at each boot, use /etc/inittab:
tty1::sysinit:echo -e '\033[9;X]'
Other usefull ESC sequences
- To (definitly) hide cursor:
# echo -e '\033[?17;0;0c' > /dev/tty1 (from serial console)
# echo -e '\033[?17;0;0c' (from framebuffer console)
- inverse screen on:
# echo -e '\033[?5h' > /dev/tty1
- inverse screen off:
# echo -e '\033[?5l' > /dev/tty1
- To erase the screen
echo -e '\033[2J' > /dev/tty1 (from serial console)