README: add notes about test tools
[android/external-libkmsxx.git] / README.md
1 # libkms++ - C++ library for kernel mode setting
3 libkms++ is a C++11 library for kernel mode setting.
5 Also included are simple test tools for KMS and python wrapper for libkms++.
7 ## Test tools
9 - kmsprint - print information about DRM objects
10 - testpat - set modes and show test pattern on crtcs/planes
11 - kmsview - view raw images
12 - db - simple double-buffering test
13 - kmscube - rotating 3D cube on crtcs/planes
15 ## Dependencies:
17 - libdrm
18 - SWIG 3.x (for python bindings)
19 - Python 3.x (for python bindings)
21 ## Build instructions:
23 ```
24 $ mkdir build
25 $ cd build
26 $ cmake ..
27 $ make -j4
28 ```
30 ## Cross compiling instructions:
32 Directions for cross compiling depend on your environment. These are for mine (buildroot):
34 As above, but specify `-DCMAKE_TOOLCHAIN_FILE=<path>/your-toolchain.cmake` for cmake, where your-toolchain.cmake is something similar to:
36 ```
37 SET(CMAKE_SYSTEM_NAME Linux)
39 SET(BROOT "<buildroot>/output/")
41 # specify the cross compiler
42 SET(CMAKE_C_COMPILER   ${BROOT}/host/usr/bin/arm-buildroot-linux-gnueabihf-gcc)
43 SET(CMAKE_CXX_COMPILER ${BROOT}/host/usr/bin/arm-buildroot-linux-gnueabihf-g++)
45 # where is the target environment
46 SET(CMAKE_FIND_ROOT_PATH ${BROOT}/target ${BROOT}/host)
48 SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
49 SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
50 SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
51 ```
53 ## Build options
55 You can use the following cmake flags to control the build. Use `-DFLAG=VALUE` to set them.
57 Option name          | Values        | Default
58 -------------------- | ------------- | --------
59 CMAKE_BUILD_TYPE     | Release/Debug | Release
60 LIBKMS_ENABLE_PYTHON | ON/OFF        | ON
61 LIBKMS_ENABLE_KMSCUBEĀ | ON/OFF       | OFF
63 ## Env variables
65 You can use the following environmental variables to control the behavior of libkms.
67 Variable                          | Description
68 --------------------------------- | -------------
69 LIBKMSXX_DISABLE_UNIVERSAL_PLANES | Set to disable the use of universal planes
70 LIBKMSXX_DISABLE_ATOMIC           | Set to disable the use of atomic modesetting