Mesa (staging/19.1): egl: Don't add hardware device if there is no render node v2.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 20 08:57:10 UTC 2019


Module: Mesa
Branch: staging/19.1
Commit: 15f6bb5c6ced76dcb7c984c2405e6f5b28d651b5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=15f6bb5c6ced76dcb7c984c2405e6f5b28d651b5

Author: Mathias Fröhlich <Mathias.Froehlich at gmx.net>
Date:   Thu Jun  6 10:22:25 2019 +0200

egl: Don't add hardware device if there is no render node v2.

Do not offer a hardware drm backed egl device if no render node
is available. The current implementation will fail on this
egl device. On top it issues a warning that is actually missleading.
There are finally more error paths that can fail on the way to a
hardware backed egl device. Fixing all of them would kind of require
opening the drm device and see if there is a usable driver associated
with the device. The taken approach avoids a full probe and fixes at
least this kind of problem on kvm virtualization hosts I observe here.

Fixes: dbb4457d985 ("egl: add EGL_EXT_device_drm support")
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
Signed-off-by: Mathias Fröhlich <Mathias.Froehlich at web.de>
(cherry picked from commit 5743a36b2b32a91eaf82c8d109932fe4fea01233)

---

 src/egl/main/egldevice.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/egl/main/egldevice.c b/src/egl/main/egldevice.c
index c5c9a21273a..ece0f4075da 100644
--- a/src/egl/main/egldevice.c
+++ b/src/egl/main/egldevice.c
@@ -108,9 +108,9 @@ static int
 _eglAddDRMDevice(drmDevicePtr device, _EGLDevice **out_dev)
 {
    _EGLDevice *dev;
+   const int wanted_nodes = 1 << DRM_NODE_RENDER | 1 << DRM_NODE_PRIMARY;
 
-   if ((device->available_nodes & (1 << DRM_NODE_PRIMARY |
-                                   1 << DRM_NODE_RENDER)) == 0)
+   if ((device->available_nodes & wanted_nodes) != wanted_nodes)
       return -1;
 
    dev = _eglGlobal.DeviceList;




More information about the mesa-commit mailing list