# --- T2-COPYRIGHT-NOTE-BEGIN ---
# T2 SDE: package/*/xorg-server/hotfix-drm-busid.patch
# Copyright (C) 2022 The T2 SDE Project
# 
# This Copyright note is generated by scripts/Create-CopyPatch,
# more information can be found in the files COPYING and README.
# 
# This patch file is dual-licensed. It is available under the license the
# patched project is licensed under, as long as it is an OpenSource license
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
# of the GNU General Public License version 2 as used by the T2 SDE.
# --- T2-COPYRIGHT-NOTE-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);
