Skip to content

Commit e6a2123

Browse files
committed
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 <[email protected]>
1 parent c34d3a3 commit e6a2123

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/gpu/arm/ump/linux/ump_kernel_linux.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,16 @@ static int ump_file_ioctl(struct inode *inode, struct file *filp, unsigned int c
321321
break;
322322

323323
case UMP_IOC_ALLOCATE :
324+
#if defined(CONFIG_ARCH_MESON64_ODROIDC2)
325+
mapping_allow_writable(filp->f_mapping);
326+
#endif
324327
err = ump_allocate_wrapper((u32 __user *)argument, session_data);
325328
break;
326329

327330
case UMP_IOC_RELEASE:
331+
#if defined(CONFIG_ARCH_MESON64_ODROIDC2)
332+
mapping_deny_writable(filp->f_mapping);
333+
#endif
328334
err = ump_release_wrapper((u32 __user *)argument, session_data);
329335
break;
330336

0 commit comments

Comments
 (0)