aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/omap/omap_vout.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/platform/omap/omap_vout.c')
-rw-r--r--drivers/media/platform/omap/omap_vout.c36
1 files changed, 11 insertions, 25 deletions
diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c
index 35cc526e6c93..96c4a17e4280 100644
--- a/drivers/media/platform/omap/omap_vout.c
+++ b/drivers/media/platform/omap/omap_vout.c
@@ -205,19 +205,21 @@ static u32 omap_vout_uservirt_to_phys(u32 virtp)
205 struct vm_area_struct *vma; 205 struct vm_area_struct *vma;
206 struct mm_struct *mm = current->mm; 206 struct mm_struct *mm = current->mm;
207 207
208 vma = find_vma(mm, virtp);
209 /* For kernel direct-mapped memory, take the easy way */ 208 /* For kernel direct-mapped memory, take the easy way */
210 if (virtp >= PAGE_OFFSET) { 209 if (virtp >= PAGE_OFFSET)
211 physp = virt_to_phys((void *) virtp); 210 return virt_to_phys((void *) virtp);
212 } else if (vma && (vma->vm_flags & VM_IO) && vma->vm_pgoff) { 211
212 down_read(&current->mm->mmap_sem);
213 vma = find_vma(mm, virtp);
214 if (vma && (vma->vm_flags & VM_IO) && vma->vm_pgoff) {
213 /* this will catch, kernel-allocated, mmaped-to-usermode 215 /* this will catch, kernel-allocated, mmaped-to-usermode
214 addresses */ 216 addresses */
215 physp = (vma->vm_pgoff << PAGE_SHIFT) + (virtp - vma->vm_start); 217 physp = (vma->vm_pgoff << PAGE_SHIFT) + (virtp - vma->vm_start);
218 up_read(&current->mm->mmap_sem);
216 } else { 219 } else {
217 /* otherwise, use get_user_pages() for general userland pages */ 220 /* otherwise, use get_user_pages() for general userland pages */
218 int res, nr_pages = 1; 221 int res, nr_pages = 1;
219 struct page *pages; 222 struct page *pages;
220 down_read(&current->mm->mmap_sem);
221 223
222 res = get_user_pages(current, current->mm, virtp, nr_pages, 1, 224 res = get_user_pages(current, current->mm, virtp, nr_pages, 1,
223 0, &pages, NULL); 225 0, &pages, NULL);
@@ -595,7 +597,7 @@ static void omap_vout_isr(void *arg, unsigned int irqstatus)
595 return; 597 return;
596 598
597 spin_lock(&vout->vbq_lock); 599 spin_lock(&vout->vbq_lock);
598 do_gettimeofday(&timevalue); 600 v4l2_get_timestamp(&timevalue);
599 601
600 switch (cur_display->type) { 602 switch (cur_display->type) {
601 case OMAP_DISPLAY_TYPE_DSI: 603 case OMAP_DISPLAY_TYPE_DSI:
@@ -1230,21 +1232,6 @@ static int vidioc_s_fmt_vid_overlay(struct file *file, void *fh,
1230 return ret; 1232 return ret;
1231} 1233}
1232 1234
1233static int vidioc_enum_fmt_vid_overlay(struct file *file, void *fh,
1234 struct v4l2_fmtdesc *fmt)
1235{
1236 int index = fmt->index;
1237
1238 if (index >= NUM_OUTPUT_FORMATS)
1239 return -EINVAL;
1240
1241 fmt->flags = omap_formats[index].flags;
1242 strlcpy(fmt->description, omap_formats[index].description,
1243 sizeof(fmt->description));
1244 fmt->pixelformat = omap_formats[index].pixelformat;
1245 return 0;
1246}
1247
1248static int vidioc_g_fmt_vid_overlay(struct file *file, void *fh, 1235static int vidioc_g_fmt_vid_overlay(struct file *file, void *fh,
1249 struct v4l2_format *f) 1236 struct v4l2_format *f)
1250{ 1237{
@@ -1858,10 +1845,9 @@ static const struct v4l2_ioctl_ops vout_ioctl_ops = {
1858 .vidioc_s_fbuf = vidioc_s_fbuf, 1845 .vidioc_s_fbuf = vidioc_s_fbuf,
1859 .vidioc_g_fbuf = vidioc_g_fbuf, 1846 .vidioc_g_fbuf = vidioc_g_fbuf,
1860 .vidioc_s_ctrl = vidioc_s_ctrl, 1847 .vidioc_s_ctrl = vidioc_s_ctrl,
1861 .vidioc_try_fmt_vid_overlay = vidioc_try_fmt_vid_overlay, 1848 .vidioc_try_fmt_vid_out_overlay = vidioc_try_fmt_vid_overlay,
1862 .vidioc_s_fmt_vid_overlay = vidioc_s_fmt_vid_overlay, 1849 .vidioc_s_fmt_vid_out_overlay = vidioc_s_fmt_vid_overlay,
1863 .vidioc_enum_fmt_vid_overlay = vidioc_enum_fmt_vid_overlay, 1850 .vidioc_g_fmt_vid_out_overlay = vidioc_g_fmt_vid_overlay,
1864 .vidioc_g_fmt_vid_overlay = vidioc_g_fmt_vid_overlay,
1865 .vidioc_cropcap = vidioc_cropcap, 1851 .vidioc_cropcap = vidioc_cropcap,
1866 .vidioc_g_crop = vidioc_g_crop, 1852 .vidioc_g_crop = vidioc_g_crop,
1867 .vidioc_s_crop = vidioc_s_crop, 1853 .vidioc_s_crop = vidioc_s_crop,