From 21125280db0aa0c7886da46b87c244d6e8bd472c Mon Sep 17 00:00:00 2001 From: Leonidas P <29687487+JpegXguy@users.noreply.github.com> Date: Mon, 28 Jan 2019 13:52:22 +0200 Subject: [PATCH] Fix mali patch for rk3399 No need to check linux version anymore, function call is the same. Try to see if it builds --- .../04-patch-4.4.167-168_mali.patch | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/patch/kernel/rk3399-default/04-patch-4.4.167-168_mali.patch b/patch/kernel/rk3399-default/04-patch-4.4.167-168_mali.patch index 8ae82f09e..02288bfe4 100644 --- a/patch/kernel/rk3399-default/04-patch-4.4.167-168_mali.patch +++ b/patch/kernel/rk3399-default/04-patch-4.4.167-168_mali.patch @@ -22,19 +22,23 @@ index 4824b316..53b262b5 100644 if (pinned_pages <= 0) diff --git a/drivers/gpu/arm/midgard/mali_kbase_mem_linux.c b/drivers/gpu/arm/midgard/mali_kbase_mem_linux.c -index b6dac558..631fb4be 100644 +index b6dac558..8362e256 100644 --- a/drivers/gpu/arm/midgard/mali_kbase_mem_linux.c +++ b/drivers/gpu/arm/midgard/mali_kbase_mem_linux.c -@@ -1191,10 +1191,10 @@ static struct kbase_va_region *kbase_mem_from_user_buffer( +@@ -1189,13 +1189,10 @@ static struct kbase_va_region *kbase_mem_from_user_buffer( + /* We can't really store the page list because that would involve */ + /* keeping the pages pinned - instead we pin/unpin around the job */ /* (as part of the external resources handling code) */ - #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0) +-#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0) ++ faulted_pages = get_user_pages(current, current->mm, address, *va_pages, - reg->flags & KBASE_REG_GPU_WR, 0, NULL, NULL); -+ reg->flags & KBASE_REG_GPU_WR, NULL, NULL); - #else - faulted_pages = get_user_pages(address, *va_pages, +-#else +- faulted_pages = get_user_pages(address, *va_pages, - reg->flags & KBASE_REG_GPU_WR, 0, NULL, NULL); -+ reg->flags & KBASE_REG_GPU_WR, NULL, NULL); - #endif +-#endif ++ reg->flags & KBASE_REG_GPU_WR ? FOLL_WRITE : 0, NULL, NULL); ++ up_read(¤t->mm->mmap_sem); + if (faulted_pages != *va_pages)