aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2012-05-15 07:39:25 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-05-15 07:39:25 -0400
commit69ecdbac144147a80747914d9b6ea3472e2d93e7 (patch)
treee1bb68c3568f370cd6a7d2ae29a051bee244ce0f /drivers/media/video
parentb7dc4cd17506284a47eeb9160207e43c7d5486fe (diff)
parentb6255ee3d82798eb1eee9fb1cca713317b5afae8 (diff)
Merge remote-tracking branch 'linus/master' into staging/for_v3.5
* linus/master: (805 commits) tty: Fix LED error return openvswitch: checking wrong variable in queue_userspace_packet() bonding: Fix LACPDU rx_dropped commit. Linux 3.4-rc7 ARM: EXYNOS: fix ctrlbit for exynos5_clk_pdma1 ARM: EXYNOS: use s5p-timer for UniversalC210 board ARM / mach-shmobile: Invalidate caches when booting secondary cores ARM / mach-shmobile: sh73a0 SMP TWD boot regression fix ARM / mach-shmobile: r8a7779 SMP TWD boot regression fix ARM: mach-shmobile: convert ag5evm to use the generic MMC GPIO hotplug helper ARM: mach-shmobile: convert mackerel to use the generic MMC GPIO hotplug helper MAINTAINERS: Add myself as the cpufreq maintainer dm mpath: check if scsi_dh module already loaded before trying to load dm thin: correct module description dm thin: fix unprotected use of prepared_discards list dm thin: reinstate missing mempool_free in cell_release_singleton gpio/exynos: Fix compiler warnings when non-exynos machines are selected gpio: pch9: Use proper flow type handlers powerpc/irq: Fix another case of lazy IRQ state getting out of sync ks8851: Update link status during link change interrupt ... Conflicts: drivers/media/common/tuners/xc5000.c drivers/media/common/tuners/xc5000.h drivers/usb/gadget/uvc_queue.c
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/gspca/sonixj.c8
-rw-r--r--drivers/media/video/marvell-ccic/mmp-driver.c1
-rw-r--r--drivers/media/video/s5p-fimc/fimc-capture.c31
-rw-r--r--drivers/media/video/s5p-fimc/fimc-core.c4
-rw-r--r--drivers/media/video/s5p-fimc/fimc-core.h2
-rw-r--r--drivers/media/video/soc_camera.c8
-rw-r--r--drivers/media/video/videobuf2-memops.c1
7 files changed, 34 insertions, 21 deletions
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c
index 05c6d0c004d4..4d1696d1a7f4 100644
--- a/drivers/media/video/gspca/sonixj.c
+++ b/drivers/media/video/gspca/sonixj.c
@@ -2920,6 +2920,10 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
2920 * not the JPEG end of frame ('ff d9'). 2920 * not the JPEG end of frame ('ff d9').
2921 */ 2921 */
2922 2922
2923 /* count the packets and their size */
2924 sd->npkt++;
2925 sd->pktsz += len;
2926
2923/*fixme: assumption about the following code: 2927/*fixme: assumption about the following code:
2924 * - there can be only one marker in a packet 2928 * - there can be only one marker in a packet
2925 */ 2929 */
@@ -2942,10 +2946,6 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
2942 data += i; 2946 data += i;
2943 } 2947 }
2944 2948
2945 /* count the packets and their size */
2946 sd->npkt++;
2947 sd->pktsz += len;
2948
2949 /* search backwards if there is a marker in the packet */ 2949 /* search backwards if there is a marker in the packet */
2950 for (i = len - 1; --i >= 0; ) { 2950 for (i = len - 1; --i >= 0; ) {
2951 if (data[i] != 0xff) { 2951 if (data[i] != 0xff) {
diff --git a/drivers/media/video/marvell-ccic/mmp-driver.c b/drivers/media/video/marvell-ccic/mmp-driver.c
index d23552323f45..c4c17fe76c0d 100644
--- a/drivers/media/video/marvell-ccic/mmp-driver.c
+++ b/drivers/media/video/marvell-ccic/mmp-driver.c
@@ -181,7 +181,6 @@ static int mmpcam_probe(struct platform_device *pdev)
181 INIT_LIST_HEAD(&cam->devlist); 181 INIT_LIST_HEAD(&cam->devlist);
182 182
183 mcam = &cam->mcam; 183 mcam = &cam->mcam;
184 mcam->platform = MHP_Armada610;
185 mcam->plat_power_up = mmpcam_power_up; 184 mcam->plat_power_up = mmpcam_power_up;
186 mcam->plat_power_down = mmpcam_power_down; 185 mcam->plat_power_down = mmpcam_power_down;
187 mcam->dev = &pdev->dev; 186 mcam->dev = &pdev->dev;
diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c b/drivers/media/video/s5p-fimc/fimc-capture.c
index 520217758c04..be5e4e237297 100644
--- a/drivers/media/video/s5p-fimc/fimc-capture.c
+++ b/drivers/media/video/s5p-fimc/fimc-capture.c
@@ -248,28 +248,37 @@ int fimc_capture_resume(struct fimc_dev *fimc)
248 248
249} 249}
250 250
251static unsigned int get_plane_size(struct fimc_frame *fr, unsigned int plane) 251static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt,
252{
253 if (!fr || plane >= fr->fmt->memplanes)
254 return 0;
255 return fr->f_width * fr->f_height * fr->fmt->depth[plane] / 8;
256}
257
258static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt,
259 unsigned int *num_buffers, unsigned int *num_planes, 252 unsigned int *num_buffers, unsigned int *num_planes,
260 unsigned int sizes[], void *allocators[]) 253 unsigned int sizes[], void *allocators[])
261{ 254{
255 const struct v4l2_pix_format_mplane *pixm = NULL;
262 struct fimc_ctx *ctx = vq->drv_priv; 256 struct fimc_ctx *ctx = vq->drv_priv;
263 struct fimc_fmt *fmt = ctx->d_frame.fmt; 257 struct fimc_frame *frame = &ctx->d_frame;
258 struct fimc_fmt *fmt = frame->fmt;
259 unsigned long wh;
264 int i; 260 int i;
265 261
266 if (!fmt) 262 if (pfmt) {
263 pixm = &pfmt->fmt.pix_mp;
264 fmt = fimc_find_format(&pixm->pixelformat, NULL,
265 FMT_FLAGS_CAM | FMT_FLAGS_M2M, -1);
266 wh = pixm->width * pixm->height;
267 } else {
268 wh = frame->f_width * frame->f_height;
269 }
270
271 if (fmt == NULL)
267 return -EINVAL; 272 return -EINVAL;
268 273
269 *num_planes = fmt->memplanes; 274 *num_planes = fmt->memplanes;
270 275
271 for (i = 0; i < fmt->memplanes; i++) { 276 for (i = 0; i < fmt->memplanes; i++) {
272 sizes[i] = get_plane_size(&ctx->d_frame, i); 277 unsigned int size = (wh * fmt->depth[i]) / 8;
278 if (pixm)
279 sizes[i] = max(size, pixm->plane_fmt[i].sizeimage);
280 else
281 sizes[i] = size;
273 allocators[i] = ctx->fimc_dev->alloc_ctx; 282 allocators[i] = ctx->fimc_dev->alloc_ctx;
274 } 283 }
275 284
diff --git a/drivers/media/video/s5p-fimc/fimc-core.c b/drivers/media/video/s5p-fimc/fimc-core.c
index c58dd9f8ce67..f6b9060a0c0f 100644
--- a/drivers/media/video/s5p-fimc/fimc-core.c
+++ b/drivers/media/video/s5p-fimc/fimc-core.c
@@ -1007,14 +1007,14 @@ static int fimc_m2m_g_fmt_mplane(struct file *file, void *fh,
1007 * @mask: the color flags to match 1007 * @mask: the color flags to match
1008 * @index: offset in the fimc_formats array, ignored if negative 1008 * @index: offset in the fimc_formats array, ignored if negative
1009 */ 1009 */
1010struct fimc_fmt *fimc_find_format(u32 *pixelformat, u32 *mbus_code, 1010struct fimc_fmt *fimc_find_format(const u32 *pixelformat, const u32 *mbus_code,
1011 unsigned int mask, int index) 1011 unsigned int mask, int index)
1012{ 1012{
1013 struct fimc_fmt *fmt, *def_fmt = NULL; 1013 struct fimc_fmt *fmt, *def_fmt = NULL;
1014 unsigned int i; 1014 unsigned int i;
1015 int id = 0; 1015 int id = 0;
1016 1016
1017 if (index >= ARRAY_SIZE(fimc_formats)) 1017 if (index >= (int)ARRAY_SIZE(fimc_formats))
1018 return NULL; 1018 return NULL;
1019 1019
1020 for (i = 0; i < ARRAY_SIZE(fimc_formats); ++i) { 1020 for (i = 0; i < ARRAY_SIZE(fimc_formats); ++i) {
diff --git a/drivers/media/video/s5p-fimc/fimc-core.h b/drivers/media/video/s5p-fimc/fimc-core.h
index 193e8f603949..7afabb0e1907 100644
--- a/drivers/media/video/s5p-fimc/fimc-core.h
+++ b/drivers/media/video/s5p-fimc/fimc-core.h
@@ -710,7 +710,7 @@ void fimc_alpha_ctrl_update(struct fimc_ctx *ctx);
710int fimc_fill_format(struct fimc_frame *frame, struct v4l2_format *f); 710int fimc_fill_format(struct fimc_frame *frame, struct v4l2_format *f);
711void fimc_adjust_mplane_format(struct fimc_fmt *fmt, u32 width, u32 height, 711void fimc_adjust_mplane_format(struct fimc_fmt *fmt, u32 width, u32 height,
712 struct v4l2_pix_format_mplane *pix); 712 struct v4l2_pix_format_mplane *pix);
713struct fimc_fmt *fimc_find_format(u32 *pixelformat, u32 *mbus_code, 713struct fimc_fmt *fimc_find_format(const u32 *pixelformat, const u32 *mbus_code,
714 unsigned int mask, int index); 714 unsigned int mask, int index);
715 715
716int fimc_check_scaler_ratio(struct fimc_ctx *ctx, int sw, int sh, 716int fimc_check_scaler_ratio(struct fimc_ctx *ctx, int sw, int sh,
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c
index c27bb6d0a136..c3ab55883c2d 100644
--- a/drivers/media/video/soc_camera.c
+++ b/drivers/media/video/soc_camera.c
@@ -530,7 +530,10 @@ static int soc_camera_open(struct file *file)
530 if (icl->reset) 530 if (icl->reset)
531 icl->reset(icd->pdev); 531 icl->reset(icd->pdev);
532 532
533 /* Don't mess with the host during probe */
534 mutex_lock(&ici->host_lock);
533 ret = ici->ops->add(icd); 535 ret = ici->ops->add(icd);
536 mutex_unlock(&ici->host_lock);
534 if (ret < 0) { 537 if (ret < 0) {
535 dev_err(icd->pdev, "Couldn't activate the camera: %d\n", ret); 538 dev_err(icd->pdev, "Couldn't activate the camera: %d\n", ret);
536 goto eiciadd; 539 goto eiciadd;
@@ -956,7 +959,7 @@ static void scan_add_host(struct soc_camera_host *ici)
956{ 959{
957 struct soc_camera_device *icd; 960 struct soc_camera_device *icd;
958 961
959 mutex_lock(&list_lock); 962 mutex_lock(&ici->host_lock);
960 963
961 list_for_each_entry(icd, &devices, list) { 964 list_for_each_entry(icd, &devices, list) {
962 if (icd->iface == ici->nr) { 965 if (icd->iface == ici->nr) {
@@ -967,7 +970,7 @@ static void scan_add_host(struct soc_camera_host *ici)
967 } 970 }
968 } 971 }
969 972
970 mutex_unlock(&list_lock); 973 mutex_unlock(&ici->host_lock);
971} 974}
972 975
973#ifdef CONFIG_I2C_BOARDINFO 976#ifdef CONFIG_I2C_BOARDINFO
@@ -1313,6 +1316,7 @@ int soc_camera_host_register(struct soc_camera_host *ici)
1313 list_add_tail(&ici->list, &hosts); 1316 list_add_tail(&ici->list, &hosts);
1314 mutex_unlock(&list_lock); 1317 mutex_unlock(&list_lock);
1315 1318
1319 mutex_init(&ici->host_lock);
1316 scan_add_host(ici); 1320 scan_add_host(ici);
1317 1321
1318 return 0; 1322 return 0;
diff --git a/drivers/media/video/videobuf2-memops.c b/drivers/media/video/videobuf2-memops.c
index c41cb60245d6..504cd4cbe29e 100644
--- a/drivers/media/video/videobuf2-memops.c
+++ b/drivers/media/video/videobuf2-memops.c
@@ -55,6 +55,7 @@ struct vm_area_struct *vb2_get_vma(struct vm_area_struct *vma)
55 55
56 return vma_copy; 56 return vma_copy;
57} 57}
58EXPORT_SYMBOL_GPL(vb2_get_vma);
58 59
59/** 60/**
60 * vb2_put_userptr() - release a userspace virtual memory area 61 * vb2_put_userptr() - release a userspace virtual memory area