summaryrefslogtreecommitdiffstats
path: root/drivers/video/igafb.c
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>2000-01-29 01:41:54 +0000
committerRalf Baechle <ralf@linux-mips.org>2000-01-29 01:41:54 +0000
commitf969d69ba9f952e5bdd38278e25e26a3e4a61a70 (patch)
treeb3530d803df59d726afaabebc6626987dee1ca05 /drivers/video/igafb.c
parenta10ce7ef2066b455d69187643ddf2073bfc4db24 (diff)
Merge with 2.3.27.
Diffstat (limited to 'drivers/video/igafb.c')
-rw-r--r--drivers/video/igafb.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/video/igafb.c b/drivers/video/igafb.c
index 5ed528af2..43e9eeadc 100644
--- a/drivers/video/igafb.c
+++ b/drivers/video/igafb.c
@@ -261,8 +261,6 @@ static int igafb_mmap(struct fb_info *info, struct file *file,
return -ENXIO;
size = vma->vm_end - vma->vm_start;
- if (vma->vm_offset & ~PAGE_MASK)
- return -ENXIO;
/* To stop the swapper from even considering these pages. */
vma->vm_flags |= (VM_SHM | VM_LOCKED);
@@ -271,17 +269,17 @@ static int igafb_mmap(struct fb_info *info, struct file *file,
for (page = 0; page < size; ) {
map_size = 0;
for (i = 0; fb->mmap_map[i].size; i++) {
- unsigned long start = fb->mmap_map[i].voff;
- unsigned long end = start + fb->mmap_map[i].size;
- unsigned long offset = vma->vm_offset + page;
+ unsigned long start = (fb->mmap_map[i].voff) >> PAGE_SHIFT;
+ unsigned long end = start + (fb->mmap_map[i].size) >> PAGE_SHIFT;
+ unsigned long offset = vma->vm_pgoff + (page >> PAGE_SHIFT);
if (start > offset)
continue;
if (offset >= end)
continue;
- map_size = fb->mmap_map[i].size - (offset - start);
- map_offset = fb->mmap_map[i].poff + (offset - start);
+ map_size = fb->mmap_map[i].size - ((offset - start) << PAGE_SHIFT);
+ map_offset = fb->mmap_map[i].poff + ((offset - start) << PAGE_SHIFT);
break;
}
if (!map_size) {