From 2b066f173c873642e62692911f098086e4f74938 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Sun, 5 Feb 2012 18:40:31 +0100 Subject: [PATCH] output: drop drm-master on open() to avoid Xserver bugs The xserver currently crashes if we switch to its VT and it cannot claim drm-master. This normally does not happen as we drop drm-master on VT-leave. However, after calling open() on the drm char-dev we are automatically drm-master so we should drop it right away as our VT is not guaranteed to be opened at this time. There is currently no way to call open() on the drm char-dev without getting drm-master so there is still a short time-period when we have no active VT but are drm-master. Switching to X in this short time-period will still kill the X-server but we are not responsible for horrible X-server bugs so we ignore this 10ms time-span. Signed-off-by: David Herrmann --- src/output.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/output.c b/src/output.c index cac848a..74e48c5 100644 --- a/src/output.c +++ b/src/output.c @@ -797,6 +797,7 @@ int kmscon_compositor_new(struct kmscon_compositor **out) ret = -errno; goto err_free; } + drmDropMaster(comp->drm_fd); comp->gbm = gbm_create_device(comp->drm_fd); if (!comp->gbm) {