[linux-dvb] Re: [v4l-dvb-maintainer] [RFC] V4L1 API removal proposal

Mauro Carvalho Chehab mchehab at infradead.org
Mon Apr 10 12:04:55 CEST 2006


Em Seg, 2006-04-10 às 10:29 +0200, Michael Hunold escreveu:
Hi, Michael,
> Hi Mauro,
> 
> On 10.04.2006 00:36 Mauro Carvalho Chehab said the following:
> > We should fix all obsolete V4L1 drivers to V4L2 API. This affects
> > several V4L drivers, and a few DVB drivers, based on SAA7146.
> 
> It would be nice to have a list of which drivers are affected and to
> what degree (ie. if only minor things need to be changed or if the whole
> driver is affected).
> 
> Could you try to create such a list?
In the case of saa7146, I have already a patch to the core, since the
only stuff used there is VIDEO_MODE_PAL and VIDEO_MODE_NTSC. But mxb.c
still use the old DECODER_* ioctl. Those should be replaced by
VIDIOC_INT_* as defined on v4l2-common.h. You may look saa7127.c, for
example, for an example on how to use it. Shouldn't be difficult. If you
have doubts, please ask at the list.

For et61x251_sensor.h,  sn9c102_sensor.h and zc0301_sensor.h, there are
some dependencies on videodev.h. I didn't go further to investigate, but
it seems also easy to solve.

Zoran 36067 and bttv driver implements both V4L1 and V4L2 at the core.
V4L1 should be removed and called  v4l_compat_translate_ioctl instead.

For BTTV, we had a patch in the past removing all old VIDIOCfoo stuff
and fixing corresponding stuff on other bttv files. This patch should be
reworked due to several changes at bttv and due to audio routing
patches.

For Zoran 36067, This would mean to fix all decoder modules that still
use DECODER_* and VIDEO_MODE_*.

For the other drivers, more work will be required, since they don't have
any V4L2 API support.

For those, I'm creating a new videodev2 struct, that will handle V4L2
ioctl parsing, calling several callbacks. This may be useful for the
conversion process. It is still unfinished.

A preview can be seen at http://linuxtv.org/hg/~mchehab/videodev2. I
intend to include also an easy way to use videobuf at the newer way, so
that the hardest part of the migration (memory allocation/handling) will
be handled by core, requiring almost no code at the drivers.

I expect to finish by the end of the week.

> 
> > If VIDEO_V4L1 is unselected, all drivers that use videodev.h or
> > video_decoder.h instead of videodev2.h are hidden, so, only good V4L2
> > drivers will be available.
> 
> For example, my MXB driver uses video_decoder.h to drive the saa7111
> video decoder. What changes are necessary here?
The best way is to use instead saa7115. It already supports
saa7113/7114/7115 chips and seem to be easy to make it work with saa7111
also. As an side effect, it can handle multiple video standards that
were broken like PAL/M, PAL/N, PAL/60 and NTSC/Jp.
> 
> IMO video_decoder can be dropped completely, because I know that the MXB
> has a saa7111 and I know which features are used.
> 
> Will there be a new dedicated saa7111 driver that understands v4l2
> ioctls then?
> 
> Or should I got and implement the few necessary i2c command sequences
> directly? (probably not)
Please don't implement directly. for saa7115 to work with saa7111, you
need to create a V4L2_IDENT_SAA7111 at v4l2-common, include the code at
saa7111 to detect it, based on chip_id, at saa7115_attach function, and
take a look on each test for V4L2_IDENT_foo. Also, you may need to
include saa7111 struct there, if saa7113 cannot fit well. Shoudn't take
much time.

Cheers, 
Mauro.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: saa7146-2.diff
Type: text/x-patch
Size: 4605 bytes
Desc: not available
Url : http://www.linuxtv.org/pipermail/linux-dvb/attachments/20060410/385d958e/saa7146-2.bin


More information about the linux-dvb mailing list