diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-04-26 09:14:47 +0300 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2013-04-26 09:14:47 +0300 |
commit | 9bf9d47a29afbf7a43eae74a988a4aefe88ccbfd (patch) | |
tree | 966b838e2190a7d6868cda5f4eee6d0f490da27c /drivers/video/omap2 | |
parent | e45f265e7ea3ee6de24efe91fe2928d603cb1741 (diff) | |
parent | 138f296e140f79cb955caba70690076fb14e6f6d (diff) | |
download | blackbird-op-linux-9bf9d47a29afbf7a43eae74a988a4aefe88ccbfd.tar.gz blackbird-op-linux-9bf9d47a29afbf7a43eae74a988a4aefe88ccbfd.zip |
Merge branch '3.10/fb-mmap' into for-next
Merge topic branch to get vm_iomap_memory into use.
Conflicts:
drivers/video/fbmon.c
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r-- | drivers/video/omap2/omapfb/omapfb-main.c | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c index ca585ef37f25..717f13a93351 100644 --- a/drivers/video/omap2/omapfb/omapfb-main.c +++ b/drivers/video/omap2/omapfb/omapfb-main.c @@ -1101,41 +1101,25 @@ static int omapfb_mmap(struct fb_info *fbi, struct vm_area_struct *vma) struct omapfb_info *ofbi = FB2OFB(fbi); struct fb_fix_screeninfo *fix = &fbi->fix; struct omapfb2_mem_region *rg; - unsigned long off; unsigned long start; u32 len; - int r = -EINVAL; - - if (vma->vm_end - vma->vm_start == 0) - return 0; - if (vma->vm_pgoff > (~0UL >> PAGE_SHIFT)) - return -EINVAL; - off = vma->vm_pgoff << PAGE_SHIFT; + int r; rg = omapfb_get_mem_region(ofbi->region); start = omapfb_get_region_paddr(ofbi); len = fix->smem_len; - if (off >= len) - goto error; - if ((vma->vm_end - vma->vm_start + off) > len) - goto error; - - off += start; - DBG("user mmap region start %lx, len %d, off %lx\n", start, len, off); + DBG("user mmap region start %lx, len %d, off %lx\n", start, len, + vma->vm_pgoff << PAGE_SHIFT); - vma->vm_pgoff = off >> PAGE_SHIFT; - /* VM_IO | VM_DONTEXPAND | VM_DONTDUMP are set by remap_pfn_range() */ vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); vma->vm_ops = &mmap_user_ops; vma->vm_private_data = rg; - if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT, - vma->vm_end - vma->vm_start, - vma->vm_page_prot)) { - r = -EAGAIN; + + r = vm_iomap_memory(vma, start, len); + if (r) goto error; - } /* vm_ops.open won't be called for mmap itself. */ atomic_inc(&rg->map_count); @@ -1144,7 +1128,7 @@ static int omapfb_mmap(struct fb_info *fbi, struct vm_area_struct *vma) return 0; - error: +error: omapfb_put_mem_region(ofbi->region); return r; |