Skip to content
Commit 523b3658 authored by Simon Ser's avatar Simon Ser
Browse files

xf86drmMode: add drmIsKMS

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.

[1]: https://gitlab.freedesktop.org/wayland/weston/-/blob/master/libweston/backend-drm/drm.c#L2689
[2]: https://github.com/swaywm/wlroots/blob/a290d7a78dc36275e24e54f84570f37a66dc67a4/backend/session/session.c#L268



Signed-off-by: default avatarSimon Ser <contact@emersion.fr>
Reviewed-by: default avatarPekka Paalanen <pekka.paalanen@collabora.com>
Reviewed-by: default avatarEmil Velikov <emil.velikov@collabora.com>
parent 1225171b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment