From bb727640e9787599ec6518cfe8692486bb009526 Mon Sep 17 00:00:00 2001 From: David Herrmann Date: Fri, 30 Dec 2011 16:36:48 +0100 Subject: [PATCH] output: fix dropping master priviledges on wakeup If wakeup fails we should drop master priviledges again, otherwise we might break other applications. Also remove the SetMaster call on compositor initialization. It is redundant and not needed by us. Signed-off-by: David Herrmann --- TODO | 4 ---- src/output.c | 9 ++------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/TODO b/TODO index 9f21ad4..627b14e 100644 --- a/TODO +++ b/TODO @@ -18,10 +18,6 @@ Output Subsystem: - Retrieve DRI card from udev or at least make kmscon_compositor_new() accept a path to the DRI card so the user can have udev provide the path. - - Check whether drmSetMaster() is needed. It can only be called with root - priviledges and all my tests worked without it. What are the benefits of - calling this? - - Whats the difference between connector and encoder? Or why are encoders needed at all? The output selection logic simply tries to find the first encoder that provides an available crtc. Should we replace this logic with an diff --git a/src/output.c b/src/output.c index a19adba..37e99c1 100644 --- a/src/output.c +++ b/src/output.c @@ -810,13 +810,6 @@ static int compositor_init(struct kmscon_compositor *comp) if (comp->drm_fd < 0) return -errno; - /* TODO: When do we need this? */ - /*ret = drmSetMaster(comp->drm_fd); - if (ret) { - ret = -EACCES; - goto err_drm; - }*/ - comp->gbm = gbm_create_device(comp->drm_fd); if (!comp->gbm) { ret = -EFAULT; @@ -974,6 +967,8 @@ int kmscon_compositor_wake_up(struct kmscon_compositor *comp) return ret; comp->state = COMPOSITOR_ASLEEP; + drmDropMaster(comp->drm_fd); + return ret; }