On Wed, 29 Aug 2018 13:18:43 -0700 Madhurkiran Harikrishnan <[email protected]> wrote:
> The original implementation always chose first egl config for pbuffer > surface type, however the returned configs are implementation specific > and egl config may not always match between ctx and surface. Hence, > use gr->egl_config which already has the matching config but ensure that > windows and pbuffer bit are set for the surface type. > > Signed-off-by: Madhurkiran Harikrishnan <[email protected]> > --- > libweston/gl-renderer.c | 31 +++++++++++++++---------------- > 1 file changed, 15 insertions(+), 16 deletions(-) Hi, it sounds like the patch you proposed here was inspired by some problems with some EGL implementations. Could you test https://gitlab.freedesktop.org/wayland/weston/merge_requests/276 to see if that solves all the issues that made you write this patch? Thanks, pq > > diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c > index da29b07..13d7707 100644 > --- a/libweston/gl-renderer.c > +++ b/libweston/gl-renderer.c > @@ -3033,7 +3033,7 @@ gl_renderer_setup_egl_extensions(struct > weston_compositor *ec) > } > > static const EGLint gl_renderer_opaque_attribs[] = { > - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, > + EGL_SURFACE_TYPE, EGL_WINDOW_BIT | EGL_PBUFFER_BIT, > EGL_RED_SIZE, 1, > EGL_GREEN_SIZE, 1, > EGL_BLUE_SIZE, 1, > @@ -3043,7 +3043,7 @@ static const EGLint gl_renderer_opaque_attribs[] = { > }; > > static const EGLint gl_renderer_alpha_attribs[] = { > - EGL_SURFACE_TYPE, EGL_WINDOW_BIT, > + EGL_SURFACE_TYPE, EGL_WINDOW_BIT | EGL_PBUFFER_BIT, > EGL_RED_SIZE, 1, > EGL_GREEN_SIZE, 1, > EGL_BLUE_SIZE, 1, > @@ -3146,17 +3146,7 @@ output_handle_destroy(struct wl_listener *listener, > void *data) > > static int > gl_renderer_create_pbuffer_surface(struct gl_renderer *gr) { > - EGLConfig pbuffer_config; > - > - static const EGLint pbuffer_config_attribs[] = { > - EGL_SURFACE_TYPE, EGL_PBUFFER_BIT, > - EGL_RED_SIZE, 1, > - EGL_GREEN_SIZE, 1, > - EGL_BLUE_SIZE, 1, > - EGL_ALPHA_SIZE, 0, > - EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, > - EGL_NONE > - }; > + EGLint surface_type; > > static const EGLint pbuffer_attribs[] = { > EGL_WIDTH, 10, > @@ -3164,13 +3154,22 @@ gl_renderer_create_pbuffer_surface(struct gl_renderer > *gr) { > EGL_NONE > }; > > - if (egl_choose_config(gr, pbuffer_config_attribs, NULL, 0, > &pbuffer_config) < 0) { > - weston_log("failed to choose EGL config for PbufferSurface\n"); > + > + if(!eglGetConfigAttrib(gr->egl_display, gr->egl_config, > EGL_SURFACE_TYPE, &surface_type)) { > + weston_log("failed to get surface type for PbufferSurface\n"); > + return -1; > + } > + > + if (!((surface_type & EGL_WINDOW_BIT) && (surface_type & > EGL_PBUFFER_BIT)) && > + !gr->has_configless_context) { > + weston_log("attempted to use a different EGL config for an " > + "output but EGL_KHR_no_config_context or " > + "EGL_MESA_configless_context is not supported\n"); > return -1; > } > > gr->dummy_surface = eglCreatePbufferSurface(gr->egl_display, > - pbuffer_config, > + gr->egl_config, > pbuffer_attribs); > > if (gr->dummy_surface == EGL_NO_SURFACE) {
pgpfsgQ591rpb.pgp
Description: OpenPGP digital signature
_______________________________________________ wayland-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/wayland-devel
