<div dir="ltr"><div dir="ltr" style="font-size:12.8px">Reviewed-by: Gurchetan Singh <<a href="mailto:gurchetansingh@chromium.org" target="_blank">gurchetansingh@chromium.org</a>></div><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:18 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>
The latter already does it for us.<br>
<br>
As we're here annotate the masks as const and use unsigned for the<br>
index(es).<br>
<br>
Cc: Gurchetan Singh <<a href="mailto:gurchetansingh@chromium.org">gurchetansingh@chromium.org</a>><br>
Cc: Chad Versace <<a href="mailto:chad.versace@intel.com">chad.versace@intel.com</a>><br>
Signed-off-by: Emil Velikov <<a href="mailto:emil.velikov@collabora.com">emil.velikov@collabora.com</a>><br>
---<br>
Similar to the earlier surfaceless patch - only compile tested !<br>
---<br>
src/egl/drivers/dri2/platform_<wbr>surfaceless.c | 23 +++--------------------<br>
1 file changed, 3 insertions(+), 20 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 2afcbd7..c75a895 100644<br>
--- a/src/egl/drivers/dri2/<wbr>platform_surfaceless.c<br>
+++ b/src/egl/drivers/dri2/<wbr>platform_surfaceless.c<br>
@@ -183,38 +183,21 @@ surfaceless_add_configs_for_<wbr>visuals(_EGLDriver *drv, _EGLDisplay *dpy)<br>
<br>
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);<br>
<br>
- unsigned int visuals[3][4] = {<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>
};<br>
<br>
- int count, i, j;<br>
- unsigned int r, b, g, a;<br>
+ unsigned int count, i, j;<br>
<br>
count = 0;<br>
for (i = 0; i < ARRAY_SIZE(visuals); i++) {<br>
for (j = 0; dri2_dpy->driver_configs[j]; j++) {<br>
- const EGLint surface_type = EGL_PBUFFER_BIT;<br>
struct dri2_egl_config *dri2_conf;<br>
<br>
- /* Determine driver supported masks */<br>
- dri2_dpy->core-><wbr>getConfigAttrib(dri2_dpy-><wbr>driver_configs[j],<br>
- __DRI_ATTRIB_RED_MASK, &r);<br>
- dri2_dpy->core-><wbr>getConfigAttrib(dri2_dpy-><wbr>driver_configs[j],<br>
- __DRI_ATTRIB_BLUE_MASK, &b);<br>
- dri2_dpy->core-><wbr>getConfigAttrib(dri2_dpy-><wbr>driver_configs[j],<br>
- __DRI_ATTRIB_GREEN_MASK, &g);<br>
- dri2_dpy->core-><wbr>getConfigAttrib(dri2_dpy-><wbr>driver_configs[j],<br>
- __DRI_ATTRIB_ALPHA_MASK, &a);<br>
-<br>
- /* Compare with advertised visuals */<br>
- if (r ^ visuals[i][0] || g ^ visuals[i][1]<br>
- || b ^ visuals[i][2] || a ^ visuals[i][3])<br>
- continue;<br>
-<br>
dri2_conf = dri2_add_config(dpy, dri2_dpy->driver_configs[j],<br>
- count + 1, surface_type, NULL, visuals[i]);<br>
+ count + 1, EGL_PBUFFER_BIT, NULL, visuals[i]);<br>
<br>
if (dri2_conf)<br>
count++;<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.9.0<br>
<br>
</font></span></blockquote></div><br></div>