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>
*/
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);
}
/*
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)