drmModeGetResources() tells the system capability and not runtime availability of the hardware resource. DRM_IOCTL_MODE_GETCRTC only tells userspace which CRTCs are enabled through KMS, not which are active in hardware. A pipe can be actively scanning out without being enabled through the KMS state, so relying on GETCRTC alone would report such a CRTC as free and assignable when it is not. Add new function drmModeGetCrtcList that enumerates the crtc list.
Arun R Murthy (2): xf86drmMode: add drmModeGetCrtcList() to enumerate available CRTCs tests/crtclist: add utility to inspect CRTC usage core-symbols.txt | 2 + tests/crtclist.c | 116 +++++++++++++++++++++++++++++++++++++++++++ tests/meson.build | 9 ++++ xf86drmMode.c | 123 ++++++++++++++++++++++++++++++++++++++++++++++ xf86drmMode.h | 38 ++++++++++++++ 5 files changed, 288 insertions(+) create mode 100644 tests/crtclist.c -- 2.25.1
