aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/ivtv/ivtv-irq.c
diff options
context:
space:
mode:
authorIan Armstrong <ian@iarmst.demon.co.uk>2007-10-16 02:21:46 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-01-25 16:03:09 -0500
commitc240ad00af78228726e6301ad6ffc54d3adce2a0 (patch)
tree5dbb5b9336a2ed515987f30f9618101a720caa56 /drivers/media/video/ivtv/ivtv-irq.c
parent9de982d3117a3f83e4e7b14016a1df25b4a693d6 (diff)
V4L/DVB (6712): ivtv: ivtv yuv stream handling change
Currently the yuv output stream buffer is divided into blocks whose size depend on the broadcast standard selected during the driver init phase. However, the standard can be changed after the init phase. This effectively breaks the yuv output stream handler, since it relies on the different yuv planes being block aligned. This patch changes the setup, so that the block size is always the same. The decoder dma function has been modified to cope with the fact that the second yuv plane may no longer be block aligned. The start of the yuv frame must still be at the beginning of a block, so the stream write function has also been modified to ensure this is always true. Also, the stream write function will now initiate a yuv dma transfer as soon as a full frame is ready. It will not wait until the current write request has completed, or the stream buffer becomes full. Signed-off-by: Ian Armstrong <ian@iarmst.demon.co.uk> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/ivtv/ivtv-irq.c')
-rw-r--r--drivers/media/video/ivtv/ivtv-irq.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/drivers/media/video/ivtv/ivtv-irq.c b/drivers/media/video/ivtv/ivtv-irq.c
index fd1688e4757d..bcf1c85991af 100644
--- a/drivers/media/video/ivtv/ivtv-irq.c
+++ b/drivers/media/video/ivtv/ivtv-irq.c
@@ -313,15 +313,28 @@ void ivtv_dma_stream_dec_prepare(struct ivtv_stream *s, u32 offset, int lock)
313 IVTV_DEBUG_HI_DMA("DEC PREPARE DMA %s: %08x %08x\n", s->name, s->q_predma.bytesused, offset); 313 IVTV_DEBUG_HI_DMA("DEC PREPARE DMA %s: %08x %08x\n", s->name, s->q_predma.bytesused, offset);
314 list_for_each_entry(buf, &s->q_predma.list, list) { 314 list_for_each_entry(buf, &s->q_predma.list, list) {
315 /* YUV UV Offset from Y Buffer */ 315 /* YUV UV Offset from Y Buffer */
316 if (s->type == IVTV_DEC_STREAM_TYPE_YUV && !y_done && bytes_written >= y_size) { 316 if (s->type == IVTV_DEC_STREAM_TYPE_YUV && !y_done &&
317 (bytes_written + buf->bytesused) >= y_size) {
318 s->sg_pending[idx].src = buf->dma_handle;
319 s->sg_pending[idx].dst = offset;
320 s->sg_pending[idx].size = y_size - bytes_written;
317 offset = uv_offset; 321 offset = uv_offset;
322 if (s->sg_pending[idx].size != buf->bytesused) {
323 idx++;
324 s->sg_pending[idx].src =
325 buf->dma_handle + s->sg_pending[idx - 1].size;
326 s->sg_pending[idx].dst = offset;
327 s->sg_pending[idx].size =
328 buf->bytesused - s->sg_pending[idx - 1].size;
329 offset += s->sg_pending[idx].size;
330 }
318 y_done = 1; 331 y_done = 1;
332 } else {
333 s->sg_pending[idx].src = buf->dma_handle;
334 s->sg_pending[idx].dst = offset;
335 s->sg_pending[idx].size = buf->bytesused;
336 offset += buf->bytesused;
319 } 337 }
320 s->sg_pending[idx].src = buf->dma_handle;
321 s->sg_pending[idx].dst = offset;
322 s->sg_pending[idx].size = buf->bytesused;
323
324 offset += buf->bytesused;
325 bytes_written += buf->bytesused; 338 bytes_written += buf->bytesused;
326 339
327 /* Sync SG buffers */ 340 /* Sync SG buffers */