Bug: 116741782

Clone this repo:
  1. cad46da DO NOT MERGE - Merge pi-dev@5234907 into stage-aosp-master by Xin Li · 4 months ago master
  2. da2bf7b Add default code reviewers into OWNERS am: e98b951207 am: 46aeb0c856 by Chih-Hung Hsieh · 5 months ago
  3. 46aeb0c Add default code reviewers into OWNERS am: e98b951207 by Chih-Hung Hsieh · 5 months ago
  4. e98b951 Add default code reviewers into OWNERS by Chih-Hung Hsieh · 5 months ago android-q-preview-1 android-q-preview-2.5 android-q-preview-4
  5. cbf264f libkmsxx: Add Android.bp file to build with AOSP am: c39eaab165 am: 37b9460964 by Andrew F. Davis · 8 months ago

Build Status

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

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

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


  • 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


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

Build instructions:

To build the Python bindings you need to set up the git-submodule for pybind11:

git submodule update --init

And to compile:

$ mkdir build
$ cd build
$ cmake ..
$ make -j4

Cross compiling instructions:

Directions for cross compiling depend on your environment.

These are for mine with buildroot:

$ mkdir build
$ cd build
$ cmake -DCMAKE_TOOLCHAIN_FILE=<buildrootpath>/output/host/usr/share/buildroot/toolchainfile.cmake ..
$ make -j4

Your environment may provide similar toolchainfile. If not, you can create a toolchainfile of your own, something along these lines:


SET(BROOT "<buildroot>/output/")

# specify the cross compiler
SET(CMAKE_C_COMPILER   ${BROOT}/host/usr/bin/arm-buildroot-linux-gnueabihf-gcc)
SET(CMAKE_CXX_COMPILER ${BROOT}/host/usr/bin/arm-buildroot-linux-gnueabihf-g++)

# where is the target environment


Build options

You can use the following cmake flags to control the build. Use -DFLAG=VALUE to set them.

Option nameValuesDefaultNotes
KMSXX_PYTHON_VERSIONpython3/python2python3;python2Name of the python pkgconfig file

Env variables

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

KMSXX_DISABLE_UNIVERSAL_PLANESSet to disable the use of universal planes
KMSXX_DISABLE_ATOMICSet to disable the use of atomic modesetting

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