From e2eeaab2a4b3d4d3c500f3480214f8c962c3213b Mon Sep 17 00:00:00 2001 From: msizanoen1 Date: Sat, 5 Feb 2022 13:34:27 +0700 Subject: [PATCH] glamor: Use render node for glamor device path where possible On certain system deployments, /dev/dri/card* nodes aren't directly accessible to the currently logged in user, but the display server only access it by asking systemd-logind to open the device for it. This causes the X server to fail when trying to re-open the card* device directly, causing all use of DRI3 to fail. Fix this by using the render device path instead where possible. --- glamor/glamor_egl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c index 5382eb2bc..dc8409dcc 100644 --- a/glamor/glamor_egl.c +++ b/glamor/glamor_egl.c @@ -927,7 +927,9 @@ glamor_egl_screen_init(ScreenPtr screen, struct glamor_context *glamor_ctx) /* To do DRI3 device FD generation, we need to open a new fd * to the same device we were handed in originally. */ - glamor_egl->device_path = drmGetDeviceNameFromFd2(glamor_egl->fd); + glamor_egl->device_path = drmGetRenderDeviceNameFromFd(glamor_egl->fd); + if (!glamor_egl->device_path) + glamor_egl->device_path = drmGetDeviceNameFromFd2(glamor_egl->fd); if (!dri3_screen_init(screen, &glamor_dri3_info)) { xf86DrvMsg(scrn->scrnIndex, X_ERROR,