aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--types/wlr_drm_lease_v1.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/types/wlr_drm_lease_v1.c b/types/wlr_drm_lease_v1.c
index 7cb9974d..0ef9e036 100644
--- a/types/wlr_drm_lease_v1.c
+++ b/types/wlr_drm_lease_v1.c
@@ -621,10 +621,18 @@ static void handle_backend_destroy(struct wl_listener *listener, void *data) {
static void drm_lease_device_v1_create(struct wlr_drm_lease_v1_manager *manager,
struct wlr_backend *backend) {
- assert(backend);
+ struct wlr_drm_backend *drm_backend = get_drm_backend_from_backend(backend);
+
+ // Make sure we can get a non-master FD for the DRM backend. On some setups
+ // we don't have the permission for this.
+ int fd = wlr_drm_backend_get_non_master_fd(backend);
+ if (fd < 0) {
+ wlr_log(WLR_INFO, "Skipping %s: failed to get read-only DRM FD",
+ drm_backend->name);
+ return;
+ }
+ close(fd);
- struct wlr_drm_backend *drm_backend =
- get_drm_backend_from_backend(backend);
wlr_log(WLR_DEBUG, "Creating wlr_drm_lease_device_v1 for %s",
drm_backend->name);