aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-driver.h
diff options
context:
space:
mode:
authorAndy Walls <awalls@radix.net>2009-04-15 19:45:10 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-16 17:20:44 -0400
commit21a278b85d3c6b8064af0c03aec3205e28aad3b7 (patch)
treeefa0ee9cdfc303b03faf5b080b7f5721cf13c765 /drivers/media/video/cx18/cx18-driver.h
parent40c5520f55924ba87090d0d93222baad74202559 (diff)
V4L/DVB (11619): cx18: Simplify the work handler for outgoing mailbox commands
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. 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-driver.h')
-rw-r--r--drivers/media/video/cx18/cx18-driver.h30
1 files changed, 2 insertions, 28 deletions
diff --git a/drivers/media/video/cx18/cx18-driver.h b/drivers/media/video/cx18/cx18-driver.h
index 35a6758a7aac..f89b82367963 100644
--- a/drivers/media/video/cx18/cx18-driver.h
+++ b/drivers/media/video/cx18/cx18-driver.h
@@ -326,33 +326,6 @@ struct cx18_in_work_order {
326 char *str; 326 char *str;
327}; 327};
328 328
329/*
330 * There are 2 types of deferrable tasks that send messages out to the firmware:
331 * 1. Sending individual buffers back to the firmware
332 * 2. Sending as many free buffers for a stream from q_free as we can to the fw
333 *
334 * The worst case scenario for multiple simultaneous streams is
335 * TS, YUV, PCM, VBI, MPEG, and IDX all going at once.
336 *
337 * We try to load the firmware queue with as many free buffers as possible,
338 * whenever we get a buffer back for a stream. For the TS we return the single
339 * buffer to the firmware at that time as well. For all other streams, we
340 * return single buffers to the firmware as the application drains them.
341 *
342 * 6 streams * 2 sets of orders * (1 single buf + 1 load fw from q_free)
343 * = 24 work orders should cover our needs, provided the applications read
344 * at a fairly steady rate. If apps don't, we fall back to non-deferred
345 * operation, when no cx18_out_work_orders are available for use.
346 */
347#define CX18_MAX_OUT_WORK_ORDERS (24)
348
349struct cx18_out_work_order {
350 struct work_struct work;
351 atomic_t pending;
352 struct cx18_stream *s;
353 struct cx18_buffer *buf; /* buf == NULL, means load fw from q_free */
354};
355
356#define CX18_INVALID_TASK_HANDLE 0xffffffff 329#define CX18_INVALID_TASK_HANDLE 0xffffffff
357 330
358struct cx18_stream { 331struct cx18_stream {
@@ -381,6 +354,8 @@ struct cx18_stream {
381 struct cx18_queue q_busy; /* busy buffers - in use by firmware */ 354 struct cx18_queue q_busy; /* busy buffers - in use by firmware */
382 struct cx18_queue q_full; /* full buffers - data for user apps */ 355 struct cx18_queue q_full; /* full buffers - data for user apps */
383 356
357 struct work_struct out_work_order;
358
384 /* DVB / Digital Transport */ 359 /* DVB / Digital Transport */
385 struct cx18_dvb dvb; 360 struct cx18_dvb dvb;
386}; 361};
@@ -603,7 +578,6 @@ struct cx18 {
603 578
604 struct workqueue_struct *out_work_queue; 579 struct workqueue_struct *out_work_queue;
605 char out_workq_name[12]; /* "cx18-NN-out" */ 580 char out_workq_name[12]; /* "cx18-NN-out" */
606 struct cx18_out_work_order out_work_order[CX18_MAX_OUT_WORK_ORDERS];
607 581
608 /* i2c */ 582 /* i2c */
609 struct i2c_adapter i2c_adap[2]; 583 struct i2c_adapter i2c_adap[2];