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://anongit.freedesktop.org/mesa/drm

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/envsetup.sh
$ 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
$ ./autogen.sh
$ 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
Connectors:
id      encoder status          type    size (mm)       modes   encoders
8       0       connected       HDMI-A  470x300         1       7
  modes:
        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
  props:
        1 EDID:
                flags: immutable blob
                blobs:

                value:
                        00ffffffffffff0030ae0c0a01010101
                        23180103802f1e78ee23c5a5574f9e26
                        0f5054bdcf00714f8180818c9500950f
                        a9c0b300010121399030621a274068b0
                        3600da281100001c000000fd00324b1e
                        5311000a202020202020000000fc004c
                        543232353220576964650a20000000ff
                        0045333530303532310a202020200099
        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)