Merge pull request #1258 from JpegXguy/patch-2

Fix rk3399-default mali patch
This commit is contained in:
Igor Pečovnik 2019-01-31 19:41:22 +01:00 committed by GitHub
commit bb0dccc2e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,23 +22,19 @@ 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..8362e256 100644
index b6dac558..287e09b6 100644
--- a/drivers/gpu/arm/midgard/mali_kbase_mem_linux.c
+++ b/drivers/gpu/arm/midgard/mali_kbase_mem_linux.c
@@ -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 */
@@ -1191,10 +1191,10 @@ static struct kbase_va_region *kbase_mem_from_user_buffer(
/* (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);
-#else
- faulted_pages = get_user_pages(address, *va_pages,
- reg->flags & KBASE_REG_GPU_WR, 0, NULL, NULL);
-#endif
+ reg->flags & KBASE_REG_GPU_WR ? FOLL_WRITE : 0, NULL, NULL);
+
#else
faulted_pages = get_user_pages(address, *va_pages,
- reg->flags & KBASE_REG_GPU_WR, 0, NULL, NULL);
+ reg->flags & KBASE_REG_GPU_WR ? FOLL_WRITE : 0, NULL, NULL);
#endif
up_read(&current->mm->mmap_sem);
if (faulted_pages != *va_pages)