Difference between revisions of "Framebuffer"

From ArmadeusWiki
Jump to: navigation, search
m (intro)
m (writing rules)
Line 9: Line 9:
 
Following instructions are only given as references or if you want to change the default LCD:
 
Following instructions are only given as references or if you want to change the default LCD:
 
* launch Linux kernel configuration:
 
* launch Linux kernel configuration:
<pre>
+
<pre class="host">
 
  [armadeus]$ make linux26-menuconfig
 
  [armadeus]$ make linux26-menuconfig
 
</pre>
 
</pre>
 
* activates:
 
* activates:
  Device Drivers  ---> Character devices  ---> [*] Virtual terminal
+
<pre class="config">
Device Drivers  ---> Character devices  ---> [*]  Support for console on virtual terminal
+
  Device Drivers   
 +
    ---> Character devices  --->  
 +
        [*] Virtual terminal
 +
        [*]  Support for console on virtual terminal
 +
</pre>
 
* activates:
 
* activates:
  Device Drivers  ---> Graphics support  ---> <*> Support for frame buffer devices  ---> <*>  Motorola i.MX LCD support
+
<pre class="config">
 +
  Device Drivers   
 +
    ---> Graphics support   
 +
        <*> Support for frame buffer devices   
 +
        <*>  Motorola i.MX LCD support
 +
</pre>
 
* and choose your LCD in:
 
* and choose your LCD in:
 +
<pre class="config">
 
  LCD Panel (xxxx)  --->
 
  LCD Panel (xxxx)  --->
 +
</pre>
 
* activates:
 
* activates:
  Device Drivers  ---> Graphics support  ---> Console display driver support ---> <*> Framebuffer Console support
+
<pre class="config">
 +
  Device Drivers   
 +
    ---> Graphics support   
 +
        ---> Console display driver support
 +
            <*> Framebuffer Console support
 +
</pre>
 
* deactivates VGA stuff & add some fonts, then choose Armadeus boot logo
 
* deactivates VGA stuff & add some fonts, then choose Armadeus boot logo
  Device Drivers  ---> Graphics support  ---> [*] Bootup logo ---> [*]  224-color Armadeus Linux logo
+
<pre class="config">
 +
  Device Drivers  --->  
 +
    Graphics support  --->  
 +
        [*] Bootup logo
 +
        [*]  224-color Armadeus Linux logo
 +
</pre>
 
* recompiles the kernel:
 
* recompiles the kernel:
 +
<pre class="host">
 
  [armadeus]$ make linux26
 
  [armadeus]$ make linux26
 +
</pre>
 
* now to have console on serial port, you will have to add "console=ttySMX0,115200n8" to your boot parameters
 
* now to have console on serial port, you will have to add "console=ttySMX0,115200n8" to your boot parameters
 
* reflash kernel image on your board and enjoy ! (you should see Linux logo on screen at startup)
 
* reflash kernel image on your board and enjoy ! (you should see Linux logo on screen at startup)
Line 32: Line 55:
  
 
You can activate some tools from the Buildroot's menuconfig:  
 
You can activate some tools from the Buildroot's menuconfig:  
<pre>
+
<pre class="host">
 
  $ make menuconfig
 
  $ make menuconfig
  Package Selection for the target  ---> Graphic libraries and applications (graphic/text)  ---> fbset/fbv/fbgrab
+
</pre>
 +
<pre class="config">
 +
  Package Selection for the target   
 +
    ---> Graphic libraries and applications (graphic/text)   
 +
        ---> fbset/fbv/fbgrab
 
</pre>
 
</pre>
  
Line 40: Line 67:
  
 
==Tips==
 
==Tips==
 +
 
* To stop blinking cursor:
 
* To stop blinking cursor:
 +
<pre class="apf">
 
  # echo 0 > /sys/class/graphics/fbcon/cursor_blink
 
  # echo 0 > /sys/class/graphics/fbcon/cursor_blink
 +
</pre>
 
* To make it blinking again:
 
* To make it blinking again:
 +
<pre class="apf">
 
  # echo 1 > /sys/class/graphics/fbcon/cursor_blink
 
  # echo 1 > /sys/class/graphics/fbcon/cursor_blink
 +
</pre>
 
* To grab a screenshot of a running Framebuffer application, use [[FBGrab]]
 
* To grab a screenshot of a running Framebuffer application, use [[FBGrab]]
 
* To enter in Framebuffer low power mode:
 
* To enter in Framebuffer low power mode:
 +
<pre class="apf">
 
  # echo 1 > /sys/class/graphics/fb0/blank
 
  # echo 1 > /sys/class/graphics/fb0/blank
 +
</pre>
 
* To leave Framebuffer low power mode:
 
* To leave Framebuffer low power mode:
 +
<pre class="apf">
 
  # echo 0 > /sys/class/graphics/fb0/blank
 
  # echo 0 > /sys/class/graphics/fb0/blank
 +
</pre>
 
* To set low power mode entering time (where X is a time in minute; 0 = never):
 
* To set low power mode entering time (where X is a time in minute; 0 = never):
 +
<pre class="apf">
 
  # echo -e '\033[9;X]' > /dev/tty1    (from serial console)
 
  # echo -e '\033[9;X]' > /dev/tty1    (from serial console)
 +
</pre>
 
or
 
or
 +
<pre class="apf">
 
  # echo -e '\033[9;X]'    (from framebuffer console)
 
  # echo -e '\033[9;X]'    (from framebuffer console)
 +
</pre>
 
or to set it at each boot, use ''/etc/inittab'':
 
or to set it at each boot, use ''/etc/inittab'':
 +
<pre class="apf">
 
  tty1::sysinit:echo -e '\033[9;X]'
 
  tty1::sysinit:echo -e '\033[9;X]'
 +
</pre>
  
 
==Other usefull ESC sequences==
 
==Other usefull ESC sequences==
 
* To (definitly) hide cursor:
 
* To (definitly) hide cursor:
 +
<pre class="apf">
 
  # echo -e '\033[?17;0;0c' > /dev/tty1    (from serial console)
 
  # echo -e '\033[?17;0;0c' > /dev/tty1    (from serial console)
 +
</pre>
 
or
 
or
 +
<pre class="apf">
 
  # echo -e '\033[?17;0;0c'    (from framebuffer console)
 
  # echo -e '\033[?17;0;0c'    (from framebuffer console)
 +
</pre>
 
* inverse screen on:
 
* inverse screen on:
 +
<pre class="apf">
 
  # echo -e '\033[?5h' > /dev/tty1
 
  # echo -e '\033[?5h' > /dev/tty1
 +
</pre>
 
* inverse screen off:
 
* inverse screen off:
 +
<pre class="apf">
 
  # echo -e '\033[?5l' > /dev/tty1
 
  # echo -e '\033[?5l' > /dev/tty1
 +
</pre>
  
 
=Links=
 
=Links=

Revision as of 17:51, 5 February 2009

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, GTK, etc...

Kernel configuration

Framebuffer is already configured (for Sharp LQ043 LCD) in standard/default Armadeus kernel image.
Following instructions are only given as references or if you want to change the default LCD:

  • launch Linux kernel configuration:
 [armadeus]$ make linux26-menuconfig
  • activates:
 Device Drivers  
    ---> Character devices  ---> 
        [*] Virtual terminal
        [*]   Support for console on virtual terminal
  • activates:
 Device Drivers  
    ---> Graphics support  
        <*> Support for frame buffer devices  
        <*>   Motorola i.MX LCD support
  • and choose your LCD in:
 LCD Panel (xxxx)  --->
  • activates:
 Device Drivers  
    ---> Graphics support  
        ---> Console display driver support
            <*> Framebuffer Console support
  • deactivates VGA stuff & add some fonts, then choose Armadeus boot logo
 Device Drivers  ---> 
    Graphics support  ---> 
        [*] Bootup logo
        [*]   224-color Armadeus Linux logo
  • recompiles the kernel:
 [armadeus]$ make linux26
  • now to have console on serial port, you will have to add "console=ttySMX0,115200n8" to your boot parameters
  • reflash kernel image on your board and enjoy ! (you should see Linux logo on screen at startup)

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)  
        ---> fbset/fbv/fbgrab

You have several test tools on yahoo groups to play a little with the framebuffer.

Tips

  • To stop blinking cursor:
 # echo 0 > /sys/class/graphics/fbcon/cursor_blink
  • 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 low power mode:
 # echo 1 > /sys/class/graphics/fb0/blank
  • To leave Framebuffer low power mode:
 # echo 0 > /sys/class/graphics/fb0/blank
  • To set low power mode 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

Links