From 1468e60647db296c7eeaebe7021de26cbe4a56f9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg?= Date: Wed, 2 Oct 2013 10:49:05 -0700 Subject: [PATCH] launcher: Bail out if we can't be drm master If we can't be drm master, we won't be able to do anything useful with the drm device. --- src/launcher-util.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/launcher-util.c b/src/launcher-util.c index 88eb06a..ad93d37 100644 --- a/src/launcher-util.c +++ b/src/launcher-util.c @@ -110,9 +110,11 @@ weston_launcher_open(struct weston_launcher *launcher, } if (major(s.st_rdev) == DRM_MAJOR) { + drm_magic_t magic; launcher->drm_fd = fd; - if (drm_set_master(fd) == -1) { - weston_log("could not set master on drm fd\n"); + if (drmGetMagic(fd, &magic) != 0 || + drmAuthMagic(fd, magic) != 0) { + weston_log("drm fd not master\n"); close(fd); return -1; } -- 2.7.4