Skip to content

Commit

Permalink
media: coda: retire coda_buf_is_end_of_stream
Browse files Browse the repository at this point in the history
Using the output queue sequence counter to determine the last buffer to
be encoded or decoded always was fragile at best. Now that we have the
last buffer flag propagating from the output queue to the capture queue
correctly, this is not needed anymore.

Signed-off-by: Philipp Zabel <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
pH5 authored and mchehab committed Jun 24, 2019
1 parent 9e3b94c commit 0ee08a1
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions drivers/media/platform/coda/coda-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -900,25 +900,15 @@ static int coda_dqbuf(struct file *file, void *priv, struct v4l2_buffer *buf)
return ret;
}

static bool coda_buf_is_end_of_stream(struct coda_ctx *ctx,
struct vb2_v4l2_buffer *buf)
{
return ((ctx->bit_stream_param & CODA_BIT_STREAM_END_FLAG) &&
(buf->sequence == (ctx->qsequence - 1)));
}

void coda_m2m_buf_done(struct coda_ctx *ctx, struct vb2_v4l2_buffer *buf,
enum vb2_buffer_state state)
{
const struct v4l2_event eos_event = {
.type = V4L2_EVENT_EOS
};

if (coda_buf_is_end_of_stream(ctx, buf)) {
buf->flags |= V4L2_BUF_FLAG_LAST;

if (buf->flags & V4L2_BUF_FLAG_LAST)
v4l2_event_queue_fh(&ctx->fh, &eos_event);
}

v4l2_m2m_buf_done(buf, state);
}
Expand Down

0 comments on commit 0ee08a1

Please sign in to comment.