aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPrabhakar Lad <prabhakar.csengg@gmail.com>2014-09-06 11:26:51 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-09-21 19:16:39 -0400
commitc54d4a0b08bc4deddd3919d64f4121eaa487e28e (patch)
treeed420b3e16d845edad031e48871d89de16473f7c
parent815789244eda0b3be11fb1824354ca20c8ec3508 (diff)
[media] media: davinci: vpif_capture: fix the check on suspend/resume callbacks
It is possible to call STREAMON without having any buffers queued. So vb2_is_streaming() can return true without start_streaming() having been called. Only after at least one buffer has been queued will start_streaming be called. The check vb2_is_streaming() is incorrect as this would start the DMA without having proper DMA pointers set up. this patch uses vb2_start_streaming_called() instead to check is streaming was called. Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r--drivers/media/platform/davinci/vpif_capture.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/platform/davinci/vpif_capture.c b/drivers/media/platform/davinci/vpif_capture.c
index 881efcdbee87..3ccb26ff43c8 100644
--- a/drivers/media/platform/davinci/vpif_capture.c
+++ b/drivers/media/platform/davinci/vpif_capture.c
@@ -1596,7 +1596,7 @@ static int vpif_suspend(struct device *dev)
1596 ch = vpif_obj.dev[i]; 1596 ch = vpif_obj.dev[i];
1597 common = &ch->common[VPIF_VIDEO_INDEX]; 1597 common = &ch->common[VPIF_VIDEO_INDEX];
1598 1598
1599 if (!vb2_is_streaming(&common->buffer_queue)) 1599 if (!vb2_start_streaming_called(&common->buffer_queue))
1600 continue; 1600 continue;
1601 1601
1602 mutex_lock(&common->lock); 1602 mutex_lock(&common->lock);
@@ -1630,7 +1630,7 @@ static int vpif_resume(struct device *dev)
1630 ch = vpif_obj.dev[i]; 1630 ch = vpif_obj.dev[i];
1631 common = &ch->common[VPIF_VIDEO_INDEX]; 1631 common = &ch->common[VPIF_VIDEO_INDEX];
1632 1632
1633 if (!vb2_is_streaming(&common->buffer_queue)) 1633 if (!vb2_start_streaming_called(&common->buffer_queue))
1634 continue; 1634 continue;
1635 1635
1636 mutex_lock(&common->lock); 1636 mutex_lock(&common->lock);