From 3012941002869ab9e83716939666f21d8df38a0f Mon Sep 17 00:00:00 2001 From: Anthony Ryan Date: Wed, 25 Jan 2017 00:05:44 -0500 Subject: [PATCH 1/2] Fix README formatting, and add a note about Linaro's TRIM_UNUSED_KSYMS being problematic for this. --- README.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 60f007e..c8659c3 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,21 @@ -== How to build me == +How to build me +================ + +Required kernel config options + +* CONFIG_TRIM_UNUSED_KSYMS = N Assuming you have your kernel build environment in KERNEL_ARGS (i.e. ARCH=arm CROSS_COMPILE=...). Assuming you have your kernel source tree in KERNEL_SRC. To build, use: > ${KERNEL_ARGS} make M=$PWD -C ${KERNEL_SRC} CONFIG_MALI_MIDGARD=m CONFIG_MALI_DEVFREQ=y CONFIG_MALI_DMA_FENCE=y CONFIG_MALI_EXPERT=y CONFIG_MALI_PLATFORM_THIRDPARTY=y CONFIG_MALI_PLATFORM_THIRDPARTY_NAME=rk + This will generate rockchip-vpu.ko, mali_kbase.ko and vtl_ts_ct_ct36x.ko. You'll need additional DT modifications to enable those feature, see below. -== VPU (h264 decode) == +VPU (h264 decode) +================= To get rockchip VPU working on a mainline kernel, you'll need to change your DTS. Include: @@ -44,7 +51,8 @@ Finally, install rockchip VPU userland, you can choose either: At the moment the most stable driver is VAAPI, which can be tested with VLC. -== GPU (Mali, 3D Acceleration) == +GPU (Mali, 3D Acceleration) +=========================== You'll need to change your DTS here as well: From 0d0ec1c8aa7385a8158550d26df64c99a982c76a Mon Sep 17 00:00:00 2001 From: Anthony Ryan Date: Tue, 16 May 2017 23:55:45 -0400 Subject: [PATCH 2/2] Changes for kernel 4.11 support --- midgard/mali_kbase_mem.c | 1 + midgard/mali_kbase_mem_linux.c | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/midgard/mali_kbase_mem.c b/midgard/mali_kbase_mem.c index 9531c69..f4b4ded 100644 --- a/midgard/mali_kbase_mem.c +++ b/midgard/mali_kbase_mem.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include diff --git a/midgard/mali_kbase_mem_linux.c b/midgard/mali_kbase_mem_linux.c index cf57a40..7de991b 100644 --- a/midgard/mali_kbase_mem_linux.c +++ b/midgard/mali_kbase_mem_linux.c @@ -1844,9 +1844,9 @@ static void kbase_cpu_vm_close(struct vm_area_struct *vma) 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; @@ -1870,9 +1870,9 @@ static int kbase_cpu_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) /* insert all valid pages from the fault location */ for (i = rel_pgoff; - i < MIN((vma->vm_end - vma->vm_start) >> PAGE_SHIFT, + i < MIN((vmf->vma->vm_end - vmf->vma->vm_start) >> PAGE_SHIFT, map->alloc->nents - map->page_off); i++) { - int ret = vm_insert_pfn(vma, map->vm_start + (i << PAGE_SHIFT), + int ret = vm_insert_pfn(vmf->vma, map->vm_start + (i << PAGE_SHIFT), PFN_DOWN(map->alloc->pages[map->page_off + i])); if (ret < 0 && ret != -EBUSY) goto locked_bad_fault;