aboutsummaryrefslogtreecommitdiff
path: root/graphics/libdrm
diff options
context:
space:
mode:
authorKoop Mast <kwm@FreeBSD.org>2015-11-02 13:12:13 +0000
committerKoop Mast <kwm@FreeBSD.org>2015-11-02 13:12:13 +0000
commit8606beb1b8e2c5e7528606cf47afea9adbfa2193 (patch)
tree5de6037b42b533eec4297bc763136bd9b41b8ebb /graphics/libdrm
parent3171afc9d9424f00b16bdfd198f9b51325b51f35 (diff)
downloadports-8606beb1b8e2c5e7528606cf47afea9adbfa2193.tar.gz
ports-8606beb1b8e2c5e7528606cf47afea9adbfa2193.zip
The intel kernel driver leaks error code "512" (ERESTARTSYS) to
userland. This error code should be converted to EINTR and/or EAGAIN. Teach libdrm to handle this error code as a work around, and add a override to not apply the patch. Which is done for people doing DRM development. PR: 204174
Notes
Notes: svn path=/head/; revision=400652
Diffstat (limited to 'graphics/libdrm')
-rw-r--r--graphics/libdrm/Makefile7
-rw-r--r--graphics/libdrm/files/extra-xf86drm.c19
2 files changed, 26 insertions, 0 deletions
diff --git a/graphics/libdrm/Makefile b/graphics/libdrm/Makefile
index f9fd9bcdba61..2942b6f3d850 100644
--- a/graphics/libdrm/Makefile
+++ b/graphics/libdrm/Makefile
@@ -3,6 +3,7 @@
PORTNAME= libdrm
PORTVERSION= 2.4.65
+PORTREVISION= 1
PORTEPOCH= 1
CATEGORIES= graphics x11
MASTER_SITES= http://dri.freedesktop.org/libdrm/
@@ -59,6 +60,12 @@ PLIST_SUB+= INTEL_DRIVER="@comment "
PLIST_SUB+= RADEON_DRIVERS="@comment "
.endif
+# This variable is not for users. So use a non-default name, intended for
+# people working on DRM kernel module development.
+.if !defined(LIBDRM_SKIP_RETURN_PATCH)
+EXTRA_PATCHES+= ${FILESDIR}/extra-xf86drm.c
+.endif
+
pre-patch:
@${REINPLACE_CMD} 's|{libdir}/pkgconfig|{prefix}/libdata/pkgconfig|g; \
s,i?86|x86_64),i?86|amd64|x86_64),g' \
diff --git a/graphics/libdrm/files/extra-xf86drm.c b/graphics/libdrm/files/extra-xf86drm.c
new file mode 100644
index 000000000000..382a32da2acb
--- /dev/null
+++ b/graphics/libdrm/files/extra-xf86drm.c
@@ -0,0 +1,19 @@
+Error code 512 is being leaked from kernel space. While it should be
+converted to either EINTR or EAGAIN in the kernel. Teach libdrm to do this
+for now. Newer kernel modules will have this fixed included.
+
+dragonfly fixed this issue in,
+http://gitweb.dragonflybsd.org/dragonfly.git/commit/b922632f623ee2cc2c1346bb3a6894a7756676aa
+which will be included in the 4.4 release when it is released.
+
+--- xf86drm.c.orig 2015-11-02 12:26:19.910518000 +0100
++++ xf86drm.c 2015-11-02 12:27:10.575894000 +0100
+@@ -174,7 +174,7 @@
+
+ do {
+ ret = ioctl(fd, request, arg);
+- } while (ret == -1 && (errno == EINTR || errno == EAGAIN));
++ } while (ret == -1 && (errno == EINTR || errno == EAGAIN || errno == 512));
+ return ret;
+ }
+