diff options
author | Andy Walls <awalls@radix.net> | 2009-11-09 21:55:30 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-05 15:41:52 -0500 |
commit | 22dce188ef3e1e058ceabe3b3072640d7568f764 (patch) | |
tree | 6a5ee29e5b7cdf9125bea7456c8de75ab0861b92 /drivers/media/video/cx18/cx18-queue.c | |
parent | 52fcb3ecc6707f52dfe4297f96b7609d4ba517fb (diff) |
V4L/DVB (13430): cx18: Fix YUV capture so that encoder passes a single frame per transfer
Fix YUV capture such that the encoder will pass one frame per transfer. This
will allow the application to maintain frame alignment when a transfer from
the encoder is missed due to high system latency in service the CX23418 IRQ.
Also force YUV buffer sizes to be specified in multiples of 33.75 kB, the
smalled amount of buffer sizes need to store a complete set of HM12 4:2:0
macroblocks specifying 32 lines of the frame. A full 60Hz/525 line
screen requires 15 * 33.75 kB per frame and a full 50Hz/625 line screen
requires 18 * 33.75 kB per frame so the default buffer size is 3 * 33.75 kB,
requiring exactly 5 or 6 buffers per MDL respectively. The bytes needed per
frame and hence MDL need not be the bytes in an integer number of buffers.
However, if frame artifacts are seen with scaled screen sizes, the YUV buffer
size can be set 34 kB (33.75 kB) to get rid of the artifacts at the cost of more
copies between the kernel and userspace.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18/cx18-queue.c')
-rw-r--r-- | drivers/media/video/cx18/cx18-queue.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/media/video/cx18/cx18-queue.c b/drivers/media/video/cx18/cx18-queue.c index c1a49ecf9d98..98cbf001f8da 100644 --- a/drivers/media/video/cx18/cx18-queue.c +++ b/drivers/media/video/cx18/cx18-queue.c | |||
@@ -348,9 +348,11 @@ int cx18_stream_alloc(struct cx18_stream *s) | |||
348 | if (s->buffers == 0) | 348 | if (s->buffers == 0) |
349 | return 0; | 349 | return 0; |
350 | 350 | ||
351 | CX18_DEBUG_INFO("Allocate %s stream: %d x %d buffers (%dkB total)\n", | 351 | CX18_DEBUG_INFO("Allocate %s stream: %d x %d buffers " |
352 | "(%d.%02d kB total)\n", | ||
352 | s->name, s->buffers, s->buf_size, | 353 | s->name, s->buffers, s->buf_size, |
353 | s->buffers * s->buf_size / 1024); | 354 | s->buffers * s->buf_size / 1024, |
355 | (s->buffers * s->buf_size * 100 / 1024) % 100); | ||
354 | 356 | ||
355 | if (((char __iomem *)&cx->scb->cpu_mdl[cx->free_mdl_idx + s->buffers] - | 357 | if (((char __iomem *)&cx->scb->cpu_mdl[cx->free_mdl_idx + s->buffers] - |
356 | (char __iomem *)cx->scb) > SCB_RESERVED_SIZE) { | 358 | (char __iomem *)cx->scb) > SCB_RESERVED_SIZE) { |