diff --git a/system/egl/egl.cpp b/system/egl/egl.cpp
index b0b510b70c6693b0a3dee38575e4d0ac79ab0a30..60d17e5b336a9d8991516a5121f12dd153e04c9b 100644
--- a/system/egl/egl.cpp
+++ b/system/egl/egl.cpp
@@ -920,7 +920,11 @@ __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char *procname)
 
 const char* eglQueryString(EGLDisplay dpy, EGLint name)
 {
-    VALIDATE_DISPLAY_INIT(dpy, NULL);
+    // EGL_BAD_DISPLAY is generated if display is not an EGL display connection, unless display is
+    // EGL_NO_DISPLAY and name is EGL_EXTENSIONS.
+    if (dpy || name != EGL_EXTENSIONS) {
+        VALIDATE_DISPLAY_INIT(dpy, NULL);
+    }
 
     return s_display.queryString(name);
 }