[Mesa-dev] [PATCH] egl/android: config id increase one by one

Emil Velikov emil.l.velikov at gmail.com
Thu Jan 12 15:31:51 UTC 2017


On 12 January 2017 at 07:38, Liu Zhiquan <zhiquan.liu at intel.com> wrote:
> when dri2_add_config, driver_configs may add to exist dri2_conf,
> the config id should not increase in this case.
> In the code, when ConfigID equal to count+1, it's mean a new config,
> config_count will increase. otherwise it's a exist config.
>
What a lovely little bug. How exactly did you spotted it - please
mention in the commit log.

> Signed-off-by: Liu Zhiquan <zhiquan.liu at intel.com>
> Signed-off-by: Long, Zhifang <zhifang.long at intel.com>
> ---
>  src/egl/drivers/dri2/platform_android.c | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
> index 1c880f9..5bf6fd5 100644
> --- a/src/egl/drivers/dri2/platform_android.c
> +++ b/src/egl/drivers/dri2/platform_android.c
> @@ -950,9 +950,9 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
>       EGL_NONE
>     };
>     unsigned int format_count[ARRAY_SIZE(visuals)] = { 0 };
> -   int count, i, j;
> +   int config_count, i, j;
>
Please keep the variable name as-is. With that the patch is
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>

Other platforms would need similar fix, can you please send patches
for those as well please ?

For future work we might as well add helper. Something like the below
should be fine

struct dri2_visual_info {
   const char *name; // optional
   int format;
   unsigned int rgba_masks[4];
};

static EGLBoolean
dri2_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy, EGLint
surface_type, EGLint attr_list[], const struct dri2_visual_info *foo)

NB: with this we'll start setting NATIVE_VISUAL_ID and TYPE on all platforms.
Make sure each platform has constructed large enough attr_list[].

platform_x11 and platform_wayland have some interesting handling -
might be ok to address those but will need a careful look.

Thanks
Emil


More information about the mesa-dev mailing list