41 #define TS_WIDTH (2 * TS_SIZE)
42 #define TS_WIDTH_ACTIVY TS_SIZE
43 #define TS_WIDTH_DVBC TS_SIZE
44 #define TS_HEIGHT_MASK 0xf00
45 #define TS_HEIGHT_MASK_ACTIVY 0xc00
46 #define TS_HEIGHT_MASK_DVBC 0xe00
47 #define TS_MIN_BUFSIZE_K 188
48 #define TS_MAX_BUFSIZE_K 1410
49 #define TS_MAX_BUFSIZE_K_ACTIVY 564
50 #define TS_MAX_BUFSIZE_K_DVBC 1316
51 #define BUFFER_WARNING_WAIT (30*HZ)
66 dprintk(2,
"budget: %p\n", budget);
77 dprintk(2,
"budget: %p\n", budget);
100 switch(budget->
card->type) {
166 struct budget *budget = (
struct budget *) fe->
dvb->priv;
181 start_ts_capture(budget);
183 stop_ts_capture(budget);
190 static void vpeirq(
unsigned long data)
192 struct budget *budget = (
struct budget *) data;
202 newdma -= newdma % 188;
207 budget->
ttbp = newdma;
209 if (budget->
feeding == 0 || newdma == olddma)
212 if (newdma > olddma) {
213 count = newdma - olddma;
226 printk(
"%s %s: used %d times >80%% of buffer (%u bytes now)\n",
235 int uselocks,
int nobusyloop)
239 unsigned long flags = 0;
241 if (count > 4 || count <= 0)
249 spin_unlock_irqrestore(&budget->
debilock, flags);
260 spin_unlock_irqrestore(&budget->
debilock, flags);
265 result &= (0xffffffff
UL >> ((4 -
count) * 8));
268 spin_unlock_irqrestore(&budget->
debilock, flags);
274 int count,
u32 value,
int uselocks,
int nobusyloop)
277 unsigned long flags = 0;
280 if (count > 4 || count <= 0)
288 spin_unlock_irqrestore(&budget->
debilock, flags);
300 spin_unlock_irqrestore(&budget->
debilock, flags);
305 spin_unlock_irqrestore(&budget->
debilock, flags);
317 struct budget *budget = (
struct budget *) demux->
priv;
320 dprintk(2,
"budget: %p\n", budget);
322 if (!demux->
dmx.frontend)
328 status = start_ts_capture(budget);
336 struct budget *budget = (
struct budget *) demux->
priv;
339 dprintk(2,
"budget: %p\n", budget);
343 status = stop_ts_capture(budget);
348 static int budget_register(
struct budget *budget)
353 dprintk(2,
"budget: %p\n", budget);
355 dvbdemux->
priv = (
void *) budget;
368 budget->
dmxdev.filternum = 256;
370 budget->
dmxdev.capabilities = 0;
395 static void budget_unregister(
struct budget *budget)
399 dprintk(2,
"budget: %p\n", budget);
403 dvbdemux->
dmx.close(&dvbdemux->
dmx);
420 memset(budget, 0,
sizeof(
struct budget));
422 dprintk(2,
"dev: %p, budget: %p\n", dev, budget);
427 switch(budget->
card->type) {
454 else if (dma_buffer_size > max_bufsize)
455 dma_buffer_size = max_bufsize;
470 dprintk(2,
"%s: buffer type = %s, width = %d, height = %d\n",
477 owner, &budget->
dev->pci->dev, adapter_nums);
507 goto err_dvb_unregister;
528 if ((ret = budget_register(budget)) == 0)
547 budget->
dvb_frontend->ops.read_status = budget_read_fe_status;
555 dprintk(2,
"budget: %p\n", budget);
557 budget_unregister(budget);
572 struct budget *budget = (
struct budget *) dev->
ext_priv;
574 dprintk(8,
"dev: %p, budget: %p\n", dev, budget);
582 struct budget *budget = (
struct budget *) dev->
ext_priv;
587 stop_ts_capture(budget);
588 start_ts_capture(budget);