From e6a2123ce9131a740f96e58004d76890d6b56a3f Mon Sep 17 00:00:00 2001 From: Dongjin Kim Date: Fri, 29 Jun 2018 19:48:17 +0900 Subject: [PATCH] ODROID-C2: gpu/arm: hack to force the memory page writable This patch is the hack to force the memory pages allocated by the ump driver to be writable such that they cannot have an error 'permission denied' when 'mmap()' is called. Change-Id: I6917b0c36d93b0bf24a5a81d68c46c1802e2f9a5 Signed-off-by: Dongjin Kim --- drivers/gpu/arm/ump/linux/ump_kernel_linux.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/arm/ump/linux/ump_kernel_linux.c b/drivers/gpu/arm/ump/linux/ump_kernel_linux.c index e162c85cbd44fa..56c36118565233 100755 --- a/drivers/gpu/arm/ump/linux/ump_kernel_linux.c +++ b/drivers/gpu/arm/ump/linux/ump_kernel_linux.c @@ -321,10 +321,16 @@ static int ump_file_ioctl(struct inode *inode, struct file *filp, unsigned int c break; case UMP_IOC_ALLOCATE : +#if defined(CONFIG_ARCH_MESON64_ODROIDC2) + mapping_allow_writable(filp->f_mapping); +#endif err = ump_allocate_wrapper((u32 __user *)argument, session_data); break; case UMP_IOC_RELEASE: +#if defined(CONFIG_ARCH_MESON64_ODROIDC2) + mapping_deny_writable(filp->f_mapping); +#endif err = ump_release_wrapper((u32 __user *)argument, session_data); break;