Skip to content

xf86drmMode: add drmIsKMS

Simon Ser requested to merge emersion/drm:is-kms into master

If a device has a primary node, it doesn't necessarily mean it's suitable for KMS usage. For instance, render-only drivers also expose primary nodes.

The check is extracted from Weston 1.

The motivation for this new function is two-fold:

  • Avoid an unnecessary GETRESOURCES call. To check whether a primary node is suitable for KMS, we don't actually need to retrieve the object IDs we just need to check the counts.
  • Avoid confusion in user-space and make sure user-space implements the check properly. For instance, wlroots doesn't 2: it uses drmGetVersion which succeeds with render-only drivers.

Signed-off-by: Simon Ser contact@emersion.fr

cc @pq @danvet @evelikov

Edited by Simon Ser

Merge request reports