[prefix=PATCH weston] gl-renderer.c: Pass visual ID for choosing egl configs for pbuffer

Daniel Stone daniel at fooishbar.org
Thu Aug 2 12:35:05 UTC 2018


Hi Madhurkiran,

On Tue, 31 Jul 2018 at 02:02, Madhurkiran Harikrishnan
<MADHURKI at xilinx.com> wrote:
> Thanks for the comments. For a not having configless_context,  can you explain why should I check gr->egl_config, because the attributes passed while getting this gr->egl_config does not have EGL_PBUFFER_BIT set for EGL_SURFACE_TYPE, which means config returned from the driver would not have this bit set. In that case, shouldn't pbuffer_config just suffice.

Please see the lines I quoted here:

> On Wed, 21 Mar 2018 at 22:45, Madhurkiran Harikrishnan <madhurkiran.harikrishnan at xilinx.com> wrote:
> > +       if (pbuffer_config != gr->egl_config &&
> > +           !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;
> > +       }

With the patch you have posted, if the driver does not support
configless_context, the code will:
  - pick an EGL_WINDOW_BIT EGLConfig (via ChooseConfig) and assign
this to gr->egl_config
  - pick another EGL_PBUFFER_BIT EGLConfig (via ChooseConfig) and
assign this to pbuffer_config
  - if pbuffer_config != gr->egl_config, return error and fail

So from your code, you already say that the two configs must be the
same config. What I am saying is that since we already know what the
value of the config must be (the same as the one we have already
selected), there is no need to call ChooseConfig twice. Just call it
once, and make sure that a config which supports both window + pbuffer
is selected.

Cheers,
Daniel


More information about the wayland-devel mailing list