[Mesa-dev] [PATCH 08/10] egl/drm: Declare EGLConfig attrib array inside loop

Chad Versace chadversary at chromium.org
Thu Jun 22 19:33:14 UTC 2017


On Thu 22 Jun 2017, Eric Engestrom wrote:
> On 22 June 2017 19:10:54 BST, Chad Versace <chadversary at chromium.org> wrote:
> > No behavioral change. Just a readability cleanup.
> > 
> > Instead of modifying this small array on each loop iteration, we now
> > initialize it in-place with the values it needs.
> > 
> > Cc: Eric Engestrom <eric at engestrom.ch>
> > Cc: Emil Velikov <emil.velikov at collabora.com>
> > ---
> >  src/egl/drivers/dri2/platform_drm.c | 14 +++++++-------
> >  1 file changed, 7 insertions(+), 7 deletions(-)
> > 
> > diff --git a/src/egl/drivers/dri2/platform_drm.c
> > b/src/egl/drivers/dri2/platform_drm.c
> > index 7f907aff6c9..c88d48827b3 100644
> > --- a/src/egl/drivers/dri2/platform_drm.c
> > +++ b/src/egl/drivers/dri2/platform_drm.c
> > @@ -598,10 +598,7 @@ drm_add_configs_for_visuals(_EGLDriver *drv,
> > _EGLDisplay *disp)
> >        { GBM_FORMAT_ARGB8888,    0x00ff0000, 0xff000000 },
> >        { GBM_FORMAT_RGB565,      0x0000f800, 0x00000000 },
> >     };
> > -   EGLint attr_list[] = {
> > -      EGL_NATIVE_VISUAL_ID, 0,
> > -      EGL_NONE,
> > -   };
> > +
> >     unsigned int format_count[ARRAY_SIZE(visuals)] = { 0 };
> >     unsigned int count = 0;
> >  
> > @@ -614,12 +611,15 @@ drm_add_configs_for_visuals(_EGLDriver *drv,
> > _EGLDisplay *disp)
> >                                      __DRI_ATTRIB_ALPHA_MASK, &alpha);
> >  
> >        for (unsigned j = 0; j < ARRAY_SIZE(visuals); j++) {
> > -         struct dri2_egl_config *dri2_conf;
> 
> I think this line should stay here.

I put it back.


More information about the mesa-dev mailing list