summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorGerd Knorr <devnull@localhost>2004-03-25 16:26:47 +0000
committerGerd Knorr <devnull@localhost>2004-03-25 16:26:47 +0000
commit7dd69143ef63543a133144bb54298e428291bcba (patch)
treebd107fc990b28cf6b6c834c540376347fc108753 /linux/drivers
parentd73c1199a74554504ef79713b38a3e66ab6a6798 (diff)
downloadmediapointer-dvb-s2-7dd69143ef63543a133144bb54298e428291bcba.tar.gz
mediapointer-dvb-s2-7dd69143ef63543a133144bb54298e428291bcba.tar.bz2
- minor vbi fix.
- add some latency debug code to the bttv irq handler (enable with debug_latency=1).
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/video/bttv-driver.c40
1 files changed, 28 insertions, 12 deletions
diff --git a/linux/drivers/media/video/bttv-driver.c b/linux/drivers/media/video/bttv-driver.c
index 39b1c3672..3712f827b 100644
--- a/linux/drivers/media/video/bttv-driver.c
+++ b/linux/drivers/media/video/bttv-driver.c
@@ -59,6 +59,7 @@ static unsigned int gbufsize = 0x208000;
static int video_nr = -1;
static int radio_nr = -1;
static int vbi_nr = -1;
+static int debug_latency = 0;
static unsigned int fdsr = 0;
@@ -98,6 +99,7 @@ MODULE_PARM_DESC(gbufsize,"size of the capture buffers, default is 0x208000");
MODULE_PARM(video_nr,"i");
MODULE_PARM(radio_nr,"i");
MODULE_PARM(vbi_nr,"i");
+MODULE_PARM(debug_latency,"i");
MODULE_PARM(fdsr,"i");
@@ -2177,13 +2179,13 @@ static int bttv_do_ioctl(struct inode *inode, struct file *file,
VID_TYPE_OVERLAY|
VID_TYPE_CLIPPING|
VID_TYPE_SCALES;
- cap->channels = bttv_tvcards[btv->c.type].video_inputs;
- cap->audios = bttv_tvcards[btv->c.type].audio_inputs;
cap->maxwidth = bttv_tvnorms[btv->tvnorm].swidth;
cap->maxheight = bttv_tvnorms[btv->tvnorm].sheight;
cap->minwidth = 48;
cap->minheight = 32;
}
+ cap->channels = bttv_tvcards[btv->c.type].video_inputs;
+ cap->audios = bttv_tvcards[btv->c.type].audio_inputs;
return 0;
}
@@ -3212,6 +3214,28 @@ static void bttv_print_riscaddr(struct bttv *btv)
btv->screen ? (unsigned long long)btv->screen->bottom.dma : 0);
}
+static void bttv_irq_debug_low_latency(struct bttv *btv, u32 rc)
+{
+ printk("bttv%d: irq: skipped frame [main=%lx,o_vbi=%lx,o_field=%lx,rc=%lx]\n",
+ btv->c.nr,
+ (unsigned long)btv->main.dma,
+ (unsigned long)btv->main.cpu[RISC_SLOT_O_VBI+1],
+ (unsigned long)btv->main.cpu[RISC_SLOT_O_FIELD+1],
+ (unsigned long)rc);
+
+ if (0 == (btread(BT848_DSTATUS) & BT848_DSTATUS_HLOC)) {
+ printk("bttv%d: Oh, there (temporarely?) is no input signal. "
+ "Ok, then this is harmless, don't worry ;)",
+ btv->c.nr);
+ return;
+ }
+ printk("bttv%d: Uhm. Looks like we have unusual high IRQ latencies.\n",
+ btv->c.nr);
+ printk("bttv%d: Lets try to catch the culpit red-handed ...\n",
+ btv->c.nr);
+ dump_stack();
+}
+
static int
bttv_irq_next_set(struct bttv *btv, struct bttv_buffer_set *set)
{
@@ -3401,16 +3425,8 @@ bttv_irq_switch_fields(struct bttv *btv)
rc = btread(BT848_RISC_COUNT);
if (rc < btv->main.dma || rc > btv->main.dma + 0x100) {
btv->framedrop++;
- if (irq_debug) {
- // TODO: dump_stack(); experiments
- printk("bttv%d: skipped frame. no signal? high irq latency? "
- "[main=%lx,o_vbi=%lx,o_field=%lx,rc=%lx]\n",
- btv->c.nr,
- (unsigned long)btv->main.dma,
- (unsigned long)btv->main.cpu[RISC_SLOT_O_VBI+1],
- (unsigned long)btv->main.cpu[RISC_SLOT_O_FIELD+1],
- (unsigned long)rc);
- }
+ if (debug_latency)
+ bttv_irq_debug_low_latency(btv, rc);
spin_unlock(&btv->s_lock);
return;
}