Tux
Communication
Mailing lists
Documentation
User Manual
Target board info.
Target chip info.
Support
Linux support
Bugzilla
Downloads
STLinux
Updates
Search
Google


The web
stlinux.com
Graphics and Video Drivers
Framebuffer Driver
ST Logo

Introduction

A framebuffer driver is available for STi5528 and STm8000 SoC based systems. This driver supports mode change, vertical panning and virtual terminals. This allows the use of the framebuffer based X11 server and DirectFB. The driver presents a memory mapped, truecolour, graphics framebuffer that supports 16, 24 and 32bit colour depths.

Kernel Pre-requesites

The framebuffer driver consists of a number of kernel modules. Before these can be used the kernel must have been built with the option CONFIG_FB set. This option is selected by the "Support for frame buffer devices" which can be found in "Device Drivers/Graphics support" in the kernel configuration tools.

Secondly the ST graphics devices use system memory for display buffers; in order to allocate the required large contiguous memory regions, CONFIG_BIGPHYS_AREA must be configured. This can be done using the "Big Physical Area" option which can be found in "System types" in the kernel configuration tools. When booting the kernel, a kernel command line option is required to reserve a number of memory pages for bigphysarea; e.g. bigphysmem=4000 reserves 16Mb.

Finally, in order to control the SCART A/V switch present on platforms such as the Espresso, the I2C subsystem and ST40 I2C bit banging driver must be configured into the kernel. To do this, in the kernel configuration, enter the "Device Drivers" menu, and under "I2C support", enable "I2C support", which will cause more options to be displayed. One of these is the "I2C Hardware Bus support" menu, where "STMicroelectronics ST40 PIO I2C" should be enabled.

Additionally the "Virtual terminal" (CONFIG_VT) option in "Device Drivers/Character devices" may be selected. If this is done a new set of options will become available in "Device Drivers/Graphics support/Console display driver support". It is necessary to turn off the "VGA text console" option (CONFIG_VGA_CONSOLE) and turn on the "Framebuffer console support" option (CONFIG_FRAMEBUFFER_CONSOLE).

Building the kernel modules

The kernel modules are supplied in source code to allow them to be built against the kernel which is being used on the target system. To build them simply copy the source files into a local directory, and invoke the Makefile, specifying the location of the built kernel tree. For example:

host% cp -a /opt/STM/STLinux-2.0/devkit/kernel/stgfb-0.1_20050421 .
host% cd stgfb-0.1_20050421/Linux
host% make ST40KERNEL=/home/fred/kernel

If you specify the directory where the kernel build process should place object files (using the O= option to make), then the same option must be supplied when building the graphics modules.

Finally to install the modules, as root execute:

host# make ST40KERNEL=/home/fred/kernel \
        INSTALL_MOD_PATH=/opt/STM/STLinux-2.0/devkit/sh4/target \
	INSTALL_MOD_DIR=stgfb \
	modules_install

Inserting the Kernel modules

There are four modules required to start the framebuffer, which can typically be found in:

/lib/modules/kernel version string/extras

in the target filesystem. On the STm8000 they can be installed with the following commands:

target# cd /lib/modules/2.6.11/extras
target# insmod cfbcopyarea.ko
target# insmod cfbfillrect.ko
target# insmod cfbimgblt.ko
target# insmod stmfbdev-stm8000.ko

The cfb*.ko modules are generic software implementations of console drawing operations that are currently not accelerated by the driver. The order in which these are installed is not important, but they must be installed before the stmfbdev-SOCNAME.ko driver module.

Default Display Mode

When the framebuffer modules is installed a default display mode will be started. If no module parameters are specified, this will be 720x576@50Hz interlaced, PAL BDGHI colour standard and a 16bit RGB565 framebuffer format. If there is insufficient memory available (via the bigphysarea interface) for the default display mode, the loading of the framebuffer driver will fail. This default mode can be altered using various module parameters to "stgfb.ko" when it is loaded.

Module Parameters
Name Values
tvstandard= N, n, P, p, S or s (default is "P" i.e PAL)
bitdepth= 16,24 or 32 (default is 16)
fbsize= size of framebuffer memory in bytes

For example to start with a default NTSC, 32bit framebuffer with extra memory for panning/double buffering you might use:

target# insmod stgfb.ko tvstandard=N bitdepth=32 fbsize=300000

Note that the default NTSC mode timing is 720x480@59.94Hz interlaced. The "S" option selects 720x576@50Hz interlaced with the SECAM colour standard.

If the "fbsize" parameter is not specified then the driver attempts to allocate the minimum amount of memory required for the default mode. If the "fbsize" parameter is given but the default mode requires more memory than the amount specified, the size is adjusted up to fit the default mode's requirements.

Valid HTML 4.01! Last updated: 2007/08/22 10:30:38
© Copyright STMicroelectronics Limited, 2005
Printer