From b7d3bbbd82b729a04dd6b58592fa4972f493c63d Mon Sep 17 00:00:00 2001 From: Quantum Date: Sun, 15 Aug 2021 18:16:09 -0400 Subject: [PATCH] [client] egl: use standard-compliant way of EGL detection According to the documentation for eglQueryString: > EGL_BAD_DISPLAY is generated if display is not an EGL display connection, > unless display is EGL_NO_DISPLAY and name is EGL_EXTENSIONS. Therefore, we should check EGL by doing: eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS) Indeed, the old way of eglQueryString(EGL_NO_DISPLAY, EGL_VERSION) works on libglvnd but not using mesa's libEGL.so directly. Also added a warning to make it more obvious that EGL is not available. --- client/renderers/EGL/egl.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/renderers/EGL/egl.c b/client/renderers/EGL/egl.c index c75d0807..2c2230b0 100644 --- a/client/renderers/EGL/egl.c +++ b/client/renderers/EGL/egl.c @@ -201,8 +201,11 @@ static bool egl_create(LG_Renderer ** renderer, const LG_RendererParams params, bool * needsOpenGL) { // check if EGL is even available - if (!eglQueryString(EGL_NO_DISPLAY, EGL_VERSION)) + if (!eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS)) + { + DEBUG_WARN("EGL is not available"); return false; + } // create our local storage struct Inst * this = calloc(1, sizeof(*this));