Bug: 116741782

Clone this repo:
  1. e98b951 Add default code reviewers into OWNERS by Chih-Hung Hsieh · 6 weeks ago master sdk-release
  2. c39eaab libkmsxx: Add Android.bp file to build with AOSP by Andrew F. Davis · 7 months ago android-wear-8.0.0_r2
  3. 0e3e4ad Add metadata files and update LICENSE for modedb_cea.cpp by Alistair Strachan · 6 months ago
  4. 32cb9d6 libkmsxx: Add include of <cerrno.h> to various files by Andrew F. Davis · 7 months ago
  5. e77f68c Merge commit 'e0067bdc75566629c9143818c8f3970c16c8825e' by Alistair Strachan · 5 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