mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 01:50:10 +01:00
egl: Fix invalid device UUID returned by EGL_EXT_device_persistent_id
MR !36998 / commit 72f2565fc9 introduced
an issue where QueryDeviceInfo is not called in eglQueryDeviceBinaryEXT,
which causes the queried UUID to always be zero.
This commit fixes the issue by adding a call to QueryDeviceInfo.
Also, it refactors the inconsistent function names passed to _eglError.
Signed-off-by: Christoph Neuhauser <christoph.neuhauser@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37616>
This commit is contained in:
parent
b58026fac9
commit
5e5bc7a1c7
1 changed files with 12 additions and 3 deletions
|
|
@ -295,6 +295,15 @@ _eglQueryDeviceBinaryEXT(_EGLDevice *dev, EGLint name, EGLint max_size,
|
|||
}
|
||||
|
||||
#ifdef HAVE_LIBDRM
|
||||
drmDevicePtr device = _eglDeviceDrm(dev);
|
||||
/* Software device does not have render node. */
|
||||
const char *render_node =
|
||||
_eglDeviceSupports(dev, _EGL_DEVICE_SOFTWARE) ?
|
||||
"" : device->nodes[DRM_NODE_RENDER];
|
||||
if (!_eglDriver.QueryDeviceInfo(render_node, &dev->device_info)) {
|
||||
_eglError(EGL_BAD_DEVICE_EXT, "eglQueryDeviceBinaryEXT");
|
||||
return EGL_FALSE;
|
||||
}
|
||||
if (value && name == EGL_DEVICE_UUID_EXT) {
|
||||
memcpy(value, dev->device_info.device_uuid, EGL_UUID_SIZE);
|
||||
}
|
||||
|
|
@ -361,7 +370,7 @@ _eglQueryDeviceStringEXT(_EGLDevice *dev, EGLint name)
|
|||
break;
|
||||
#ifdef HAVE_LIBDRM
|
||||
if (!_eglDriver.QueryDeviceInfo(render_node, &dev->device_info)) {
|
||||
_eglError(EGL_BAD_DEVICE_EXT, "_eglQueryDeviceStringEXT");
|
||||
_eglError(EGL_BAD_DEVICE_EXT, "eglQueryDeviceStringEXT");
|
||||
return NULL;
|
||||
}
|
||||
return dev->device_info.vendor_name;
|
||||
|
|
@ -375,7 +384,7 @@ _eglQueryDeviceStringEXT(_EGLDevice *dev, EGLint name)
|
|||
break;
|
||||
#ifdef HAVE_LIBDRM
|
||||
if (!_eglDriver.QueryDeviceInfo(render_node, &dev->device_info)) {
|
||||
_eglError(EGL_BAD_DEVICE_EXT, "_eglQueryDeviceStringEXT");
|
||||
_eglError(EGL_BAD_DEVICE_EXT, "eglQueryDeviceStringEXT");
|
||||
return NULL;
|
||||
}
|
||||
return dev->device_info.renderer_name;
|
||||
|
|
@ -390,7 +399,7 @@ _eglQueryDeviceStringEXT(_EGLDevice *dev, EGLint name)
|
|||
break;
|
||||
#ifdef HAVE_LIBDRM
|
||||
if (!_eglDriver.QueryDeviceInfo(render_node, &dev->device_info)) {
|
||||
_eglError(EGL_BAD_DEVICE_EXT, "_eglQueryDeviceStringEXT");
|
||||
_eglError(EGL_BAD_DEVICE_EXT, "eglQueryDeviceStringEXT");
|
||||
return NULL;
|
||||
}
|
||||
return dev->device_info.driver_name;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue