The patch number 14775 was added via Douglas Schilling Landgraf 
<[email protected]>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        Linux Media Mailing List <[email protected]>

------

From: Hans Verkuil  <[email protected]>
videobuf: Add support for V4L2_BUF_FLAG_ERROR


For recoverable stream errors dqbuf() now returns 0 and the error flag
is set instead of returning EIO.

Priority: normal

Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Signed-off-by: Douglas Schilling Landgraf <[email protected]>


---

 linux/drivers/media/video/videobuf-core.c |   16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff -r 6ee39e9cad68 -r 4878665465f0 linux/drivers/media/video/videobuf-core.c
--- a/linux/drivers/media/video/videobuf-core.c Wed May 12 00:28:09 2010 -0300
+++ b/linux/drivers/media/video/videobuf-core.c Wed May 12 00:29:02 2010 -0300
@@ -286,8 +286,10 @@
        case VIDEOBUF_ACTIVE:
                b->flags |= V4L2_BUF_FLAG_QUEUED;
                break;
+       case VIDEOBUF_ERROR:
+               b->flags |= V4L2_BUF_FLAG_ERROR;
+               /* fall through */
        case VIDEOBUF_DONE:
-       case VIDEOBUF_ERROR:
                b->flags |= V4L2_BUF_FLAG_DONE;
                break;
        case VIDEOBUF_NEEDS_INIT:
@@ -671,6 +673,7 @@
 
        MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS);
 
+       memset(b, 0, sizeof(*b));
        mutex_lock(&q->vb_lock);
 
        retval = stream_next_buffer(q, &buf, nonblocking);
@@ -682,23 +685,20 @@
        switch (buf->state) {
        case VIDEOBUF_ERROR:
                dprintk(1, "dqbuf: state is error\n");
-               retval = -EIO;
-               CALL(q, sync, q, buf);
-               buf->state = VIDEOBUF_IDLE;
                break;
        case VIDEOBUF_DONE:
                dprintk(1, "dqbuf: state is done\n");
-               CALL(q, sync, q, buf);
-               buf->state = VIDEOBUF_IDLE;
                break;
        default:
                dprintk(1, "dqbuf: state invalid\n");
                retval = -EINVAL;
                goto done;
        }
+       CALL(q, sync, q, buf);
+       videobuf_status(q, b, buf, q->type);
        list_del(&buf->stream);
-       memset(b, 0, sizeof(*b));
-       videobuf_status(q, b, buf, q->type);
+       buf->state = VIDEOBUF_IDLE;
+       b->flags &= ~V4L2_BUF_FLAG_DONE;
 done:
        mutex_unlock(&q->vb_lock);
        return retval;


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/4878665465f05f0d7713531e89e68e21a9d0eda0

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to