Commit c5036d61 authored by Lad, Prabhakar's avatar Lad, Prabhakar Committed by Mauro Carvalho Chehab

[media] media: au0828: drop vbi_buffer_filled() and re-use buffer_filled()

The vbi_buffer_filled() and buffer_filled() did the same functionality
except for incrementing the buffer sequence, this patch drops the
vbi_buffer_filled() and re-uses buffer_filled() for vbi buffers
as well by adding the check for vb2-queue type while incrementing
the sequence numbers. Along side this patch aligns the input parameters
of buffer_filled() function appropriately.
Signed-off-by: default avatarLad, Prabhakar <prabhakar.csengg@gmail.com>
Acked-by: default avatarShuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 48205533
...@@ -302,26 +302,20 @@ static inline void buffer_filled(struct au0828_dev *dev, ...@@ -302,26 +302,20 @@ static inline void buffer_filled(struct au0828_dev *dev,
struct au0828_dmaqueue *dma_q, struct au0828_dmaqueue *dma_q,
struct au0828_buffer *buf) struct au0828_buffer *buf)
{ {
/* Advice that buffer was filled */ struct vb2_buffer vb = buf->vb;
au0828_isocdbg("[%p/%d] wakeup\n", buf, buf->top_field); struct vb2_queue *q = vb.vb2_queue;
buf->vb.v4l2_buf.sequence = dev->frame_count++;
buf->vb.v4l2_buf.field = V4L2_FIELD_INTERLACED;
v4l2_get_timestamp(&buf->vb.v4l2_buf.timestamp);
vb2_buffer_done(&buf->vb, VB2_BUF_STATE_DONE);
}
static inline void vbi_buffer_filled(struct au0828_dev *dev,
struct au0828_dmaqueue *dma_q,
struct au0828_buffer *buf)
{
/* Advice that buffer was filled */ /* Advice that buffer was filled */
au0828_isocdbg("[%p/%d] wakeup\n", buf, buf->top_field); au0828_isocdbg("[%p/%d] wakeup\n", buf, buf->top_field);
buf->vb.v4l2_buf.sequence = dev->vbi_frame_count++; if (q->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
buf->vb.v4l2_buf.field = V4L2_FIELD_INTERLACED; vb.v4l2_buf.sequence = dev->frame_count++;
v4l2_get_timestamp(&buf->vb.v4l2_buf.timestamp); else
vb2_buffer_done(&buf->vb, VB2_BUF_STATE_DONE); vb.v4l2_buf.sequence = dev->vbi_frame_count++;
vb.v4l2_buf.field = V4L2_FIELD_INTERLACED;
v4l2_get_timestamp(&vb.v4l2_buf.timestamp);
vb2_buffer_done(&vb, VB2_BUF_STATE_DONE);
} }
/* /*
...@@ -574,9 +568,7 @@ static inline int au0828_isoc_copy(struct au0828_dev *dev, struct urb *urb) ...@@ -574,9 +568,7 @@ static inline int au0828_isoc_copy(struct au0828_dev *dev, struct urb *urb)
if (fbyte & 0x40) { if (fbyte & 0x40) {
/* VBI */ /* VBI */
if (vbi_buf != NULL) if (vbi_buf != NULL)
vbi_buffer_filled(dev, buffer_filled(dev, vbi_dma_q, vbi_buf);
vbi_dma_q,
vbi_buf);
vbi_get_next_buf(vbi_dma_q, &vbi_buf); vbi_get_next_buf(vbi_dma_q, &vbi_buf);
if (vbi_buf == NULL) if (vbi_buf == NULL)
vbioutp = NULL; vbioutp = NULL;
...@@ -945,7 +937,7 @@ static void au0828_vbi_buffer_timeout(unsigned long data) ...@@ -945,7 +937,7 @@ static void au0828_vbi_buffer_timeout(unsigned long data)
if (buf != NULL) { if (buf != NULL) {
vbi_data = vb2_plane_vaddr(&buf->vb, 0); vbi_data = vb2_plane_vaddr(&buf->vb, 0);
memset(vbi_data, 0x00, buf->length); memset(vbi_data, 0x00, buf->length);
vbi_buffer_filled(dev, dma_q, buf); buffer_filled(dev, dma_q, buf);
} }
vbi_get_next_buf(dma_q, &buf); vbi_get_next_buf(dma_q, &buf);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment