1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/xorg-server/hotfix-drm-busid.patch
3 # Copyright (C) 2022 The T2 SDE Project
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
8 # This patch file is dual-licensed. It is available under the license the
9 # patched project is licensed under, as long as it is an OpenSource license
10 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
11 # of the GNU General Public License version 2 as used by the T2 SDE.
12 # --- T2-COPYRIGHT-NOTE-END ---
14 diff --git a/hw/xfree86/os-support/linux/lnx_platform.c b/hw/xfree86/os-support/linux/lnx_platform.c
15 index 8a6be97aa..b8ec58663 100644
16 --- a/hw/xfree86/os-support/linux/lnx_platform.c
17 +++ b/hw/xfree86/os-support/linux/lnx_platform.c
20 get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index)
28 @@ -48,6 +48,18 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index)
32 + sv.drm_di_major = 1;
33 + sv.drm_di_minor = 4;
34 + sv.drm_dd_major = -1; /* Don't care */
35 + sv.drm_dd_minor = -1; /* Don't care */
37 + err = drmSetInterfaceVersion(fd, &sv);
39 + xf86Msg(X_ERROR, "%s: failed to set DRM interface version 1.4: %s\n",
40 + path, strerror(-err));
44 /* for a delayed probe we've already added the device */
45 if (delayed_index == -1) {
46 xf86_add_platform_device(attribs, FALSE);
47 @@ -57,6 +69,10 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index)
49 xf86_platform_devices[delayed_index].flags |= XF86_PDEV_SERVER_FD;
51 + buf = drmGetBusid(fd);
52 + xf86_platform_odev_attributes(delayed_index)->busid = XNFstrdup(buf);
55 v = drmGetVersion(fd);
57 xf86Msg(X_ERROR, "%s: failed to query DRM version\n", path);