LinuxCommandLibrary

modetest

diagnostic tool for testing and debugging Kernel Mode Setting functionality of

TLDR

List connectors and their available modes for a specific driver

$ modetest -M [driver] -c
copy
Set resolution of a connector
$ sudo modetest -M [driver] -s [connector_id]:[1920]x[1080]
copy
List all DRM objects (connectors, encoders, CRTCs, planes)
$ sudo modetest -M [i915]
copy
Test a specific plane with format
$ sudo modetest -M [driver] -P [plane_id]@[crtc_id]:[WxH]+[X]+[Y]@[format]
copy
Display verbose output
$ modetest -M [driver] -v
copy

SYNOPSIS

modetest [-M module] [-c] [-e] [-p] [-f] [-s connector:mode] [-P plane] [-v]

DESCRIPTION

modetest is a diagnostic tool for testing and debugging Kernel Mode Setting (KMS) functionality of Direct Rendering Manager (DRM) drivers. It enumerates DRM objects including connectors, encoders, CRTCs, and planes, and can set display modes directly.
The tool is part of libdrm and provides low-level access to the graphics subsystem for testing display configurations, pixel formats, and plane overlays. It displays an SMPTE color bar test pattern when setting modes.

PARAMETERS

-M _module_

Specify DRM driver module name (e.g., i915, amdgpu, nouveau, mgag200)
-c, --connectors
List connectors and their available modes
-e, --encoders
List encoders
-p, --planes
List planes
-f, --framebuffers
List framebuffers
-s _connector:mode_
Set mode on connector (format: connector_id:WIDTHxHEIGHT[@refresh])
-P _plane_spec_
Test plane with specified configuration
-C, --crtc _id_
Target specific CRTC (display controller)
--format _fmt_
Specify pixel format (e.g., XR24, BG24, ARGB8888)
-v, --verbose
Enable verbose output with detailed information
-h, --help
Display help message

CAVEATS

Requires root privileges or membership in the render/video groups to access DRM devices. Running modetest on an active display can disrupt the current desktop environment (Xorg, Wayland), potentially causing blank screens or display corruption. Primarily intended for developers and diagnostic purposes.

HISTORY

modetest is part of the libdrm project, which provides the userspace library for interacting with the Linux kernel's Direct Rendering Manager. KMS was introduced in Linux kernel 2.6.29 (2009) to move display mode setting from userspace X servers into the kernel.

SEE ALSO

drm(7), xrandr(1), wlr-randr(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community