提交 66e1d378 编写于 作者: S Steven Toth 提交者: Mauro Carvalho Chehab

[media] saa7164: allow the number of encoder buffers to be user configurable

Signed-off-by: NSteven Toth <stoth@kernellabs.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 9230acaa
...@@ -49,9 +49,13 @@ unsigned int saa_debug; ...@@ -49,9 +49,13 @@ unsigned int saa_debug;
module_param_named(debug, saa_debug, int, 0644); module_param_named(debug, saa_debug, int, 0644);
MODULE_PARM_DESC(debug, "enable debug messages"); MODULE_PARM_DESC(debug, "enable debug messages");
unsigned int encoder_buffers = SAA7164_MAX_ENCODER_BUFFERS;
module_param(encoder_buffers, int, 0644);
MODULE_PARM_DESC(encoder_buffers, "Total buffers in read queue 16-512 def:64");
unsigned int waitsecs = 10; unsigned int waitsecs = 10;
module_param(waitsecs, int, 0644); module_param(waitsecs, int, 0644);
MODULE_PARM_DESC(debug, "timeout on firmware messages"); MODULE_PARM_DESC(waitsecs, "timeout on firmware messages");
static unsigned int card[] = {[0 ... (SAA7164_MAXBOARDS - 1)] = UNSET }; static unsigned int card[] = {[0 ... (SAA7164_MAXBOARDS - 1)] = UNSET };
module_param_array(card, int, NULL, 0444); module_param_array(card, int, NULL, 0444);
...@@ -59,7 +63,7 @@ MODULE_PARM_DESC(card, "card type"); ...@@ -59,7 +63,7 @@ MODULE_PARM_DESC(card, "card type");
unsigned int print_histogram = 64; unsigned int print_histogram = 64;
module_param(print_histogram, int, 0644); module_param(print_histogram, int, 0644);
MODULE_PARM_DESC(debug, "print histogram values once"); MODULE_PARM_DESC(print_histogram, "print histogram values once");
static unsigned int saa7164_devcount; static unsigned int saa7164_devcount;
...@@ -264,7 +268,7 @@ static void saa7164_work_enchandler(struct work_struct *w) ...@@ -264,7 +268,7 @@ static void saa7164_work_enchandler(struct work_struct *w)
wake_up_interruptible(&port->wait_read); wake_up_interruptible(&port->wait_read);
} else } else
printk(KERN_ERR "encirq no free buffers\n"); printk(KERN_ERR "encirq no free buffers, increase param encoder_buffers\n");
/* Ensure offset into buffer remains 0, fill buffer /* Ensure offset into buffer remains 0, fill buffer
* with known bad data. */ * with known bad data. */
......
...@@ -1316,7 +1316,12 @@ int saa7164_encoder_register(struct saa7164_port *port) ...@@ -1316,7 +1316,12 @@ int saa7164_encoder_register(struct saa7164_port *port)
len = port->hw_streamingparams.numberoflines * len = port->hw_streamingparams.numberoflines *
port->hw_streamingparams.pitch; port->hw_streamingparams.pitch;
for (i = 0; i < SAA7164_MAX_ENCODER_BUFFERS; i++) { if (encoder_buffers < 16)
encoder_buffers = 16;
if (encoder_buffers > 512)
encoder_buffers = 512;
for (i = 0; i < encoder_buffers; i++) {
ubuf = saa7164_buffer_alloc_user(dev, len); ubuf = saa7164_buffer_alloc_user(dev, len);
if (ubuf) { if (ubuf) {
......
...@@ -85,7 +85,7 @@ ...@@ -85,7 +85,7 @@
#define SAA7164_MAX_UNITS 8 #define SAA7164_MAX_UNITS 8
#define SAA7164_TS_NUMBER_OF_LINES 312 #define SAA7164_TS_NUMBER_OF_LINES 312
#define SAA7164_PT_ENTRIES 16 /* (312 * 188) / 4096 */ #define SAA7164_PT_ENTRIES 16 /* (312 * 188) / 4096 */
#define SAA7164_MAX_ENCODER_BUFFERS 16 #define SAA7164_MAX_ENCODER_BUFFERS 64 /* max 5secs of latency at 6Mbps */
/* Port related defines */ /* Port related defines */
#define SAA7164_PORT_TS1 (0) #define SAA7164_PORT_TS1 (0)
...@@ -433,6 +433,7 @@ struct saa7164_dev { ...@@ -433,6 +433,7 @@ struct saa7164_dev {
extern struct list_head saa7164_devlist; extern struct list_head saa7164_devlist;
extern unsigned int waitsecs; extern unsigned int waitsecs;
extern unsigned int encoder_buffers;
/* ----------------------------------------------------------- */ /* ----------------------------------------------------------- */
/* saa7164-core.c */ /* saa7164-core.c */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册