NOTICE: The Processors Wiki will End-of-Life on January 15, 2021. It is recommended to download any files or other content you may need that are hosted on processors.wiki.ti.com. The site is now set to read only.

Template:Glsdk running graphics demos

From Texas Instruments Wiki
Jump to: navigation, search

Running OMAP DRM DSS Examples[edit]

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[edit]

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.

Finding Connector ID[edit]

Note: Most of the applications used in the Demos would require the user to pass a connector id. A connector id is a number that is assigned to each of the display devices connected to the system. To get the list of the display devices connected and the corresponding connector id one can use the modetest application (shipped with the file system) as mentioned below:

  target #  modetest

Look for the display device for which the connector ID is required - such as HDMI, LCD etc.


Connectors:
id      encoder status          type    size (mm)       modes   encoders
4       3       connected       HDMI-A  480x270         20      3
  modes:
        name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
  1920x1080 60 1920 2008 2052 2200 1080 1084 1089 1125 flags: phsync, pvsync; type: preferred, driver
...
16      15      connected       unknown 0x0             1       15
  modes:
        name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
  800x480 60 800 1010 1040 1056 480 502 515 525 flags: nhsync, nvsync; type: preferred, driver

Usually, LCD is assigned 16 (800x480), and HDMI is assigned 4 (multiple resolutions). |

Connectors:
id  encoder status      type    size (mm)   modes   encoders
4   3   connected   unknown 0x0     1   3
  modes:
    name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
  1280x800 60 1280 1328 1360 1404 800 804 811 823 flags: nhsync, nvsync; type: preferred, driver
...
16  11  connected   HDMI-A  700x390     31  11
  modes:
    name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
  1280x720 60 1280 1390 1430 1650 720 725 730 750 flags: phsync, pvsync; type: preferred, driver

Usually LCD is assigned 4 (800x480), HDMI is assigned 16 (multiple resolutions).

Finding Plane ID[edit]

To find the Plane ID, run the modetest command:

  target #  modetest

Look for the section called Planes. (Sample truncated output of the Planes section is given below)

Planes:
id      crtc    fb      CRTC x,y        x,y     gamma size
19      0       0       0,0             0,0     0
 formats: RG16 RX12 XR12 RA12 AR12 XR15 AR15 RG24 RX24 XR24 RA24 AR24 NV12 YUYV UYVY
 props:
 ...
20      0       0       0,0             0,0     0
 formats: RG16 RX12 XR12 RA12 AR12 XR15 AR15 RG24 RX24 XR24 RA24 AR24 NV12 YUYV UYVY
 props:
 ...

kmscube[edit]

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 <connector-id>
  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 <connector-id>
  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[edit]

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 <path_to_the_file> --kmscube --connector <connector_number>

This feature is not supported on OMAP5 based releases.


Run kmscube with video on default display (LCD):

  target # viddec3test <path_to_the_file> --kmscube

Run kmscube with video on secondary display (HDMI):

  target # viddec3test <path_to_the_file> --kmscube --connector 16 #Usually, the connector id for HDMI is 16.


Run kmscube with video on default display (HDMI):

  target # viddec3test <path_to_the_file> --kmscube

Run kmscube with video on secondary display (LCD):

  target # viddec3test <path_to_the_file> --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 <path_to_the_file> --kmscube --connector <connector_number> --fov <number>

Wayland/Weston[edit]

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=<number of seconds>

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[edit]

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[edit]

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://<path-to-file-name> video-sink=waylandsink


Exiting weston[edit]

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[edit]

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[edit]

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[edit]

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[edit]

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 toolfor Jacinto6 platform.

PVRTune[edit]

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[edit]

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 <log-filename> <application-to-be-traced>

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.

Testing DSS WB pipeline[edit]

Memory to Memory (M2M)[edit]

  1. Identify the WB pipeline M2M device.

    # ls /sys/class/video4linux/
    Video0 video10 video11
    # cat  /sys/class/video4linux/video10/name
    omapwb-m2m
  2. Look at list of formats supported.

    # v4l2-ctl -d /dev/video10 --list-formats
    ioctl: VIDIOC_ENUM_FMT
            Index       : 0
            Type        : Video Capture Multiplanar
            Pixel Format: 'NV12'
            Name        : Y/CbCr 4:2:0
    
            Index       : 1
            Type        : Video Capture Multiplanar
            Pixel Format: 'YUYV'
            Name        : YUYV 4:2:2
    
            Index       : 2
            Type        : Video Capture Multiplanar
            Pixel Format: 'UYVY'
            Name        : UYVY 4:2:2
    
            Index       : 3
            Type        : Video Capture Multiplanar
            Pixel Format: 'XR24'
            Name        : 32-bit BGRX 8-8-8-8
  3. Use v4l2-ctl command to test the input output. Below command converts from NV12 to YUYV using WB pipeline in M2M mode.

    # v4l2-ctl -d /dev/video10 --set-fmt-video-out=width=1920,height=1080,pixelformat=NV12  \
    --stream-from=test/BigBuckBunny_1920_1080_24fps_100frames.nv12 \
    --set-fmt-video=width=1920,height=1080,pixelformat=YUYV \
    --stream-to=out/video_test_file.yuyv --stream-mmap=3 --stream-out-mmap=3 --stream-count=70 --stream-poll

Capture[edit]

  1. Identify the WB pipeline capture device.

    # ls /sys/class/video4linux/
    Video0 video10 video11
    # cat  /sys/class/video4linux/video11/name
    omapwb-cap
  2. Look at list of formats supported.

    # v4l2-ctl -d /dev/video11 --list-formats
    ioctl: VIDIOC_ENUM_FMT
            Index       : 0
            Type        : Video Capture Multiplanar
            Pixel Format: 'NV12'
            Name        : Y/CbCr 4:2:0
    
            Index       : 1
            Type        : Video Capture Multiplanar
            Pixel Format: 'YUYV'
            Name        : YUYV 4:2:2
    
            Index       : 2
            Type        : Video Capture Multiplanar
            Pixel Format: 'UYVY'
            Name        : UYVY 4:2:2
    
            Index       : 3
            Type        : Video Capture Multiplanar
            Pixel Format: 'XR24'
            Name        : 32-bit BGRX 8-8-8-8
    
  3. Use v4l2-ctl command to test the input output. Below command converts from NV12 to YUYV using WB pipeline in M2M mode.

    # v4l2-ctl -d /dev/video11 -i 0 --set-fmt-video=pixelformat=NV12 \
    --stream-to=/test/video_test_file.yuv --stream-mmap=6 --stream-count=10 --stream-poll
    Video input set to 0 (CRTC#0 - LCD1: ok)
    <<<<<<<<< 7.84 fps
    <
    # v4l2-ctl -d /dev/video11 -i 1 --set-fmt-video=pixelformat=NV12 --stream-to=/test/video
    _test_file.yuv --stream-mmap=6 --stream-count=10 --stream-poll
    Video input set to 1 (CRTC#1 - DIGIT/TV: ok)
    <<<<<<<<<< 8.65 fps