aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/cx18/cx18-mailbox.c
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-04-13 23:08:00 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-16 18:20:44 -0300
commit40c5520f55924ba87090d0d93222baad74202559 (patch)
tree731576eb5bb3c37df60c8cc78adbfc4d18bc0dd4 /drivers/media/video/cx18/cx18-mailbox.c
parent5f0a3cfcfd315d87de8f80af49b114daf7137823 (diff)
V4L/DVB (11618): cx18: Convert per stream mutex locks to per queue spin locks
To avoid sleeps in providing buffers to user space and in handling incoming buffers from the capture unit, converted the per stream mutex for locking queues to 3 spin locks. There is now a spin lock per queue to increase concurrency when moving buffers around. Also simplified queue manipulations and buffer handling of incoming buffers of data from the capture unit. 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-mailbox.c')
-rw-r--r--drivers/media/video/cx18/cx18-mailbox.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/media/video/cx18/cx18-mailbox.c b/drivers/media/video/cx18/cx18-mailbox.c
index df7d61d0a13..afe46c3d405 100644
--- a/drivers/media/video/cx18/cx18-mailbox.c
+++ b/drivers/media/video/cx18/cx18-mailbox.c
@@ -191,23 +191,24 @@ static void epu_dma_done(struct cx18 *cx, struct cx18_in_work_order *order)
if (buf == NULL) {
CX18_WARN("Could not find buf %d for stream %s\n",
id, s->name);
- /* Put as many buffers as possible back into fw use */
- cx18_stream_load_fw_queue(s);
continue;
}
- if (s->type == CX18_ENC_STREAM_TYPE_TS && s->dvb.enabled) {
- CX18_DEBUG_HI_DMA("TS recv bytesused = %d\n",
- buf->bytesused);
- dvb_dmx_swfilter(&s->dvb.demux, buf->buf,
- buf->bytesused);
+ CX18_DEBUG_HI_DMA("%s recv bytesused = %d\n",
+ s->name, buf->bytesused);
+
+ if (s->type != CX18_ENC_STREAM_TYPE_TS)
+ cx18_enqueue(s, buf, &s->q_full);
+ else {
+ if (s->dvb.enabled)
+ dvb_dmx_swfilter(&s->dvb.demux, buf->buf,
+ buf->bytesused);
+ cx18_enqueue(s, buf, &s->q_free);
}
- /* Put as many buffers as possible back into fw use */
- cx18_stream_load_fw_queue(s);
- /* Put back TS buffer, since it was removed from all queues */
- if (s->type == CX18_ENC_STREAM_TYPE_TS)
- cx18_stream_put_buf_fw(s, buf);
}
+ /* Put as many buffers as possible back into fw use */
+ cx18_stream_load_fw_queue(s);
+
wake_up(&cx->dma_waitq);
if (s->id != -1)
wake_up(&s->waitq);