* updated tzdata (2024a -> 2024b)
[t2sde.git] / package / xorg / xorg-server / hotfix-drm-busid.patch
blobf1ec79ea6a75a993192825638d0ed8985b59f82b
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/xorg-server/hotfix-drm-busid.patch
3 # Copyright (C) 2022 The T2 SDE Project
4 #
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
7 #
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
18 @@ -23,7 +23,9 @@
19 static Bool
20 get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index)
22 + drmSetVersion sv;
23 drmVersionPtr v;
24 + char *buf;
25 int fd;
26 int err = 0;
27 if (paused) {
28 @@ -48,6 +48,18 @@ get_drm_info(struct OdevAttributes *attribs, char *path, int delayed_index)
29 if (fd == -1)
30 return FALSE;
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);
38 + if (err) {
39 + xf86Msg(X_ERROR, "%s: failed to set DRM interface version 1.4: %s\n",
40 + path, strerror(-err));
41 + goto out;
42 + }
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)
48 if (server_fd)
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);
53 + drmFreeBusid(buf);
55 v = drmGetVersion(fd);
56 if (!v) {
57 xf86Msg(X_ERROR, "%s: failed to query DRM version\n", path);