summaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel
diff options
context:
space:
mode:
authorThomas Chou <thomas@wytron.com.tw>2009-09-27 15:38:01 +0800
committerMike Frysinger <vapier@gentoo.org>2009-10-08 00:58:15 -0400
commit59bd00c85012af2b59ba8c1b47caaf10ccbfa3b1 (patch)
tree10a6c46f29a6378aadadf143697efcb1e6b55078 /arch/blackfin/kernel
parent4a7bcb4fe96824f882d126dc39df9ba658a29372 (diff)
downloadop-kernel-dev-59bd00c85012af2b59ba8c1b47caaf10ccbfa3b1.zip
op-kernel-dev-59bd00c85012af2b59ba8c1b47caaf10ccbfa3b1.tar.gz
Blackfin: fix framebuffer mmap bug for nommu
The patch added a special get_unmapped_area for framebuffer which was hooked to the file ops in drivers/video/fbmem.c. This is needed since v2.6.29-rc1 where nommu vma management was updated, and mmap of framebuffer caused kernel BUG panic. You may turn on "Debug the global anon/private NOMMU mapping region tree" config to such message. As Documentation/nommu-mmap.txt said, "To provide shareable character device support, a driver must provide a file->f_op->get_unmapped_area() operation. The mmap() routines will call this to get a proposed address for the mapping." With this change, user space should call mmap for framebuffer using shared map. Or it can try shared map first, then private map if failed. This shared map usage is now consistent between mmu and nommu. The sys_ file may not be a good place for this patch. But there is a similar one for sparc. I tested a similar patch on nios2nommu, though I don't have a blackfin board to test. Signed-off-by: Thomas Chou <thomas@wytron.com.tw> Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/kernel')
-rw-r--r--arch/blackfin/kernel/sys_bfin.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/blackfin/kernel/sys_bfin.c b/arch/blackfin/kernel/sys_bfin.c
index 8b294a1..afcef12 100644
--- a/arch/blackfin/kernel/sys_bfin.c
+++ b/arch/blackfin/kernel/sys_bfin.c
@@ -69,3 +69,14 @@ asmlinkage void *sys_dma_memcpy(void *dest, const void *src, size_t len)
{
return safe_dma_memcpy(dest, src, len);
}
+
+#if defined(CONFIG_FB) || defined(CONFIG_FB_MODULE)
+#include <linux/fb.h>
+unsigned long get_fb_unmapped_area(struct file *filp, unsigned long orig_addr,
+ unsigned long len, unsigned long pgoff, unsigned long flags)
+{
+ struct fb_info *info = filp->private_data;
+ return (unsigned long)info->screen_base;
+}
+EXPORT_SYMBOL(get_fb_unmapped_area);
+#endif
OpenPOWER on IntegriCloud