diff options
author | Javier Martin <javier.martin@vista-silicon.com> | 2011-12-22 10:12:00 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-01-06 08:02:14 -0500 |
commit | ccd1a499c1675fef5d2a138617507add63cb81db (patch) | |
tree | 7f1e85857fcc173e465d6d9c5eb78a55bb169192 /drivers/media/video/mx2_camera.c | |
parent | f410991dcf1fc3ad1d3311b79b4f1b917224ebed (diff) |
[media] media i.MX27 camera: Fix field_count handling
To properly detect frame loss the driver must keep
track of a frame_count.
Furthermore, field_count use was erroneous because
in progressive format this must be incremented twice.
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/mx2_camera.c')
-rw-r--r-- | drivers/media/video/mx2_camera.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c index e635ab3c71e7..04aab0c538aa 100644 --- a/drivers/media/video/mx2_camera.c +++ b/drivers/media/video/mx2_camera.c | |||
@@ -258,6 +258,7 @@ struct mx2_camera_dev { | |||
258 | dma_addr_t discard_buffer_dma; | 258 | dma_addr_t discard_buffer_dma; |
259 | size_t discard_size; | 259 | size_t discard_size; |
260 | struct mx2_fmt_cfg *emma_prp; | 260 | struct mx2_fmt_cfg *emma_prp; |
261 | u32 frame_count; | ||
261 | }; | 262 | }; |
262 | 263 | ||
263 | /* buffer for one video frame */ | 264 | /* buffer for one video frame */ |
@@ -371,6 +372,7 @@ static int mx2_camera_add_device(struct soc_camera_device *icd) | |||
371 | writel(pcdev->csicr1, pcdev->base_csi + CSICR1); | 372 | writel(pcdev->csicr1, pcdev->base_csi + CSICR1); |
372 | 373 | ||
373 | pcdev->icd = icd; | 374 | pcdev->icd = icd; |
375 | pcdev->frame_count = 0; | ||
374 | 376 | ||
375 | dev_info(icd->parent, "Camera driver attached to camera %d\n", | 377 | dev_info(icd->parent, "Camera driver attached to camera %d\n", |
376 | icd->devnum); | 378 | icd->devnum); |
@@ -1374,7 +1376,8 @@ static void mx27_camera_frame_done_emma(struct mx2_camera_dev *pcdev, | |||
1374 | list_del(&vb->queue); | 1376 | list_del(&vb->queue); |
1375 | vb->state = state; | 1377 | vb->state = state; |
1376 | do_gettimeofday(&vb->ts); | 1378 | do_gettimeofday(&vb->ts); |
1377 | vb->field_count++; | 1379 | vb->field_count = pcdev->frame_count * 2; |
1380 | pcdev->frame_count++; | ||
1378 | 1381 | ||
1379 | wake_up(&vb->done); | 1382 | wake_up(&vb->done); |
1380 | } | 1383 | } |