Fading Coder

One Final Commit for the Last Sprint

Home > Tech > Content

Linux DRM/KMS Testing Tools: modetest, kmscube, and igt-gpu-tools

Tech May 9 5

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

Related Articles

Understanding Strong and Weak References in Java

Strong References Strong reference are the most prevalent type of object referencing in Java. When an object has a strong reference pointing to it, the garbage collector will not reclaim its memory. F...

Comprehensive Guide to SSTI Explained with Payload Bypass Techniques

Introduction Server-Side Template Injection (SSTI) is a vulnerability in web applications where user input is improper handled within the template engine and executed on the server. This exploit can r...

Implement Image Upload Functionality for Django Integrated TinyMCE Editor

Django’s Admin panel is highly user-friendly, and pairing it with TinyMCE, an effective rich text editor, simplifies content management significantly. Combining the two is particular useful for bloggi...

Leave a Comment

Anonymous

◎Feel free to join the discussion and share your thoughts.