Compare commits

...

3 Commits

Author SHA1 Message Date
Emil Velikov
949b1048f7 Update version to 18.3.0-rc1
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
2018-11-06 15:31:07 +00:00
Emil Velikov
22201d2048 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: ce562f9e3f ("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 b3ade65387)
2018-11-05 22:16:10 +00:00
Emil Velikov
60fe2f6ecc egl: add EGL_EXT_device_base entrypoints
eglQueryDevicesEXT (unlike the other three functions) does not depend
on the display. It is implemented in GLVND, which calls into each
driver collecting the list of devices and presenting it to the user.

For the other entrypoints, GLVND acts as pass through stub calling into
the vendor library. The vendor implementation calls back into GLVND to
get the vendor dispatch. Then the driver proceeds to call itself via
the said dispatch.

This design makes is possible to keep using "old" GLVND with newer
vendor drivers. Since effectively all the extension code is within the
latter itself.

Without said entrypoints, any user will outright crash - as reported in
the bug report.

Note: there's a follow-up fix needed to our GLVND code, to make piglit
happy.

v2: add some beefy documentation in the commit message.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108635
Fixes: 7552fcb7b9 ("egl: add base EGL_EXT_device_base implementation")
Reported-by: kyle.devir@mykolab.com
Cc: kyle.devir@mykolab.com
Acked-by: Eric Engestrom <eric@engestrom.ch>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Emil Velikov <emil.velikov@collabora.com>
(cherry picked from commit 2a8fefdeb0)
2018-11-05 22:16:08 +00:00
3 changed files with 13 additions and 1 deletions

View File

@@ -1 +1 @@
18.3.0-devel
18.3.0-rc1

View File

@@ -199,5 +199,12 @@ EGL_FUNCTIONS = (
# EGL_EXT_image_dma_buf_import_modifiers
_eglFunc("eglQueryDmaBufFormatsEXT", "display"),
_eglFunc("eglQueryDmaBufModifiersEXT", "display"),
# EGL_EXT_device_base
_eglFunc("eglQueryDeviceAttribEXT", "device"),
_eglFunc("eglQueryDeviceStringEXT", "device"),
_eglFunc("eglQueryDevicesEXT", "none"),
_eglFunc("eglQueryDisplayAttribEXT", "display"),
)

View File

@@ -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;