Output: Correctly acquire/release DRM master

If we switch VT, we must release DRM master to allow other applications to
access the DRM. When waking up the compositor we try to acquire the master again
to access the DRM.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann committed 2011-12-03 16:39:06 +01:00
1 parent 39b3cc1237
commit e195d911e1
1 file changed
+10 -3
+10 -3
View File
@@ -929,8 +929,11 @@ void kmscon_compositor_unref(struct kmscon_compositor *comp)
*/
void kmscon_compositor_sleep(struct kmscon_compositor *comp)
{
if (comp)
comp->state = COMPOSITOR_ASLEEP;
if (!comp)
return;
comp->state = COMPOSITOR_ASLEEP;
drmDropMaster(comp->drm_fd);
}
/*
@@ -946,10 +949,14 @@ int kmscon_compositor_wake_up(struct kmscon_compositor *comp)
if (!comp)
return -EINVAL;
if (comp->state == COMPOSITOR_AWAKE)
return comp->count_outputs;
ret = drmSetMaster(comp->drm_fd);
if (ret)
return -EACCES;
comp->state = COMPOSITOR_AWAKE;
ret = kmscon_compositor_refresh(comp);
if (ret >= 0)