<div dir="ltr">>> unsigned int format_count[ARRAY_SIZE(visuals)] = {};<br><br>Isn't this invalid in C?<br><a href="http://stackoverflow.com/questions/17589533/is-an-empty-initializer-list-valid-c-code">http://stackoverflow.com/questions/17589533/is-an-empty-initializer-list-valid-c-code</a><br><br>Other than that, this patch is<br>Reviewed-by: Gurchetan Singh <<a href="mailto:gurchetansingh@chromium.org">gurchetansingh@chromium.org</a>></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Aug 25, 2016 at 9:23 AM, Emil Velikov <span dir="ltr"><<a href="mailto:emil.l.velikov@gmail.com" target="_blank">emil.l.velikov@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Emil Velikov <<a href="mailto:emil.velikov@collabora.com">emil.velikov@collabora.com</a>><br>
<br>
Analogous to previous commit.<br>
<br>
Signed-off-by: Emil Velikov <<a href="mailto:emil.velikov@collabora.com">emil.velikov@collabora.com</a>><br>
---<br>
 src/egl/drivers/dri2/platform_<wbr>surfaceless.c | 15 ++++++++-------<br>
 1 file changed, 8 insertions(+), 7 deletions(-)<br>
<br>
diff --git a/src/egl/drivers/dri2/<wbr>platform_surfaceless.c b/src/egl/drivers/dri2/<wbr>platform_surfaceless.c<br>
index 9e2aa7c..c788f82 100644<br>
--- a/src/egl/drivers/dri2/<wbr>platform_surfaceless.c<br>
+++ b/src/egl/drivers/dri2/<wbr>platform_surfaceless.c<br>
@@ -189,25 +189,26 @@ surfaceless_add_configs_for_<wbr>visuals(_EGLDriver *drv, _EGLDisplay *dpy)<br>
       { "RGB888",   { 0xff0000, 0xff00, 0xff, 0x0 } },<br>
       { "RGB565",   { 0x00f800, 0x07e0, 0x1f, 0x0 } },<br>
    };<br>
+   unsigned int format_count[ARRAY_SIZE(<wbr>visuals)] = {};<br>
    unsigned int count, i, j;<br>
<br>
    count = 0;<br>
-   for (i = 0; i < ARRAY_SIZE(visuals); i++) {<br>
-      int format_count = 0;<br>
-<br>
-      for (j = 0; dri2_dpy->driver_configs[j]; j++) {<br>
+   for (i = 0; i < dri2_dpy->driver_configs[i]; i++) {<br>
+      for (j = 0; ARRAY_SIZE(visuals); j++) {<br>
          struct dri2_egl_config *dri2_conf;<br>
<br>
-         dri2_conf = dri2_add_config(dpy, dri2_dpy->driver_configs[j],<br>
+         dri2_conf = dri2_add_config(dpy, dri2_dpy->driver_configs[i],<br>
                count + 1, EGL_PBUFFER_BIT, NULL, visuals[i].rgba_masks);<br>
<br>
          if (dri2_conf) {<br>
             count++;<br>
-            format_count++;<br>
+            format_count[j]++;<br>
          }<br>
       }<br>
+   }<br>
<br>
-      if (!format_count) {<br>
+   for (i = 0; ARRAY_SIZE(format_count); i++) {<br>
+      if (!format_count[i]) {<br>
          _eglLog(_EGL_DEBUG, "No DRI config supports native format %s",<br>
                visuals[i].format_name);<br>
       }<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.9.0<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>