summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Wawrzyniak2019-12-05 10:30:42 -0500
committerMichael Wawrzyniak2019-12-05 10:30:42 -0500
commitb28ec127871f5d4b231cf1082fafb242e203261d (patch)
tree2f678d223d0db5eed77304548dd8f6e660854a36
parent2c29043939c20748377d1093386e6622856e61bb (diff)
downloadaur-b28ec127871f5d4b231cf1082fafb242e203261d.tar.gz
Update to (hopefully) fix 5.4 kernel building
Credit to @abucodonosor and @severach on GitHub
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD6
-rw-r--r--evdi-1.6.4-kernel-5.4.x.patch133
3 files changed, 139 insertions, 2 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 4c80df36724..57d32114162 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -12,8 +12,10 @@ pkgbase = evdi
depends = libdrm
source = evdi-1.6.4-1.tar.gz::https://github.com/DisplayLink/evdi/archive/v1.6.4.tar.gz
source = relro.patch
+ source = evdi-1.6.4-kernel-5.4.x.patch
md5sums = 67d8ab1bb7a4ca013c5435df42ace5dc
md5sums = 05e64dd295a66c030139d0c8f6f7013b
+ md5sums = 1938ebead0b2c64f11591970a554fffc
pkgname = evdi
diff --git a/PKGBUILD b/PKGBUILD
index cb86bff6a03..845a5656406 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -20,10 +20,12 @@ options=()
install=$pkgname.install
changelog=$pkgname.Changelog
source=($pkgname-$pkgver-$pkgrel.tar.gz::https://github.com/DisplayLink/evdi/archive/v$pkgver.tar.gz
- relro.patch)
+ relro.patch
+ evdi-1.6.4-kernel-5.4.x.patch)
noextract=()
md5sums=('67d8ab1bb7a4ca013c5435df42ace5dc'
- '05e64dd295a66c030139d0c8f6f7013b')
+ '05e64dd295a66c030139d0c8f6f7013b'
+ '1938ebead0b2c64f11591970a554fffc')
prepare() {
cd "$pkgname-$pkgver"
diff --git a/evdi-1.6.4-kernel-5.4.x.patch b/evdi-1.6.4-kernel-5.4.x.patch
new file mode 100644
index 00000000000..44db8b311cd
--- /dev/null
+++ b/evdi-1.6.4-kernel-5.4.x.patch
@@ -0,0 +1,133 @@
+diff -Naur evdi-1.6.4/module/evdi_drv.c evdi-1.6.4-p/module/evdi_drv.c
+--- evdi-1.6.4/module/evdi_drv.c 2019-11-21 08:42:24.000000000 +0100
++++ evdi-1.6.4-p/module/evdi_drv.c 2019-11-30 04:46:06.140301023 +0100
+@@ -81,8 +81,12 @@
+ }
+
+ static struct drm_driver driver = {
+- .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME
+- | DRIVER_ATOMIC,
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)
++ .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME
++ | DRIVER_ATOMIC,
++#else
++ .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC,
++#endif
+ #if KERNEL_VERSION(4, 12, 0) > LINUX_VERSION_CODE
+ .load = evdi_driver_load,
+ #endif
+diff -Naur evdi-1.6.4/module/evdi_drv.h evdi-1.6.4-p/module/evdi_drv.h
+--- evdi-1.6.4/module/evdi_drv.h 2019-11-21 08:42:24.000000000 +0100
++++ evdi-1.6.4-p/module/evdi_drv.h 2019-11-30 04:46:06.140301023 +0100
+@@ -20,7 +20,11 @@
+ #include <drm/drm_crtc_helper.h>
+ #include <drm/drm_rect.h>
+ #include <drm/drm_gem.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)
+ #include <linux/reservation.h>
++#else
++#include <linux/dma-resv.h>
++#endif
+ #include "evdi_debug.h"
+
+ #define DRIVER_NAME "evdi"
+@@ -51,8 +55,13 @@
+ struct page **pages;
+ void *vmapping;
+ struct sg_table *sg;
+- struct reservation_object *resv;
+- struct reservation_object _resv;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)
++ struct reservation_object *resv;
++ struct reservation_object _resv;
++#else
++ struct dma_resv *resv;
++ struct dma_resv _resv;
++#endif
+ };
+
+ #define to_evdi_bo(x) container_of(x, struct evdi_gem_object, base)
+@@ -112,8 +121,12 @@
+
+ struct drm_gem_object *evdi_gem_prime_import(struct drm_device *dev,
+ struct dma_buf *dma_buf);
+-struct dma_buf *evdi_gem_prime_export(struct drm_device *dev,
+- struct drm_gem_object *obj, int flags);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)
++struct dma_buf *evdi_gem_prime_export(__maybe_unused struct drm_device *dev,
++ struct drm_gem_object *obj, int flags)
++#else
++struct dma_buf *evdi_gem_prime_export(struct drm_gem_object *obj, int flags);
++#endif
+
+ int evdi_gem_vmap(struct evdi_gem_object *obj);
+ void evdi_gem_vunmap(struct evdi_gem_object *obj);
+diff -Naur evdi-1.6.4/module/evdi_gem.c evdi-1.6.4-p/module/evdi_gem.c
+--- evdi-1.6.4/module/evdi_gem.c 2019-11-21 08:42:24.000000000 +0100
++++ evdi-1.6.4-p/module/evdi_gem.c 2019-11-30 04:47:05.410984523 +0100
+@@ -61,7 +61,11 @@
+ return NULL;
+ }
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)
+ reservation_object_init(&obj->_resv);
++#else
++ dma_resv_init(&obj->_resv);
++#endif
+ obj->resv = &obj->_resv;
+
+ return obj;
+@@ -254,8 +258,11 @@
+
+ if (gem_obj->dev->vma_offset_manager)
+ drm_gem_free_mmap_offset(gem_obj);
+-
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)
+ reservation_object_fini(&obj->_resv);
++#else
++ dma_resv_fini(&obj->_resv);
++#endif
+ obj->resv = NULL;
+ }
+
+@@ -569,8 +576,11 @@
+ return ERR_PTR(ret);
+ }
+
+-struct dma_buf *evdi_gem_prime_export(__maybe_unused struct drm_device *dev,
+- struct drm_gem_object *obj, int flags)
++struct dma_buf *evdi_gem_prime_export(
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)
++ __maybe_unused struct drm_device *dev,
++#endif
++ struct drm_gem_object *obj, int flags)
+ {
+ struct evdi_gem_object *evdi_obj = to_evdi_bo(obj);
+ struct dma_buf_export_info exp_info = {
+@@ -581,8 +591,7 @@
+ .resv = evdi_obj->resv,
+ .priv = obj
+ };
+-
+-#if KERNEL_VERSION(4, 9, 0) <= LINUX_VERSION_CODE
++#if LINUX_VERSION_CODE <= KERNEL_VERSION(4, 9, 0)
+ return drm_gem_dmabuf_export(dev, &exp_info);
+ #else
+ return dma_buf_export(&exp_info);
+diff -Naur evdi-1.6.4/module/Makefile evdi-1.6.4-p/module/Makefile
+--- evdi-1.6.4/module/Makefile 2019-11-21 02:42:24.000000000 -0500
++++ evdi-1.6.4-p/module/Makefile 2019-12-05 10:18:30.513130412 -0500
+@@ -19,11 +19,11 @@
+ KBUILD_VERBOSE ?= 1
+
+ all:
+- $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) CONFIG_MODULE_SIG= -C $(KERN_DIR) modules
++ $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) M=$(CURDIR) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) CONFIG_MODULE_SIG= -C $(KERN_DIR) modules
+
+ clean:
+ @echo $(KERN_DIR)
+- $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) -C $(KERN_DIR) clean
++ $(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) M=$(CURDIR) SUBDIRS=$(CURDIR) SRCROOT=$(CURDIR) -C $(KERN_DIR) clean
+
+ else
+