From e39d72aec203ee317feb87ba1c8953a99aad2a5c Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 25 Mar 2021 18:42:06 +0100 Subject: [PATCH] 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 Fixes: 5743a36b2b32 ("egl: Don't add hardware device if there is no render node v2.") Reviewed-by: Eric Anholt Part-of: --- src/egl/main/egldevice.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/egl/main/egldevice.c b/src/egl/main/egldevice.c index 4aa1a77..79048d8 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 */ -- 2.7.4