Using the Screen Graphics Subsystem
The default buildfile (imx8mp-evk.build that's provided with this BSP doesn't build an image that starts the Screen Graphics Subsystem (Screen). Instead, you must use the image that's built from the imx8mp-evk-graphics.build file, which starts Screen automatically.
The Screen Graphics Subsystem (Screen) includes the libraries, services and tools required to run graphics applications on the board with supported graphics processors, and to manage graphics shown on the display. To use Screen, you must configure the graphics and display and ensure that you have the necessary binaries required on your target. To confirm whether Screen is running properly on your target, we provide demo applications with this BSP that you can run on the target. This chapter provides an overview of how to use Screen on your target, but for detailed information, you should refer to the Screen Graphics Subsystem Developer's Guide in the QNX Software Development Platform 8.0 documentation.
Graphics configuration
The specifics of a board’s graphics configuration, such as the target's output display port or the output resolution, are defined in the graphics configuration file (graphics.conf file). The graphics configuration file and required Screen binaries are found in the $QNX_TARGETarch64le/usr/lib/graphics/iMX8MP directory on your host installation. On the target, the same binaries and configuration are typically located at /usr/lib/graphics/iMX8MP/. Before you start Screen, you must ensure that the LD_LIBRARY_PATH environment variable includes the path to the Screen binaries. In the example buildfile, this has been done for you, but if you haven't done this, here what you can do before starting Screen:
# export LD_LIBRARY_PATH=/proc/boot:/lib:/usr/lib:/lib/dll:/lib/dll/pci:\
/usr/lib/graphics/iMX8MP
# screen -c /usr/lib/graphics/iMX8MP/graphics.conf
# slay screen
# screen -c /usr/lib/graphics/iMX8MP/graphics.conf
For more information about the Screen Graphics Subsystem, see the Screen Graphics Subsystem Developer’s Guide in the QNX Software Development Platform 8.0 documentation.
Configure the display for Screen
In the graphics.conf file, the video-mode setting must match the screen resolution and frame rate supported by the display that's connected to your board. Screen reads these parameters from the graphics.conf file to initialize the display drivers. These are the suggested resolutions and frame rates for displays that can be found in the graphics.conf file:- 1920 x 1080 @ 60 (default)
- 1280 x 1024 @ 75
- 1280 x 1024 @ 60
- 1280 x 720 @ 60
- 1152 x 864 @ 75
- 1024 x 768 @ 75
- 1024 x 768 @ 60
- 800 x 600 @ 75
- 800 x 600 @ 60
- 640 x 480 @ 75
- 640 x 480 @ 60
video-mode
in the graphics.conf file as shown
here:...
...
begin display 1
video-mode = 1920 x 1080 @ 60
end display
begin display 2
video-mode = 1920 x 1080 @ 60
end display
...
...
For more information about configuring the display subsection
in the
graphics.conf, see Configure display subsectionin the Screen Graphics Subsystem Developer's Guide.
Display drivers
The video display configuration libraries available are $QNX_TARGET/aarch64le/usr/lib/graphics/iMX8MP/libWFDimx8m.so and $QNX_TARGET/aarch64le/usr/lib/graphics/iMX8MP/libwfdcfg-imx8mp-dsi-oled.so.
Using the GPU
- $QNX_TARGET/aarch64le/usr/lib/graphics/iMX8MP/libEGL_viv.so
- $QNX_TARGET/aarch64le/usr/lib/graphics/iMX8MP/libGalcore.so
- $QNX_TARGET/aarch64le/usr/lib/graphics/iMX8MP/libGAL.so
- $QNX_TARGET/aarch64le/usr/lib/graphics/iMX8MP/libGLES_CL_viv.so
- $QNX_TARGET/aarch64le/usr/lib/graphics/iMX8MP/libGLES_CM_viv.so
- $QNX_TARGET/aarch64le/usr/lib/graphics/iMX8MP/libGLESv2_viv.so
- $QNX_TARGET/aarch64le/usr/lib/graphics/iMX8MP/libGLSLC.so
- $QNX_TARGET/aarch64le/usr/lib/graphics/iMX8MP/libOpenCL.so
- $QNX_TARGET/aarch64le/usr/lib/graphics/iMX8MP/libOpenVG_viv.so
- $QNX_TARGET/aarch64le/usr/lib/graphics/iMX8MP/libVSC.so
Run Screen applications
This BSP archive comes with built-in demo applications that show how to use Screen. It's a good idea to run these demos on your target to confirm that Screen is configured properly and all the necessary drivers are available for Screen to run. If the following demo applications run successfully, it's a good indication that Screen is properly configured on your target.
- sw-vsync
- Shows vsync that uses software rendering, but doesn't use GLES. This application is useful to test your display works with basic Screen functionality.
Figure 1sw-vsync
- gles2-gears
- Shows gears that use OpenGL ES 2.X for the rendering API; if gles2-gears
runs, then it confirms that screen and drivers
necessary for OpenGL ES 2.x have
started successfully.
Figure 2gles2-gears
For more information about using the utilities or debugging them, see the
Utilities and Binaries
and the Debugging
chapters in the Screen Developer's Guide, respectively.
Create Screen applications
When you create an application that supports Screen, it must link to the Screen library (libscreen.so). This library provides the interfaces for applications to use the Screen API. Depending on the graphical requirements of your application, you may need to link in additional libraries. Below are some of the libraries commonly used when building applications that use Screen:- libEGL
- The interface to access vendor-specific EGL functionality. Refer to the EGL standard from www.khronos.org.
- libGLESv2
- The interface to access vendor-specific OpenGL ES functionality. Refer to the OpenGL ES standard from www.khronos.org.
- libimg
- The interface to load and decode images. For more information, see the Image Library Reference guide in the QNX Software Development Platform 8.0 documentation.
For more information about application development using Screen, see the
Screen Graphics Subsystem Developer’s Guide. For
information about linking libraries, see QNX C/C++ Project properties
in the Reference
chapter of the QNX Momentics IDE User's Guide or the Compiling and Debugging
chapter of the QNX OS
Programmer's Guide.