[RFCv3 PATCH 04/10] vb2: call buf_finish from __dqbuf

2014-02-13 Thread Hans Verkuil
From: Hans Verkuil hans.verk...@cisco.com

This ensures that it is also called from queue_cancel, which also calls
__dqbuf(). Without this change any time queue_cancel is called while
streaming the buf_finish op will not be called and any driver cleanup
will not happen.

Signed-off-by: Hans Verkuil hans.verk...@cisco.com
---
 drivers/media/v4l2-core/videobuf2-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/v4l2-core/videobuf2-core.c 
b/drivers/media/v4l2-core/videobuf2-core.c
index 1f037de..3756378 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -1762,6 +1762,8 @@ static void __vb2_dqbuf(struct vb2_buffer *vb)
if (vb-state == VB2_BUF_STATE_DEQUEUED)
return;
 
+   call_vb_qop(vb, buf_finish, vb);
+
vb-state = VB2_BUF_STATE_DEQUEUED;
 
/* unmap DMABUF buffer */
@@ -1787,8 +1789,6 @@ static int vb2_internal_dqbuf(struct vb2_queue *q, struct 
v4l2_buffer *b, bool n
if (ret  0)
return ret;
 
-   call_vb_qop(vb, buf_finish, vb);
-
switch (vb-state) {
case VB2_BUF_STATE_DONE:
dprintk(3, dqbuf: Returning done buffer\n);
-- 
1.8.4.rc3

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFCv3 PATCH 04/10] vb2: call buf_finish from __dqbuf

2014-02-13 Thread Pawel Osciak
On Thu, Feb 13, 2014 at 6:40 PM, Hans Verkuil hverk...@xs4all.nl wrote:
 From: Hans Verkuil hans.verk...@cisco.com

 This ensures that it is also called from queue_cancel, which also calls
 __dqbuf(). Without this change any time queue_cancel is called while
 streaming the buf_finish op will not be called and any driver cleanup
 will not happen.

 Signed-off-by: Hans Verkuil hans.verk...@cisco.com

Acked-by: Pawel Osciak pa...@osciak.com

 ---
  drivers/media/v4l2-core/videobuf2-core.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/drivers/media/v4l2-core/videobuf2-core.c 
 b/drivers/media/v4l2-core/videobuf2-core.c
 index 1f037de..3756378 100644
 --- a/drivers/media/v4l2-core/videobuf2-core.c
 +++ b/drivers/media/v4l2-core/videobuf2-core.c
 @@ -1762,6 +1762,8 @@ static void __vb2_dqbuf(struct vb2_buffer *vb)
 if (vb-state == VB2_BUF_STATE_DEQUEUED)
 return;

 +   call_vb_qop(vb, buf_finish, vb);
 +
 vb-state = VB2_BUF_STATE_DEQUEUED;

 /* unmap DMABUF buffer */
 @@ -1787,8 +1789,6 @@ static int vb2_internal_dqbuf(struct vb2_queue *q, 
 struct v4l2_buffer *b, bool n
 if (ret  0)
 return ret;

 -   call_vb_qop(vb, buf_finish, vb);
 -
 switch (vb-state) {
 case VB2_BUF_STATE_DONE:
 dprintk(3, dqbuf: Returning done buffer\n);
 --
 1.8.4.rc3




-- 
Best regards,
Pawel Osciak
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html