summaryrefslogtreecommitdiff
path: root/src/egl
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2019-09-10 12:07:07 -0400
committerAdam Jackson <ajax@redhat.com>2019-09-11 14:11:40 -0400
commit7e0e53a077850ecb1ff86c481475f8fd79fb51fc (patch)
treec81b8dc0874cc645a7d476608990a474350d0eb2 /src/egl
parent96b592696f13be09621bc50be31a89fde54b18e2 (diff)
downloadmesa-7e0e53a077850ecb1ff86c481475f8fd79fb51fc.tar.gz
egl/dri2: Refuse to add EGLConfigs with no supported surface types
For example, the surfaceless platform only supports pbuffers. If the driver supports MSAA, we would still create a config, but it would have no supported surface types. That's meaningless, so don't do it. Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Diffstat (limited to 'src/egl')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 526cb1969c1..f968cd7af27 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -420,6 +420,22 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
base.BindToTextureRGBA = bind_to_texture_rgba;
}
+ if (double_buffer) {
+ surface_type &= ~EGL_PIXMAP_BIT;
+ }
+
+ /* No support for pbuffer + MSAA for now.
+ *
+ * XXX TODO: pbuffer + MSAA does not work and causes crashes.
+ * See QT bugreport: https://bugreports.qt.io/browse/QTBUG-47509
+ */
+ if (base.Samples) {
+ surface_type &= ~EGL_PBUFFER_BIT;
+ }
+
+ if (!surface_type)
+ return NULL;
+
base.RenderableType = disp->ClientAPIs;
base.Conformant = disp->ClientAPIs;
@@ -464,19 +480,6 @@ dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
return NULL;
}
- if (double_buffer) {
- surface_type &= ~EGL_PIXMAP_BIT;
- }
-
- /* No support for pbuffer + MSAA for now.
- *
- * XXX TODO: pbuffer + MSAA does not work and causes crashes.
- * See QT bugreport: https://bugreports.qt.io/browse/QTBUG-47509
- */
- if (base.Samples) {
- surface_type &= ~EGL_PBUFFER_BIT;
- }
-
conf->base.SurfaceType |= surface_type;
return conf;