[Mesa-dev] [PATCH] egl: Fix EGL_PLATFORM_X11_SCREEN_KHR handling

Emil Velikov emil.l.velikov at gmail.com
Thu Apr 18 13:46:52 UTC 2019


Hi Adam,

On Wed, 17 Apr 2019 at 19:57, Adam Jackson <ajax at redhat.com> wrote:
>
> If this was specified and a non-NULL display was passed to
> eglGetPlatformDisplay, we would ignore the attribute and instead use
> whatever xcb thought the default screen would be.
>
> To fix this, store a copy of the attribute list in the _EGLDisplay, and
> use that to look up any non-default screen number if we need it.
> ---
>  src/egl/drivers/dri2/platform_x11.c | 28 ++++++++--
>  src/egl/main/eglapi.c               |  2 +-
>  src/egl/main/egldisplay.c           | 85 +++++++++++++++++++++++------
>  src/egl/main/egldisplay.h           |  4 +-
>  4 files changed, 96 insertions(+), 23 deletions(-)
>
We have multiple different things happening here. Can you split things up a bit?

1. Flesh out a simpler version of _eglNumAttribs based off
_eglConvertIntsToAttribs. For example:

len = 0;
if (attribs) {
   while (attribs[len] != EGL_NONE)
      len += 2;
   len++;
}
return len;

2. Optional: update the codebase to use ^^ helper
3. Introduce Options::Attribs, populate and compare
Note: add extra wording why compare is safe - as-is it will cause
functional changes in some corner-cases
4. update platform_x11.c to honour the attribs
5. Kill off Options::Platform - _eglParseX11DisplayAttribList and elsewhere.
6. Optional: move _eglParseX11DisplayAttribList validation before the
_eglFindDisplay() ... just like all !X11 platforms do.

Nit: Make _eglSameAttribs return a bool - an c99 or EGL one.

Thanks
Emil


More information about the mesa-dev mailing list