"Anduin Withers" <[EMAIL PROTECTED]> writes:

> > What was the point of adding the "simpler"
> > mode in the first place btw.?
> 
> I didn't make that change and didn't follow the discussion. It was added in 
> ~0.1.10, prior to that most ivtv cards had worked just fine with "simple". 

Ah, ok, so it might be that "opmode=1 works" report doesn't apply to
all ivtv-supported cards, right?

> > > (as done everywhere,
> > 
> > No, bttv doesn't.
> 
> By everywhere I was thinking mostly about ivtv, but sure, lets talk about
> bttv.

At least keep in mind that ivtv isn't the only msp3400 user ...

> I count 18 drivers that initilize to zero (or otherwise don't expect a zero
> state). There are seven (including msp3400) that don't. Only two of those
> seven don't mention you somewhere in the source (tda7432.c and stradis.c)
> (not that that is the only measure of what was actually looked at and
> copied).

Just counting them is bogous.  Note that there is a important
difference between the v4l drivers (bttv, iviv, ...) and the i2c
helpers (msp3400, tvaudio, tuner, ...).  The i2c helper modules are
never ever called directly from userspace, those calls always go
indirectly through the v4l driver.

What bttv usually does on ioctls is this:
  (a) clear the struct.
  (b) fill in the data it knows.
  (c) pass the struct down do the i2c helpers
      to let them fill in additional stuff.
  (d) return to the application.

I think ivtv should handle it the same way, otherwise we'll run into
problems when sharing the msp3400 code.

> I'm not arguing it isn't good (or even necessary) to initilize before
> calling, just that there seems to be little reason not to either initilize
> the struct when the ioctl is called or at least assume it isn't zero.

The i2c helpers modules must not clear the structs.  That would kill
any data filled by the v4l driver in step (b).  Thats why some drivers
clear the structs and some don't.  And at least bttv must do (a) and
(b) itself.  Moving (a)+(b) into the msp3400 module isn't an option as
not all bt878 cards have a msp3400 chip.

I hope the issues here are a bit more clear now ...

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
ivtv-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ivtv-devel

Reply via email to