[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>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
815789244e
commit
c54d4a0b08
@@ -1596,7 +1596,7 @@ static int vpif_suspend(struct device *dev)
|
|||||||
ch = vpif_obj.dev[i];
|
ch = vpif_obj.dev[i];
|
||||||
common = &ch->common[VPIF_VIDEO_INDEX];
|
common = &ch->common[VPIF_VIDEO_INDEX];
|
||||||
|
|
||||||
if (!vb2_is_streaming(&common->buffer_queue))
|
if (!vb2_start_streaming_called(&common->buffer_queue))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
mutex_lock(&common->lock);
|
mutex_lock(&common->lock);
|
||||||
@@ -1630,7 +1630,7 @@ static int vpif_resume(struct device *dev)
|
|||||||
ch = vpif_obj.dev[i];
|
ch = vpif_obj.dev[i];
|
||||||
common = &ch->common[VPIF_VIDEO_INDEX];
|
common = &ch->common[VPIF_VIDEO_INDEX];
|
||||||
|
|
||||||
if (!vb2_is_streaming(&common->buffer_queue))
|
if (!vb2_start_streaming_called(&common->buffer_queue))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
mutex_lock(&common->lock);
|
mutex_lock(&common->lock);
|
||||||
|
|||||||
Reference in New Issue
Block a user