[v2,weston] gl-renderer.c: Use gr->egl_config to create pbuffer surface

Submitted by Adam Jackson on Aug. 3, 2018, 6:05 p.m.

Details

Message ID 7205da3ebd7d7750910d21f3b13cb183d7abfd14.camel@redhat.com
State New
Series "gl-renderer.c: Use gr->egl_config to create pbuffer surface"
Headers show

Commit Message

Adam Jackson Aug. 3, 2018, 6:05 p.m.
On Thu, 2018-08-02 at 17:21 -0700, Madhurkiran Harikrishnan 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.

Does this make pbuffer surface support mandatory? (Or, is it mandatory
already.) If so it might make more sense to just do:


As that way you'll always pick an EGLConfig with pbuffer support.

- ajax

Patch hide | download patch | download mbox

diff --git a/libweston/gl-renderer.c b/libweston/gl-renderer.c
index 2c50d2da..97a8ef6a 100644
--- a/libweston/gl-renderer.c
+++ b/libweston/gl-renderer.c
@@ -3263,7 +3263,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,
@@ -3273,7 +3273,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,

Comments

Daniel Stone Aug. 3, 2018, 6:08 p.m.
Hi Adam,

On Fri, 3 Aug 2018 at 19:05, Adam Jackson <ajax@redhat.com> wrote:
> On Thu, 2018-08-02 at 17:21 -0700, Madhurkiran Harikrishnan 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.
>
> Does this make pbuffer surface support mandatory? (Or, is it mandatory
> already.) If so it might make more sense to just do:

It's only mandatory if configless_context is not supported.

The patch we need to see from this is: if configless_context is not
supported, select EGL_WINDOW_BIT | EGL_PBUFFER_BIT for gr->egl_config.
Without selecting configs twice, or querying the configs later.

Cheers,
Daniel