diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2010-04-28 03:05:22 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-19 11:58:37 -0400 |
commit | b2dfd1a45f014e24f0eecc50a7edc954425c348a (patch) | |
tree | 8e24a65edda8d0cef448622ab8bcc56205cc6683 /drivers/media | |
parent | bc0f7f19ab9ba5c7ec648b400d1360b525fa1a3a (diff) |
V4L/DVB: 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.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/video/videobuf-core.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/media/video/videobuf-core.c b/drivers/media/video/videobuf-core.c index 9f99e3bf5392..f47cf1ca1239 100644 --- a/drivers/media/video/videobuf-core.c +++ b/drivers/media/video/videobuf-core.c | |||
@@ -285,8 +285,10 @@ static void videobuf_status(struct videobuf_queue *q, struct v4l2_buffer *b, | |||
285 | case VIDEOBUF_ACTIVE: | 285 | case VIDEOBUF_ACTIVE: |
286 | b->flags |= V4L2_BUF_FLAG_QUEUED; | 286 | b->flags |= V4L2_BUF_FLAG_QUEUED; |
287 | break; | 287 | break; |
288 | case VIDEOBUF_DONE: | ||
289 | case VIDEOBUF_ERROR: | 288 | case VIDEOBUF_ERROR: |
289 | b->flags |= V4L2_BUF_FLAG_ERROR; | ||
290 | /* fall through */ | ||
291 | case VIDEOBUF_DONE: | ||
290 | b->flags |= V4L2_BUF_FLAG_DONE; | 292 | b->flags |= V4L2_BUF_FLAG_DONE; |
291 | break; | 293 | break; |
292 | case VIDEOBUF_NEEDS_INIT: | 294 | case VIDEOBUF_NEEDS_INIT: |
@@ -670,6 +672,7 @@ int videobuf_dqbuf(struct videobuf_queue *q, | |||
670 | 672 | ||
671 | MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS); | 673 | MAGIC_CHECK(q->int_ops->magic, MAGIC_QTYPE_OPS); |
672 | 674 | ||
675 | memset(b, 0, sizeof(*b)); | ||
673 | mutex_lock(&q->vb_lock); | 676 | mutex_lock(&q->vb_lock); |
674 | 677 | ||
675 | retval = stream_next_buffer(q, &buf, nonblocking); | 678 | retval = stream_next_buffer(q, &buf, nonblocking); |
@@ -681,23 +684,20 @@ int videobuf_dqbuf(struct videobuf_queue *q, | |||
681 | switch (buf->state) { | 684 | switch (buf->state) { |
682 | case VIDEOBUF_ERROR: | 685 | case VIDEOBUF_ERROR: |
683 | dprintk(1, "dqbuf: state is error\n"); | 686 | dprintk(1, "dqbuf: state is error\n"); |
684 | retval = -EIO; | ||
685 | CALL(q, sync, q, buf); | ||
686 | buf->state = VIDEOBUF_IDLE; | ||
687 | break; | 687 | break; |
688 | case VIDEOBUF_DONE: | 688 | case VIDEOBUF_DONE: |
689 | dprintk(1, "dqbuf: state is done\n"); | 689 | dprintk(1, "dqbuf: state is done\n"); |
690 | CALL(q, sync, q, buf); | ||
691 | buf->state = VIDEOBUF_IDLE; | ||
692 | break; | 690 | break; |
693 | default: | 691 | default: |
694 | dprintk(1, "dqbuf: state invalid\n"); | 692 | dprintk(1, "dqbuf: state invalid\n"); |
695 | retval = -EINVAL; | 693 | retval = -EINVAL; |
696 | goto done; | 694 | goto done; |
697 | } | 695 | } |
698 | list_del(&buf->stream); | 696 | CALL(q, sync, q, buf); |
699 | memset(b, 0, sizeof(*b)); | ||
700 | videobuf_status(q, b, buf, q->type); | 697 | videobuf_status(q, b, buf, q->type); |
698 | list_del(&buf->stream); | ||
699 | buf->state = VIDEOBUF_IDLE; | ||
700 | b->flags &= ~V4L2_BUF_FLAG_DONE; | ||
701 | done: | 701 | done: |
702 | mutex_unlock(&q->vb_lock); | 702 | mutex_unlock(&q->vb_lock); |
703 | return retval; | 703 | return retval; |