Template:Glsdk running graphics demos

Running OMAP DRM DSS Examples
The drmclone, drmextended, and modetest examples demonstrates how to create a CRTC (i.e. FB) and display planes (overlays) on the CRTC. Additionally, drmtest demonstrates similar functionality as the previously mentioned demos, along with dynamic plane updates for 2 CRTCs.

Retrieve the omapdrm-tests source

git clone https://github.com/tomba/omapdrm-tests.git cd omapdrm-tests

Run (or example planescale)

./planescale

Graphics Demos from Command Line
The graphics driver and userspace libraries and binaries are distributed along with the SDK.

Graphic demos can also run from command line. In order to do so, exit Weston by pressing Ctrl-Alt-Backspace from the keyboard which connects to the EVM. Then, if the LCD screen stays in "Please wait...", press Ctrl-Alt-F1 to go to the command line on LCD console. After that, the command line can be used from serial console, SSH console, or LCD console. Graphic demos can also run from command line. In order to do so, exit Weston by pressing Ctrl-Alt-Backspace from the keyboard which connects to the EVM. Then, if the LCD screen stays in "Please wait...", press Ctrl-Alt-F1 to go to the command line on LCD console. After that, the command line can be used from serial console, SSH console, or LCD console.

Please make sure the board is connected to atleast one display before running these demos.

kmscube
Run kmscube on default display (HDMI): target # kmscube

Run kmscube on default display (LCD): target # kmscube Run kmscube on secondary display (HDMI): target # kmscube -c  target # kmscube -c 16 #Usually, the connector id for HDMI is 16. Run kmscube on all connected displays (LCD & HDMI & FPDLink(optional)): target # kmscube -a

Run kmscube on default display (HDMI): target # kmscube Run kmscube on secondary display (LCD): target # kmscube -c  target # kmscube -c 16 #Usually, the connector id for LCD is 16. Run kmscube on all connected displays (LCD & HDMI): target # kmscube -a

kmscube with video
This demo allows a video frame to be applied as a texture onto the surface of the kmscube. The user can invoke the demo by following the syntax below:

target # viddec3test  --kmscube --connector 

This feature is not supported on OMAP5 based releases.

Run kmscube with video on default display (LCD): target # viddec3test  --kmscube Run kmscube with video on secondary display (HDMI): target # viddec3test  --kmscube --connector 16 #Usually, the connector id for HDMI is 16.

Run kmscube with video on default display (HDMI): target # viddec3test  --kmscube Run kmscube with video on secondary display (LCD): target # viddec3test  --kmscube --connector 16 #Usually, the connector id for HDMI is 16.

Additionally, to change the field of view of the rotating cube, the user can specify the same on the command line like below:

target # viddec3test  --kmscube --connector  --fov

Wayland/Weston
Wayland/Weston version brings in the multiple display support in extended desktop mode and the ability to drag-and-drop windows from one display to the other.

To execute the demos, the graphics driver must be initialized by running start weston, if this has not been done earlier.

target # /etc/init.d/weston start

To launch weston without using systemd init scripts, do the following:

On all connected displays (LCD, HDMI and FPDLink): target # weston --tty=1 --backend=drm-backend.so

On default display (HDMI): target # weston --tty=1 --connector=4 On secondary display (LCD): target # weston --tty=1 --connector=16 On all connected displays (LCD and HDMI): target # weston --tty=1

By default, the screensaver timeout is configured to 300 seconds.

The user can change the screensaver timeout using a command line option --idle-time=

To disable the screen timeout and to configure weston configured to display on all connectors, use the option with "0" as the input: --idle-time=0

The filesystem comes with a preconfigured weston.ini file which will be located in

/etc/weston.ini /etc/weston.ini

Running weston clients
Weston client examples can run from the command line on serial port console or SSH console. After launching weston, the user should be able to use the keyboard and the mouse for various controls.

# /usr/bin/weston-flower # /usr/bin/weston-clickdot # /usr/bin/weston-cliptest # /usr/bin/weston-dnd # /usr/bin/weston-editor # /usr/bin/weston-eventdemo # /usr/bin/weston-image /usr/share/weston/terminal.png # /usr/bin/weston-resizor # /usr/bin/weston-simple-egl # /usr/bin/weston-simple-shm # /usr/bin/weston-simple-touch # /usr/bin/weston-smoke # /usr/bin/weston-info # /usr/bin/weston-terminal

There is one icon on the top right hand corner of the weston desktop window which has been configured for
 * weston-terminal

Clicking this icon should launch the applications on the Weston Desktop.

It is possible to add other icons by editing the weston.ini file.

There are several other applications that are included in the default filesystem. To invoke these applications, the user should launch the weston-terminal (top right hand corner of the desktop) and then invoke the client apps as described below from within the terminal window:

wayland sh # /usr/bin/weston-flower wayland sh # /usr/bin/weston-clickdot wayland sh # /usr/bin/weston-cliptest wayland sh # /usr/bin/weston-dnd wayland sh # /usr/bin/weston-editor wayland sh # /usr/bin/weston-eventdemo wayland sh # /usr/bin/weston-image /usr/share/weston/terminal.png wayland sh # /usr/bin/weston-resizor wayland sh # /usr/bin/weston-simple-egl wayland sh # /usr/bin/weston-simple-shm wayland sh # /usr/bin/weston-simple-touch wayland sh # /usr/bin/weston-smoke wayland sh # /usr/bin/weston-info wayland sh # /usr/bin/weston-terminal

Running multimedia with Wayland sink
The GStreamer video sink for Wayland is the waylandsink. To use this video-sink for video playback:

target # gst-launch-1.0 playbin uri=file:// video-sink=waylandsink

Exiting weston
Terminate all Weston clients before exiting Weston. If you have invoked Weston from the serial console, exit Weston by pressing Ctrl-C.

It is also possible to invoke Weston from the native console, exit Weston by using pressing Ctrl-Alt-Backspace.

Using IVI shell feature
The SDK also has support for configuring weston ivi-shell. The default shell that is configured in the SDK is the desktop-shell.

To change the shell to ivi-shell, the user will have to add the following lines into the /etc/weston.ini.

To switch back to the desktop-shell can be done by commenting these lines in the /etc/weston.ini (comments begin with a '#' at the start of line).

[core] shell=ivi-shell.so [ivi-shell] ivi-module=ivi-controller.so ivi-input-module=ivi-input-controller.so

After the above configuration is completed, we can restart weston by running the following commands

target# /etc/init.d/weston stop target# /etc/init.d/weston start

NOTE: When weston starts with ivi-shell, the default background is black, this is different from the desktop-shell that brings up a window with background.

With ivi-shell configured for weston, wayland client applications use ivi-application protocol to be managed by a central HMI window management. The wayland-ivi-extension provides ivi-controller.so to manage properties of surfaces/layers/screens and it also provides the ivi-input-controller.so to manage the input focus on a surface.

Applications must support the ivi-application protocol to be managed by the HMI central controller with an unique numeric ID.

Some important references to wayland-ivi-extension can be found at the following links: https://at.projects.genivi.org/wiki/display/WIE/01.+Quick+start https://at.projects.genivi.org/wiki/display/PROJ/Wayland+IVI+Extension+Design

Running weston’s sample client applications with ivi-shell
All the sample client applications in the weston package like weston-simple-egl, weston-simple-shm, weston-flower etc also have support for ivi-shell. The SDK includes the application called layer-add-surfaces which is part of the wayland-ivi-extension. This application allows the user to invoke the various functionalities of the ivi-shell and control the applications.

The following is an example sequence of commands and the corresponding effect on the target.

After launching the weston with the ivi-shell, please run the below sequence of commands:

target# weston-simple-shm & At this point nothing is displayed on the screen, some additional commands are required.

target# layer_add_surfaces 0 1000 2 &

This command creates a layer with ID 1000 and to add maximum 2 surfaces to this layer on the screen 0 (which is usually the LCD). At this point, the user can see weston-simple-shm running on LCD. This also prints the numericID (surfaceID) to which client’s surface is mapped as shown below:

CreateWithDimension: layer ID (1000), Width (1280), Height (800) SetVisibility     : layer ID (1000), ILM_TRUE layer: 1000 created surface               : 10369 created SetDestinationRectangle: surface ID (10369), Width (250), Height (250) SetSourceRectangle    : surface ID (10369), Width (250), Height (250) SetVisibility         : surface ID (10369), ILM_TRUE layerAddSurface       : surface ID (10369) is added to layer ID (1000)

Here 10369 is the number to which weston-simple-shm application’s surface is mapped.

User can launch one more client application which allows layer_add_surfaces to add second surface to the layer 1000 as shown below.

target# weston-flower &

User can control the properties of the above surfaces using LayerManagerControl as shown below to set the position, resize, opacity and visibility respectively.

target# LayerManagerControl set surface 10369 position 100 100 target# LayerManagerControl set surface 10369 destination region 150 150 300 300 target# LayerManagerControl set surface 10369 opacity 0.5 target# LayerManagerControl set surface 10369 visibility 1

target# LayerManagerControl help

The help option prints all possible control operations with the LayerManagerControl binary, please refer to the available options.

IMG PowerVR Demos
The Processor SDK Linux Automotive filesystem comes packaged with example OpenGLES applications. Both DRM and Wayland based applications are packaged as part of the filesystem.

The examples running on Wayland can be invoked using the below commands. target # /usr/bin/SGX/demos/Wayland/OGLES2ChameleonMan target # /usr/bin/SGX/demos/Wayland/OGLES2Navigation

The examples running on DRM/KMS can be invoked using the below commands. target # /usr/bin/SGX/demos/Raw/OGLES2ChameleonMan target # /usr/bin/SGX/demos/Raw/OGLES2Navigation

After you see the output on the display interface, hit q to terminate the application.

Using the PowerVR Tools
Please refer to http://community.imgtec.com/developers/powervr/graphics-sdk/ for additional details on the tools and detailed documentation.

The target file system includes tools such as PVRScope and PVRTrace recorder libraries from Imagination PowerVR SDK to profile and trace SGX activities. In addition, it also includes PVRPerfServerDeveloper tool.

PVRTune
PVRPerfServerDeveloper tool can be used along with the PVRTune running on the PC to gather data on the SGX loading and activity threads. You can invoke the tool with the below command:

target # /opt/img-powervr-sdk/PVRHub/PVRPerfServer/PVRPerfServerDeveloper

PVRTrace
The default filesystem contains helper scripts to obtain the PVRTrace of the graphics application. This trace can then be played back on the PC using the PVRTrace Utility.

To start tracing, use the below commands as reference:

target # cp /opt/img-powervr-sdk/PVRHub/Scripts/start_tracing.sh ~/. target # ./start_tracing.sh  

Example: target # ./start_tracing.sh westonapp weston-simple-egl

The above command will do the following:
 * 1) Setup the required environment for the tracing
 * 2) Create a directory under the current working directory called pvrtrace
 * 3) Launch the application specified by the user
 * 4) Start tracing the PVR Interactions and record the same to the log-filename

To end the tracing, user can invoke the Ctrl-C and the trace file path will be displayed.

The trace file can then be transferred to a PC and we can visualize the application using the host side PVRTrace utility. Please refer to the link at the beginning of this section for more details.