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

Message ID 1495062017-6955-1-git-send-email-daniel.diaz@linaro.org
State New
Headers show
Series
  • [1/3] util/egl: Honour Surfaceless MESA in get_default_display
Related show

Commit Message

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

Patch hide | download patch | download mbox

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;