summaryrefslogtreecommitdiff
path: root/src/egl
diff options
context:
space:
mode:
authorChad Versace <chadversary@chromium.org>2017-06-22 11:00:41 -0700
committerChad Versace <chadversary@chromium.org>2017-06-22 12:35:49 -0700
commitf8ad7f405492ae1b6b035dd41b6b4b77be51f719 (patch)
tree54596434468f1d77d29575bd062ce206f164d551 /src/egl
parentbd789098a53518ac559eba7305876f3dcacdc863 (diff)
egl/drm: Declare EGLConfig attrib array inside loop
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. Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Diffstat (limited to 'src/egl')
-rw-r--r--src/egl/drivers/dri2/platform_drm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c
index 7f907aff6c9..11928225b99 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;
@@ -619,7 +616,10 @@ drm_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *disp)
if (visuals[j].red_mask != red || visuals[j].alpha_mask != alpha)
continue;
- attr_list[1] = visuals[j].format;
+ const EGLint attr_list[] = {
+ EGL_NATIVE_VISUAL_ID, visuals[j].format,
+ EGL_NONE,
+ };
dri2_conf = dri2_add_config(disp, dri2_dpy->driver_configs[i],
count + 1, EGL_WINDOW_BIT, attr_list, NULL);