This describes how to use looptest (https://github.com/uli/looptest) to verify DRM driver output using a V4L input device and a loopback cable.
The script does a fuzzy compare of the captured frame with a reference frame, so it should work on analog signals, but it has only been tested with an HDMI signal on a Renesas R-Car H1 "Lager" board.
The following tools must be installed on the system:
- Python 2.x
- modetest from libdrm (git://anongit.freedesktop.org/mesa/drm)
- yavta (http://git.ideasonboard.org/yavta.git), with a the patch yavta.patch from the looptest repository applied.
- raw2rgbpnm (git://git.retiisi.org.uk/~sailus/raw2rgbpnm.git)
- ImageMagick, specifically the convert and compare tools.
Running the tests
The script must be run like so:
python run_tests.py -M <module> -c <connector> -v <V4L device> [-r <resolution>-<frequency>[,...]]
The list of resolutions ("-r" option) can be omitted, in which case all supported resolutions for the given connector will be checked.
Example for the Lager board:
python run_tests.py -M rcar-du -c 49 -v /dev/video31 -r 1024x768-60,800x600-60,640x480-60
The result of the given example, at the time of writing, looks like so:
Testing 1024x768-60 setting mode 1024x768-60Hz@XR24 on connectors 49, crtc 43 capturing frame converting frame comparing to reference: mae 1.31046e-05 PASS Testing 800x600-60 setting mode 800x600-60Hz@XR24 on connectors 49, crtc 43 capturing frame converting frame comparing to reference: mae 0.000818342 PASS Testing 640x480-60 setting mode 640x480-60Hz@XR24 on connectors 49, crtc 43 capturing frame converting frame comparing to reference: mae 0.351281 FAIL 2 passed, 1 failed