summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Velikov <emil.velikov@collabora.com>2018-11-02 18:34:19 +0000
committerEmil Velikov <emil.l.velikov@gmail.com>2018-11-05 22:16:10 +0000
commit22201d2048c1834ed46fa340cdb60273acd720b0 (patch)
tree031598f1453bd321fc242bb500fdaaa72190d53f
parent60fe2f6eccc263e89dc78f5488148c65b2824623 (diff)
egl/glvnd: correctly report errors when vendor cannot be found
If the user provides an invalid display or device the ToVendor lookup will fail. In this case, the local [Mesa vendor] error code will be set. Thus on sequential eglGetError(), the error will be EGL_SUCCESS. To be more specific, GLVND remembers the last vendor and calls back into it's eglGetError, although there's no guarantee to ever have had one. v2: - Add _eglError call, so the debug callback is executed (Kyle) - Drop XXX comment. Piglit: tests/egl/spec/egl_ext_device_query Fixes: ce562f9e3fa ("EGL: Implement the libglvnd interface for EGL (v3)") Cc: Eric Engestrom <eric@engestrom.ch> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Kyle Brenneman <kbrenneman@nvidia.com> (cherry picked from commit b3ade6538798ad9bf397d8b386eab3dd8af57f3d)
-rw-r--r--src/egl/main/egldispatchstubs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/egl/main/egldispatchstubs.c b/src/egl/main/egldispatchstubs.c
index bfc3195c779..96708aeb0dc 100644
--- a/src/egl/main/egldispatchstubs.c
+++ b/src/egl/main/egldispatchstubs.c
@@ -59,6 +59,11 @@ static __eglMustCastToProperFunctionPointerType FetchVendorFunc(__EGLvendorInfo
}
if (func == NULL) {
if (errorCode != EGL_SUCCESS) {
+ // Since we have no vendor, the follow-up eglGetError() call will
+ // end up using the GLVND error code. Set it here.
+ if (vendor == NULL) {
+ exports->setEGLError(errorCode);
+ }
_eglError(errorCode, __EGL_DISPATCH_FUNC_NAMES[index]);
}
return NULL;