summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/ivtv/ivtv-irq.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2007-07-28 17:07:12 +0200
committerHans Verkuil <hverkuil@xs4all.nl>2007-07-28 17:07:12 +0200
commitfe63b013b5d4c0822f2cb6868de131e3c62dcc35 (patch)
tree007959ef54f78c7612d8624b874707902177d288 /linux/drivers/media/video/ivtv/ivtv-irq.c
parent23c9830c96f5c9ee0b845bd48efd5fc70356d83f (diff)
downloadmediapointer-dvb-s2-fe63b013b5d4c0822f2cb6868de131e3c62dcc35.tar.gz
mediapointer-dvb-s2-fe63b013b5d4c0822f2cb6868de131e3c62dcc35.tar.bz2
ivtv: always steal full frames if out of buffers.
From: Hans Verkuil <hverkuil@xs4all.nl> When there are no more free buffers, then buffers are stolen from the predma queue. Buffers should be stolen from the head of that queue (which is where the most recently added buffers are) and all buffers belonging to a frame should be stolen. Otherwise 'half-frames' would remain in the queue, which leads to ugly playback and complete sync failure for YUV buffers. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media/video/ivtv/ivtv-irq.c')
-rw-r--r--linux/drivers/media/video/ivtv/ivtv-irq.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/linux/drivers/media/video/ivtv/ivtv-irq.c b/linux/drivers/media/video/ivtv/ivtv-irq.c
index f7bcdf74c..32ceedf07 100644
--- a/linux/drivers/media/video/ivtv/ivtv-irq.c
+++ b/linux/drivers/media/video/ivtv/ivtv-irq.c
@@ -220,6 +220,7 @@ static int stream_enc_dma_append(struct ivtv_stream *s, u32 data[CX2341X_MBOX_MA
s->SGarray[idx].src = cpu_to_le32(offset);
s->SGarray[idx].size = cpu_to_le32(s->buf_size);
buf->bytesused = (size < s->buf_size) ? size : s->buf_size;
+ buf->dma_xfer_cnt = s->dma_xfer_cnt;
s->q_predma.bytesused += buf->bytesused;
size -= buf->bytesused;
@@ -292,7 +293,7 @@ static void dma_post(struct ivtv_stream *s)
/* flag byteswap ABCD -> DCBA for MPG & VBI data outside irq */
if (s->type == IVTV_ENC_STREAM_TYPE_MPG ||
s->type == IVTV_ENC_STREAM_TYPE_VBI)
- set_bit(IVTV_F_B_NEED_BUF_SWAP, &buf->b_flags);
+ buf->b_flags |= IVTV_F_B_NEED_BUF_SWAP;
}
if (buf)
buf->bytesused += s->dma_last_offset;
@@ -402,12 +403,14 @@ static void ivtv_dma_enc_start(struct ivtv_stream *s)
}
itv->vbi.dma_offset = s_vbi->dma_offset;
s_vbi->SG_length = 0;
+ s_vbi->dma_xfer_cnt++;
set_bit(IVTV_F_S_DMA_HAS_VBI, &s->s_flags);
IVTV_DEBUG_HI_DMA("include DMA for %s\n", s->name);
}
/* Mark last buffer size for Interrupt flag */
s->SGarray[s->SG_length - 1].size |= cpu_to_le32(0x80000000);
+ s->dma_xfer_cnt++;
if (s->type == IVTV_ENC_STREAM_TYPE_VBI)
set_bit(IVTV_F_I_ENC_VBI, &itv->i_flags);