1 # kms++ - C++ library for kernel mode setting
3 kms++ is a C++11 library for kernel mode setting.
5 Also included are some simple utilities for KMS and python bindings for kms++.
7 ## Utilities
9 - testpat - set modes and planes and show test pattern on crtcs/planes, and test page flips
10 - kmsprint - print information about DRM objects
11 - kmsview - view raw images
12 - kmscube - rotating 3D cube on crtcs/planes
13 - kmscapture - show captured frames from a camera on screen
15 ## Dependencies:
17 - libdrm
18 - Python 3.x (for python bindings)
20 ## Build instructions:
22 To build the Python bindings you need to set up the git-submodule for pybind11:
24 ```
25 git submodule update --init
26 ```
28 And to compile:
30 ```
31 $ mkdir build
32 $ cd build
33 $ cmake ..
34 $ make -j4
35 ```
37 ## Cross compiling instructions:
39 Directions for cross compiling depend on your environment.
41 These are for mine with buildroot:
43 ```
44 $ mkdir build
45 $ cd build
46 $ cmake -DCMAKE_TOOLCHAIN_FILE=<buildrootpath>/output/host/usr/share/buildroot/toolchainfile.cmake ..
47 $ make -j4
48 ```
50 Your environment may provide similar toolchainfile. If not, you can create a toolchainfile of your own, something along these lines:
52 ```
53 SET(CMAKE_SYSTEM_NAME Linux)
55 SET(BROOT "<buildroot>/output/")
57 # specify the cross compiler
58 SET(CMAKE_C_COMPILER ${BROOT}/host/usr/bin/arm-buildroot-linux-gnueabihf-gcc)
59 SET(CMAKE_CXX_COMPILER ${BROOT}/host/usr/bin/arm-buildroot-linux-gnueabihf-g++)
61 # where is the target environment
62 SET(CMAKE_FIND_ROOT_PATH ${BROOT}/target ${BROOT}/host)
64 SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
65 SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
66 SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
67 ```
69 ## Build options
71 You can use the following cmake flags to control the build. Use `-DFLAG=VALUE` to set them.
73 Option name | Values | Default | Notes
74 --------------------- | ------------- | -------- | --------
75 CMAKE_BUILD_TYPE | Release/Debug | Release |
76 BUILD_SHARED_LIBS | ON/OFF | OFF |
77 KMSXX_ENABLE_PYTHON | ON/OFF | ON |
78 KMSXX_ENABLE_KMSCUBE | ON/OFF | OFF |
80 ## Env variables
82 You can use the following runtime environmental variables to control the behavior of kms++.
84 Variable | Description
85 --------------------------------- | -------------
86 KMSXX_DISABLE_UNIVERSAL_PLANES | Set to disable the use of universal planes
87 KMSXX_DISABLE_ATOMIC | Set to disable the use of atomic modesetting