Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 357351
b: refs/heads/master
c: 55ee64b
h: refs/heads/master
i:
  357349: 3caca61
  357347: c21e25d
  357343: fad3d59
v: v3
  • Loading branch information
Al Viro authored and Mauro Carvalho Chehab committed Jan 6, 2013
1 parent 2be64a3 commit 4131a26
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 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: a0a030bdbe612b7d8a941fba672300f7fc21b275
refs/heads/master: 55ee64b30a38d688232e5eb2860467dddc493573
12 changes: 7 additions & 5 deletions trunk/drivers/media/platform/omap/omap_vout.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,19 +205,21 @@ static u32 omap_vout_uservirt_to_phys(u32 virtp)
struct vm_area_struct *vma;
struct mm_struct *mm = current->mm;

vma = find_vma(mm, virtp);
/* For kernel direct-mapped memory, take the easy way */
if (virtp >= PAGE_OFFSET) {
physp = virt_to_phys((void *) virtp);
} else if (vma && (vma->vm_flags & VM_IO) && vma->vm_pgoff) {
if (virtp >= PAGE_OFFSET)
return virt_to_phys((void *) virtp);

down_read(&current->mm->mmap_sem);
vma = find_vma(mm, virtp);
if (vma && (vma->vm_flags & VM_IO) && vma->vm_pgoff) {
/* this will catch, kernel-allocated, mmaped-to-usermode
addresses */
physp = (vma->vm_pgoff << PAGE_SHIFT) + (virtp - vma->vm_start);
up_read(&current->mm->mmap_sem);
} else {
/* otherwise, use get_user_pages() for general userland pages */
int res, nr_pages = 1;
struct page *pages;
down_read(&current->mm->mmap_sem);

res = get_user_pages(current, current->mm, virtp, nr_pages, 1,
0, &pages, NULL);
Expand Down

0 comments on commit 4131a26

Please sign in to comment.