summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx18/cx18-streams.h
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-04-15 19:45:10 -0400
committerAndy Walls <awalls@radix.net>2009-04-15 19:45:10 -0400
commitaa8de0afdd1a794bcd8f80c83ca7710c0050894a (patch)
tree9ab215017cf3ed0bc8155c2c9df2d83954dc8713 /linux/drivers/media/video/cx18/cx18-streams.h
parent4898ebd32abf45917d84356171f9b18e52d58697 (diff)
downloadmediapointer-dvb-s2-aa8de0afdd1a794bcd8f80c83ca7710c0050894a.tar.gz
mediapointer-dvb-s2-aa8de0afdd1a794bcd8f80c83ca7710c0050894a.tar.bz2
cx18: Simplify the work handler for outgoing mailbox commands
From: Andy Walls <awalls@radix.net> Simplify the way outgoing work handler gets scheduled to send empty buffers back to the firmware for use. Also reduced the memory required for scheduling this outgoing work, by using a single, per stream work object. Priority: normal Signed-off-by: Andy Walls <awalls@radix.net>
Diffstat (limited to 'linux/drivers/media/video/cx18/cx18-streams.h')
-rw-r--r--linux/drivers/media/video/cx18/cx18-streams.h17
1 files changed, 14 insertions, 3 deletions
diff --git a/linux/drivers/media/video/cx18/cx18-streams.h b/linux/drivers/media/video/cx18/cx18-streams.h
index c0801d51d..b51a014b5 100644
--- a/linux/drivers/media/video/cx18/cx18-streams.h
+++ b/linux/drivers/media/video/cx18/cx18-streams.h
@@ -29,9 +29,20 @@ int cx18_streams_register(struct cx18 *cx);
void cx18_streams_cleanup(struct cx18 *cx, int unregister);
/* Related to submission of buffers to firmware */
-void cx18_stream_load_fw_queue(struct cx18_stream *s);
-struct cx18_queue *cx18_stream_put_buf_fw(struct cx18_stream *s,
- struct cx18_buffer *buf);
+static inline void cx18_stream_load_fw_queue(struct cx18_stream *s)
+{
+ struct cx18 *cx = s->cx;
+ queue_work(cx->out_work_queue, &s->out_work_order);
+}
+
+static inline void cx18_stream_put_buf_fw(struct cx18_stream *s,
+ struct cx18_buffer *buf)
+{
+ /* Put buf on q_free; the out work handler will move buf(s) to q_busy */
+ cx18_enqueue(s, buf, &s->q_free);
+ cx18_stream_load_fw_queue(s);
+}
+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
void cx18_out_work_handler(struct work_struct *work);
#else