mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
backend/session: fix KMS device filtering
As explained in [1], user-space should perform a drmModeGetResources call to figure out whether a device supports KMS. [1]: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/127
This commit is contained in:
parent
c5dad8b626
commit
73137ace84
1 changed files with 11 additions and 3 deletions
|
|
@ -265,12 +265,20 @@ static struct wlr_device *open_if_kms(struct wlr_session *restrict session,
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
drmVersion *ver = drmGetVersion(dev->fd);
|
// The kernel errors out with EOPNOTSUPP if DRIVER_MODESET isn't set
|
||||||
if (!ver) {
|
drmModeRes *res = drmModeGetResources(dev->fd);
|
||||||
|
if (!res) {
|
||||||
|
if (errno != EOPNOTSUPP) {
|
||||||
|
wlr_log_errno(WLR_ERROR, "drmModeGetResources(%s) failed", path);
|
||||||
|
}
|
||||||
goto out_dev;
|
goto out_dev;
|
||||||
}
|
}
|
||||||
|
if (res->count_crtcs == 0) {
|
||||||
|
drmModeFreeResources(res);
|
||||||
|
goto out_dev;
|
||||||
|
}
|
||||||
|
drmModeFreeResources(res);
|
||||||
|
|
||||||
drmFreeVersion(ver);
|
|
||||||
return dev;
|
return dev;
|
||||||
|
|
||||||
out_dev:
|
out_dev:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue