* BTTV - experimental no_overlay patch
@ 2005-08-03 3:40 Mauro Carvalho Chehab
2005-08-03 6:06 ` Pavel Machek
0 siblings, 1 reply; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2005-08-03 3:40 UTC (permalink / raw)
To: Andrew Burgess; +Cc: LKML, Linux and Kernel Video
[-- Attachment #1: Type: text/plain, Size: 714 bytes --]
Bodo/Andrew,
This small patch will allow no_overlay flag to disable BTTV driver to
report OVERLAY capabilities. It should fix your troubles by enabling
no_overlay=1 when inserting bttv module.
This patch is against our CVS tree, but should apply with some hunk on
2.6.13-rc4 or 2.6.13-rc5.
I'll generate a new one at morning, against 2.6.13-rc5 hopefully to
have it applied at 2.6.13, since it fixes an OOPS.
-----
This patch does implement no_overlay=1 insmod option support, so,
computers with PCI2PCI transfer problems should not feel more OOPS when
using bttv cards, by disabling overlay.
Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
[-- Attachment #2: v4l_bttv_no_overlay.diff --]
[-- Type: text/x-patch, Size: 3065 bytes --]
Index: bttv-driver.c
===================================================================
RCS file: /cvs/video4linux/video4linux/bttv-driver.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -p -r1.47 -r1.48
--- bttv-driver.c 30 Jul 2005 19:47:02 -0000 1.47
+++ bttv-driver.c 3 Aug 2005 03:23:41 -0000 1.48
@@ -1,5 +1,5 @@
/*
- $Id: bttv-driver.c,v 1.47 2005/07/30 19:47:02 mkrufky Exp $
+ $Id: bttv-driver.c,v 1.48 2005/08/03 03:23:41 mchehab Exp $
bttv - Bt848 frame grabber driver
@@ -80,6 +80,7 @@ static unsigned int irq_iswitch = 0;
static unsigned int uv_ratio = 50;
static unsigned int full_luma_range = 0;
static unsigned int coring = 0;
+extern unsigned int no_overlay;
/* API features (turn on/off stuff for testing) */
static unsigned int v4l2 = 1;
@@ -2170,6 +2171,9 @@ static int bttv_s_fmt(struct bttv_fh *fh
return 0;
}
case V4L2_BUF_TYPE_VIDEO_OVERLAY:
+ printk ("V4L2_BUF_TYPE_VIDEO_OVERLAY called. no_overlay=%d\n",no_overlay);
+ if (no_overlay)
+ return -EINVAL;
return setup_window(fh, btv, &f->fmt.win, 1);
case V4L2_BUF_TYPE_VBI_CAPTURE:
retval = bttv_switch_type(fh,f->type);
@@ -2243,9 +2247,11 @@ static int bttv_do_ioctl(struct inode *i
/* others */
cap->type = VID_TYPE_CAPTURE|
VID_TYPE_TUNER|
- VID_TYPE_OVERLAY|
VID_TYPE_CLIPPING|
VID_TYPE_SCALES;
+ if (!no_overlay)
+ cap->type |= VID_TYPE_OVERLAY;
+
cap->maxwidth = bttv_tvnorms[btv->tvnorm].swidth;
cap->maxheight = bttv_tvnorms[btv->tvnorm].sheight;
cap->minwidth = 48;
@@ -2321,6 +2327,10 @@ static int bttv_do_ioctl(struct inode *i
struct video_window *win = arg;
struct v4l2_window w2;
+ printk ("VIDIOCSWIN called. no_overlay=%d\n",no_overlay);
+ if (no_overlay)
+ return -EINVAL;
+
w2.field = V4L2_FIELD_ANY;
w2.w.left = win->x;
w2.w.top = win->y;
@@ -2596,10 +2606,12 @@ static int bttv_do_ioctl(struct inode *i
cap->version = BTTV_VERSION_CODE;
cap->capabilities =
V4L2_CAP_VIDEO_CAPTURE |
- V4L2_CAP_VIDEO_OVERLAY |
V4L2_CAP_VBI_CAPTURE |
V4L2_CAP_READWRITE |
V4L2_CAP_STREAMING;
+ if (!no_overlay)
+ cap->capabilities |= V4L2_CAP_VIDEO_OVERLAY;
+
if (bttv_tvcards[btv->c.type].tuner != UNSET &&
bttv_tvcards[btv->c.type].tuner != TUNER_ABSENT)
cap->capabilities |= V4L2_CAP_TUNER;
@@ -3095,7 +3107,7 @@ static struct file_operations bttv_fops
static struct video_device bttv_video_template =
{
.name = "UNSET",
- .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_OVERLAY|
+ .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|
VID_TYPE_CLIPPING|VID_TYPE_SCALES,
.hardware = VID_HARDWARE_BT848,
.fops = &bttv_fops,
@@ -3779,6 +3791,9 @@ static void bttv_unregister_video(struct
/* register video4linux devices */
static int __devinit bttv_register_video(struct bttv *btv)
{
+ if (!no_overlay)
+ bttv_video_template.type |= VID_TYPE_OVERLAY;
+
/* video */
btv->video_dev = vdev_init(btv, &bttv_video_template, "video");
if (NULL == btv->video_dev)
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: BTTV - experimental no_overlay patch
2005-08-03 3:40 BTTV - experimental no_overlay patch Mauro Carvalho Chehab
@ 2005-08-03 6:06 ` Pavel Machek
2005-08-03 12:29 ` Mauro Carvalho Chehab
0 siblings, 1 reply; 5+ messages in thread
From: Pavel Machek @ 2005-08-03 6:06 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: Andrew Burgess, LKML, Linux and Kernel Video
Hi!
> This small patch will allow no_overlay flag to disable BTTV driver to
> report OVERLAY capabilities. It should fix your troubles by enabling
> no_overlay=1 when inserting bttv module.
>
> This patch is against our CVS tree, but should apply with some hunk on
> 2.6.13-rc4 or 2.6.13-rc5.
>
> I'll generate a new one at morning, against 2.6.13-rc5 hopefully to
> have it applied at 2.6.13, since it fixes an OOPS.
You have to pass option for it not to oops? That does not seem
right....
Pavel
--
teflon -- maybe it is a trademark, but it should not be.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: BTTV - experimental no_overlay patch
2005-08-03 6:06 ` Pavel Machek
@ 2005-08-03 12:29 ` Mauro Carvalho Chehab
0 siblings, 0 replies; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2005-08-03 12:29 UTC (permalink / raw)
To: Pavel Machek; +Cc: Andrew Burgess, LKML, Linux and Kernel Video
Pavel,
Em Qua, 2005-08-03 às 08:06 +0200, Pavel Machek escreveu:
> Hi!
>
> > This small patch will allow no_overlay flag to disable BTTV driver to
> > report OVERLAY capabilities. It should fix your troubles by enabling
> > no_overlay=1 when inserting bttv module.
> >
> > This patch is against our CVS tree, but should apply with some hunk on
> > 2.6.13-rc4 or 2.6.13-rc5.
> >
> > I'll generate a new one at morning, against 2.6.13-rc5 hopefully to
> > have it applied at 2.6.13, since it fixes an OOPS.
>
> You have to pass option for it not to oops? That does not seem
> right....
This OOPS is caused by bad implementation of PCI2PCI data transfers
(hardware related). It is not related to V4L.
In fact, bttv code uses also a blacklist from PCI code, activating
no_overlay option on bad chipsets:
void __devinit bttv_check_chipset(void)
{
int pcipci_fail = 0;
struct pci_dev *dev = NULL;
if (pci_pci_problems & PCIPCI_FAIL)
pcipci_fail = 1;
...
if (pcipci_fail) {
printk(KERN_WARNING "bttv: BT848 and your chipset may
not work together.\n");
if (!no_overlay) {
printk(KERN_WARNING "bttv: going to disable
overlay.\n");
no_overlay = 1;
}
}
I don't know for sure if these new chipsets are at PCI fail blacklist.
After Bodo and Andrew Burgess made these tests, we may submit some info
to PCI guys for them to add the chipsets to PCI blacklist, by setting
PCIPCI_FAIL flag at pcipci_fail global var.
Mauro.
^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <4xiqy-2F3-5@gated-at.bofh.it>]
* Re: BTTV - experimental no_overlay patch
[not found] <4xiqy-2F3-5@gated-at.bofh.it>
@ 2005-08-03 23:02 ` Bodo Eggert
2005-08-04 0:06 ` Mauro Carvalho Chehab
0 siblings, 1 reply; 5+ messages in thread
From: Bodo Eggert @ 2005-08-03 23:02 UTC (permalink / raw)
To: Mauro Carvalho Chehab, Andrew Burgess, LKML,
Linux and Kernel Video
Mauro Carvalho Chehab <mchehab@brturbo.com.br> wrote:
> This small patch will allow no_overlay flag to disable BTTV driver to
> report OVERLAY capabilities. It should fix your troubles by enabling
> no_overlay=1 when inserting bttv module.
>
> This patch is against our CVS tree, but should apply with some hunk on
> 2.6.13-rc4 or 2.6.13-rc5.
>
> I'll generate a new one at morning, against 2.6.13-rc5 hopefully to
> have it applied at 2.6.13, since it fixes an OOPS.
The CVS line will off cause not apply, and I needed to change
s/static// int no_overlay in bttv-cards.c.
The picture is less distorted by pci activity with no_overlay=1, and it
feels like the stable interface I used with my nvidia+2.4+XF86 before
upgrading to 2.6+radeon+X.org. No OOPS within the first few minutes:).
--
Ich danke GMX dafür, die Verwendung meiner Adressen mittels per SPF
verbreiteten Lügen zu sabotieren.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: BTTV - experimental no_overlay patch
2005-08-03 23:02 ` Bodo Eggert
@ 2005-08-04 0:06 ` Mauro Carvalho Chehab
0 siblings, 0 replies; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2005-08-04 0:06 UTC (permalink / raw)
To: 7eggert; +Cc: Andrew Burgess, LKML, Linux and Kernel Video
Bodo,
Please, send me bttv init logs. I need to know if PCI quirks has
detected your PCI chipset as a problematic one.
Em Qui, 2005-08-04 às 01:02 +0200, Bodo Eggert escreveu:
> Mauro Carvalho Chehab <mchehab@brturbo.com.br> wrote:
>
> > This small patch will allow no_overlay flag to disable BTTV driver to
> > report OVERLAY capabilities. It should fix your troubles by enabling
> > no_overlay=1 when inserting bttv module.
> >
> > This patch is against our CVS tree, but should apply with some hunk on
> > 2.6.13-rc4 or 2.6.13-rc5.
> >
> > I'll generate a new one at morning, against 2.6.13-rc5 hopefully to
> > have it applied at 2.6.13, since it fixes an OOPS.
>
> The CVS line will off cause not apply, and I needed to change
> s/static// int no_overlay in bttv-cards.c.
Strange. At CVS it worked even with static. But it should be ok.
>
> The picture is less distorted by pci activity with no_overlay=1, and it
> feels like the stable interface I used with my nvidia+2.4+XF86 before
> upgrading to 2.6+radeon+X.org. No OOPS within the first few minutes:).
That's good!
Mauro.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-08-04 0:12 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-03 3:40 BTTV - experimental no_overlay patch Mauro Carvalho Chehab
2005-08-03 6:06 ` Pavel Machek
2005-08-03 12:29 ` Mauro Carvalho Chehab
[not found] <4xiqy-2F3-5@gated-at.bofh.it>
2005-08-03 23:02 ` Bodo Eggert
2005-08-04 0:06 ` Mauro Carvalho Chehab
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox