From: Mauro Carvalho Chehab <mchehab@infradead.org>
To: Adrian Bunk <bunk@stusta.de>
Cc: linux-dvb-maintainer@linuxtv.org, linux-kernel@vger.kernel.org
Subject: Re: [v4l-dvb-maintainer] Re: [PATCH 05/21] Added no_overlay option and quirks to saa7134
Date: Fri, 17 Mar 2006 21:04:22 -0300 [thread overview]
Message-ID: <1142640262.4630.20.camel@praia> (raw)
In-Reply-To: <20060317232457.GB9717@stusta.de>
[-- Attachment #1: Type: text/plain, Size: 1184 bytes --]
Adrian,
Argh! I just forgot to add the important part of the patch! I'm
enclosing it. Please, test. I'll add to both devel and master branch of
v4l-dvb.git tree.
Cheers,
Mauro.
Em Sáb, 2006-03-18 às 00:24 +0100, Adrian Bunk escreveu:
> On Fri, Mar 17, 2006 at 05:54:34PM -0300, mchehab@infradead.org wrote:
> >
> > From: Mauro Carvalho Chehab <mchehab@infradead.org>
> > Date: 1142020010 \-0300
> >
> > Some chipsets have several problems when pci to pci transfers are activated
> > on overlay mode. the option no_overlay allows disabling such feature of
> > the driver, in favor of keeping the system stable.
> > The default is to use pcipci_fail flag defined on drivers/pci/quirks.c.
> > It also allows the user to override it by forcing disable overlay or forcing
> > enable. Forcing enable may generate PCI transfer corruption, including disk
> > mass corruption, so should be used with care.
> > Added a text description to this option and make messages looks the same at
> > both bttv and saa7134 drivers.
> >...
>
> As far as I can see, the the no_overlay option in the saa7134 driver
> doesn't change anything (except for a printk).
>
> cu
> Adrian
>
Cheers,
Mauro.
[-- Attachment #2: no_overlay_fix.patch --]
[-- Type: text/x-patch, Size: 5767 bytes --]
diff-tree fc33159b01f433f26a72c871ce76d85a45ec9c16 (from 59002b58a7773888479ad6704a96c2a645b83dc6)
Author: Mauro Carvalho Chehab <mchehab@infradead.org>
Date: Fri Mar 17 20:54:32 2006 -0300
V4L/DVB (3545): Fixed no_overlay option and quirks on saa7134 driver
Some chipsets have several problems when pci to pci transfers are activated
on overlay mode. the option no_overlay allows disabling such feature of
the driver, in favor of keeping the system stable.
The default is to use pcipci_fail flag defined on drivers/pci/quirks.c.
It also allows the user to override it by forcing disable overlay or forcing
enable. Forcing enable may generate PCI transfer corruption, including disk
mass corruption, so should be used with care.
Added a text description to this option and make messages looks the same at
both bttv and saa7134 drivers.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c
index 3203a80..15405d1 100644
--- a/drivers/media/video/saa7134/saa7134-core.c
+++ b/drivers/media/video/saa7134/saa7134-core.c
@@ -66,8 +66,8 @@ static unsigned int latency = UNSET;
module_param(latency, int, 0444);
MODULE_PARM_DESC(latency,"pci latency timer");
-static int no_overlay=-1;
-module_param(no_overlay, int, 0444);
+int saa7134_no_overlay=-1;
+module_param_named(no_overlay, saa7134_no_overlay, int, 0444);
MODULE_PARM_DESC(no_overlay,"allow override overlay default (0 disables, 1 enables)"
" [some VIA/SIS chipsets are known to have problem with overlay]");
@@ -843,11 +843,11 @@ static int __devinit saa7134_initdev(str
printk(KERN_INFO "%s: quirk: this driver and your "
"chipset may not work together"
" in overlay mode.\n",dev->name);
- if (!no_overlay) {
+ if (!saa7134_no_overlay) {
printk(KERN_INFO "%s: quirk: overlay "
"mode will be disabled.\n",
dev->name);
- no_overlay = 1;
+ saa7134_no_overlay = 1;
} else {
printk(KERN_INFO "%s: quirk: overlay "
"mode will be forced. Use this"
@@ -957,6 +957,11 @@ static int __devinit saa7134_initdev(str
v4l2_prio_init(&dev->prio);
/* register v4l devices */
+ if (saa7134_no_overlay <= 0) {
+ saa7134_video_template.type |= VID_TYPE_OVERLAY;
+ } else {
+ printk("bttv: Overlay support disabled.\n");
+ }
dev->video_dev = vdev_init(dev,&saa7134_video_template,"video");
err = video_register_device(dev->video_dev,VFL_TYPE_GRABBER,
video_nr[dev->nr]);
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c
index 2da382d..aeef80f 100644
--- a/drivers/media/video/saa7134/saa7134-video.c
+++ b/drivers/media/video/saa7134/saa7134-video.c
@@ -1461,6 +1461,10 @@ static int saa7134_g_fmt(struct saa7134_
f->fmt.pix.height * f->fmt.pix.bytesperline;
return 0;
case V4L2_BUF_TYPE_VIDEO_OVERLAY:
+ if (saa7134_no_overlay > 0) {
+ printk ("V4L2_BUF_TYPE_VIDEO_OVERLAY: no_overlay\n");
+ return -EINVAL;
+ }
f->fmt.win = fh->win;
return 0;
case V4L2_BUF_TYPE_VBI_CAPTURE:
@@ -1525,6 +1529,10 @@ static int saa7134_try_fmt(struct saa713
return 0;
}
case V4L2_BUF_TYPE_VIDEO_OVERLAY:
+ if (saa7134_no_overlay > 0) {
+ printk ("V4L2_BUF_TYPE_VIDEO_OVERLAY: no_overlay\n");
+ return -EINVAL;
+ }
err = verify_preview(dev,&f->fmt.win);
if (0 != err)
return err;
@@ -1555,6 +1563,10 @@ static int saa7134_s_fmt(struct saa7134_
fh->cap.field = f->fmt.pix.field;
return 0;
case V4L2_BUF_TYPE_VIDEO_OVERLAY:
+ if (saa7134_no_overlay > 0) {
+ printk ("V4L2_BUF_TYPE_VIDEO_OVERLAY: no_overlay\n");
+ return -EINVAL;
+ }
err = verify_preview(dev,&f->fmt.win);
if (0 != err)
return err;
@@ -1714,11 +1726,13 @@ static int video_do_ioctl(struct inode *
cap->version = SAA7134_VERSION_CODE;
cap->capabilities =
V4L2_CAP_VIDEO_CAPTURE |
- V4L2_CAP_VIDEO_OVERLAY |
V4L2_CAP_VBI_CAPTURE |
V4L2_CAP_READWRITE |
V4L2_CAP_STREAMING |
V4L2_CAP_TUNER;
+ if (saa7134_no_overlay <= 0) {
+ cap->capabilities |= V4L2_CAP_VIDEO_OVERLAY;
+ }
if ((tuner_type == TUNER_ABSENT) || (tuner_type == UNSET))
cap->capabilities &= ~V4L2_CAP_TUNER;
@@ -1969,6 +1983,10 @@ static int video_do_ioctl(struct inode *
switch (type) {
case V4L2_BUF_TYPE_VIDEO_CAPTURE:
case V4L2_BUF_TYPE_VIDEO_OVERLAY:
+ if (saa7134_no_overlay > 0) {
+ printk ("V4L2_BUF_TYPE_VIDEO_OVERLAY: no_overlay\n");
+ return -EINVAL;
+ }
if (index >= FORMATS)
return -EINVAL;
if (f->type == V4L2_BUF_TYPE_VIDEO_OVERLAY &&
@@ -2029,6 +2047,11 @@ static int video_do_ioctl(struct inode *
int *on = arg;
if (*on) {
+ if (saa7134_no_overlay > 0) {
+ printk ("no_overlay\n");
+ return -EINVAL;
+ }
+
if (!res_get(dev,fh,RESOURCE_OVERLAY))
return -EBUSY;
spin_lock_irqsave(&dev->slock,flags);
@@ -2280,7 +2303,7 @@ static struct file_operations radio_fops
struct video_device saa7134_video_template =
{
.name = "saa7134-video",
- .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|VID_TYPE_OVERLAY|
+ .type = VID_TYPE_CAPTURE|VID_TYPE_TUNER|
VID_TYPE_CLIPPING|VID_TYPE_SCALES,
.hardware = 0,
.fops = &video_fops,
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h
index c159428..28e6f0a 100644
--- a/drivers/media/video/saa7134/saa7134.h
+++ b/drivers/media/video/saa7134/saa7134.h
@@ -557,6 +557,7 @@ struct saa7134_dev {
/* saa7134-core.c */
extern struct list_head saa7134_devlist;
+extern int saa7134_no_overlay;
void saa7134_track_gpio(struct saa7134_dev *dev, char *msg);
next prev parent reply other threads:[~2006-03-18 0:04 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-17 20:53 [PATCH 00/21] V4L/DVB fixes mchehab
2006-03-17 20:54 ` [PATCH 01/21] Nskips maybe used uninitialized in bttv_risc_overlay mchehab
2006-03-17 20:54 ` [PATCH 04/21] Fix typo in enum name and use enum in struct dmxdev_filter mchehab
2006-03-17 20:54 ` [PATCH 02/21] Fix cx88 error messages on balance change mchehab
2006-03-17 20:54 ` [PATCH 03/21] Correct gpio values for Aver 303 Studio in v4l-dvb tree mchehab
2006-03-17 20:54 ` [PATCH 06/21] Cx88-cards.c: fix values of gpio0 for card CX88_BOARD_PROLINK_PLAYTVPVR mchehab
2006-03-17 20:54 ` [PATCH 07/21] Cx88-input.c: add IR remote control support to CX88_BOARD_PROLINK_PLAYTVPVR mchehab
2006-03-17 20:54 ` [PATCH 05/21] Added no_overlay option and quirks to saa7134 mchehab
2006-03-17 23:24 ` Adrian Bunk
2006-03-18 0:04 ` Mauro Carvalho Chehab [this message]
2006-03-17 20:54 ` [PATCH 08/21] Cx88 default picture controls values mchehab
2006-03-17 21:10 ` Lee Revell
2006-03-18 0:25 ` Mauro Carvalho Chehab
2006-03-17 20:54 ` [PATCH 10/21] BUG_ON() Conversion in drivers/video/media mchehab
2006-03-17 20:54 ` [PATCH 09/21] Cleanup mangled whitespace mchehab
2006-03-17 20:54 ` [PATCH 11/21] Snd_cx88_create: don't dereference NULL core mchehab
2006-03-17 20:54 ` [PATCH 14/21] Cinergy T2 dmx cleanup on disconnect mchehab
2006-03-17 20:54 ` [PATCH 13/21] Whitespace: fix incorrect indentation of curly bracket mchehab
2006-03-17 20:54 ` [PATCH 12/21] Kconfig: select VIDEO_CX25840 to build cx25840 a/v decoder module mchehab
2006-03-17 20:54 ` [PATCH 16/21] Kconfig: swap VIDEO_CX88_ALSA and VIDEO_CX88_DVB mchehab
2006-03-18 19:59 ` Michael Krufky
2006-03-18 20:15 ` [2.6.16 PATCH] " Michael Krufky
2006-03-17 20:54 ` [PATCH 17/21] Kconfig: fix ATSC frontend menu item names by manufacturer mchehab
2006-03-17 20:54 ` [PATCH 15/21] Restore tuning capabilities in v4l2 mxb driver mchehab
2006-03-17 20:54 ` [PATCH 20/21] VIDEO_CPIA2 must depend on USB mchehab
2006-03-17 20:54 ` [PATCH 18/21] Fix a bug when more than MAXBOARDS were plugged on em28xx mchehab
2006-03-17 20:54 ` [PATCH 19/21] Cpia2: move Kconfig build logic into cpia2/Kconfig mchehab
2006-03-17 20:54 ` [PATCH 21/21] Fixed em28xx based system lockup mchehab
2006-03-17 23:07 ` [PATCH 00/21] V4L/DVB fixes Linus Torvalds
2006-03-17 23:13 ` Mauro Carvalho Chehab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1142640262.4630.20.camel@praia \
--to=mchehab@infradead.org \
--cc=bunk@stusta.de \
--cc=linux-dvb-maintainer@linuxtv.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox