diff options
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/pci/meye/meye.c | 2 | ||||
-rw-r--r-- | drivers/media/platform/omap/omap_vout.c | 77 | ||||
-rw-r--r-- | drivers/media/platform/vino.c | 2 | ||||
-rw-r--r-- | drivers/media/usb/sn9c102/sn9c102_core.c | 3 | ||||
-rw-r--r-- | drivers/media/usb/usbvision/usbvision-video.c | 3 | ||||
-rw-r--r-- | drivers/media/v4l2-core/videobuf-dma-sg.c | 2 | ||||
-rw-r--r-- | drivers/media/v4l2-core/videobuf-vmalloc.c | 2 | ||||
-rw-r--r-- | drivers/media/v4l2-core/videobuf2-memops.c | 2 |
8 files changed, 58 insertions, 35 deletions
diff --git a/drivers/media/pci/meye/meye.c b/drivers/media/pci/meye/meye.c index 7bc775219f97..e5a76da86081 100644 --- a/drivers/media/pci/meye/meye.c +++ b/drivers/media/pci/meye/meye.c | |||
@@ -1647,7 +1647,7 @@ static int meye_mmap(struct file *file, struct vm_area_struct *vma) | |||
1647 | 1647 | ||
1648 | vma->vm_ops = &meye_vm_ops; | 1648 | vma->vm_ops = &meye_vm_ops; |
1649 | vma->vm_flags &= ~VM_IO; /* not I/O memory */ | 1649 | vma->vm_flags &= ~VM_IO; /* not I/O memory */ |
1650 | vma->vm_flags |= VM_RESERVED; /* avoid to swap out this VMA */ | 1650 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
1651 | vma->vm_private_data = (void *) (offset / gbufsize); | 1651 | vma->vm_private_data = (void *) (offset / gbufsize); |
1652 | meye_vm_open(vma); | 1652 | meye_vm_open(vma); |
1653 | 1653 | ||
diff --git a/drivers/media/platform/omap/omap_vout.c b/drivers/media/platform/omap/omap_vout.c index 66ac21d466af..a3b1a34c896d 100644 --- a/drivers/media/platform/omap/omap_vout.c +++ b/drivers/media/platform/omap/omap_vout.c | |||
@@ -455,11 +455,15 @@ static int omapvid_init(struct omap_vout_device *vout, u32 addr) | |||
455 | 455 | ||
456 | win = &vout->win; | 456 | win = &vout->win; |
457 | for (i = 0; i < ovid->num_overlays; i++) { | 457 | for (i = 0; i < ovid->num_overlays; i++) { |
458 | struct omap_dss_device *dssdev; | ||
459 | |||
458 | ovl = ovid->overlays[i]; | 460 | ovl = ovid->overlays[i]; |
459 | if (!ovl->manager || !ovl->manager->device) | 461 | dssdev = ovl->get_device(ovl); |
462 | |||
463 | if (!dssdev) | ||
460 | return -EINVAL; | 464 | return -EINVAL; |
461 | 465 | ||
462 | timing = &ovl->manager->device->panel.timings; | 466 | timing = &dssdev->panel.timings; |
463 | 467 | ||
464 | outw = win->w.width; | 468 | outw = win->w.width; |
465 | outh = win->w.height; | 469 | outh = win->w.height; |
@@ -516,8 +520,11 @@ static int omapvid_apply_changes(struct omap_vout_device *vout) | |||
516 | struct omapvideo_info *ovid = &vout->vid_info; | 520 | struct omapvideo_info *ovid = &vout->vid_info; |
517 | 521 | ||
518 | for (i = 0; i < ovid->num_overlays; i++) { | 522 | for (i = 0; i < ovid->num_overlays; i++) { |
523 | struct omap_dss_device *dssdev; | ||
524 | |||
519 | ovl = ovid->overlays[i]; | 525 | ovl = ovid->overlays[i]; |
520 | if (!ovl->manager || !ovl->manager->device) | 526 | dssdev = ovl->get_device(ovl); |
527 | if (!dssdev) | ||
521 | return -EINVAL; | 528 | return -EINVAL; |
522 | ovl->manager->apply(ovl->manager); | 529 | ovl->manager->apply(ovl->manager); |
523 | } | 530 | } |
@@ -580,12 +587,14 @@ static void omap_vout_isr(void *arg, unsigned int irqstatus) | |||
580 | 587 | ||
581 | ovid = &vout->vid_info; | 588 | ovid = &vout->vid_info; |
582 | ovl = ovid->overlays[0]; | 589 | ovl = ovid->overlays[0]; |
583 | /* get the display device attached to the overlay */ | ||
584 | if (!ovl->manager || !ovl->manager->device) | ||
585 | return; | ||
586 | 590 | ||
587 | mgr_id = ovl->manager->id; | 591 | mgr_id = ovl->manager->id; |
588 | cur_display = ovl->manager->device; | 592 | |
593 | /* get the display device attached to the overlay */ | ||
594 | cur_display = ovl->get_device(ovl); | ||
595 | |||
596 | if (!cur_display) | ||
597 | return; | ||
589 | 598 | ||
590 | spin_lock(&vout->vbq_lock); | 599 | spin_lock(&vout->vbq_lock); |
591 | do_gettimeofday(&timevalue); | 600 | do_gettimeofday(&timevalue); |
@@ -911,7 +920,7 @@ static int omap_vout_mmap(struct file *file, struct vm_area_struct *vma) | |||
911 | 920 | ||
912 | q->bufs[i]->baddr = vma->vm_start; | 921 | q->bufs[i]->baddr = vma->vm_start; |
913 | 922 | ||
914 | vma->vm_flags |= VM_RESERVED; | 923 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
915 | vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); | 924 | vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot); |
916 | vma->vm_ops = &omap_vout_vm_ops; | 925 | vma->vm_ops = &omap_vout_vm_ops; |
917 | vma->vm_private_data = (void *) vout; | 926 | vma->vm_private_data = (void *) vout; |
@@ -949,7 +958,9 @@ static int omap_vout_release(struct file *file) | |||
949 | /* Disable all the overlay managers connected with this interface */ | 958 | /* Disable all the overlay managers connected with this interface */ |
950 | for (i = 0; i < ovid->num_overlays; i++) { | 959 | for (i = 0; i < ovid->num_overlays; i++) { |
951 | struct omap_overlay *ovl = ovid->overlays[i]; | 960 | struct omap_overlay *ovl = ovid->overlays[i]; |
952 | if (ovl->manager && ovl->manager->device) | 961 | struct omap_dss_device *dssdev = ovl->get_device(ovl); |
962 | |||
963 | if (dssdev) | ||
953 | ovl->disable(ovl); | 964 | ovl->disable(ovl); |
954 | } | 965 | } |
955 | /* Turn off the pipeline */ | 966 | /* Turn off the pipeline */ |
@@ -1082,14 +1093,17 @@ static int vidioc_try_fmt_vid_out(struct file *file, void *fh, | |||
1082 | struct omapvideo_info *ovid; | 1093 | struct omapvideo_info *ovid; |
1083 | struct omap_video_timings *timing; | 1094 | struct omap_video_timings *timing; |
1084 | struct omap_vout_device *vout = fh; | 1095 | struct omap_vout_device *vout = fh; |
1096 | struct omap_dss_device *dssdev; | ||
1085 | 1097 | ||
1086 | ovid = &vout->vid_info; | 1098 | ovid = &vout->vid_info; |
1087 | ovl = ovid->overlays[0]; | 1099 | ovl = ovid->overlays[0]; |
1100 | /* get the display device attached to the overlay */ | ||
1101 | dssdev = ovl->get_device(ovl); | ||
1088 | 1102 | ||
1089 | if (!ovl->manager || !ovl->manager->device) | 1103 | if (!dssdev) |
1090 | return -EINVAL; | 1104 | return -EINVAL; |
1091 | /* get the display device attached to the overlay */ | 1105 | |
1092 | timing = &ovl->manager->device->panel.timings; | 1106 | timing = &dssdev->panel.timings; |
1093 | 1107 | ||
1094 | vout->fbuf.fmt.height = timing->y_res; | 1108 | vout->fbuf.fmt.height = timing->y_res; |
1095 | vout->fbuf.fmt.width = timing->x_res; | 1109 | vout->fbuf.fmt.width = timing->x_res; |
@@ -1106,6 +1120,7 @@ static int vidioc_s_fmt_vid_out(struct file *file, void *fh, | |||
1106 | struct omapvideo_info *ovid; | 1120 | struct omapvideo_info *ovid; |
1107 | struct omap_video_timings *timing; | 1121 | struct omap_video_timings *timing; |
1108 | struct omap_vout_device *vout = fh; | 1122 | struct omap_vout_device *vout = fh; |
1123 | struct omap_dss_device *dssdev; | ||
1109 | 1124 | ||
1110 | if (vout->streaming) | 1125 | if (vout->streaming) |
1111 | return -EBUSY; | 1126 | return -EBUSY; |
@@ -1114,13 +1129,14 @@ static int vidioc_s_fmt_vid_out(struct file *file, void *fh, | |||
1114 | 1129 | ||
1115 | ovid = &vout->vid_info; | 1130 | ovid = &vout->vid_info; |
1116 | ovl = ovid->overlays[0]; | 1131 | ovl = ovid->overlays[0]; |
1132 | dssdev = ovl->get_device(ovl); | ||
1117 | 1133 | ||
1118 | /* get the display device attached to the overlay */ | 1134 | /* get the display device attached to the overlay */ |
1119 | if (!ovl->manager || !ovl->manager->device) { | 1135 | if (!dssdev) { |
1120 | ret = -EINVAL; | 1136 | ret = -EINVAL; |
1121 | goto s_fmt_vid_out_exit; | 1137 | goto s_fmt_vid_out_exit; |
1122 | } | 1138 | } |
1123 | timing = &ovl->manager->device->panel.timings; | 1139 | timing = &dssdev->panel.timings; |
1124 | 1140 | ||
1125 | /* We dont support RGB24-packed mode if vrfb rotation | 1141 | /* We dont support RGB24-packed mode if vrfb rotation |
1126 | * is enabled*/ | 1142 | * is enabled*/ |
@@ -1299,6 +1315,7 @@ static int vidioc_s_crop(struct file *file, void *fh, const struct v4l2_crop *cr | |||
1299 | struct omapvideo_info *ovid; | 1315 | struct omapvideo_info *ovid; |
1300 | struct omap_overlay *ovl; | 1316 | struct omap_overlay *ovl; |
1301 | struct omap_video_timings *timing; | 1317 | struct omap_video_timings *timing; |
1318 | struct omap_dss_device *dssdev; | ||
1302 | 1319 | ||
1303 | if (vout->streaming) | 1320 | if (vout->streaming) |
1304 | return -EBUSY; | 1321 | return -EBUSY; |
@@ -1306,13 +1323,15 @@ static int vidioc_s_crop(struct file *file, void *fh, const struct v4l2_crop *cr | |||
1306 | mutex_lock(&vout->lock); | 1323 | mutex_lock(&vout->lock); |
1307 | ovid = &vout->vid_info; | 1324 | ovid = &vout->vid_info; |
1308 | ovl = ovid->overlays[0]; | 1325 | ovl = ovid->overlays[0]; |
1326 | /* get the display device attached to the overlay */ | ||
1327 | dssdev = ovl->get_device(ovl); | ||
1309 | 1328 | ||
1310 | if (!ovl->manager || !ovl->manager->device) { | 1329 | if (!dssdev) { |
1311 | ret = -EINVAL; | 1330 | ret = -EINVAL; |
1312 | goto s_crop_err; | 1331 | goto s_crop_err; |
1313 | } | 1332 | } |
1314 | /* get the display device attached to the overlay */ | 1333 | |
1315 | timing = &ovl->manager->device->panel.timings; | 1334 | timing = &dssdev->panel.timings; |
1316 | 1335 | ||
1317 | if (is_rotation_90_or_270(vout)) { | 1336 | if (is_rotation_90_or_270(vout)) { |
1318 | vout->fbuf.fmt.height = timing->x_res; | 1337 | vout->fbuf.fmt.height = timing->x_res; |
@@ -1668,7 +1687,7 @@ static int vidioc_streamon(struct file *file, void *fh, enum v4l2_buf_type i) | |||
1668 | for (j = 0; j < ovid->num_overlays; j++) { | 1687 | for (j = 0; j < ovid->num_overlays; j++) { |
1669 | struct omap_overlay *ovl = ovid->overlays[j]; | 1688 | struct omap_overlay *ovl = ovid->overlays[j]; |
1670 | 1689 | ||
1671 | if (ovl->manager && ovl->manager->device) { | 1690 | if (ovl->get_device(ovl)) { |
1672 | struct omap_overlay_info info; | 1691 | struct omap_overlay_info info; |
1673 | ovl->get_overlay_info(ovl, &info); | 1692 | ovl->get_overlay_info(ovl, &info); |
1674 | info.paddr = addr; | 1693 | info.paddr = addr; |
@@ -1691,8 +1710,9 @@ static int vidioc_streamon(struct file *file, void *fh, enum v4l2_buf_type i) | |||
1691 | 1710 | ||
1692 | for (j = 0; j < ovid->num_overlays; j++) { | 1711 | for (j = 0; j < ovid->num_overlays; j++) { |
1693 | struct omap_overlay *ovl = ovid->overlays[j]; | 1712 | struct omap_overlay *ovl = ovid->overlays[j]; |
1713 | struct omap_dss_device *dssdev = ovl->get_device(ovl); | ||
1694 | 1714 | ||
1695 | if (ovl->manager && ovl->manager->device) { | 1715 | if (dssdev) { |
1696 | ret = ovl->enable(ovl); | 1716 | ret = ovl->enable(ovl); |
1697 | if (ret) | 1717 | if (ret) |
1698 | goto streamon_err1; | 1718 | goto streamon_err1; |
@@ -1727,8 +1747,9 @@ static int vidioc_streamoff(struct file *file, void *fh, enum v4l2_buf_type i) | |||
1727 | 1747 | ||
1728 | for (j = 0; j < ovid->num_overlays; j++) { | 1748 | for (j = 0; j < ovid->num_overlays; j++) { |
1729 | struct omap_overlay *ovl = ovid->overlays[j]; | 1749 | struct omap_overlay *ovl = ovid->overlays[j]; |
1750 | struct omap_dss_device *dssdev = ovl->get_device(ovl); | ||
1730 | 1751 | ||
1731 | if (ovl->manager && ovl->manager->device) | 1752 | if (dssdev) |
1732 | ovl->disable(ovl); | 1753 | ovl->disable(ovl); |
1733 | } | 1754 | } |
1734 | 1755 | ||
@@ -1891,8 +1912,8 @@ static int __init omap_vout_setup_video_data(struct omap_vout_device *vout) | |||
1891 | struct video_device *vfd; | 1912 | struct video_device *vfd; |
1892 | struct v4l2_pix_format *pix; | 1913 | struct v4l2_pix_format *pix; |
1893 | struct v4l2_control *control; | 1914 | struct v4l2_control *control; |
1894 | struct omap_dss_device *display = | 1915 | struct omap_overlay *ovl = vout->vid_info.overlays[0]; |
1895 | vout->vid_info.overlays[0]->manager->device; | 1916 | struct omap_dss_device *display = ovl->get_device(ovl); |
1896 | 1917 | ||
1897 | /* set the default pix */ | 1918 | /* set the default pix */ |
1898 | pix = &vout->pix; | 1919 | pix = &vout->pix; |
@@ -2207,8 +2228,10 @@ static int __init omap_vout_probe(struct platform_device *pdev) | |||
2207 | */ | 2228 | */ |
2208 | for (i = 1; i < vid_dev->num_overlays; i++) { | 2229 | for (i = 1; i < vid_dev->num_overlays; i++) { |
2209 | ovl = omap_dss_get_overlay(i); | 2230 | ovl = omap_dss_get_overlay(i); |
2210 | if (ovl->manager && ovl->manager->device) { | 2231 | dssdev = ovl->get_device(ovl); |
2211 | def_display = ovl->manager->device; | 2232 | |
2233 | if (dssdev) { | ||
2234 | def_display = dssdev; | ||
2212 | } else { | 2235 | } else { |
2213 | dev_warn(&pdev->dev, "cannot find display\n"); | 2236 | dev_warn(&pdev->dev, "cannot find display\n"); |
2214 | def_display = NULL; | 2237 | def_display = NULL; |
@@ -2255,8 +2278,10 @@ probe_err1: | |||
2255 | for (i = 1; i < vid_dev->num_overlays; i++) { | 2278 | for (i = 1; i < vid_dev->num_overlays; i++) { |
2256 | def_display = NULL; | 2279 | def_display = NULL; |
2257 | ovl = omap_dss_get_overlay(i); | 2280 | ovl = omap_dss_get_overlay(i); |
2258 | if (ovl->manager && ovl->manager->device) | 2281 | dssdev = ovl->get_device(ovl); |
2259 | def_display = ovl->manager->device; | 2282 | |
2283 | if (dssdev) | ||
2284 | def_display = dssdev; | ||
2260 | 2285 | ||
2261 | if (def_display && def_display->driver) | 2286 | if (def_display && def_display->driver) |
2262 | def_display->driver->disable(def_display); | 2287 | def_display->driver->disable(def_display); |
diff --git a/drivers/media/platform/vino.c b/drivers/media/platform/vino.c index 790d96cffeea..70b0bf4b2900 100644 --- a/drivers/media/platform/vino.c +++ b/drivers/media/platform/vino.c | |||
@@ -3950,7 +3950,7 @@ found: | |||
3950 | 3950 | ||
3951 | fb->map_count = 1; | 3951 | fb->map_count = 1; |
3952 | 3952 | ||
3953 | vma->vm_flags |= VM_DONTEXPAND | VM_RESERVED; | 3953 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
3954 | vma->vm_flags &= ~VM_IO; | 3954 | vma->vm_flags &= ~VM_IO; |
3955 | vma->vm_private_data = fb; | 3955 | vma->vm_private_data = fb; |
3956 | vma->vm_file = file; | 3956 | vma->vm_file = file; |
diff --git a/drivers/media/usb/sn9c102/sn9c102_core.c b/drivers/media/usb/sn9c102/sn9c102_core.c index 19ea780b16ff..5bfc8e2f018f 100644 --- a/drivers/media/usb/sn9c102/sn9c102_core.c +++ b/drivers/media/usb/sn9c102/sn9c102_core.c | |||
@@ -2126,8 +2126,7 @@ static int sn9c102_mmap(struct file* filp, struct vm_area_struct *vma) | |||
2126 | return -EINVAL; | 2126 | return -EINVAL; |
2127 | } | 2127 | } |
2128 | 2128 | ||
2129 | vma->vm_flags |= VM_IO; | 2129 | vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP; |
2130 | vma->vm_flags |= VM_RESERVED; | ||
2131 | 2130 | ||
2132 | pos = cam->frame[i].bufmem; | 2131 | pos = cam->frame[i].bufmem; |
2133 | while (size > 0) { /* size is page-aligned */ | 2132 | while (size > 0) { /* size is page-aligned */ |
diff --git a/drivers/media/usb/usbvision/usbvision-video.c b/drivers/media/usb/usbvision/usbvision-video.c index f67018ed3795..5c36a57e6590 100644 --- a/drivers/media/usb/usbvision/usbvision-video.c +++ b/drivers/media/usb/usbvision/usbvision-video.c | |||
@@ -1108,8 +1108,7 @@ static int usbvision_mmap(struct file *file, struct vm_area_struct *vma) | |||
1108 | } | 1108 | } |
1109 | 1109 | ||
1110 | /* VM_IO is eventually going to replace PageReserved altogether */ | 1110 | /* VM_IO is eventually going to replace PageReserved altogether */ |
1111 | vma->vm_flags |= VM_IO; | 1111 | vma->vm_flags |= VM_IO | VM_DONTEXPAND | VM_DONTDUMP; |
1112 | vma->vm_flags |= VM_RESERVED; /* avoid to swap out this VMA */ | ||
1113 | 1112 | ||
1114 | pos = usbvision->frame[i].data; | 1113 | pos = usbvision->frame[i].data; |
1115 | while (size > 0) { | 1114 | while (size > 0) { |
diff --git a/drivers/media/v4l2-core/videobuf-dma-sg.c b/drivers/media/v4l2-core/videobuf-dma-sg.c index f300deafd268..828e7c10bd70 100644 --- a/drivers/media/v4l2-core/videobuf-dma-sg.c +++ b/drivers/media/v4l2-core/videobuf-dma-sg.c | |||
@@ -582,7 +582,7 @@ static int __videobuf_mmap_mapper(struct videobuf_queue *q, | |||
582 | map->count = 1; | 582 | map->count = 1; |
583 | map->q = q; | 583 | map->q = q; |
584 | vma->vm_ops = &videobuf_vm_ops; | 584 | vma->vm_ops = &videobuf_vm_ops; |
585 | vma->vm_flags |= VM_DONTEXPAND | VM_RESERVED; | 585 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
586 | vma->vm_flags &= ~VM_IO; /* using shared anonymous pages */ | 586 | vma->vm_flags &= ~VM_IO; /* using shared anonymous pages */ |
587 | vma->vm_private_data = map; | 587 | vma->vm_private_data = map; |
588 | dprintk(1, "mmap %p: q=%p %08lx-%08lx pgoff %08lx bufs %d-%d\n", | 588 | dprintk(1, "mmap %p: q=%p %08lx-%08lx pgoff %08lx bufs %d-%d\n", |
diff --git a/drivers/media/v4l2-core/videobuf-vmalloc.c b/drivers/media/v4l2-core/videobuf-vmalloc.c index df142580e44c..2ff7fcc77b11 100644 --- a/drivers/media/v4l2-core/videobuf-vmalloc.c +++ b/drivers/media/v4l2-core/videobuf-vmalloc.c | |||
@@ -270,7 +270,7 @@ static int __videobuf_mmap_mapper(struct videobuf_queue *q, | |||
270 | } | 270 | } |
271 | 271 | ||
272 | vma->vm_ops = &videobuf_vm_ops; | 272 | vma->vm_ops = &videobuf_vm_ops; |
273 | vma->vm_flags |= VM_DONTEXPAND | VM_RESERVED; | 273 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
274 | vma->vm_private_data = map; | 274 | vma->vm_private_data = map; |
275 | 275 | ||
276 | dprintk(1, "mmap %p: q=%p %08lx-%08lx (%lx) pgoff %08lx buf %d\n", | 276 | dprintk(1, "mmap %p: q=%p %08lx-%08lx (%lx) pgoff %08lx buf %d\n", |
diff --git a/drivers/media/v4l2-core/videobuf2-memops.c b/drivers/media/v4l2-core/videobuf2-memops.c index 504cd4cbe29e..051ea3571b20 100644 --- a/drivers/media/v4l2-core/videobuf2-memops.c +++ b/drivers/media/v4l2-core/videobuf2-memops.c | |||
@@ -163,7 +163,7 @@ int vb2_mmap_pfn_range(struct vm_area_struct *vma, unsigned long paddr, | |||
163 | return ret; | 163 | return ret; |
164 | } | 164 | } |
165 | 165 | ||
166 | vma->vm_flags |= VM_DONTEXPAND | VM_RESERVED; | 166 | vma->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP; |
167 | vma->vm_private_data = priv; | 167 | vma->vm_private_data = priv; |
168 | vma->vm_ops = vm_ops; | 168 | vma->vm_ops = vm_ops; |
169 | 169 | ||