diff mbox series

[1/3] util/egl: Honour Surfaceless MESA in get_default_display

Message ID 1495062017-6955-1-git-send-email-daniel.diaz@linaro.org
State Accepted
Commit 7b74602136b4249e34823e88a84b3e61bd534af1
Headers show
Series [1/3] util/egl: Honour Surfaceless MESA in get_default_display | expand

Commit Message

Daniel Díaz May 17, 2017, 11 p.m. UTC
Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
---
 tests/util/piglit-util-egl.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/tests/util/piglit-util-egl.c b/tests/util/piglit-util-egl.c
index 106c735..389fe12 100644
--- a/tests/util/piglit-util-egl.c
+++ b/tests/util/piglit-util-egl.c
@@ -85,6 +85,7 @@  piglit_egl_get_default_display(EGLenum platform)
 	static bool has_x11 = false;
 	static bool has_wayland = false;
 	static bool has_gbm = false;
+	static bool has_surfaceless_mesa = false;
 
 	static EGLDisplay (*peglGetPlatformDisplayEXT)(EGLenum platform, void *native_display, const EGLint *attrib_list);
 
@@ -99,6 +100,7 @@  piglit_egl_get_default_display(EGLenum platform)
 		has_x11 = piglit_is_egl_extension_supported(EGL_NO_DISPLAY, "EGL_EXT_platform_x11");
 		has_wayland = piglit_is_egl_extension_supported(EGL_NO_DISPLAY, "EGL_EXT_platform_wayland");
 		has_gbm = piglit_is_egl_extension_supported(EGL_NO_DISPLAY, "EGL_EXT_platform_gbm");
+		has_surfaceless_mesa = piglit_is_egl_extension_supported(EGL_NO_DISPLAY, "EGL_MESA_platform_surfaceless");
 
 		peglGetPlatformDisplayEXT = (void*) eglGetProcAddress("eglGetPlatformDisplayEXT");
 	}
@@ -123,6 +125,11 @@  piglit_egl_get_default_display(EGLenum platform)
 			return EGL_NO_DISPLAY;
 		}
 		break;
+	case EGL_PLATFORM_SURFACELESS_MESA:
+		if (!has_surfaceless_mesa) {
+			return EGL_NO_DISPLAY;
+		}
+		break;
 	default:
 		fprintf(stderr, "%s: unrecognized platform %#x\n", __func__, platform);
 		return EGL_NO_DISPLAY;