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.
This commit is contained in:
msizanoen1 2022-02-05 13:34:27 +07:00 committed by Matt Turner
parent 146bb9b2c1
commit e2eeaab2a4

View File

@ -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,