Difference between revisions of "Framebuffer"

From ArmadeusWiki
Jump to: navigation, search
 
(Links)
(45 intermediate revisions by 5 users not shown)
Line 1: Line 1:
== Armadeus Framebuffer documentation page ! ==
+
On this page you will find usefull informations to have a working Linux Framebuffer on your board.
  
Here is the procedure to have a working framebuffer on the board (beware
+
==Introduction==
it's tricky for the moment !!, but it's for people who can't wait ;-))
+
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...
  
 +
==Kernel configuration==
 +
{{Note | Framebuffer is already configured (for [[LQ043_Adapt|Sharp LQ043 LCD]] on [[APF9328]] and for Chimei LW700 on [[APF27]]/[[APF51]]) in standard/default Armadeus kernel image. [[APF28]] has a boot option to [[APF28Dev#Selecting_LCD|choose the LCD]].}}
  
* comment lines number 427 & 438 in linux/drivers/video/imxfb.c (PD11,PD12 config)
+
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.
* merge attached scb9328.c file with linux/arc/arm/mach-imx/scb9328.c
+
  
configure the linux kernel for Framebuffer support:
+
==Userland==
<pre>
+
* Framebuffer device can be accessed with ''/dev/fb0''.
make menuconfig
+
 
 +
* You can activate some tools from the Buildroot's menuconfig:  
 +
<pre class="host">
 +
$ make menuconfig
 +
</pre>
 +
<pre class="config">
 +
Package Selection for the target
 +
    ...
 +
    Graphic libraries and applications (graphic/text)  --->
 +
    ...
 +
        [*] fbgrab
 +
        [*] fbtest
 +
        [*] fbv
 +
    ...
 +
        ---> Graphic libraries and applications (graphic/text) 
 +
            ---> fbset/fbv/fbgrab
 
</pre>
 
</pre>
* in "Char Devices" menu, activate ''"Virtual Terminal"'' and ''"Support for virtual terminal on console"''
 
* in "Graphic support" activate "Support for Framebuffer", "Motorola iMX
 
LCD support" "Console display driver support ->Frame buffer console
 
support" (deactivate VGA stuff & add some fonts), then choose 224 colour
 
boot logo
 
  
recompile the kernel, now to have console on serial port, you will have
+
{{Note | As explain on [[LinuxInstall]] page, to compile '''fbtest''', ''libnetpbm10-dev'' must be installed in your host system}}
to add "console=ttySMX0,115200n8" to your boot parameters
+
  
load image on your board and enjoy (you should see linux logo on screen
+
* For example to grab a snapshot of the framebuffer:
at startup)!
+
<pre class="apf">
 
+
# fbgrab /tmp/snapshot.png
If you have devfs activated, framebuffer device can be accessed with /dev/fb/0. Otherwise, you will neede to create the device node with
+
<pre>
+
mknod c 29 0
+
 
</pre>
 
</pre>
  
You can activate some test tools from the armadeus build process:  
+
* For example to display an image using standard image file formats PNG, GIF...:
<pre>
+
<pre class="apf">
make menuconfig -> packages -> fbset
+
# fbv myimage.png
 
</pre>
 
</pre>
  
You have several test tools on yahoo groups to play a little with the framebuffer.
+
==Tips==
  
 +
* To stop blinking cursor:
 +
<pre class="apf">
 +
# echo 0 > /sys/class/graphics/fbcon/cursor_blink
 +
</pre>
 +
also possible at boot time (with 3.x recent kernels):
 +
<pre class="apf">
 +
BIOS> setenv extrabootargs vt.global_cursor_default=0
 +
</pre>
 +
* To make it blinking again:
 +
<pre class="apf">
 +
# echo 1 > /sys/class/graphics/fbcon/cursor_blink
 +
</pre>
 +
* To grab a screenshot of a running Framebuffer application, use [[FBGrab]]
 +
* To enter in Framebuffer sleep mode:
 +
<pre class="apf">
 +
# echo 1 > /sys/class/graphics/fb0/blank
 +
</pre>
 +
* To leave Framebuffer sleep power mode:
 +
<pre class="apf">
 +
# echo 0 > /sys/class/graphics/fb0/blank
 +
</pre>
 +
* To set "sleep mode"/screensaver entering time (where X is a time in minute; 0 = never):
 +
<pre class="apf">
 +
# echo -e '\033[9;X]' > /dev/tty1    (from serial console)
 +
</pre>
 +
or
 +
<pre class="apf">
 +
# echo -e '\033[9;X]'    (from framebuffer console)
 +
</pre>
 +
or to set it at each boot, use ''/etc/inittab'':
 +
<pre class="apf">
 +
tty1::sysinit:echo -e '\033[9;X]'
 +
</pre>
 +
 +
==Other usefull ESC sequences==
 +
* To (definitly) hide cursor:
 +
<pre class="apf">
 +
# echo -e '\033[?17;0;0c' > /dev/tty1    (from serial console)
 +
</pre>
 +
or
 +
<pre class="apf">
 +
# echo -e '\033[?17;0;0c'    (from framebuffer console)
 +
</pre>
 +
* inverse screen on:
 +
<pre class="apf">
 +
# echo -e '\033[?5h' > /dev/tty1
 +
</pre>
 +
* inverse screen off:
 +
<pre class="apf">
 +
# echo -e '\033[?5l' > /dev/tty1
 +
</pre>
 +
* To erase the screen
 +
<pre class="apf">
 +
echo -e '\033[2J' > /dev/tty1 (from serial console)
 +
</pre>
  
 +
=Links=
 +
* [[Linux_Boot_Logo|How to change the Linux boot logo]]
 +
* [[i.MX6 Framebuffer Overlay|How to play with Framebuffer overlay on APF6]]
 +
* [http://lxr.linux.no/linux/Documentation/VGA-softcursor.txt How to configure soft cursor]
 +
* http://linux-fbdev.sourceforge.net/
 +
* [http://www-curri.u-strasbg.fr/documentation/calcul/doc/ProPack/3SP1/docs/man_html/man4/console_codes.4.html Linux console ESC sequences]
 +
* http://directfb.org/
 +
* [http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:fbcon  Blackfin wiki page on the subject]
  
[[Category:Documentation]]
+
[[Category:Graphical User Interface]]
 +
[[Category:Framebuffer]]

Revision as of 12:47, 20 April 2017

On this page you will find usefull informations to have a working Linux Framebuffer on your board.

Introduction

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...

Kernel configuration

Note Note: Framebuffer is already configured (for Sharp LQ043 LCD on APF9328 and for Chimei LW700 on APF27/APF51) in standard/default Armadeus kernel image. APF28 has a boot option to choose the LCD.


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.

Userland

  • 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
Note Note: As explain on LinuxInstall page, to compile fbtest, libnetpbm10-dev must be installed in your host system


  • 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

Tips

  • 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 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)

or

 # 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)

or

 # 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)

Links