From 2a6649bf6aa50c44a05fc02e1efb8b788c58e82b Mon Sep 17 00:00:00 2001 From: sakindia123 Date: Sun, 11 Aug 2013 14:20:37 +0200 Subject: Samsung i9300 Update 11 Change-Id: I7f6dbdd97e3ed66634bf123d43224a79524c04e9 --- drivers/video/Makefile | 1 - drivers/video/fbmem.c | 12 ++++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) (limited to 'drivers/video') diff --git a/drivers/video/Makefile b/drivers/video/Makefile index ff3c7b2..1261866 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -182,4 +182,3 @@ obj-$(CONFIG_FB_VIRTUAL) += vfb.o #video output switch sysfs driver obj-$(CONFIG_VIDEO_OUTPUT_CONTROL) += output.o - 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 #include +#include /* @@ -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; -- cgit v1.1