summaryrefslogtreecommitdiff
path: root/src/egl
diff options
context:
space:
mode:
authorEric Engestrom <eric@engestrom.ch>2017-06-21 21:55:56 +0100
committerEric Engestrom <eric.engestrom@imgtec.com>2017-06-22 17:32:31 +0100
commitc87f73724efbec493d0149738d3a7ea11bfab222 (patch)
tree67c217abb9430daa4fd9eabd0f669c9f561acc73 /src/egl
parent5e884353e647261ac815c85724fc108e86dd1d85 (diff)
egl: properly count configs
dri2_conf represents another config (which shouldn't be counted) if it doesn't have the requested ID. Reported-by: Liu Zhiquan <zhiquan.liu@intel.com> Signed-off-by: Eric Engestrom <eric@engestrom.ch> Cc: <mesa-stable@lists.freedesktop.org> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Diffstat (limited to 'src/egl')
-rw-r--r--src/egl/drivers/dri2/platform_android.c3
-rw-r--r--src/egl/drivers/dri2/platform_drm.c3
-rw-r--r--src/egl/drivers/dri2/platform_surfaceless.c3
-rw-r--r--src/egl/drivers/dri2/platform_wayland.c3
-rw-r--r--src/egl/drivers/dri2/platform_x11.c6
5 files changed, 12 insertions, 6 deletions
diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c
index eaaeff4641c..dba5ad6d551 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -1079,7 +1079,8 @@ droid_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
dri2_conf = dri2_add_config(dpy, dri2_dpy->driver_configs[j],
count + 1, surface_type, config_attrs, visuals[i].rgba_masks);
if (dri2_conf) {
- count++;
+ if (dri2_conf->base.ConfigID == count + 1)
+ count++;
format_count[i]++;
}
}
diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c
index 2cf7106255f..869f599df57 100644
--- a/src/egl/drivers/dri2/platform_drm.c
+++ b/src/egl/drivers/dri2/platform_drm.c
@@ -631,7 +631,8 @@ drm_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *disp)
dri2_conf = dri2_add_config(disp, dri2_dpy->driver_configs[i],
count + 1, EGL_WINDOW_BIT, attr_list, NULL);
if (dri2_conf) {
- count++;
+ if (dri2_conf->base.ConfigID == count + 1)
+ count++;
format_count[j]++;
}
}
diff --git a/src/egl/drivers/dri2/platform_surfaceless.c b/src/egl/drivers/dri2/platform_surfaceless.c
index 0eb3fb7505c..f292f2b3fe3 100644
--- a/src/egl/drivers/dri2/platform_surfaceless.c
+++ b/src/egl/drivers/dri2/platform_surfaceless.c
@@ -212,7 +212,8 @@ surfaceless_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *dpy)
count + 1, EGL_PBUFFER_BIT, NULL, visuals[j].rgba_masks);
if (dri2_conf) {
- count++;
+ if (dri2_conf->base.ConfigID == count + 1)
+ count++;
format_count[j]++;
}
}
diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
index 1444449e8c5..128ef75105d 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -1131,7 +1131,8 @@ dri2_wl_add_configs_for_visuals(_EGLDriver *drv, _EGLDisplay *disp)
dri2_conf = dri2_add_config(disp, dri2_dpy->driver_configs[i],
count + 1, EGL_WINDOW_BIT, NULL, visuals[j].rgba_masks);
if (dri2_conf) {
- count++;
+ if (dri2_conf->base.ConfigID == count + 1)
+ count++;
format_count[j]++;
}
}
diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c
index 95e560a32a6..f91ad67d5f9 100644
--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -773,7 +773,8 @@ dri2_x11_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
dri2_conf = dri2_add_config(disp, config, count + 1, surface_type,
config_attrs, rgba_masks);
if (dri2_conf)
- count++;
+ if (dri2_conf->base.ConfigID == count + 1)
+ count++;
/* Allow a 24-bit RGB visual to match a 32-bit RGBA EGLConfig.
* Otherwise it will only match a 32-bit RGBA visual. On a
@@ -788,7 +789,8 @@ dri2_x11_add_configs_for_visuals(struct dri2_egl_display *dri2_dpy,
dri2_conf = dri2_add_config(disp, config, count + 1, surface_type,
config_attrs, rgba_masks);
if (dri2_conf)
- count++;
+ if (dri2_conf->base.ConfigID == count + 1)
+ count++;
}
}
}