|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | - | - |
| ext/pybind11/ | | 03-May-2024 | - | | |
| kms++/ | | 03-May-2024 | - | 4,060 | 2,981 |
| kms++util/ | | 03-May-2024 | - | 4,891 | 3,878 |
| kmscube/ | | 03-May-2024 | - | 1,619 | 1,116 |
| py/ | | 03-May-2024 | - | 3,259 | 2,385 |
| scripts/ | | 03-May-2024 | - | 108 | 80 |
| utils/ | | 03-May-2024 | - | 3,055 | 2,364 |
| .gitignore | D | 03-May-2024 | 55 | 8 | 7 |
| .gitmodules | D | 03-May-2024 | 94 | 4 | 3 |
| .travis.yml | D | 03-May-2024 | 1.7 KiB | 82 | 63 |
| Android.bp | D | 03-May-2024 | 1.6 KiB | 60 | 53 |
| CMakeLists.txt | D | 03-May-2024 | 2.6 KiB | 91 | 65 |
| LICENSE | D | 03-May-2024 | 17.9 KiB | 410 | 321 |
| LTO.cmake | D | 03-May-2024 | 791 | 33 | 24 |
| METADATA | D | 03-May-2024 | 553 | 20 | 19 |
| MODULE_LICENSE_MPL2 | D | 03-May-2024 | 0 | | |
| NOTICE | D | 03-May-2024 | 17.9 KiB | 410 | 321 |
| OWNERS | D | 03-May-2024 | 141 | 4 | 3 |
| README.md | D | 03-May-2024 | 3 KiB | 102 | 69 |
| TODO | D | 03-May-2024 | 203 | 9 | 4 |
README.md
1[![Build Status](https://travis-ci.org/tomba/kmsxx.svg?branch=master)](https://travis-ci.org/tomba/kmsxx)
2
3# kms++ - C++ library for kernel mode setting
4
5kms++ is a C++11 library for kernel mode setting.
6
7Also included are some simple utilities for KMS and python bindings for kms++.
8
9## Utilities
10
11- kmstest - set modes and planes and show test pattern on crtcs/planes, and test page flips
12- kmsprint - print information about DRM objects
13- kmsview - view raw images
14- kmscube - rotating 3D cube on crtcs/planes
15- kmscapture - show captured frames from a camera on screen
16
17## Dependencies:
18
19- libdrm
20- Python 3.x (for python bindings)
21
22## Build instructions:
23
24To build the Python bindings you need to set up the git-submodule for pybind11:
25
26```
27git submodule update --init
28```
29
30And to compile:
31
32```
33$ mkdir build
34$ cd build
35$ cmake ..
36$ make -j4
37```
38
39## Cross compiling instructions:
40
41Directions for cross compiling depend on your environment.
42
43These are for mine with buildroot:
44
45```
46$ mkdir build
47$ cd build
48$ cmake -DCMAKE_TOOLCHAIN_FILE=<buildrootpath>/output/host/usr/share/buildroot/toolchainfile.cmake ..
49$ make -j4
50```
51
52Your environment may provide similar toolchainfile. If not, you can create a toolchainfile of your own, something along these lines:
53
54```
55SET(CMAKE_SYSTEM_NAME Linux)
56
57SET(BROOT "<buildroot>/output/")
58
59# specify the cross compiler
60SET(CMAKE_C_COMPILER ${BROOT}/host/usr/bin/arm-buildroot-linux-gnueabihf-gcc)
61SET(CMAKE_CXX_COMPILER ${BROOT}/host/usr/bin/arm-buildroot-linux-gnueabihf-g++)
62
63# where is the target environment
64SET(CMAKE_FIND_ROOT_PATH ${BROOT}/target ${BROOT}/host)
65
66SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY)
67SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
68SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
69```
70
71## Build options
72
73You can use the following cmake flags to control the build. Use `-DFLAG=VALUE` to set them.
74
75Option name | Values | Default | Notes
76--------------------- | ------------- | --------------- | --------
77CMAKE_BUILD_TYPE | Release/Debug | Release |
78BUILD_SHARED_LIBS | ON/OFF | OFF |
79KMSXX_ENABLE_PYTHON | ON/OFF | ON |
80KMSXX_ENABLE_KMSCUBE | ON/OFF | OFF |
81KMSXX_PYTHON_VERSION | python3/python2 | python3;python2 | Name of the python pkgconfig file
82
83## Env variables
84
85You can use the following runtime environmental variables to control the behavior of kms++.
86
87Variable | Description
88--------------------------------- | -------------
89KMSXX_DISABLE_UNIVERSAL_PLANES | Set to disable the use of universal planes
90KMSXX_DISABLE_ATOMIC | Set to disable the use of atomic modesetting
91KMSXX_DEVICE | Path to the card device node to use
92KMSXX_DRIVER | Name of the driver to use. The format is either "drvname" or "drvname:idx"
93
94## Python notes
95
96You can run the python code directly from the build dir by defining PYTHONPATH env variable. For example:
97
98```
99PYTHONPATH=build/py py/tests/hpd.py
100
101```
102