aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/fbmem.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/fbmem.c')
-rw-r--r--drivers/video/fbmem.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/video/fbmem.c b/drivers/video/fbmem.c
index b585a38..1ca9b20 100644
--- a/drivers/video/fbmem.c
+++ b/drivers/video/fbmem.c
@@ -34,6 +34,7 @@
#include <linux/fb.h>
#include <asm/fb.h>
+#include <linux/cma.h>
/*
@@ -1380,6 +1381,17 @@ fb_mmap(struct file *file, struct vm_area_struct * vma)
/* frame buffer memory */
start = info->fix.smem_start;
len = PAGE_ALIGN((start & ~PAGE_MASK) + info->fix.smem_len);
+
+#if defined(CONFIG_CPU_EXYNOS4212) || defined(CONFIG_CPU_EXYNOS4412)
+ if (!cma_is_registered_region(start, len)) {
+ pr_err("%s: %x@%x is allowed to map\n",
+ __func__, (unsigned int)start,
+ (unsigned int)len);
+ mutex_unlock(&info->mm_lock);
+ return -EINVAL;
+ }
+#endif
+
if (off >= len) {
/* memory mapped io */
off -= len;