Skip to content
Andrew Duncan edited this page Sep 11, 2013 · 16 revisions

Using the DispmanX API on the Raspberry Pi

Disclaimer

I am not associated with either the Raspberry Pi Foundation or Broadcom Europe Ltd. The information presented here is from my own experience experimenting with the DispmanX API and by examining other publicly available source code that uses the DispmanX API. You use the information provided here at your own risk. While all care has been taken in providing this information, no responsibility will be accepted if you use this information.

The software included in this repository is provided 'as is' without warranty of any kind, expressed or implied, including buy not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the author or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.

Introduction

There are a number of APIs available for the Raspberry Pi that can make use of the computers GPU. These include OpenMAX, Open GL ES(1 and 2) and OpenVG. The raspberrypi/firmware repository has short example programs using these and other APIs. They can be found in /opt/vc/src/hello_pi/ on the Raspbian 'wheezy' image, and probably in the same place on other distribution. Among these examples is a program called hello_dispmanx. It is a very small example of the Dispmanx windowing system. Apart from this example, there is very little documentation available for this API. There are snippets of information on the Raspberry Pi forum, but I have not found a single place with detailed information on DispmanX. Hopefully the programs in this repository and this wiki can be used as a starting point for anyone wanting to make use of DispmanX.

Basics

Image Types

Displaying an Image

Opening the Display and getting display width and height

Creating a resource and writing image data to the GPU

Adding an element to display the image data

The three rectangles

Layer numbering

Rotation

Cleaning up

Hiding the framebuffer

Double Buffering

Sprites

Taking a snapshot