From eLinux.org
< R-Car(Redirected from Tests:KMS-modetest)
Jump to: navigation, search

How to verify DRM/KMS driver functionality using the modetest tool from libdrm.

Obtaining modetest

In the likely event that modetest is not part of your Linux distribution, you can build it together with libdrm from git://anongit.freedesktop.org/mesa/drm in the usual manner:

  1. ./autogen.sh --enable-install-test-programs
  2. make

The binary can then be found in tests/modetest/.

This can then be installed with:

  1. make install


Find connector

To find the IDs of the video output connectors, run modetest like so:

modetest -M rcar-du

(Replace rcar-du with the name of your device.)

You will get a list of encoders, connectors, CRTCs, and other objects. Look for the section that starts with Connectors::

id      encoder status          name            size (mm)       modes   encoders
51      50      connected       VGA-1           0x0             5       50
        name refresh (Hz) hdisp hss hse htot vdisp vss vse vtot)
  1024x768 60 1024 1048 1184 1344 768 771 777 806 flags: nhsync, nvsync; type: driver
  800x600 60 800 840 968 1056 600 601 605 628 flags: phsync, pvsync; type: driver
  800x600 56 800 824 896 1024 600 601 603 625 flags: phsync, pvsync; type: driver
  848x480 60 848 864 976 1088 480 486 494 517 flags: phsync, pvsync; type: driver
  640x480 60 640 656 752 800 480 490 492 525 flags: nhsync, nvsync; type: driver

Note the ID (first column) of the connector you intend to test.

You can now have modetest draw a test pattern to the screen:

modetest -M rcar-du -s 51:800x600-60Hz

Be sure to replace 51 in the example with a valid connector ID, and 800x600-60Hz with a mode supported by that connector. You should now see a test pattern on the specified connector.