Linux DRM/KMS Testing Tools: modetest, kmscube, and igt-gpu-tools
modetest
The modetest utility, part of the libdrm package, enables querying display device capabilities, performing basic display tests, and configuring display modes.
Source code can be obtained from: https://dri.freedesktop.org/libdrm/libdrm-2.4.100.tar.bz2
To comppile:
./configure
make -j4
Upon successful compilation, the executable modetest will be generated under libdrm-2.4.100/tests/modetest.
Example Usage
Running modetest requires root privileges.
Example command:
./modetest -M vc4 -D 0 -a -s 32@140:1920x1080 -P 173@140:1920x1080 -Ftiles
This command outputs a full-screen gradient striped pattern via HDMI.
Use the --help flag to vieew all supported options:
./modetest --help
To list supported resolutions for the current platform:
modetest -M <platform_drm_name>
kmscube
Provided by Mesa3D, kmscube is a lightweight test application based on KMS/GBM/EGL/OpenGL ES 2.0. It operates with out X11 or Wayland, rendering graphics through DRM/KMS.
It leverages GBM, EGL, and OpenGL ES libraries from Mesa3D, and uses libdrm for DRM/KMS access. Thus, it demonstrates fundamental usage patterns for OpenGL, EGL, GBM, and DRM/KMS.
Download link: https://gitlab.freedesktop.org/mesa/kmscube
Compilation steps:
meson . build && ninja -C build
After compilation, the executable will appear in the build directory:
ls build/
To see available options:
./kmscube --help
Basic usage:
sudo ./kmscube -A -D /dev/dri/card0 -M smooth
Options explained:
-A: Enables atomic mode for DRM/KMS-D: Specifies the device node (DRM/KMS and GPU share the same node)-M: Selects OpenGL rendering mode; valid options are:smooth,rgba,nv12-2img,nv12-1img