From 1ff5109b5fc016ee0c4bef281e4309fe5dfe461f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Tue, 17 Sep 2013 14:03:42 -0700 Subject: [PATCH] compositor: Open drm device through launcher --- src/compositor-drm.c | 2 +- src/weston-launch.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/compositor-drm.c b/src/compositor-drm.c index 68406da..6c791ab 100644 --- a/src/compositor-drm.c +++ b/src/compositor-drm.c @@ -1215,7 +1215,7 @@ init_drm(struct drm_compositor *ec, struct udev_device *device) } filename = udev_device_get_devnode(device); - fd = open(filename, O_RDWR | O_CLOEXEC); + fd = weston_launcher_open(&ec->base, filename, O_RDWR); if (fd < 0) { /* Probably permissions error */ weston_log("couldn't open %s, skipping\n", diff --git a/src/weston-launch.c b/src/weston-launch.c index 7264f7e..be77a34 100644 --- a/src/weston-launch.c +++ b/src/weston-launch.c @@ -58,6 +58,8 @@ #include "weston-launch.h" +#define DRM_MAJOR 226 + #define MAX_ARGV_SIZE 256 struct weston_launch { @@ -313,10 +315,11 @@ handle_open(struct weston_launch *wl, struct msghdr *msg, ssize_t len) goto err0; } - if (major(s.st_rdev) != INPUT_MAJOR) { + if (major(s.st_rdev) != INPUT_MAJOR && + major(s.st_rdev) != DRM_MAJOR) { close(fd); fd = -1; - fprintf(stderr, "Device %s is not an input device\n", + fprintf(stderr, "Device %s is not an input or drm device\n", message->path); goto err0; } -- 2.7.4