diff options
author | Andy Walls <awalls@radix.net> | 2008-11-04 22:49:14 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-11-11 05:11:33 -0500 |
commit | 1d6782bda5c1fb2bca44af50647b45427d8ef4ec (patch) | |
tree | 11cc68f4410ca4850ff3d874900f628ed9326064 /drivers/media/video/cx18/cx18-dvb.c | |
parent | c9ff1b689a5d605640f098afc37d6102ecef9876 (diff) |
V4L/DVB (9516): cx18: Move DVB buffer transfer handling from irq handler to work_queue
cx18: Move DVB buffer transfer handling from irq handler to work_queue thread.
In order to properly lock the epu2cpu mailbox for driver to CX23418 commands,
the DVB/TS buffer handling needs to be moved from the IRQ handler and IRQ
context to a work queue. This work_queue implmentation is strikingly similar
to the ivtv implementation - for better or worse.
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-dvb.c')
-rw-r--r-- | drivers/media/video/cx18/cx18-dvb.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/media/video/cx18/cx18-dvb.c b/drivers/media/video/cx18/cx18-dvb.c index afc694e7bdb2..4542e2e5e3d7 100644 --- a/drivers/media/video/cx18/cx18-dvb.c +++ b/drivers/media/video/cx18/cx18-dvb.c | |||
@@ -23,6 +23,8 @@ | |||
23 | #include "cx18-dvb.h" | 23 | #include "cx18-dvb.h" |
24 | #include "cx18-io.h" | 24 | #include "cx18-io.h" |
25 | #include "cx18-streams.h" | 25 | #include "cx18-streams.h" |
26 | #include "cx18-queue.h" | ||
27 | #include "cx18-scb.h" | ||
26 | #include "cx18-cards.h" | 28 | #include "cx18-cards.h" |
27 | #include "s5h1409.h" | 29 | #include "s5h1409.h" |
28 | #include "mxl5005s.h" | 30 | #include "mxl5005s.h" |
@@ -300,3 +302,24 @@ static int dvb_register(struct cx18_stream *stream) | |||
300 | 302 | ||
301 | return ret; | 303 | return ret; |
302 | } | 304 | } |
305 | |||
306 | void cx18_dvb_work_handler(struct cx18 *cx) | ||
307 | { | ||
308 | struct cx18_buffer *buf; | ||
309 | struct cx18_stream *s = &cx->streams[CX18_ENC_STREAM_TYPE_TS]; | ||
310 | |||
311 | while ((buf = cx18_dequeue(s, &s->q_full)) != NULL) { | ||
312 | if (s->dvb.enabled) | ||
313 | dvb_dmx_swfilter(&s->dvb.demux, buf->buf, | ||
314 | buf->bytesused); | ||
315 | |||
316 | cx18_enqueue(s, buf, &s->q_free); | ||
317 | cx18_buf_sync_for_device(s, buf); | ||
318 | if (s->handle == CX18_INVALID_TASK_HANDLE) /* FIXME: improve */ | ||
319 | continue; | ||
320 | |||
321 | cx18_vapi(cx, CX18_CPU_DE_SET_MDL, 5, s->handle, | ||
322 | (void __iomem *)&cx->scb->cpu_mdl[buf->id] - cx->enc_mem, | ||
323 | 1, buf->id, s->buf_size); | ||
324 | } | ||
325 | } | ||