KMS++: C++11 library, utilities and python bindings for Linux kernel mode setting
  • C++ 66.8%
  • Python 18.1%
  • C 13%
  • Meson 2.1%
Find a file
cmitu 4ff33a88cb framebuffer: use older function to get FB info
Use the old 'drmModeGetFB' function for FB info to support older `libdrm` and Linux kernel versions (i.e. Buster).
We only lose the pixel format info, which we don't need for `runcommand` integration.
2024-01-25 05:14:40 +00:00
.github/workflows workflows: Use "meson setup" 2023-10-06 13:29:28 +03:00
kms++ framebuffer: use older function to get FB info 2024-01-25 05:14:40 +00:00
kms++util testpat: Fix memory mapping in threaded drawing 2023-11-15 08:52:57 +02:00
kmscube meson: Add summary 2023-02-24 18:10:42 +02:00
py py: pic.py: Add simple test for fb.map() 2023-11-08 09:28:59 +02:00
scripts Add .clang-format and format-all script 2020-10-09 15:54:43 +03:00
subprojects Update pybind11 to 2.10.4 2023-05-29 16:11:49 +03:00
utils utils: added a custom "kmsprint" 2024-01-25 05:14:40 +00:00
.clang-format Add .clang-format and format-all script 2020-10-09 15:54:43 +03:00
.clang-tidy Add .clang-tidy 2020-12-01 09:14:34 +02:00
.gitignore gitignore: add .cache 2021-10-06 10:12:00 +03:00
.gitmodules Remove pybind11 git submodule 2020-12-16 10:26:04 +02:00
.travis.yml Use system libfmt 2020-12-16 08:58:48 +02:00
Android.bp Add Android.bp file to build with AOSP 2018-09-28 19:19:13 +03:00
LICENSE Use full license text to help github figure out the license 2018-01-12 14:55:20 +02:00
meson.build Fix issues related to utils & libutils 2023-10-06 13:28:33 +03:00
meson_options.txt meson: Remove static-libc option 2023-06-12 08:59:28 +03:00
README.md README: fix compile instructions 2023-09-30 19:20:59 +03:00
TODO Update TODO 2016-05-30 20:55:16 +03:00

Build Status

kms++ - C++ library for kernel mode setting

kms++ is a C++17 library for kernel mode setting.

Also included are some simple utilities for KMS and python bindings for kms++.

Utilities

  • kmstest - set modes and planes and show test pattern on crtcs/planes, and test page flips
  • kmsprint - print information about DRM objects
  • kmsview - view raw images
  • kmscube - rotating 3D cube on crtcs/planes
  • kmscapture - show captured frames from a camera on screen

Dependencies:

  • libdrm
  • Python 3.x (for python bindings)

Build instructions:

meson setup build
ninja -C build

Cross compiling instructions:

meson build --cross-file=<path-to-meson-cross-file>
ninja -C build

Here is my cross file for arm32 (where ${BROOT} is path to my buildroot output dir):

[binaries]
c = ['ccache', '${BROOT}/host/bin/arm-buildroot-linux-gnueabihf-gcc']
cpp = ['ccache', '${BROOT}/host/bin/arm-buildroot-linux-gnueabihf-g++']
ar = '${BROOT}/host/bin/arm-buildroot-linux-gnueabihf-ar'
strip = '${BROOT}/host/bin/arm-buildroot-linux-gnueabihf-strip'
pkgconfig = '${BROOT}/host/bin/pkg-config'

[host_machine]
system = 'linux'
cpu_family = 'arm'
cpu = 'arm'
endian = 'little'

Build options

You can use meson options to configure the build. E.g.

meson build -Dbuildtype=debug -Dkmscube=true

Use meson configure build to see all the configuration options and their current values.

kms++ specific build options are:

Option name Values Default Notes
pykms true, false true Python bindings
kmscube true, false false GLES kmscube
omap enabled, disabled, auto auto libdrm-omap support

Env variables

You can use the following runtime environmental variables to control the behavior of kms++.

Variable Description
KMSXX_DISABLE_UNIVERSAL_PLANES Set to disable the use of universal planes
KMSXX_DISABLE_ATOMIC Set to disable the use of atomic modesetting
KMSXX_DEVICE Path to the card device node to use
KMSXX_DRIVER Name of the driver to use. The format is either "drvname" or "drvname:idx"

Python notes

You can run the python code directly from the build dir by defining PYTHONPATH env variable. For example:

PYTHONPATH=build/py py/tests/hpd.py