Mesa (staging/21.0): egl: only take render nodes into account when listing DRM devices
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Mar 26 17:00:50 UTC 2021
Module: Mesa
Branch: staging/21.0
Commit: f1ec9335a8b39d4c9437c4f5e134deadad9da563
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f1ec9335a8b39d4c9437c4f5e134deadad9da563
Author: Simon Ser <contact at emersion.fr>
Date: Thu Mar 25 18:42:06 2021 +0100
egl: only take render nodes into account when listing DRM devices
We don't want to expose an EGL device for a display-only DRM devices
(like VKMS). For these DRM devices we have a separate software-rendering
device (the first in the list, always present).
There is a similar check in _eglAddDRMDevice, however it will be
removed in a future commit to allow split render/display devices
to be properly added. We can't figure out whether we're on a split
render/display system before loading the driver.
Signed-off-by: Simon Ser <contact at emersion.fr>
Fixes: 5743a36b2b32 ("egl: Don't add hardware device if there is no render node v2.")
Reviewed-by: Eric Anholt <eric at anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9697>
(cherry picked from commit e39d72aec203ee317feb87ba1c8953a99aad2a5c)
---
.pick_status.json | 2 +-
src/egl/main/egldevice.c | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/.pick_status.json b/.pick_status.json
index 479540b2d1b..782aa31547c 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -112,7 +112,7 @@
"description": "egl: only take render nodes into account when listing DRM devices",
"nominated": true,
"nomination_type": 1,
- "resolution": 0,
+ "resolution": 1,
"master_sha": null,
"because_sha": "5743a36b2b32a91eaf82c8d109932fe4fea01233"
},
diff --git a/src/egl/main/egldevice.c b/src/egl/main/egldevice.c
index 68ca4d2cf35..d224345f5c9 100644
--- a/src/egl/main/egldevice.c
+++ b/src/egl/main/egldevice.c
@@ -274,6 +274,9 @@ _eglRefreshDeviceList(void)
num_devs = drmGetDevices2(0, devices, ARRAY_SIZE(devices));
for (int i = 0; i < num_devs; i++) {
+ if (!(devices[i]->available_nodes & (1 << DRM_NODE_RENDER)))
+ continue;
+
ret = _eglAddDRMDevice(devices[i], NULL);
/* Device is not added - error or already present */
More information about the mesa-commit
mailing list