Skip to content

Latest commit

 

History

History
232 lines (142 loc) · 7.04 KB

KMS-DRM.md

File metadata and controls

232 lines (142 loc) · 7.04 KB

Welcome to HiGFXback with the KMS/DRM graphics backend!

Contents

Getting started

Components running on KMS/DRM graphics backend just use the DRM (Direct Rendering Manager) graphics driver interface (/dev/dri/card0) accessible through the libdrm.so library. As they directly access the memory of the display device, there is no compositing windowing system.

If the current graphics backend used on HiGFXback is not KMS/DRM, switch on it with startdrm command.

Components running on KMS/DRM graphics backend directly handle keyboard and mouse input events with the event device input driver interface (/dev/input/event0 and /dev/input/event1) available on HiGFXback.

But depending on the input peripheral, it's possible to use specific input driver interfaces if supported by the component running on the KMS/DRM graphics backend.

Note that event device input driver interface is also accessible through the libevdev.so library.

Kmscon

When starting on KMS/DRM graphics backend, kmscon terminal emulator is displayed. System informations about KMS/DRM settings can be get with modetest.

Back to Top

drm-tests, drm-howto

Programs running on KMS/DRM graphics backend are available as examples, tests or benchmarks.

$ modetest -s 23:1024x768
$ modeset

Back to Top

evtest, libevdev-events

Programs are available for testing event device input interfaces used by components running on KMS/DRM graphics backend.

Back to Top

Vulkan rendering

For display rendering with KMS/DRM graphics backend, Vulkan implementation in libvulkan.so library (loading library from Vulkan-Loader) and its ICD (Installable Client Driver) relies on Direct-to-Display WSI interface.

On HiGFXback, Direct-to-Display WSI interfaces (Window System Integration for KMS/DRM) are used with one of the following ICD selected with VK_ICD_FILENAMES environment variable:

  • Mesa associated to lvp_icd.json manifest file
  • SwiftShader associated to swiftshader_icd.json manifest file

But depending on the platform, specific ICD can be used.

Vulkan-Tools, Vulkan-Examples, vkcube2 and yagears2 programs are available as examples, tests or benchmarks.

$ vkcube
$ /drm/share/Vulkan-Examples/vulkanscene
$ vkcube2 -m khr -k 0:0:0
$ yagears2-vk -w vk-d2d

Back to Top

OpenGL rendering

For display rendering with KMS/DRM graphics backend, OpenGL implementation in libGL.so library, but also OpenGL ES 1.1 CM implementation in libGLESv1_CM.so library and OpenGL ES 2.0 implementation in libGLESv2.so library, rely on EGL for KMS/DRM interface through GBM (Generic Buffer Management) with the libgbm.so library.

Loading libraries can be used:

  • libGLEW.so library from GLEW (OpenGL Extension Wrangler)
  • libepoxy.so library from Epoxy

On HiGFXback, EGL for KMS/DRM interfaces are used with one of the following implementation selected with alternatives-GL command:

  • Mesa with libEGL.so -> libmesaEGL.so, libGL.so -> libmesaGL.so, libGLESv1_CM.so -> libmesaGLESv1_CM.so, libGLESv2.so -> libmesaGLESv2.so libraries
  • SwiftShader with libEGL.so -> libswiftshaderEGL.so, libGLESv1_CM.so -> libswiftshaderGLESv1_CM.so, libGLESv2.so -> libswiftshaderGLESv2.so libraries

But depending on the platform, specific implementation can be used.

mesa-demos and yagears programs are available as examples, tests or benchmarks.

$ /drm/share/mesa-demos/eglkms
$ yagears -b egl-drm -e gl
$ yagears -b egl-drm -e glesv1_cm
$ yagears -b egl-drm -e glesv2

Back to Top

Multimedia frameworks

FFmpeg

On HiGFXback, FFmpeg interfaces for KMS/DRM graphics backend are provided by libavformat.so, libavcodec.so, libswscale.so libraries and rely on libavdevice.so library for output.

ffmpeg program is available as example.

$ ffmpeg -loglevel quiet -re -i big_buck_bunny_480p_stereo.avi -s 854x480 -pix_fmt bgr0 -f kmsdumb /dev/dri/card0
$ ffmpeg -loglevel quiet -loop 1 -i ffmpeg-logo.png -s 808:216 -pix_fmt bgr0 -f kmsdumb /dev/dri/card0

Back to Top

GStreamer

On HiGFXback, GStreamer interfaces for KMS/DRM graphics backend are provided by libgstreamer-1.0.so library and rely on libgstkms.so plugin for output.

gst-launch-1.0 program is available as example.

$ gst-launch-1.0 -q filesrc location=big_buck_bunny_480p_stereo.avi ! decodebin ! videoconvert ! videobox autocrop=true ! kmssink
$ gst-launch-1.0 -q filesrc location=gstreamer-logo.jpg ! decodebin ! videoconvert ! imagefreeze ! videobox autocrop=true ! kmssink

Back to Top

Tools

Kmsi

$ kmsi tux.jpg
$ kmsi gnu.png

Kmspdf

$ kmspdf -r poppler vulkan11-reference-guide.pdf
$ kmspdf -r mupdf opengles20-reference-card.pdf

mpv

$ mpv -quiet -vo=drm 02_gran_dillama_1080p.mp4

Back to Top

Graphics abstraction layers

On HiGFXback, SDL (Simple Directmedia Layer) interfaces running on KMS/DRM graphics backend are provided by libSDL2.so library.

SDL2-test and yagears2 programs are available as examples, tests or benchmarks.

$ /drm/share/SDL2/test/testsprite2
$ /drm/share/SDL2/test/testgles2
$ yagears2-gui -t sdl -e glesv2
$ /drm/share/SDL2/test/testoverlay2 -scale 8
$ /drm/share/SDL2/test/testvulkan
$ yagears2-vk-gui -t sdl

Back to Top