[4/5] util/egl: Support querying client extensions

Submitted by Chad Versace on Feb. 9, 2014, 9:31 p.m.

Details

Message ID 1391981476-24780-5-git-send-email-chad.versace@linux.intel.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Chad Versace Feb. 9, 2014, 9:31 p.m.
This patch fixes piglit_is_egl_extension_supported() to correctly handle
client extensions.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
---
 tests/util/piglit-util-egl.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Patch hide | download patch | download mbox

diff --git a/tests/util/piglit-util-egl.c b/tests/util/piglit-util-egl.c
index 52fb338..2fb18ea 100644
--- a/tests/util/piglit-util-egl.c
+++ b/tests/util/piglit-util-egl.c
@@ -82,6 +82,14 @@  piglit_is_egl_extension_supported(EGLDisplay egl_dpy, const char *name)
 	const char *const egl_extension_list =
 		eglQueryString(egl_dpy, EGL_EXTENSIONS);
 
+	/* If egl_dpy is EGL_NO_DISPLAY and the EGL implementation lacks
+	 * support for client extensions, then eglQueryString() will have
+	 * returned NULL.
+	 */
+	if (egl_extension_list == NULL) {
+		return false;
+	}
+
 	return piglit_is_extension_in_string(egl_extension_list, name);
 }