[Mesa-dev] [PATCH 2/2] egl: correct surface_type when add config

Emil Velikov emil.l.velikov at gmail.com
Thu Jan 12 16:18:43 UTC 2017


[Adding Tomasz]

On 12 January 2017 at 07:14, Liu Zhiquan <zhiquan.liu at intel.com> wrote:
> When add config, dri_config is double or single. Should only add
> EGL_WINDOW_BIT to surface_type for double dri_config, Should only add
> EGL_PBUFFER_BIT EGL_PIXMAP_BIT to surface_type for single dri_config.
> This avoid crash when operate on wrong surface_type which
> dri_double_config or dri_single_config is null.
>
Afaict you got it spot on - WINDOW are double, while PBUFFER and
PIXMAP are single config.

> Signed-off-by: Liu Zhiquan <zhiquan.liu at intel.com>
> Signed-off-by: Long, Zhifang <zhifang.long at intel.com>
> ---
>  src/egl/drivers/dri2/egl_dri2.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
> index ac231d0..60b24ad 100644
> --- a/src/egl/drivers/dri2/egl_dri2.c
> +++ b/src/egl/drivers/dri2/egl_dri2.c
> @@ -287,6 +287,11 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
>        return NULL;
>     }
>
> +   if (surface_type & (double_buffer ? EGL_WINDOW_BIT : (EGL_PBUFFER_BIT | EGL_PIXMAP_BIT)))
> +      surface_type &= ~(!double_buffer ? EGL_WINDOW_BIT : (EGL_PBUFFER_BIT | EGL_PIXMAP_BIT));
> +   else
> +      return NULL;
> +
This is quite messy to read. Please rework.

How did you test the series ? Please ensure that there's no
piglit/dEQP regressions for Linux (x11, surfaceless, etc) and Android
platforms.

Thanks
Emil


More information about the mesa-dev mailing list