<div dir="ltr"><span style="font-size:12.8px">Reviewed-by: Gurchetan Singh <</span><a href="mailto:gurchetansingh@chromium.org" target="_blank" style="font-size:12.8px">gurchetansingh@chromium.org</a><span style="font-size:12.8px">></span><div class="gmail-yj6qo gmail-ajU" style="font-size:12.8px"></div></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>
Currently we print a debug message if the total configs is non-zero only<br>
to do the same (at an error level) as we return from the function.<br>
<br>
Rework the message to print if we're missing a config for the given<br>
format.<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 | 27 ++++++++++++++++++---------<br>
1 file changed, 18 insertions(+), 9 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 386aa7a..9e2aa7c 100644<br>
--- a/src/egl/drivers/dri2/<wbr>platform_surfaceless.c<br>
+++ b/src/egl/drivers/dri2/<wbr>platform_surfaceless.c<br>
@@ -181,28 +181,37 @@ static EGLBoolean<br>
surfaceless_add_configs_for_<wbr>visuals(_EGLDriver *drv, _EGLDisplay *dpy)<br>
{<br>
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);<br>
- static const unsigned int visuals[3][4] = {<br>
- { 0xff0000, 0xff00, 0xff, 0xff000000 }, // ARGB8888<br>
- { 0xff0000, 0xff00, 0xff, 0x0 }, // RGB888<br>
- { 0xf800, 0x7e0, 0x1f, 0x0 }, // RGB565<br>
+ static const struct {<br>
+ const char *format_name;<br>
+ unsigned int rgba_masks[4];<br>
+ } visuals[] = {<br>
+ { "ARGB8888", { 0xff0000, 0xff00, 0xff, 0xff000000 } },<br>
+ { "RGB888", { 0xff0000, 0xff00, 0xff, 0x0 } },<br>
+ { "RGB565", { 0x00f800, 0x07e0, 0x1f, 0x0 } },<br>
};<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>
struct dri2_egl_config *dri2_conf;<br>
<br>
dri2_conf = dri2_add_config(dpy, dri2_dpy->driver_configs[j],<br>
- count + 1, EGL_PBUFFER_BIT, NULL, visuals[i]);<br>
+ count + 1, EGL_PBUFFER_BIT, NULL, visuals[i].rgba_masks);<br>
<br>
- if (dri2_conf)<br>
+ if (dri2_conf) {<br>
count++;<br>
+ format_count++;<br>
+ }<br>
}<br>
- }<br>
<br>
- if (!count)<br>
- _eglLog(_EGL_DEBUG, "Can't create surfaceless visuals");<br>
+ if (!format_count) {<br>
+ _eglLog(_EGL_DEBUG, "No DRI config supports native format %s",<br>
+ visuals[i].format_name);<br>
+ }<br>
+ }<br>
<br>
return (count != 0);<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>