From: David Herrmann Date: Fri, 30 Dec 2011 15:40:49 +0000 (+0100) Subject: output: allow kmscon_compositor_use to be called when asleep X-Git-Tag: kmscon-7~1295 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=290601396ead99b6d45297be73002a7aae73cde4;p=platform%2Fupstream%2Fkmscon.git output: allow kmscon_compositor_use to be called when asleep There is no reason to prohibit a compositor from activating its GL context while being asleep. It is even recommended to activate the GL context when being asleep as there is no other way to initialize other subsystems without an GL context. Signed-off-by: David Herrmann --- diff --git a/src/output.c b/src/output.c index 37e99c1..819d679 100644 --- a/src/output.c +++ b/src/output.c @@ -985,8 +985,10 @@ bool kmscon_compositor_is_asleep(struct kmscon_compositor *comp) } /* - * This activates the EGL/GL context of this compositor. This fails if the - * compositor is asleep. + * This activates the EGL/GL context of this compositor. This works even if the + * compositor is asleep. Moreover, most other subsystems that need an GL context + * require this function to be called before they are used. + * * You must call this before trying to enable outputs. A new compositor is not * enabled by default. * Returns 0 on success. @@ -997,9 +999,6 @@ bool kmscon_compositor_is_asleep(struct kmscon_compositor *comp) */ int kmscon_compositor_use(struct kmscon_compositor *comp) { - if (kmscon_compositor_is_asleep(comp)) - return -EINVAL; - if (!eglMakeCurrent(comp->display, EGL_NO_SURFACE, EGL_NO_SURFACE, comp->context)) return -EFAULT;