1[](https://github.com/tomba/kmsxx/actions/workflows/c-cpp.yml) 2 3# kms++ - C++ library for kernel mode setting 4 5kms++ is a C++17 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 24``` 25meson setup build 26ninja -C build 27``` 28 29## Cross compiling instructions: 30 31``` 32meson build --cross-file=<path-to-meson-cross-file> 33ninja -C build 34``` 35 36Here is my cross file for arm32 (where ${BROOT} is path to my buildroot output dir): 37 38``` 39[binaries] 40c = ['ccache', '${BROOT}/host/bin/arm-buildroot-linux-gnueabihf-gcc'] 41cpp = ['ccache', '${BROOT}/host/bin/arm-buildroot-linux-gnueabihf-g++'] 42ar = '${BROOT}/host/bin/arm-buildroot-linux-gnueabihf-ar' 43strip = '${BROOT}/host/bin/arm-buildroot-linux-gnueabihf-strip' 44pkgconfig = '${BROOT}/host/bin/pkg-config' 45 46[host_machine] 47system = 'linux' 48cpu_family = 'arm' 49cpu = 'arm' 50endian = 'little' 51``` 52 53## Build options 54 55You can use meson options to configure the build. E.g. 56 57``` 58meson build -Dbuildtype=debug -Dkmscube=true 59``` 60 61Use `meson configure build` to see all the configuration options and their current values. 62 63kms++ specific build options are: 64 65Option name | Values | Default | Notes 66---------------- | ------------- | --------------- | -------- 67pykms | true, false | true | Python bindings 68kmscube | true, false | false | GLES kmscube 69omap | enabled, disabled, auto | auto | libdrm-omap support 70 71## Env variables 72 73You can use the following runtime environmental variables to control the behavior of kms++. 74 75Variable | Description 76--------------------------------- | ------------- 77KMSXX_DISABLE_UNIVERSAL_PLANES | Set to disable the use of universal planes 78KMSXX_DISABLE_ATOMIC | Set to disable the use of atomic modesetting 79KMSXX_DEVICE | Path to the card device node to use 80KMSXX_DRIVER | Name of the driver to use. The format is either "drvname" or "drvname:idx" 81 82## Python notes 83 84You can run the python code directly from the build dir by defining PYTHONPATH env variable. For example: 85 86``` 87PYTHONPATH=build/py py/tests/hpd.py 88``` 89