Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 362948
b: refs/heads/master
c: 47f698a
h: refs/heads/master
v: v3
  • Loading branch information
Tomi Valkeinen committed Apr 24, 2013
1 parent 1490560 commit 87fdbd1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 31 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6d28c21fe7b0921af57b15673cbafd4d61f2653d
refs/heads/master: 47f698a9f2fc49711f3a43ca6713e83f0e76ea5e
50 changes: 20 additions & 30 deletions trunk/drivers/video/controlfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,36 +285,26 @@ static int controlfb_pan_display(struct fb_var_screeninfo *var,
static int controlfb_mmap(struct fb_info *info,
struct vm_area_struct *vma)
{
unsigned long off, start;
u32 len;

off = vma->vm_pgoff << PAGE_SHIFT;

/* frame buffer memory */
start = info->fix.smem_start;
len = PAGE_ALIGN((start & ~PAGE_MASK)+info->fix.smem_len);
if (off >= len) {
/* memory mapped io */
off -= len;
if (info->var.accel_flags)
return -EINVAL;
start = info->fix.mmio_start;
len = PAGE_ALIGN((start & ~PAGE_MASK)+info->fix.mmio_len);
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
} else {
/* framebuffer */
vma->vm_page_prot = pgprot_cached_wthru(vma->vm_page_prot);
}
start &= PAGE_MASK;
if ((vma->vm_end - vma->vm_start + off) > len)
return -EINVAL;
off += start;
vma->vm_pgoff = off >> PAGE_SHIFT;
if (io_remap_pfn_range(vma, vma->vm_start, off >> PAGE_SHIFT,
vma->vm_end - vma->vm_start, vma->vm_page_prot))
return -EAGAIN;

return 0;
unsigned long mmio_pgoff;
unsigned long start;
u32 len;

start = info->fix.smem_start;
len = info->fix.smem_len;
mmio_pgoff = PAGE_ALIGN((start & ~PAGE_MASK) + len) >> PAGE_SHIFT;
if (vma->vm_pgoff >= mmio_pgoff) {
if (info->var.accel_flags)
return -EINVAL;
vma->vm_pgoff -= mmio_pgoff;
start = info->fix.mmio_start;
len = info->fix.mmio_len;
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
} else {
/* framebuffer */
vma->vm_page_prot = pgprot_cached_wthru(vma->vm_page_prot);
}

return vm_iomap_memory(vma, start, len);
}

static int controlfb_blank(int blank_mode, struct fb_info *info)
Expand Down

0 comments on commit 87fdbd1

Please sign in to comment.