R-Car/Tests:KMS

This page describes how to use the kmsxx library and its Python bindings to test DRM/KMS drivers.

Requirements
kmsxx has a number of dependencies:
 * Python 3
 * cmake (minimum version 2.8.11)
 * a current build of libdrm; if your version is older than a couple of days, it is recommended to build a new one.
 * a C++ compiler supporting C++11

Getting the source code

 * 1) Check out kmsxx from https://github.com/tomba/kmsxx.git
 * 2) Check out the pybind11 submodule:

Using kmsxx with the Python bindings
It is now possible to access the driver API through kmsxx from Python:

Python 3.4.2 (default, Oct 8 2014, 14:47:30) [GCC 4.9.1] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import pykms >>> card = pykms.Card >>> conn = card.get_first_connected_connector >>> crtc = conn.get_current_crtc >>> crtc.mode.name '1024x768' [...]
 * 1) PYTHONPATH=build/py/:py/ python3

Automated testing
A version of kmsxx that adds a handful of automated tests can be found here: https://github.com/uli/kmsxx/tree/autotest.

Invoke the test suite using. The output should look something like this: aaa_sanity.py Testing connector VGA-1 PASS atomic_flip.py PASS atomic_set_plane.py FAIL atomic_small_dest.py PASS atomic_small_fb.py PASS fb_large.py PASS fb_small.py PASS mode_invalid.py PASS mode_reset.py PASS mode_set_all.py PASS

9 passed, 1 failed, 0 skipped

The test suite will exit with an error code if any tests have failed.

By default, tests are performed using the first available connector. It is possible to specify a different connector on the command line:, for instance, will use the second connector.