Re: [PATCH] V4L: adding digital video timings APIs

2009-11-16 Thread Hans Verkuil
On Monday 16 November 2009 19:35:40 Karicheri, Muralidharan wrote:
> 
> Hans,
> 
> >Hi Murali,
> >
> >What is the status of this? It would be great if we can get this in for
> >2.6.33.
> >
> 
> I am working on the documentation today and then the application. I think a
> new patch will be ready by tomorrow. I am not sure if there is a better way
> to add documentation.. Currently I have just editing the xml file manually.

That's what I do as well. I know that there are some xml editing programs
available, but I've no idea how well they work with this code.

Regards,

Hans

> 
> Regards,
> Murali
> >Regards,
> >
> > Hans
> >
> >--
> >Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom
> 
> 
> 
> 



-- 
Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


RE: [PATCH] V4L: adding digital video timings APIs

2009-11-16 Thread Karicheri, Muralidharan

Hans,

>Hi Murali,
>
>What is the status of this? It would be great if we can get this in for
>2.6.33.
>

I am working on the documentation today and then the application. I think a
new patch will be ready by tomorrow. I am not sure if there is a better way
to add documentation.. Currently I have just editing the xml file manually.

Regards,
Murali
>Regards,
>
>   Hans
>
>--
>Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


RE: [PATCH] V4L: adding digital video timings APIs

2009-11-13 Thread Karicheri, Muralidharan
Hi,

I have downloaded the tree for Documentation and Applications and started first 
building documentation.

make media-spec

It seems to build. What output it creates? Do I edit one of the xml file
to add the documentation? After adding the documentation, I guess I need
to build again and verify the document is added in proper format. I am
assuming that the build will create a html file which I can view for 
verification of content. Please reply so that I can save some time in this
process by not re-inventing the wheel.

Thanks.

Murali Karicheri
Software Design Engineer
Texas Instruments Inc.
Germantown, MD 20874
phone: 301-407-9583
email: m-kariche...@ti.com

>-Original Message-
>From: Hans Verkuil [mailto:hverk...@xs4all.nl]
>Sent: Wednesday, November 11, 2009 2:21 AM
>To: Karicheri, Muralidharan
>Cc: linux-me...@vger.kernel.org; davinci-linux-open-
>sou...@linux.davincidsp.com
>Subject: Re: [PATCH] V4L: adding digital video timings APIs
>
>On Thursday 05 November 2009 13:56:29 Hans Verkuil wrote:
>> On Friday 23 October 2009 22:44:34 Karicheri, Muralidharan wrote:
>> > Hans,
>> >
>> > >> following IOCTLS :-
>> > >>
>> > >>  -  verify the new v4l2_input capabilities flag added
>> > >>  -  Enumerate available presets using VIDIOC_ENUM_DV_PRESETS
>> > >>  -  Set one of the supported preset using VIDIOC_S_DV_PRESET
>> > >>  -  Get current preset using VIDIOC_G_DV_PRESET
>> > >>  -  Detect current preset using VIDIOC_QUERY_DV_PRESET
>> > >>  -  Using stub functions in tvp7002, verify VIDIOC_S_DV_TIMINGS
>> > >> and VIDIOC_G_DV_TIMINGS ioctls are received at the sub device.
>> > >>
>> > >> TODOs :
>> > >>
>> > >>  - Test it on a 64bit platform - I need help here since I don't have
>the
>> > >> platform.
>> > >>  - Add documentation (Can someone tell me which file to modify in
>the
>> > >> kernel tree?).
>> > >
>> > >Use the spec in media-spec/v4l.
>> >
>> > [MK] Where can I access this? Is this part of kernel tree (I couldn't
>find
>> > it under Documentation/video4linux/ under the kernel tree? Is it just
>updating a text file or I need to have some tool installed to access
>> > this documentation and update it.
>>
>> This has been moved around quite a bit lately. It is now in
>> linux/Documentation/DocBook/v4l. You build it using 'make media-spec'.
>>
>> > >Please also add support to v4l2-ctl.cpp in v4l2-apps/util! That's
>handy
>> > >for testing.
>> > [MK] Are you referring to the following repository for this?
>> >
>> > http://linuxtv.org/hg/~dougsland/tool/file/5b884b36bbab
>> >
>> > Is there a way I can do a git clone for this?
>>
>> Both the doc and the v4l2-ctl.cpp utility are in the master hg repository
>> (linuxtv.org/hg/v4l-dvb). The utility can be found here: v4l2-apps/util.
>> Build it using 'make apps'. The patches of the timings API, docs and
>utils
>> should all be done against the master hg tree since that is that latest
>and
>> greatest tree.
>>
>> >
>> > >
>> > >Setting the input/output capabilities should be done in v4l2-ioctl.c
>> > >rather than in the drivers. All the info you need to set these bits is
>> > >available in the core after all.
>> > >
>> >
>> > [MK] Could you explain this to me? In my prototype, I had tvp5146 that
>> > implements S_STD and tvp7002 that implements S_PRESET. Since bridge
>driver
>> > has all the knowledge about the sub devices and their capabilities, it
>can
>> > set the flag for each of the input that it supports (currently I am
>> > setting this flag in the board setup file that describes all the inputs
>using v4l2_input structure). So it is a matter of setting relevant cap flag
>in this file for each of the input based on what the sub device supports. I
>am not sure how core can figure this out?
>>
>> The problem is that we don't want to go through all drivers in order to
>set
>> the input/output capability flags. However, v4l2_ioctl.c can easily check
>> whether the v4l2_ioctl_ops struct has set vidioc_s_std,
>vidioc_s_dv_preset
>> and/or vidioc_s_dv_timings and fill in the caps accordingly. If this is
>done
>> before the vidioc_enum_input/output is called, then the driver can
>override
>> what v4l2_ioctl.c did if that is needed.
>>
>> >
>> > >I also noticed that not all new ioctls are part of video_ops. Aren't
>they
>> > >all required?
>> > >
>> > [MK] All new ioctls are supported in video_ops. I am not sure what you
>are
>> > referring to. For sub device ops, only few are required since bridge
>device
>> > can handle the rest.
>>
>> OK.
>>
>> Regards,
>>
>>  Hans
>>
>
>Hi Murali,
>
>What is the status of this? It would be great if we can get this in for
>2.6.33.
>
>Regards,
>
>   Hans
>
>--
>Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


RE: [PATCH] V4L: adding digital video timings APIs

2009-11-12 Thread Karicheri, Muralidharan
>
>Actually, the bridge driver only needs to override if it has multiple
>inputs
>where the capability flags differ (i.e. some inputs only support S_STD and
>others only support S_DV_PRESET).
>
>In all other cases the core will fill it in correctly.
>
>Doing it in the core ensures that the capability flags will be filled in so
>drivers don't need to remember doing this. The alternative is that you have
>to
>go through ALL existing drivers and add the new SUPPORTS_STD capability
>flag.
>

That is a good point to have it in the core. I will update the patch
and send it.

>But even then I am pretty certain that people will forget to set this flag
>for new upcoming drivers.
>
>So I prefer to have this set in the core and only drivers that have mixed
>inputs/outputs need to do a bit more work.
>
>Regards,
>
>   Hans
>
>>
>> Murali
>>
>> >Regards,
>> >
>> >Hans
>> >
>> >--
>> >Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom
>>
>>
>>
>
>
>
>--
>Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH] V4L: adding digital video timings APIs

2009-11-11 Thread Hans Verkuil
On Wednesday 11 November 2009 22:45:15 Karicheri, Muralidharan wrote:
> Hans,
> 
> >> [MK] Could you explain this to me? In my prototype, I had tvp5146 that
> >> implements S_STD and tvp7002 that implements S_PRESET. Since bridge
> >driver
> >> has all the knowledge about the sub devices and their capabilities, it
> >can
> >> set the flag for each of the input that it supports (currently I am
> >> setting this flag in the board setup file that describes all the inputs
> >using v4l2_input structure). So it is a matter of setting relevant cap flag
> >in this file for each of the input based on what the sub device supports. I
> >am not sure how core can figure this out?
> >
> >The problem is that we don't want to go through all drivers in order to set
> >the input/output capability flags. However, v4l2_ioctl.c can easily check
> >whether the v4l2_ioctl_ops struct has set vidioc_s_std, vidioc_s_dv_preset
> >and/or vidioc_s_dv_timings and fill in the caps accordingly. If this is
> >done
> >before the vidioc_enum_input/output is called, then the driver can override
> >what v4l2_ioctl.c did if that is needed.
> >
> 
> Why do we need to do that? Why not leave it to the bridge driver to set that
> flag since it knows all encoder/decoder connected to it and whether current 
> encoder/decoder has support for S_STD or S_PRESET looking at the sub dev ops.
> If we set them at the core, as you explained, then bridge driver needs to
> override it. That is not clean IMO.

Actually, the bridge driver only needs to override if it has multiple inputs
where the capability flags differ (i.e. some inputs only support S_STD and
others only support S_DV_PRESET).

In all other cases the core will fill it in correctly.

Doing it in the core ensures that the capability flags will be filled in so
drivers don't need to remember doing this. The alternative is that you have to
go through ALL existing drivers and add the new SUPPORTS_STD capability flag.

But even then I am pretty certain that people will forget to set this flag
for new upcoming drivers.

So I prefer to have this set in the core and only drivers that have mixed
inputs/outputs need to do a bit more work.

Regards,

Hans

> 
> Murali
> 
> >Regards,
> >
> > Hans
> >
> >--
> >Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom
> 
> 
> 



-- 
Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


RE: [PATCH] V4L: adding digital video timings APIs

2009-11-11 Thread Karicheri, Muralidharan
Hans,

Please see my response to your comment on setting the flag. I still think it is 
cleaner to do it in the bridge driver.

The patch is ready and I need to finish the documentation. I plan to do this in 
a weeks time and push the patch to the list.

Murali Karicheri
Software Design Engineer
Texas Instruments Inc.
Germantown, MD 20874
phone: 301-407-9583
email: m-kariche...@ti.com

>-Original Message-
>From: Hans Verkuil [mailto:hverk...@xs4all.nl]
>Sent: Wednesday, November 11, 2009 2:21 AM
>To: Karicheri, Muralidharan
>Cc: linux-me...@vger.kernel.org; davinci-linux-open-
>sou...@linux.davincidsp.com
>Subject: Re: [PATCH] V4L: adding digital video timings APIs
>
>On Thursday 05 November 2009 13:56:29 Hans Verkuil wrote:
>> On Friday 23 October 2009 22:44:34 Karicheri, Muralidharan wrote:
>> > Hans,
>> >
>> > >> following IOCTLS :-
>> > >>
>> > >>  -  verify the new v4l2_input capabilities flag added
>> > >>  -  Enumerate available presets using VIDIOC_ENUM_DV_PRESETS
>> > >>  -  Set one of the supported preset using VIDIOC_S_DV_PRESET
>> > >>  -  Get current preset using VIDIOC_G_DV_PRESET
>> > >>  -  Detect current preset using VIDIOC_QUERY_DV_PRESET
>> > >>  -  Using stub functions in tvp7002, verify VIDIOC_S_DV_TIMINGS
>> > >> and VIDIOC_G_DV_TIMINGS ioctls are received at the sub device.
>> > >>
>> > >> TODOs :
>> > >>
>> > >>  - Test it on a 64bit platform - I need help here since I don't have
>the
>> > >> platform.
>> > >>  - Add documentation (Can someone tell me which file to modify in
>the
>> > >> kernel tree?).
>> > >
>> > >Use the spec in media-spec/v4l.
>> >
>> > [MK] Where can I access this? Is this part of kernel tree (I couldn't
>find
>> > it under Documentation/video4linux/ under the kernel tree? Is it just
>updating a text file or I need to have some tool installed to access
>> > this documentation and update it.
>>
>> This has been moved around quite a bit lately. It is now in
>> linux/Documentation/DocBook/v4l. You build it using 'make media-spec'.
>>
>> > >Please also add support to v4l2-ctl.cpp in v4l2-apps/util! That's
>handy
>> > >for testing.
>> > [MK] Are you referring to the following repository for this?
>> >
>> > http://linuxtv.org/hg/~dougsland/tool/file/5b884b36bbab
>> >
>> > Is there a way I can do a git clone for this?
>>
>> Both the doc and the v4l2-ctl.cpp utility are in the master hg repository
>> (linuxtv.org/hg/v4l-dvb). The utility can be found here: v4l2-apps/util.
>> Build it using 'make apps'. The patches of the timings API, docs and
>utils
>> should all be done against the master hg tree since that is that latest
>and
>> greatest tree.
>>
>> >
>> > >
>> > >Setting the input/output capabilities should be done in v4l2-ioctl.c
>> > >rather than in the drivers. All the info you need to set these bits is
>> > >available in the core after all.
>> > >
>> >
>> > [MK] Could you explain this to me? In my prototype, I had tvp5146 that
>> > implements S_STD and tvp7002 that implements S_PRESET. Since bridge
>driver
>> > has all the knowledge about the sub devices and their capabilities, it
>can
>> > set the flag for each of the input that it supports (currently I am
>> > setting this flag in the board setup file that describes all the inputs
>using v4l2_input structure). So it is a matter of setting relevant cap flag
>in this file for each of the input based on what the sub device supports. I
>am not sure how core can figure this out?
>>
>> The problem is that we don't want to go through all drivers in order to
>set
>> the input/output capability flags. However, v4l2_ioctl.c can easily check
>> whether the v4l2_ioctl_ops struct has set vidioc_s_std,
>vidioc_s_dv_preset
>> and/or vidioc_s_dv_timings and fill in the caps accordingly. If this is
>done
>> before the vidioc_enum_input/output is called, then the driver can
>override
>> what v4l2_ioctl.c did if that is needed.
>>
>> >
>> > >I also noticed that not all new ioctls are part of video_ops. Aren't
>they
>> > >all required?
>> > >
>> > [MK] All new ioctls are supported in video_ops. I am not sure what you
>are
>> > referring to. For sub device ops, only few are required since bridge
>device
>> > can handle the rest.
>>
>> OK.
>>
>> Regards,
>>
>>  Hans
>>
>
>Hi Murali,
>
>What is the status of this? It would be great if we can get this in for
>2.6.33.
>
>Regards,
>
>   Hans
>
>--
>Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


RE: [PATCH] V4L: adding digital video timings APIs

2009-11-11 Thread Karicheri, Muralidharan
Hans,

>> [MK] Could you explain this to me? In my prototype, I had tvp5146 that
>> implements S_STD and tvp7002 that implements S_PRESET. Since bridge
>driver
>> has all the knowledge about the sub devices and their capabilities, it
>can
>> set the flag for each of the input that it supports (currently I am
>> setting this flag in the board setup file that describes all the inputs
>using v4l2_input structure). So it is a matter of setting relevant cap flag
>in this file for each of the input based on what the sub device supports. I
>am not sure how core can figure this out?
>
>The problem is that we don't want to go through all drivers in order to set
>the input/output capability flags. However, v4l2_ioctl.c can easily check
>whether the v4l2_ioctl_ops struct has set vidioc_s_std, vidioc_s_dv_preset
>and/or vidioc_s_dv_timings and fill in the caps accordingly. If this is
>done
>before the vidioc_enum_input/output is called, then the driver can override
>what v4l2_ioctl.c did if that is needed.
>

Why do we need to do that? Why not leave it to the bridge driver to set that
flag since it knows all encoder/decoder connected to it and whether current 
encoder/decoder has support for S_STD or S_PRESET looking at the sub dev ops.
If we set them at the core, as you explained, then bridge driver needs to
override it. That is not clean IMO.

Murali

>Regards,
>
>   Hans
>
>--
>Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


Re: [PATCH] V4L: adding digital video timings APIs

2009-11-10 Thread Hans Verkuil
On Thursday 05 November 2009 13:56:29 Hans Verkuil wrote:
> On Friday 23 October 2009 22:44:34 Karicheri, Muralidharan wrote:
> > Hans,
> > 
> > >> following IOCTLS :-
> > >>
> > >>  -  verify the new v4l2_input capabilities flag added
> > >>  -  Enumerate available presets using VIDIOC_ENUM_DV_PRESETS
> > >>  -  Set one of the supported preset using VIDIOC_S_DV_PRESET
> > >>  -  Get current preset using VIDIOC_G_DV_PRESET
> > >>  -  Detect current preset using VIDIOC_QUERY_DV_PRESET
> > >>  -  Using stub functions in tvp7002, verify VIDIOC_S_DV_TIMINGS
> > >> and VIDIOC_G_DV_TIMINGS ioctls are received at the sub device.
> > >>
> > >> TODOs :
> > >>
> > >>  - Test it on a 64bit platform - I need help here since I don't have the
> > >> platform.
> > >>  - Add documentation (Can someone tell me which file to modify in the
> > >> kernel tree?).
> > >
> > >Use the spec in media-spec/v4l.
> > 
> > [MK] Where can I access this? Is this part of kernel tree (I couldn't find
> > it under Documentation/video4linux/ under the kernel tree? Is it just 
> > updating a text file or I need to have some tool installed to access
> > this documentation and update it.
> 
> This has been moved around quite a bit lately. It is now in
> linux/Documentation/DocBook/v4l. You build it using 'make media-spec'.
> 
> > >Please also add support to v4l2-ctl.cpp in v4l2-apps/util! That's handy
> > >for testing.
> > [MK] Are you referring to the following repository for this?
> > 
> > http://linuxtv.org/hg/~dougsland/tool/file/5b884b36bbab
> > 
> > Is there a way I can do a git clone for this?
> 
> Both the doc and the v4l2-ctl.cpp utility are in the master hg repository
> (linuxtv.org/hg/v4l-dvb). The utility can be found here: v4l2-apps/util.
> Build it using 'make apps'. The patches of the timings API, docs and utils
> should all be done against the master hg tree since that is that latest and
> greatest tree.
> 
> > 
> > >
> > >Setting the input/output capabilities should be done in v4l2-ioctl.c
> > >rather than in the drivers. All the info you need to set these bits is
> > >available in the core after all.
> > >
> > 
> > [MK] Could you explain this to me? In my prototype, I had tvp5146 that
> > implements S_STD and tvp7002 that implements S_PRESET. Since bridge driver
> > has all the knowledge about the sub devices and their capabilities, it can
> > set the flag for each of the input that it supports (currently I am
> > setting this flag in the board setup file that describes all the inputs 
> > using v4l2_input structure). So it is a matter of setting relevant cap flag 
> > in this file for each of the input based on what the sub device supports. I 
> > am not sure how core can figure this out?
> 
> The problem is that we don't want to go through all drivers in order to set
> the input/output capability flags. However, v4l2_ioctl.c can easily check
> whether the v4l2_ioctl_ops struct has set vidioc_s_std, vidioc_s_dv_preset
> and/or vidioc_s_dv_timings and fill in the caps accordingly. If this is done
> before the vidioc_enum_input/output is called, then the driver can override
> what v4l2_ioctl.c did if that is needed.
> 
> > 
> > >I also noticed that not all new ioctls are part of video_ops. Aren't they
> > >all required?
> > >
> > [MK] All new ioctls are supported in video_ops. I am not sure what you are
> > referring to. For sub device ops, only few are required since bridge device
> > can handle the rest.
> 
> OK.
> 
> Regards,
> 
>   Hans
> 

Hi Murali,

What is the status of this? It would be great if we can get this in for 2.6.33.

Regards,

Hans

-- 
Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom

___
Davinci-linux-open-source mailing list
Davinci-linux-open-source@linux.davincidsp.com
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source


RE: [PATCH] V4L: adding digital video timings APIs

2009-10-23 Thread Karicheri, Muralidharan
Hans,

>> following IOCTLS :-
>>
>>  -  verify the new v4l2_input capabilities flag added
>>  -  Enumerate available presets using VIDIOC_ENUM_DV_PRESETS
>>  -  Set one of the supported preset using VIDIOC_S_DV_PRESET
>>  -  Get current preset using VIDIOC_G_DV_PRESET
>>  -  Detect current preset using VIDIOC_QUERY_DV_PRESET
>>  -  Using stub functions in tvp7002, verify VIDIOC_S_DV_TIMINGS
>> and VIDIOC_G_DV_TIMINGS ioctls are received at the sub device.
>>
>> TODOs :
>>
>>  - Test it on a 64bit platform - I need help here since I don't have the
>> platform.
>>  - Add documentation (Can someone tell me which file to modify in the
>> kernel tree?).
>
>Use the spec in media-spec/v4l.

[MK] Where can I access this? Is this part of kernel tree (I couldn't find
it under Documentation/video4linux/ under the kernel tree? Is it just updating 
a text file or I need to have some tool installed to access
this documentation and update it.
>
>Please also add support to v4l2-ctl.cpp in v4l2-apps/util! That's handy
>for testing.
[MK] Are you referring to the following repository for this?

http://linuxtv.org/hg/~dougsland/tool/file/5b884b36bbab

Is there a way I can do a git clone for this?

>
>Setting the input/output capabilities should be done in v4l2-ioctl.c
>rather than in the drivers. All the info you need to set these bits is
>available in the core after all.
>

[MK] Could you explain this to me? In my prototype, I had tvp5146 that
implements S_STD and tvp7002 that implements S_PRESET. Since bridge driver
has all the knowledge about the sub devices and their capabilities, it can
set the flag for each of the input that it supports (currently I am
setting this flag in the board setup file that describes all the inputs using 
v4l2_input structure). So it is a matter of setting relevant cap flag in this 
file for each of the input based on what the sub device supports. I am not sure 
how core can figure this out?

>I also noticed that not all new ioctls are part of video_ops. Aren't they
>all required?
>
[MK] All new ioctls are supported in video_ops. I am not sure what you are
referring to. For sub device ops, only few are required since bridge device
can handle the rest.

>Regards,
>
>Hans
>
>PS: Thanks for all your work! It's great to see this moving forward nicely!
>
>>
>> Please review this and let me know your comments.
>>
>> Mandatory reviewer - Hans Verkuil 
>>
>> Signed-off-by: Muralidharan Karicheri 
>> ---
>> Applies to V4L-DVB linux-next branch
>>
>>  drivers/media/video/v4l2-compat-ioctl32.c |7 ++
>>  drivers/media/video/v4l2-ioctl.c  |  122
>> ++
>>  include/linux/videodev2.h |  136
>> -
>>  include/media/v4l2-ioctl.h|   15 +++
>>  include/media/v4l2-subdev.h   |   21 +
>>  5 files changed, 299 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/media/video/v4l2-compat-ioctl32.c
>> b/drivers/media/video/v4l2-compat-ioctl32.c
>> index 997975d..9277448 100644
>> --- a/drivers/media/video/v4l2-compat-ioctl32.c
>> +++ b/drivers/media/video/v4l2-compat-ioctl32.c
>> @@ -1077,6 +1077,13 @@ long v4l2_compat_ioctl32(struct file *file,
>> unsigned int cmd, unsigned long arg)
>>  case VIDIOC_DBG_G_REGISTER:
>>  case VIDIOC_DBG_G_CHIP_IDENT:
>>  case VIDIOC_S_HW_FREQ_SEEK:
>> +case VIDIOC_ENUM_DV_PRESETS:
>> +case VIDIOC_S_DV_PRESET:
>> +case VIDIOC_G_DV_PRESET:
>> +case VIDIOC_QUERY_DV_PRESET:
>> +case VIDIOC_S_DV_TIMINGS:
>> +case VIDIOC_G_DV_TIMINGS:
>> +
>>  ret = do_video_ioctl(file, cmd, arg);
>>  break;
>>
>> diff --git a/drivers/media/video/v4l2-ioctl.c
>> b/drivers/media/video/v4l2-ioctl.c
>> index 30cc334..10b5678 100644
>> --- a/drivers/media/video/v4l2-ioctl.c
>> +++ b/drivers/media/video/v4l2-ioctl.c
>> @@ -284,6 +284,12 @@ static const char *v4l2_ioctls[] = {
>>  [_IOC_NR(VIDIOC_DBG_G_CHIP_IDENT)] = "VIDIOC_DBG_G_CHIP_IDENT",
>>  [_IOC_NR(VIDIOC_S_HW_FREQ_SEEK)]   = "VIDIOC_S_HW_FREQ_SEEK",
>>  #endif
>> +[_IOC_NR(VIDIOC_ENUM_DV_PRESETS)]  = "VIDIOC_ENUM_DV_PRESETS",
>> +[_IOC_NR(VIDIOC_S_DV_PRESET)]  = "VIDIOC_S_DV_PRESET",
>> +[_IOC_NR(VIDIOC_G_DV_PRESET)]  = "VIDIOC_G_DV_PRESET",
>> +[_IOC_NR(VIDIOC_QUERY_DV_PRESET)]  = "VIDIOC_QUERY_DV_PRESET",
>> +[_IOC_NR(VIDIOC_S_DV_TIMINGS)] = "VIDIOC_S_DV_TIMINGS",
>> +[_IOC_NR(VIDIOC_G_DV_TIMINGS)] = "VIDIOC_G_DV_TIMINGS",
>>  };
>>  #define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls)
>>
>> @@ -1794,6 +1800,122 @@ static long __video_do_ioctl(struct file *file,
>>  }
>>  break;
>>  }
>> +case VIDIOC_ENUM_DV_PRESETS:
>> +{
>> +struct v4l2_dv_enum_preset *p = arg;
>> +
>> +if (!ops->vidioc_enum_dv_presets)
>> +break;
>> +
>> +ret = ops->vidioc_enum_dv_presets(file, fh, p);
>> +if (!ret)
>> +dbgarg(cmd,
>> +   

Re: [PATCH] V4L: adding digital video timings APIs

2009-10-21 Thread Hans Verkuil
Hi Murali,

> From: Muralidharan Karicheri 
>
> This is the initial version of the digital video timings APIs
> implementation.
>
> This adds the above APIs to the v4l2 core. This is based on version v1.2
> of the RFC titled "V4L - Support for video timings at the input/output
> interface"
> Following new ioctls are added:-
>
>   - VIDIOC_ENUM_DV_PRESETS
>   - VIDIOC_S_DV_PRESET
>   - VIDIOC_G_DV_PRESET
>   - VIDIOC_QUERY_DV_PRESET
>   - VIDIOC_S_DV_TIMINGS
>   - VIDIOC_G_DV_TIMINGS
>
> Please refer to the RFC for the details. This code was tested using vpfe
> capture driver on TI's DM365. Following is the test configuration used :-
>
> Blue Ray HD DVD source -> TVP7002 -> DM365 (VPFE) ->DDR
>
> A draft version of the TVP7002 driver (currently being reviewed in the
> mailing
> list) was used that supports V4L2_DV_1080I60 & V4L2_DV_720P60 presets.
>
> A loopback video capture application was used for testing these APIs. This
> calls
> following IOCTLS :-
>
>  -  verify the new v4l2_input capabilities flag added
>  -  Enumerate available presets using VIDIOC_ENUM_DV_PRESETS
>  -  Set one of the supported preset using VIDIOC_S_DV_PRESET
>  -  Get current preset using VIDIOC_G_DV_PRESET
>  -  Detect current preset using VIDIOC_QUERY_DV_PRESET
>  -  Using stub functions in tvp7002, verify VIDIOC_S_DV_TIMINGS
> and VIDIOC_G_DV_TIMINGS ioctls are received at the sub device.
>
> TODOs :
>
>  - Test it on a 64bit platform - I need help here since I don't have the
> platform.
>  - Add documentation (Can someone tell me which file to modify in the
> kernel tree?).

Use the spec in media-spec/v4l.

Please also add support to v4l2-ctl.cpp in v4l2-apps/util! That's handy
for testing.

Setting the input/output capabilities should be done in v4l2-ioctl.c
rather than in the drivers. All the info you need to set these bits is
available in the core after all.

I also noticed that not all new ioctls are part of video_ops. Aren't they
all required?

Regards,

Hans

PS: Thanks for all your work! It's great to see this moving forward nicely!

>
> Please review this and let me know your comments.
>
> Mandatory reviewer - Hans Verkuil 
>
> Signed-off-by: Muralidharan Karicheri 
> ---
> Applies to V4L-DVB linux-next branch
>
>  drivers/media/video/v4l2-compat-ioctl32.c |7 ++
>  drivers/media/video/v4l2-ioctl.c  |  122
> ++
>  include/linux/videodev2.h |  136
> -
>  include/media/v4l2-ioctl.h|   15 +++
>  include/media/v4l2-subdev.h   |   21 +
>  5 files changed, 299 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/video/v4l2-compat-ioctl32.c
> b/drivers/media/video/v4l2-compat-ioctl32.c
> index 997975d..9277448 100644
> --- a/drivers/media/video/v4l2-compat-ioctl32.c
> +++ b/drivers/media/video/v4l2-compat-ioctl32.c
> @@ -1077,6 +1077,13 @@ long v4l2_compat_ioctl32(struct file *file,
> unsigned int cmd, unsigned long arg)
>   case VIDIOC_DBG_G_REGISTER:
>   case VIDIOC_DBG_G_CHIP_IDENT:
>   case VIDIOC_S_HW_FREQ_SEEK:
> + case VIDIOC_ENUM_DV_PRESETS:
> + case VIDIOC_S_DV_PRESET:
> + case VIDIOC_G_DV_PRESET:
> + case VIDIOC_QUERY_DV_PRESET:
> + case VIDIOC_S_DV_TIMINGS:
> + case VIDIOC_G_DV_TIMINGS:
> +
>   ret = do_video_ioctl(file, cmd, arg);
>   break;
>
> diff --git a/drivers/media/video/v4l2-ioctl.c
> b/drivers/media/video/v4l2-ioctl.c
> index 30cc334..10b5678 100644
> --- a/drivers/media/video/v4l2-ioctl.c
> +++ b/drivers/media/video/v4l2-ioctl.c
> @@ -284,6 +284,12 @@ static const char *v4l2_ioctls[] = {
>   [_IOC_NR(VIDIOC_DBG_G_CHIP_IDENT)] = "VIDIOC_DBG_G_CHIP_IDENT",
>   [_IOC_NR(VIDIOC_S_HW_FREQ_SEEK)]   = "VIDIOC_S_HW_FREQ_SEEK",
>  #endif
> + [_IOC_NR(VIDIOC_ENUM_DV_PRESETS)]  = "VIDIOC_ENUM_DV_PRESETS",
> + [_IOC_NR(VIDIOC_S_DV_PRESET)]  = "VIDIOC_S_DV_PRESET",
> + [_IOC_NR(VIDIOC_G_DV_PRESET)]  = "VIDIOC_G_DV_PRESET",
> + [_IOC_NR(VIDIOC_QUERY_DV_PRESET)]  = "VIDIOC_QUERY_DV_PRESET",
> + [_IOC_NR(VIDIOC_S_DV_TIMINGS)] = "VIDIOC_S_DV_TIMINGS",
> + [_IOC_NR(VIDIOC_G_DV_TIMINGS)] = "VIDIOC_G_DV_TIMINGS",
>  };
>  #define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls)
>
> @@ -1794,6 +1800,122 @@ static long __video_do_ioctl(struct file *file,
>   }
>   break;
>   }
> + case VIDIOC_ENUM_DV_PRESETS:
> + {
> + struct v4l2_dv_enum_preset *p = arg;
> +
> + if (!ops->vidioc_enum_dv_presets)
> + break;
> +
> + ret = ops->vidioc_enum_dv_presets(file, fh, p);
> + if (!ret)
> + dbgarg(cmd,
> + "index=%d, preset=%d, name=%s, width=%d,"
> + " height=%d ",
> + p->index, p->preset, p->name, p->width,
> + p->height);
> + break;
> + }
>