ANNOUNCE: introcuding kmsxx, tests and python wrappers

Tomi Valkeinen tomi.valkeinen at ti.com
Mon Nov 30 07:54:33 PST 2015


Hi,

Here's something we've been working on and using on our environment, and
I think it's now in a state where others may find it usable too:

https://github.com/tomba/kmsxx

libkmsxx is a small C++11 library for kernel mode setting. It tries to
implement as little extra as possible while bringing the kms API in a
C++ form to the user. It only implements a subset of what libdrm supports.

The repository also contains small utils, test tools and python wrappers.

The focus with libkmsxx has been mainly on testing, enabling us to write
small test apps easily by minimizing the amount of code needed to do KMS
operations, and to write python scripts to do tests which can easily be
modified. The code is definitely not production quality code, but we've
tried to keep the code clean.

At the moment we have these tests/utils:

    kmsprint - print information about DRM objects
    testpat - set modes and show test pattern on crtcs/planes
    kmsview - view raw images
    db - simple double-buffering test
    kmscube - rotating 3D cube on crtcs/planes

Some highlights:

Testpat is a tool to setup modes and planes, and have a test pattern on
the screen. It "guesses" what you want to do, which means you don't
usually need to fill in all the details:

XR24 framebuffer on first connected connector in the default mode:
    testpat -f XR24

XR24 framebuffer on a 400x400 plane on the first connected connector in
the default mode:
    testpat -p 400x400 -f XR24

Test pattern on the second connector with default mode:
    testpat -c @1

With the python wrappers and a base script (iact.py) which sets up a
bunch of helper variables/funcs for you, you can have an interactive
python shell where you can do things like:

  for x in range(0, crtc.width() - fb.width()): set_plane(x,
int((sin(x/50) + 1) * 100)); sleep(0.01)

 Tomi

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/dri-devel/attachments/20151130/74915b7a/attachment.sig>


More information about the dri-devel mailing list