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 <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann 2012-02-05 18:40:31 +01:00
parent 06286da4ef
commit 2b066f173c

View File

@ -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) {