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.
parent 57a10e4d
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment