summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWookey <wookey@debian.org>2018-01-26 02:55:20 +0000
committerWookey <wookey@debian.org>2018-01-26 02:55:20 +0000
commit2f339e3c3bacfb7a398f3f28256e661d2c82bf51 (patch)
treef339dec5479795442139931bf69567a9f0aa1572
parentb09883e70072e7fb7dc42d01cbed4efa0eb6ab82 (diff)
Add patch to enable builds against kernel 4.14
-rw-r--r--README10
-rw-r--r--debian/changelog6
-rw-r--r--debian/patches/build-on-linux-4.14.patch69
-rw-r--r--debian/patches/series1
4 files changed, 81 insertions, 5 deletions
diff --git a/README b/README
index 20b324b..4670e02 100644
--- a/README
+++ b/README
@@ -1,8 +1,8 @@
-This repository contains the out-of-tree Linux kernel driver for the ARM Mali
-Midgard GPU. It is based on the r16p0 release, called 16.0 in this Debian DKMS
-package. It also contains some patches to make it work with mainline device
-tree bindings backported to v4.9 kernel. Newer kernel versions are not
-supported in this driver version.
+This repository contains the out-of-tree Linux kernel driver for the
+ARM Mali Midgard GPU (T60x, T62x, T76x). It is based on the r16p0
+release, called 16.0 in this Debian DKMS package. It also contains
+some patches to make it work with mainline device tree bindings
+backported to v4.9 and 4.14 kernels.
Tested on Firefly rk3288 board with Debian Jessie and Stretch using kernel
package linux-image-4.9.0-3-armmp_4.9.30-2+deb9u3_armhf.deb from Stretch and
diff --git a/debian/changelog b/debian/changelog
index eda79c1..ef8e012 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+mali-midgard (16.0-3) unstable; urgency=medium
+
+ * Include patches for 4.14 kernel
+
+ -- Wookey <wookey@debian.org> Mon, 15 Jan 2018 20:14:39 +0000
+
mali-midgard (16.0-2) unstable; urgency=medium
* Upload to contrib (Closes: #876222)
diff --git a/debian/patches/build-on-linux-4.14.patch b/debian/patches/build-on-linux-4.14.patch
new file mode 100644
index 0000000..fdf1115
--- /dev/null
+++ b/debian/patches/build-on-linux-4.14.patch
@@ -0,0 +1,69 @@
+Description: Fixes to allow midgard r16p0 to build against 4.14 headers
+Author: Guillaume Tucker <guillaume.tucker@collabora.com>
+Forwarded: no
+Reviewed-By: Wookey <wookey@debian.org>
+Last-Update: 2018-01-15
+
+--- mali-midgard-16.0.orig/mali-midgard-16.0/mali_kbase_jd.c
++++ mali-midgard-16.0/mali-midgard-16.0/mali_kbase_jd.c
+@@ -975,7 +975,7 @@ bool jd_submit_atom(struct kbase_context
+ * the scheduler: 'not ready to run' and 'dependency-only' jobs. */
+ jctx->job_nr++;
+
+- katom->start_timestamp.tv64 = 0;
++ katom->start_timestamp = 0;
+ katom->udata = user_atom->udata;
+ katom->kctx = kctx;
+ katom->nr_extres = user_atom->nr_extres;
+--- mali-midgard-16.0.orig/mali-midgard-16.0/mali_kbase_mem.c
++++ mali-midgard-16.0/mali-midgard-16.0/mali_kbase_mem.c
+@@ -31,6 +31,7 @@
+ #include <linux/bug.h>
+ #include <linux/compat.h>
+ #include <linux/version.h>
++#include <linux/sched/mm.h>
+
+ #include <mali_kbase_config.h>
+ #include <mali_kbase.h>
+@@ -2159,7 +2160,7 @@ static int kbase_jd_user_buf_map(struct
+ address,
+ alloc->imported.user_buf.nr_pages,
+ reg->flags & KBASE_REG_GPU_WR ? FOLL_WRITE : 0,
+- pages, NULL);
++ pages, NULL, NULL);
+ #endif
+
+ if (pinned_pages <= 0)
+--- mali-midgard-16.0.orig/mali-midgard-16.0/mali_kbase_mem_linux.c
++++ mali-midgard-16.0/mali-midgard-16.0/mali_kbase_mem_linux.c
+@@ -1711,9 +1711,9 @@ static void kbase_cpu_vm_close(struct vm
+ KBASE_EXPORT_TEST_API(kbase_cpu_vm_close);
+
+
+-static int kbase_cpu_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
++static int kbase_cpu_vm_fault(struct vm_fault *vmf)
+ {
+- struct kbase_cpu_mapping *map = vma->vm_private_data;
++ struct kbase_cpu_mapping *map = vmf->vma->vm_private_data;
+ pgoff_t rel_pgoff;
+ size_t i;
+ pgoff_t addr;
+@@ -1735,9 +1735,10 @@ static int kbase_cpu_vm_fault(struct vm_
+
+ /* insert all valid pages from the fault location */
+ i = rel_pgoff;
+- addr = (pgoff_t)((uintptr_t)vmf->virtual_address >> PAGE_SHIFT);
+- while (i < map->alloc->nents && (addr < vma->vm_end >> PAGE_SHIFT)) {
+- int ret = vm_insert_pfn(vma, addr << PAGE_SHIFT,
++ addr = (pgoff_t)((uintptr_t)vmf->address >> PAGE_SHIFT);
++ while (i < map->alloc->nents &&
++ (addr < vmf->vma->vm_end >> PAGE_SHIFT)) {
++ int ret = vm_insert_pfn(vmf->vma, addr << PAGE_SHIFT,
+ PFN_DOWN(map->alloc->pages[i]));
+ if (ret < 0 && ret != -EBUSY)
+ goto locked_bad_fault;
+@@ -2619,4 +2620,3 @@ void kbase_va_free(struct kbase_context
+ #endif
+ }
+ KBASE_EXPORT_SYMBOL(kbase_va_free);
+-
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..c3fd635
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+build-on-linux-4.14.patch