modetest: introduce and use get_crtc_by_id() and get_crtc_mask()
authorEmil Velikov <emil.velikov@collabora.com>
Mon, 13 Apr 2020 11:31:23 +0000 (12:31 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 19 May 2020 20:09:14 +0000 (21:09 +0100)
commit336c04220ce768298875ca687ec7416bcc80cbf7
tree9ae1beaf3b9c54ea7a8485e324a6b46b1cd9e5db
parentef58af6dfc86075077a814af64cb02de814b92cb
modetest: introduce and use get_crtc_by_id() and get_crtc_mask()

Let's make the code shorter, this avoid crashes (when drmModeGetCrtc()
fails) by using a couple of helpers. As get_resources() considers the
drmModeGetCrtc() fail non-fatal, we might as well handle it properly.

v2: Add a comment above the unreachable abort() (Eze)

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com>
Tested-by: Ezequiel Garcia <ezequiel@collabora.com>
tests/modetest/modetest.c