summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx18/cx18-driver.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-driver.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-driver.h')
-rw-r--r--linux/drivers/media/video/cx18/cx18-driver.h30
1 files changed, 2 insertions, 28 deletions
diff --git a/linux/drivers/media/video/cx18/cx18-driver.h b/linux/drivers/media/video/cx18/cx18-driver.h
index 35a6758a7..f89b82367 100644
--- a/linux/drivers/media/video/cx18/cx18-driver.h
+++ b/linux/drivers/media/video/cx18/cx18-driver.h
@@ -326,33 +326,6 @@ struct cx18_in_work_order {
char *str;
};
-/*
- * There are 2 types of deferrable tasks that send messages out to the firmware:
- * 1. Sending individual buffers back to the firmware
- * 2. Sending as many free buffers for a stream from q_free as we can to the fw
- *
- * The worst case scenario for multiple simultaneous streams is
- * TS, YUV, PCM, VBI, MPEG, and IDX all going at once.
- *
- * We try to load the firmware queue with as many free buffers as possible,
- * whenever we get a buffer back for a stream. For the TS we return the single
- * buffer to the firmware at that time as well. For all other streams, we
- * return single buffers to the firmware as the application drains them.
- *
- * 6 streams * 2 sets of orders * (1 single buf + 1 load fw from q_free)
- * = 24 work orders should cover our needs, provided the applications read
- * at a fairly steady rate. If apps don't, we fall back to non-deferred
- * operation, when no cx18_out_work_orders are available for use.
- */
-#define CX18_MAX_OUT_WORK_ORDERS (24)
-
-struct cx18_out_work_order {
- struct work_struct work;
- atomic_t pending;
- struct cx18_stream *s;
- struct cx18_buffer *buf; /* buf == NULL, means load fw from q_free */
-};
-
#define CX18_INVALID_TASK_HANDLE 0xffffffff
struct cx18_stream {
@@ -381,6 +354,8 @@ struct cx18_stream {
struct cx18_queue q_busy; /* busy buffers - in use by firmware */
struct cx18_queue q_full; /* full buffers - data for user apps */
+ struct work_struct out_work_order;
+
/* DVB / Digital Transport */
struct cx18_dvb dvb;
};
@@ -603,7 +578,6 @@ struct cx18 {
struct workqueue_struct *out_work_queue;
char out_workq_name[12]; /* "cx18-NN-out" */
- struct cx18_out_work_order out_work_order[CX18_MAX_OUT_WORK_ORDERS];
/* i2c */
struct i2c_adapter i2c_adap[2];