# --- T2-COPYRIGHT-BEGIN --- # t2/package/*/xorg-server/hotfix-drm-busid.patch # Copyright (C) 2022 - 2026 The T2 SDE Project # SPDX-License-Identifier: GPL-2.0 or patched project license # --- T2-COPYRIGHT-END --- diff --git a/hw/xfree86/os-support/linux/lnx_platform.c b/hw/xfree86/os-support/linux/lnx_platform.c index 8a6be97aa..b8ec58663 100644 --- a/hw/xfree86/os-support/linux/lnx_platform.c +++ b/hw/xfree86/os-support/linux/lnx_platform.c @@ -23,7 +23,9 @@ static Bool get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) { + drmSetVersion sv; drmVersionPtr v; + char *buf; int fd; int err = 0; if (paused) { @@ -48,6 +48,18 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) if (fd == -1) return FALSE; + sv.drm_di_major = 1; + sv.drm_di_minor = 4; + sv.drm_dd_major = -1; /* Don't care */ + sv.drm_dd_minor = -1; /* Don't care */ + + err = drmSetInterfaceVersion(fd, &sv); + if (err) { + xf86Msg(X_ERROR, "%s: failed to set DRM interface version 1.4: %s\n", + path, strerror(-err)); + goto out; + } + /* for a delayed probe we've already added the device */ if (delayed_index == -1) { xf86_add_platform_device(attribs, FALSE); @@ -57,6 +69,10 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index) if (server_fd) xf86_platform_devices[delayed_index].flags |= XF86_PDEV_SERVER_FD; + buf = drmGetBusid(fd); + xf86_platform_odev_attributes(delayed_index)->busid = XNFstrdup(buf); + drmFreeBusid(buf); + v = drmGetVersion(fd); if (!v) { xf86Msg(X_ERROR, "%s: failed to query DRM version\n", path);