summaryrefslogtreecommitdiff
path: root/gnu/packages/patches/libdrm-realpath-virtio.patch
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-05-22 21:53:42 +0200
committerMarius Bakke <marius@gnu.org>2020-05-26 22:36:10 +0200
commit3f46f041150bffaf48b51aae3f5c8162726a809b (patch)
tree7ff95f3d50d574c901b96988f9ff6c9881c5de1e /gnu/packages/patches/libdrm-realpath-virtio.patch
parentd92f9d341eae2d808e322897689d895745142c3d (diff)
downloadguix-patches-3f46f041150bffaf48b51aae3f5c8162726a809b.tar
guix-patches-3f46f041150bffaf48b51aae3f5c8162726a809b.tar.gz
gnu: libdrm: Update to 2.4.101.
* gnu/packages/patches/libdrm-symbol-check.patch: Delete file. * gnu/packages/patches/libdrm-realpath-virtio.patch: New file. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/xdisorg.scm (libdrm): Update to 2.4.101. [source](uri): Adjust for new .tar.xz tarball. [source](patches): Adjust patch list as above.
Diffstat (limited to 'gnu/packages/patches/libdrm-realpath-virtio.patch')
-rw-r--r--gnu/packages/patches/libdrm-realpath-virtio.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/gnu/packages/patches/libdrm-realpath-virtio.patch b/gnu/packages/patches/libdrm-realpath-virtio.patch
new file mode 100644
index 0000000000..b7d85160b4
--- /dev/null
+++ b/gnu/packages/patches/libdrm-realpath-virtio.patch
@@ -0,0 +1,42 @@
+Only check for for relative path on virtio devices. Otherwise it could
+break driver loading in some circumstances, notably the IceCat sandbox.
+
+https://gitlab.freedesktop.org/mesa/drm/-/issues/39
+
+Taken from upstream:
+https://gitlab.freedesktop.org/mesa/drm/-/commit/57df07572ce45a1b60bae6fb89770388d3abd6dd
+
+diff --git a/xf86drm.c b/xf86drm.c
+--- a/xf86drm.c
++++ b/xf86drm.c
+@@ -3103,15 +3103,18 @@ static int drmParseSubsystemType(int maj, int min)
+ int subsystem_type;
+
+ snprintf(path, sizeof(path), "/sys/dev/char/%d:%d/device", maj, min);
+- if (!realpath(path, real_path))
+- return -errno;
+- snprintf(path, sizeof(path), "%s", real_path);
+
+ subsystem_type = get_subsystem_type(path);
++ /* Try to get the parent (underlying) device type */
+ if (subsystem_type == DRM_BUS_VIRTIO) {
++ /* Assume virtio-pci on error */
++ if (!realpath(path, real_path))
++ return DRM_BUS_VIRTIO;
+ strncat(path, "/..", PATH_MAX);
+ subsystem_type = get_subsystem_type(path);
+- }
++ if (subsystem_type < 0)
++ return DRM_BUS_VIRTIO;
++ }
+ return subsystem_type;
+ #elif defined(__OpenBSD__) || defined(__DragonFly__) || defined(__FreeBSD__)
+ return DRM_BUS_PCI;
+@@ -3920,6 +3923,7 @@ process_device(drmDevicePtr *device, const char *d_name,
+
+ switch (subsystem_type) {
+ case DRM_BUS_PCI:
++ case DRM_BUS_VIRTIO:
+ return drmProcessPciDevice(device, node, node_type, maj, min,
+ fetch_deviceinfo, flags);
+ case DRM_BUS_USB: