summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWookey <wookey@debian.org>2018-02-16 01:41:30 +0000
committerWookey <wookey@debian.org>2018-02-16 02:06:13 +0000
commit0944fb1a1bd1478eef53b5bf86c586d192586174 (patch)
treeda57d162405d017540ed7650dbe3743409742e24
parent2f339e3c3bacfb7a398f3f28256e661d2c82bf51 (diff)
Split build-on-linux-4.14 into 4 separate patches to go in patches dir
-rw-r--r--debian/dkms8
-rw-r--r--debian/patches/build-on-linux-4.14.patch69
-rw-r--r--debian/patches/include-sched-mm-fix.patch20
-rw-r--r--debian/patches/series6
-rw-r--r--debian/patches/timestamp-zero-update.patch21
-rw-r--r--debian/patches/top-level-README.patch16
-rw-r--r--debian/patches/use-vmf-struct-update.patch38
-rw-r--r--debian/patches/user-buf-map-api-update.patch21
8 files changed, 129 insertions, 70 deletions
diff --git a/debian/dkms b/debian/dkms
index 2bddbd1..ac57512 100644
--- a/debian/dkms
+++ b/debian/dkms
@@ -19,3 +19,11 @@ PATCH[0]=0001-gpu-midgard-replace-device-tree-compatible-strings.patch
PATCH[1]=0002-gpu-midgard-drop-clk_mali-name.patch
PATCH[2]=0003-gpu-midgard-look-for-lower-case-IRQ-names.patch
PATCH[3]=0004-gpu-midgard-add-deferring-in-log-when-clock-or-regul.patch
+PATCH[4]=user-buf-map-api-update.patch
+PATCH[5]=use-vmf-struct-update.patch
+PATCH[6]=timestamp-zero-update.patch
+PATCH[7]=include-sched-mm-fix.patch
+PATCH_MATCH[4]=4.1[23456].*
+PATCH_MATCH[5]=4.1[23456].*
+PATCH_MATCH[6]=4.1[23456].*
+PATCH_MATCH[7]=4.1[23456].* \ No newline at end of file
diff --git a/debian/patches/build-on-linux-4.14.patch b/debian/patches/build-on-linux-4.14.patch
deleted file mode 100644
index fdf1115..0000000
--- a/debian/patches/build-on-linux-4.14.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-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/include-sched-mm-fix.patch b/debian/patches/include-sched-mm-fix.patch
new file mode 100644
index 0000000..cdcfee0
--- /dev/null
+++ b/debian/patches/include-sched-mm-fix.patch
@@ -0,0 +1,20 @@
+--- /dev/null
++++ a/driver/product/kernel/drivers/gpu/arm/midgard/patches/include-sched-mm-fix.patch
+@@ -0,0 +1,17 @@
++Description: Fixes to allow midgard r16p0 to build against 4.14 headers
++ include sched/mm.h so stuff builds
++Author: Guillaume Tucker <guillaume.tucker@collabora.com>
++Forwarded: no
++Reviewed-By: Wookey <wookey@debian.org>
++Last-Update: 2018-01-15
++
++--- a/mali_kbase_mem.c
+++++ b/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>
diff --git a/debian/patches/series b/debian/patches/series
index c3fd635..ad2b79b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,5 @@
-build-on-linux-4.14.patch
+user-buf-map-api-update.patch
+use-vmf-struct-update.patch
+timestamp-zero-update.patch
+include-sched-mm-fix.patch
+
diff --git a/debian/patches/timestamp-zero-update.patch b/debian/patches/timestamp-zero-update.patch
new file mode 100644
index 0000000..e6e2cc7
--- /dev/null
+++ b/debian/patches/timestamp-zero-update.patch
@@ -0,0 +1,21 @@
+--- /dev/null
++++ a/driver/product/kernel/drivers/gpu/arm/midgard/patches/timestamp-zero-update.patch
+@@ -0,0 +1,18 @@
++Description: Fixes to allow midgard r16p0 to build against 4.14 headers
++ Accommodate change in katom struct
++Author: Guillaume Tucker <guillaume.tucker@collabora.com>
++Forwarded: no
++Reviewed-By: Wookey <wookey@debian.org>
++Last-Update: 2018-01-15
++
++--- a/mali_kbase_jd.c
+++++ b/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;
diff --git a/debian/patches/top-level-README.patch b/debian/patches/top-level-README.patch
new file mode 100644
index 0000000..9eae8b9
--- /dev/null
+++ b/debian/patches/top-level-README.patch
@@ -0,0 +1,16 @@
+Description: README file
+Author: Wookey <wookey@debian.org>
+Last-Update: 2018-02-13
+
+--- /dev/null
++++ mali-midgard-16.0+pristine/README
+@@ -0,0 +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 and 4.14 kernels.
++
++Tested on Firefly rk3288 board with Debian Stretch using kernel
++packages linux-headers-4.14.0-3-armmp and linux-headers-4.9.0-4-armmp
++from Stretch and its backport to Jessie.
+\ No newline at end of file
diff --git a/debian/patches/use-vmf-struct-update.patch b/debian/patches/use-vmf-struct-update.patch
new file mode 100644
index 0000000..8284a68
--- /dev/null
+++ b/debian/patches/use-vmf-struct-update.patch
@@ -0,0 +1,38 @@
+--- /dev/null
++++ a/driver/product/kernel/drivers/gpu/arm/midgard/patches/use-vmf-struct-update.patch
+@@ -0,0 +1,35 @@
++Description: Fixes to allow midgard r16p0 to build against 4.14 headers
++ Update to only pass vmf fault struct
++Author: Guillaume Tucker <guillaume.tucker@collabora.com>
++Forwarded: no
++Reviewed-By: Wookey <wookey@debian.org>
++Last-Update: 2018-01-15
++
++--- a/mali_kbase_mem_linux.c
+++++ b/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;
diff --git a/debian/patches/user-buf-map-api-update.patch b/debian/patches/user-buf-map-api-update.patch
new file mode 100644
index 0000000..3c8657d
--- /dev/null
+++ b/debian/patches/user-buf-map-api-update.patch
@@ -0,0 +1,21 @@
+--- /dev/null
++++ a/driver/product/kernel/drivers/gpu/arm/midgard/patches/user-buf-map-api-update.patch
+@@ -0,0 +1,18 @@
++Description: Fixes to allow midgard r16p0 to build against 4.14 headers
++ Accommodate user_buf_map API change
++Author: Guillaume Tucker <guillaume.tucker@collabora.com>
++Forwarded: no
++Reviewed-By: Wookey <wookey@debian.org>
++Last-Update: 2018-01-15
++
++--- a/mali_kbase_mem.c
+++++ b/mali_kbase_mem.c
++@@ -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)