Running Modetest to Test Your DRM Display Driver

Once you finish the DRM(Direct Rendering Manager) driver, you will need to run the modetest to test your driver. modetest is a user-land test program of libdrm. Now it can run on linux and android platform.

Get Modetest

Since modetest is within libdrm, so you can get it by clone a copy of libdrm:

$ git clone git://

Build on Android

Put libdrm code to "external/ " directory of Android source code tree. For example, for hikey board , run bellow commad to build.

$ source build/
$ lunch hikey-eng
$ cd external/drm/tests/modetest
$ mma

After finish building, modetest will be installed at directory: out/target/product/hikey/system/bin. Then your can tar a system.img which including modetest.

$ make systemimage

Build on Linux

On your target boad, for example, a debian/ubuntu linux, install bellow required tools and then build.

$ cd drm
$ apt-get install -y xutils-dev autoconf automake libtool xorg-dev libudev-dev
$ ./
$ make

You'll get modetest at "drm/tests/modetest" directory.

Run Modetest

Bellow commands list the DRM info including modes, where option "-M" specific the name of your DRM driver. e.g. for hikey board:

# modetest -M kirin     #list all the info of crtc, encoder and connector
# modetest -M kirin -c #list all the info of connector including modes
# ./modetest -M kirin -c
id      encoder status          type    size (mm)       modes   encoders
8       0       connected       HDMI-A  470x300         1       7
        name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
  720p60 60 1280 1390 1430 1650 720 725 730 750 flags: phsync, pvsync; type: preferred, driver
        1 EDID:
                flags: immutable blob

        2 DPMS:
                flags: enum
                enums: On=0 Standby=1 Suspend=2 Off=3
                value: 0

Test the modes by name with the "-s" option, you'll see a color bar image display on your monitor if the driver is OK.

# ./modetest -M kirin -s 8:720p60           # where "8" is the connector id and "720p60" is the name of mode.
  • Note: Runing modetest on linux require not to run the X windows server.

CategoryAssigneeDocs CategoryHowTo

xinliang/libdrm/modetest (last modified 2016-06-13 07:44:42)