compositor-android: should output be added to compositor one step before

Abhijit Potnis abhijitpotnis at gmail.com
Thu Sep 13 03:50:21 PDT 2012


Hello Kristian,

The complete Patch.

---------------------------------------------------------------------------------------------------

>From 8e1adf2e8024e2ef804df2d1b8b1cfd49c91186f Mon Sep 17 00:00:00 2001
From: Abhijit Potnis <abhijitpotnis at gmail.com>
Date: Thu, 13 Sep 2012 12:32:55 +0530
Subject: [PATCH] text: Adding output to compositor before calling
 gles2_renderer_init

Calling android_compositor_add_output() before gles2_renderer_init(),
or else in gles-renderer_init will have an invalid EGLSurface.

Signed-off-by: Abhijit Potnis <abhijitpotnis at gmail.com>
---
 src/compositor-android.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/compositor-android.c b/src/compositor-android.c
index 50c66e6..0194379 100644
--- a/src/compositor-android.c
+++ b/src/compositor-android.c
@@ -476,11 +476,11 @@ android_compositor_create(struct wl_display *display,
int argc, char *argv[],
     if (android_init_egl(compositor, output) < 0)
         goto err_output;

+    android_compositor_add_output(compositor, output);
+
     if (gles2_renderer_init(&compositor->base) < 0)
         goto err_egl;

-    android_compositor_add_output(compositor, output);
-
     compositor->seat = android_seat_create(compositor);
     if (!compositor->seat)
         goto err_egl;
-- 
1.7.9.5

---------------------------------------------------------------------------------------------------


On Thu, Sep 13, 2012 at 2:46 AM, Pekka Paalanen <ppaalanen at gmail.com> wrote:

> On Thu, 13 Sep 2012 00:18:52 -0700
> Abhijit Potnis <abhijitpotnis at gmail.com> wrote:
>
> > Hello Pekka,
> >
> > In compositor-android.c , Should we be calling
> > android_compositor_add_output() before gles2_renderer_init(),
> > or else wouldn't "op" in gles-renderer_init get assigned a junk value.
>
> Hi Abhijit,
>
> yes, looks like you are completely right.
>
> The problem was introduced in 2bc5e8eaf89967f55b63c31f58f8e3a8d7f8810e
> and I think it went without noticing, because the android backend needs
> to open the framebuffer before it can choose an EGLConfig. The
> android_output object is created before EGL init, but not added to the
> compositor's output list until it has an EGLSurface. It was just missed
> when code was being moved around and consolidated into
> gles2_renderer_init().
>
> Kristian, can you push this patch with
> Reviewed-by: Pekka Paalanen <ppaalanen at gmail.com>
> please?
>
> It will take a while before I can actually test this.
>
> > ---
> >  src/compositor-android.c |    4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/src/compositor-android.c b/src/compositor-android.c
> > index 50c66e6..0194379 100644
> > --- a/src/compositor-android.c
> > +++ b/src/compositor-android.c
> > @@ -476,11 +476,11 @@ android_compositor_create(struct wl_display
> *display,
> > int argc, char *argv[],
> >      if (android_init_egl(compositor, output) < 0)
> >          goto err_output;
> >
> > +    android_compositor_add_output(compositor, output);
> > +
> >      if (gles2_renderer_init(&compositor->base) < 0)
> >          goto err_egl;
> >
> > -    android_compositor_add_output(compositor, output);
> > -
> >      compositor->seat = android_seat_create(compositor);
> >      if (!compositor->seat)
> >          goto err_egl;
>
> Thanks,
> pq
>



-- 
Regards,
Abhijit Potnis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20120913/96704b0c/attachment.html>


More information about the wayland-devel mailing list