Re: Please help test the new v4l-subdev support in v4l2-compliance

2018-02-06 Thread Tim Harvey
On Tue, Feb 6, 2018 at 11:05 AM, Hans Verkuil  wrote:
> On 02/06/2018 07:48 PM, Tim Harvey wrote:
>> On Mon, Feb 5, 2018 at 11:34 PM, Hans Verkuil  wrote:
>>> On 02/06/2018 08:16 AM, Tim Harvey wrote:
 On Sat, Feb 3, 2018 at 7:56 AM, Hans Verkuil  wrote:
>> 

 With regards to the 3 failures:

 1. test VIDIOC_G/S_EDID: FAIL
 This is a valid catch where I was returning -EINVAL when the caller
 was simply querying the edid - I've fixed it in my driver

 2. test VIDIOC_DV_TIMINGS_CAP: FAIL
 fail: v4l2-test-io-config.cpp(375): doioctl(node,
 VIDIOC_DV_TIMINGS_CAP, ) != EINVAL
 fail: v4l2-test-io-config.cpp(392): EDID check failed for source pad 0.

 It looks like the purpose of the test is to do an ioctl with an
 invalid pad setting to ensure -EINVAL is returned. However by the time
 the VIDIOC_DV_TIMINGS_CAP ioctl used here gets routed to a
>>>
>>> No, VIDIOC_SUBDEV_DV_TIMINGS_CAP == VIDIOC_DV_TIMINGS_CAP, i.e. the
>>> v4l-subdev API reuses the same ioctl as is used in the 'main' V4L2 API.
>>> See include/uapi/linux/v4l2-subdev.h at the end for a list of 'alias'
>>> ioctls.
>>
>> Ah... thanks - I realized that was happening somehow but couldn't see how :)
>>
>>>
>>> Looking at v7 your tda1997x_get_dv_timings_cap() function doesn't check
>>> for a valid pad field. Same for tda1997x_enum_dv_timings().
>>
>> Right - I noticed this right off as well - I've added pad validation
>> but that didn't resolve the failure.
>>
>> The test failing is:
>>
>> memset(, 0, sizeof(timingscap));
>> timingscap.pad = node->is_subdev() ? node->entity.pads : 1;
>>  this sets pad=node->entity.pads=1 which is invalid
>> fail_on_test(doioctl(node, VIDIOC_DV_TIMINGS_CAP, )
>> != EINVAL);
>>  tda1997x_get_dv_timings_cap() gets called with cap->pad = 0 which
>> is valid to returns 0. I don't understand how the userspace pad=1 get
>> changed to pad=0 in my handler.
>
> Actually, you don't need to test the pad in the driver, I just looked at
> the code in v4l2-core/v4l2-subdev.c and the pad is tested there already.
>
> And I just found why it is cleared: it's a bug in v4l2-ioctl.c.
>
> Look up VIDIOC_DV_TIMINGS_CAP in the big table and change this:
>
> INFO_FL_CLEAR(v4l2_dv_timings_cap, type)
>
> to this:
>
> INFO_FL_CLEAR(v4l2_dv_timings_cap, pad)
>
> We never noticed this because we never tested this for subdevs. And that's
> why you write compliance tests!

Indeed that fixes it. I'll add that patch to my series.

All of the items on your review of v7 make sense and I'll be posting a
v8 hopefully shortly.

Thanks!

Tim


Re: Please help test the new v4l-subdev support in v4l2-compliance

2018-02-06 Thread Hans Verkuil
On 02/06/2018 07:48 PM, Tim Harvey wrote:
> On Mon, Feb 5, 2018 at 11:34 PM, Hans Verkuil  wrote:
>> On 02/06/2018 08:16 AM, Tim Harvey wrote:
>>> On Sat, Feb 3, 2018 at 7:56 AM, Hans Verkuil  wrote:
> 
>>>
>>> With regards to the 3 failures:
>>>
>>> 1. test VIDIOC_G/S_EDID: FAIL
>>> This is a valid catch where I was returning -EINVAL when the caller
>>> was simply querying the edid - I've fixed it in my driver
>>>
>>> 2. test VIDIOC_DV_TIMINGS_CAP: FAIL
>>> fail: v4l2-test-io-config.cpp(375): doioctl(node,
>>> VIDIOC_DV_TIMINGS_CAP, ) != EINVAL
>>> fail: v4l2-test-io-config.cpp(392): EDID check failed for source pad 0.
>>>
>>> It looks like the purpose of the test is to do an ioctl with an
>>> invalid pad setting to ensure -EINVAL is returned. However by the time
>>> the VIDIOC_DV_TIMINGS_CAP ioctl used here gets routed to a
>>
>> No, VIDIOC_SUBDEV_DV_TIMINGS_CAP == VIDIOC_DV_TIMINGS_CAP, i.e. the
>> v4l-subdev API reuses the same ioctl as is used in the 'main' V4L2 API.
>> See include/uapi/linux/v4l2-subdev.h at the end for a list of 'alias'
>> ioctls.
> 
> Ah... thanks - I realized that was happening somehow but couldn't see how :)
> 
>>
>> Looking at v7 your tda1997x_get_dv_timings_cap() function doesn't check
>> for a valid pad field. Same for tda1997x_enum_dv_timings().
> 
> Right - I noticed this right off as well - I've added pad validation
> but that didn't resolve the failure.
> 
> The test failing is:
> 
> memset(, 0, sizeof(timingscap));
> timingscap.pad = node->is_subdev() ? node->entity.pads : 1;
>  this sets pad=node->entity.pads=1 which is invalid
> fail_on_test(doioctl(node, VIDIOC_DV_TIMINGS_CAP, )
> != EINVAL);
>  tda1997x_get_dv_timings_cap() gets called with cap->pad = 0 which
> is valid to returns 0. I don't understand how the userspace pad=1 get
> changed to pad=0 in my handler.

Actually, you don't need to test the pad in the driver, I just looked at
the code in v4l2-core/v4l2-subdev.c and the pad is tested there already.

And I just found why it is cleared: it's a bug in v4l2-ioctl.c.

Look up VIDIOC_DV_TIMINGS_CAP in the big table and change this:

INFO_FL_CLEAR(v4l2_dv_timings_cap, type)

to this:

INFO_FL_CLEAR(v4l2_dv_timings_cap, pad)

We never noticed this because we never tested this for subdevs. And that's
why you write compliance tests!

> 
>>
>>> VIDIOC_SUBDEV_DV_TIMINGS_CAP the pad is changed to 0 which is valid.
>>> I'm not following what's going on here.
>>>
>>> 3. test Try VIDIOC_SUBDEV_G/S_FMT: FAIL
>>> fail: v4l2-test-subdevs.cpp(303): fmt.code == 0 || fmt.code == ~0U
>>> fail: v4l2-test-subdevs.cpp(342): checkMBusFrameFmt(node, fmt.format)
>>>
>>> This is reporting that a VIDIOC_SUBDEV_G_FMT with
>>> which=V4L2_SUBDEV_FORMAT_TRY returns format->code = 0. The following
>>> is my set_format:
>>>
>>> static int tda1997x_get_format(struct v4l2_subdev *sd,
>>>struct v4l2_subdev_pad_config *cfg,
>>>struct v4l2_subdev_format *format)
>>> {
>>> struct tda1997x_state *state = to_state(sd);
>>>
>>> v4l_dbg(1, debug, state->client, "%s pad=%d which=%d\n",
>>> __func__, format->pad, format->which);
>>> if (format->pad != TDA1997X_PAD_SOURCE)
>>> return -EINVAL;
>>>
>>> tda1997x_fill_format(state, >format);
>>>
>>> if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
>>> struct v4l2_mbus_framefmt *fmt;
>>>
>>> fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad);
>>> format->format.code = fmt->code;
>>> } else {
>>> format->format.code = state->mbus_code;
>>> }
>>>
>>> return 0;
>>> }
>>>
>>> I don't at all understand the V4L2_SUBDEV_FORMAT_TRY logic here which
>>> I took from other subdev drivers as boilerplate. Is the test valid?
>>
>> The test is valid, this really shouldn't return a 0 code. But I am not
>> sure what the right logic is. I'll need to do some digging myself.
> 
> I got lost in the v4l2_subdev_get_try_format implementation but closer
> inspection shows me that v4l2_subdev_get_try_format returns the
> try_fmt field of the v4l2_subdev_pad_config used for storing subdev
> pad info. What I'm missing is how that struct/field gets initialized?
> Do I need to implement an init_cfg op?

See my review of v7.

Regards,

Hans


Re: Please help test the new v4l-subdev support in v4l2-compliance

2018-02-06 Thread Tim Harvey
On Mon, Feb 5, 2018 at 11:34 PM, Hans Verkuil  wrote:
> On 02/06/2018 08:16 AM, Tim Harvey wrote:
>> On Sat, Feb 3, 2018 at 7:56 AM, Hans Verkuil  wrote:

>>
>> With regards to the 3 failures:
>>
>> 1. test VIDIOC_G/S_EDID: FAIL
>> This is a valid catch where I was returning -EINVAL when the caller
>> was simply querying the edid - I've fixed it in my driver
>>
>> 2. test VIDIOC_DV_TIMINGS_CAP: FAIL
>> fail: v4l2-test-io-config.cpp(375): doioctl(node,
>> VIDIOC_DV_TIMINGS_CAP, ) != EINVAL
>> fail: v4l2-test-io-config.cpp(392): EDID check failed for source pad 0.
>>
>> It looks like the purpose of the test is to do an ioctl with an
>> invalid pad setting to ensure -EINVAL is returned. However by the time
>> the VIDIOC_DV_TIMINGS_CAP ioctl used here gets routed to a
>
> No, VIDIOC_SUBDEV_DV_TIMINGS_CAP == VIDIOC_DV_TIMINGS_CAP, i.e. the
> v4l-subdev API reuses the same ioctl as is used in the 'main' V4L2 API.
> See include/uapi/linux/v4l2-subdev.h at the end for a list of 'alias'
> ioctls.

Ah... thanks - I realized that was happening somehow but couldn't see how :)

>
> Looking at v7 your tda1997x_get_dv_timings_cap() function doesn't check
> for a valid pad field. Same for tda1997x_enum_dv_timings().

Right - I noticed this right off as well - I've added pad validation
but that didn't resolve the failure.

The test failing is:

memset(, 0, sizeof(timingscap));
timingscap.pad = node->is_subdev() ? node->entity.pads : 1;
 this sets pad=node->entity.pads=1 which is invalid
fail_on_test(doioctl(node, VIDIOC_DV_TIMINGS_CAP, )
!= EINVAL);
 tda1997x_get_dv_timings_cap() gets called with cap->pad = 0 which
is valid to returns 0. I don't understand how the userspace pad=1 get
changed to pad=0 in my handler.

>
>> VIDIOC_SUBDEV_DV_TIMINGS_CAP the pad is changed to 0 which is valid.
>> I'm not following what's going on here.
>>
>> 3. test Try VIDIOC_SUBDEV_G/S_FMT: FAIL
>> fail: v4l2-test-subdevs.cpp(303): fmt.code == 0 || fmt.code == ~0U
>> fail: v4l2-test-subdevs.cpp(342): checkMBusFrameFmt(node, fmt.format)
>>
>> This is reporting that a VIDIOC_SUBDEV_G_FMT with
>> which=V4L2_SUBDEV_FORMAT_TRY returns format->code = 0. The following
>> is my set_format:
>>
>> static int tda1997x_get_format(struct v4l2_subdev *sd,
>>struct v4l2_subdev_pad_config *cfg,
>>struct v4l2_subdev_format *format)
>> {
>> struct tda1997x_state *state = to_state(sd);
>>
>> v4l_dbg(1, debug, state->client, "%s pad=%d which=%d\n",
>> __func__, format->pad, format->which);
>> if (format->pad != TDA1997X_PAD_SOURCE)
>> return -EINVAL;
>>
>> tda1997x_fill_format(state, >format);
>>
>> if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
>> struct v4l2_mbus_framefmt *fmt;
>>
>> fmt = v4l2_subdev_get_try_format(sd, cfg, format->pad);
>> format->format.code = fmt->code;
>> } else {
>> format->format.code = state->mbus_code;
>> }
>>
>> return 0;
>> }
>>
>> I don't at all understand the V4L2_SUBDEV_FORMAT_TRY logic here which
>> I took from other subdev drivers as boilerplate. Is the test valid?
>
> The test is valid, this really shouldn't return a 0 code. But I am not
> sure what the right logic is. I'll need to do some digging myself.

I got lost in the v4l2_subdev_get_try_format implementation but closer
inspection shows me that v4l2_subdev_get_try_format returns the
try_fmt field of the v4l2_subdev_pad_config used for storing subdev
pad info. What I'm missing is how that struct/field gets initialized?
Do I need to implement an init_cfg op?

Regards,

Tim


Re: Please help test the new v4l-subdev support in v4l2-compliance

2018-02-05 Thread Hans Verkuil
On 02/06/2018 08:16 AM, Tim Harvey wrote:
> On Sat, Feb 3, 2018 at 7:56 AM, Hans Verkuil  wrote:
>> Hi Tim, Jacopo,
>>
>> I have now finished writing the v4l2-compliance tests for the various 
>> v4l-subdev
>> ioctls. I managed to test some with the vimc driver, but that doesn't 
>> implement all
>> ioctls, so I could use some help testing my test code :-)
>>
>> To test you first need to apply these patches to your kernel:
>>
>> https://patchwork.linuxtv.org/patch/46817/
>> https://patchwork.linuxtv.org/patch/46822/
>>
>> Otherwise the compliance test will fail a lot.
>>
>> Now run v4l2-compliance -u /dev/v4l-subdevX (or -uX as a shortcut) and see 
>> what
>> happens.
>>
> 
> Hans,
> 
> Here's the compliance results for my tda1997x driver:
> 
> v4l2-compliance SHA   : b2f8f9049056eb6f9e028927dacb2c715a062df8
> Media Driver Info:
> Driver name  : imx-media
> Model: imx-media
> Serial   :
> Bus info :
> Media version: 4.15.0
> Hardware revision: 0x (0)
> Driver version   : 4.15.0
> Interface Info:
> ID   : 0x038f
> Type : V4L Sub-Device
> Entity Info:
> ID   : 0x0003 (3)
> Name : tda19971 2-0048
> Function : Unknown
> Pad 0x0104   : Source
>   Link 0x026f: to remote pad 0x163 of entity
> 'ipu1_csi0_mux': Data, Enabled
> 
> Compliance test for device /dev/v4l-subdev1:
> 
> Allow for multiple opens:
> test second /dev/v4l-subdev1 open: OK
> test for unlimited opens: OK
> 
> Debug ioctls:
> test VIDIOC_LOG_STATUS: OK
> 
> Input ioctls:
> test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
> test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
> test VIDIOC_ENUMAUDIO: OK (Not Supported)
> test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
> test VIDIOC_G/S_AUDIO: OK (Not Supported)
> Inputs: 0 Audio Inputs: 0 Tuners: 0
> 
> Output ioctls:
> test VIDIOC_G/S_MODULATOR: OK (Not Supported)
> test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
> test VIDIOC_ENUMAUDOUT: OK (Not Supported)
> test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
> test VIDIOC_G/S_AUDOUT: OK (Not Supported)
> Outputs: 0 Audio Outputs: 0 Modulators: 0
> 
> Input/Output configuration ioctls:
> test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
> test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK
> fail: v4l2-test-io-config.cpp(375): doioctl(node,
> VIDIOC_DV_TIMINGS_CAP, ) != EINVAL
> fail: v4l2-test-io-config.cpp(392): EDID check failed
> for source pad 0.
> test VIDIOC_DV_TIMINGS_CAP: FAIL
> fail: v4l2-test-io-config.cpp(454): ret && ret != EINVAL
> fail: v4l2-test-io-config.cpp(533): EDID check failed
> for source pad 0.
> test VIDIOC_G/S_EDID: FAIL
> 
> Sub-Device ioctls (Source Pad 0):
> test Try VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: OK
> fail: v4l2-test-subdevs.cpp(303): fmt.code == 0 ||
> fmt.code == ~0U
> fail: v4l2-test-subdevs.cpp(342):
> checkMBusFrameFmt(node, fmt.format)
> test Try VIDIOC_SUBDEV_G/S_FMT: FAIL
> test Try VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK (Not Supported)
> test Active VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: OK
> test Active VIDIOC_SUBDEV_G/S_FMT: OK
> test Active VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK (Not Supported)
> test VIDIOC_SUBDEV_G/S_FRAME_INTERVAL: OK (Not Supported)
> 
> Control ioctls:
> test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported)
> test VIDIOC_QUERYCTRL: OK (Not Supported)
> test VIDIOC_G/S_CTRL: OK (Not Supported)
> test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported)
> test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported)
> test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
> Standard Controls: 0 Private Controls: 0
> 
> Format ioctls:
> test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK (Not Supported)
> root@ventana:~# cat foo
> v4l2-compliance SHA   : b2f8f9049056eb6f9e028927dacb2c715a062df8
> Media Driver Info:
> Driver name  : imx-media
> Model: imx-media
> Serial   :
> Bus info :
> Media version: 4.15.0
> Hardware revision: 0x (0)
> Driver version   : 4.15.0
> Interface Info:
> ID   : 0x038f
> Type : V4L Sub-Device
> Entity Info:
> ID   : 0x0003 (3)
> Name : tda19971 2-0048
> Function : Unknown
> Pad 0x0104   : Source
>   Link 0x026f: to remote pad 0x163 of entity
> 'ipu1_csi0_mux': 

Re: Please help test the new v4l-subdev support in v4l2-compliance

2018-02-05 Thread Tim Harvey
On Sat, Feb 3, 2018 at 7:56 AM, Hans Verkuil  wrote:
> Hi Tim, Jacopo,
>
> I have now finished writing the v4l2-compliance tests for the various 
> v4l-subdev
> ioctls. I managed to test some with the vimc driver, but that doesn't 
> implement all
> ioctls, so I could use some help testing my test code :-)
>
> To test you first need to apply these patches to your kernel:
>
> https://patchwork.linuxtv.org/patch/46817/
> https://patchwork.linuxtv.org/patch/46822/
>
> Otherwise the compliance test will fail a lot.
>
> Now run v4l2-compliance -u /dev/v4l-subdevX (or -uX as a shortcut) and see 
> what
> happens.
>

Hans,

Here's the compliance results for my tda1997x driver:

v4l2-compliance SHA   : b2f8f9049056eb6f9e028927dacb2c715a062df8
Media Driver Info:
Driver name  : imx-media
Model: imx-media
Serial   :
Bus info :
Media version: 4.15.0
Hardware revision: 0x (0)
Driver version   : 4.15.0
Interface Info:
ID   : 0x038f
Type : V4L Sub-Device
Entity Info:
ID   : 0x0003 (3)
Name : tda19971 2-0048
Function : Unknown
Pad 0x0104   : Source
  Link 0x026f: to remote pad 0x163 of entity
'ipu1_csi0_mux': Data, Enabled

Compliance test for device /dev/v4l-subdev1:

Allow for multiple opens:
test second /dev/v4l-subdev1 open: OK
test for unlimited opens: OK

Debug ioctls:
test VIDIOC_LOG_STATUS: OK

Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 0 Audio Inputs: 0 Tuners: 0

Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_ENUMAUDOUT: OK (Not Supported)
test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK
fail: v4l2-test-io-config.cpp(375): doioctl(node,
VIDIOC_DV_TIMINGS_CAP, ) != EINVAL
fail: v4l2-test-io-config.cpp(392): EDID check failed
for source pad 0.
test VIDIOC_DV_TIMINGS_CAP: FAIL
fail: v4l2-test-io-config.cpp(454): ret && ret != EINVAL
fail: v4l2-test-io-config.cpp(533): EDID check failed
for source pad 0.
test VIDIOC_G/S_EDID: FAIL

Sub-Device ioctls (Source Pad 0):
test Try VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: OK
fail: v4l2-test-subdevs.cpp(303): fmt.code == 0 ||
fmt.code == ~0U
fail: v4l2-test-subdevs.cpp(342):
checkMBusFrameFmt(node, fmt.format)
test Try VIDIOC_SUBDEV_G/S_FMT: FAIL
test Try VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK (Not Supported)
test Active VIDIOC_SUBDEV_ENUM_MBUS_CODE/FRAME_SIZE/FRAME_INTERVAL: OK
test Active VIDIOC_SUBDEV_G/S_FMT: OK
test Active VIDIOC_SUBDEV_G/S_SELECTION/CROP: OK (Not Supported)
test VIDIOC_SUBDEV_G/S_FRAME_INTERVAL: OK (Not Supported)

Control ioctls:
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK (Not Supported)
test VIDIOC_QUERYCTRL: OK (Not Supported)
test VIDIOC_G/S_CTRL: OK (Not Supported)
test VIDIOC_G/S/TRY_EXT_CTRLS: OK (Not Supported)
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK (Not Supported)
test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
Standard Controls: 0 Private Controls: 0

Format ioctls:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK (Not Supported)
root@ventana:~# cat foo
v4l2-compliance SHA   : b2f8f9049056eb6f9e028927dacb2c715a062df8
Media Driver Info:
Driver name  : imx-media
Model: imx-media
Serial   :
Bus info :
Media version: 4.15.0
Hardware revision: 0x (0)
Driver version   : 4.15.0
Interface Info:
ID   : 0x038f
Type : V4L Sub-Device
Entity Info:
ID   : 0x0003 (3)
Name : tda19971 2-0048
Function : Unknown
Pad 0x0104   : Source
  Link 0x026f: to remote pad 0x163 of entity
'ipu1_csi0_mux': Data, Enabled

Compliance test for device /dev/v4l-subdev1:

Allow for multiple opens:
test second /dev/v4l-subdev1 open: OK
test for unlimited opens: OK

Debug ioctls:
test VIDIOC_LOG_STATUS: OK

Input ioctls:
test 

Re: Please help test the new v4l-subdev support in v4l2-compliance

2018-02-05 Thread Mauro Carvalho Chehab
Em Mon, 5 Feb 2018 18:01:34 +0100
Hans Verkuil  escreveu:

> On 02/05/2018 05:59 PM, Hans Verkuil wrote:
> > On 02/05/2018 05:55 PM, Mauro Carvalho Chehab wrote:  
> >> Em Mon, 5 Feb 2018 14:37:29 -0200
> >> Mauro Carvalho Chehab  escreveu:
> >>  
> >>> Em Mon, 5 Feb 2018 08:21:54 -0800
> >>> Tim Harvey  escreveu:
> >>>  
>  Hans,
> 
>  I'm failing compile (of master 4ee9911) with:
> 
>    CXX  v4l2_compliance-media-info.o
>  media-info.cpp: In function ‘media_type media_detect_type(const char*)’:
>  media-info.cpp:79:39: error: no matching function for call to
>  ‘std::basic_ifstream::basic_ifstream(std::__cxx11::string&)’
>    std::ifstream uevent_file(uevent_path);
> ^
> >>>
> >>> Btw, while on it, a few days ago, I noticed several class warnings when
> >>> building v4l-utils on Raspbian, saying that it was using some features
> >>> that future versions of gcc would stop using at qv4l2. See enclosed.
> >>>
> >>> I didn't have time to look on them.  
> >>
> >> FYI, it still happens with today's upstream's version:
> >>
> >>4ee99116d0ec (HEAD, origin/master, origin/HEAD) v4l2-ctl: improve the 
> >> fps calculation when streaming
> >>
> >> $ gcc --version
> >> gcc (Raspbian 6.3.0-18+rpi1) 6.3.0 20170516
> >> Copyright (C) 2016 Free Software Foundation, Inc.
> >> This is free software; see the source for copying conditions.  There is NO
> >> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR 
> >> PURPOSE.  
> > 
> > My guess is that it is a bogus message from gcc 6.
> > 
> > Regards,
> > 
> > Hans
> >   
> 
> See: https://gcc.gnu.org/ml/gcc/2017-05/msg00073.html
> 
> Nothing to worry about.

Hmm... as suggested there, it could be worth to add -Wno-psabi at qv4l2
Makefile if arch is arm[1], in order to avoid those warnings there.

[1] from what's said at https://gcc.gnu.org/gcc-7/changes.html, this is
due to a bug on gcc 5 for ARM.

> 
>   Hans



Thanks,
Mauro


Re: Please help test the new v4l-subdev support in v4l2-compliance

2018-02-05 Thread Hans Verkuil
On 02/05/2018 05:59 PM, Hans Verkuil wrote:
> On 02/05/2018 05:55 PM, Mauro Carvalho Chehab wrote:
>> Em Mon, 5 Feb 2018 14:37:29 -0200
>> Mauro Carvalho Chehab  escreveu:
>>
>>> Em Mon, 5 Feb 2018 08:21:54 -0800
>>> Tim Harvey  escreveu:
>>>
 Hans,

 I'm failing compile (of master 4ee9911) with:

   CXX  v4l2_compliance-media-info.o
 media-info.cpp: In function ‘media_type media_detect_type(const char*)’:
 media-info.cpp:79:39: error: no matching function for call to
 ‘std::basic_ifstream::basic_ifstream(std::__cxx11::string&)’
   std::ifstream uevent_file(uevent_path);
^  
>>>
>>> Btw, while on it, a few days ago, I noticed several class warnings when
>>> building v4l-utils on Raspbian, saying that it was using some features
>>> that future versions of gcc would stop using at qv4l2. See enclosed.
>>>
>>> I didn't have time to look on them.
>>
>> FYI, it still happens with today's upstream's version:
>>
>>  4ee99116d0ec (HEAD, origin/master, origin/HEAD) v4l2-ctl: improve the 
>> fps calculation when streaming
>>
>> $ gcc --version
>> gcc (Raspbian 6.3.0-18+rpi1) 6.3.0 20170516
>> Copyright (C) 2016 Free Software Foundation, Inc.
>> This is free software; see the source for copying conditions.  There is NO
>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> 
> My guess is that it is a bogus message from gcc 6.
> 
> Regards,
> 
>   Hans
> 

See: https://gcc.gnu.org/ml/gcc/2017-05/msg00073.html

Nothing to worry about.

Hans


Re: Please help test the new v4l-subdev support in v4l2-compliance

2018-02-05 Thread Hans Verkuil
On 02/05/2018 05:55 PM, Mauro Carvalho Chehab wrote:
> Em Mon, 5 Feb 2018 14:37:29 -0200
> Mauro Carvalho Chehab  escreveu:
> 
>> Em Mon, 5 Feb 2018 08:21:54 -0800
>> Tim Harvey  escreveu:
>>
>>> Hans,
>>>
>>> I'm failing compile (of master 4ee9911) with:
>>>
>>>   CXX  v4l2_compliance-media-info.o
>>> media-info.cpp: In function ‘media_type media_detect_type(const char*)’:
>>> media-info.cpp:79:39: error: no matching function for call to
>>> ‘std::basic_ifstream::basic_ifstream(std::__cxx11::string&)’
>>>   std::ifstream uevent_file(uevent_path);
>>>^  
>>
>> Btw, while on it, a few days ago, I noticed several class warnings when
>> building v4l-utils on Raspbian, saying that it was using some features
>> that future versions of gcc would stop using at qv4l2. See enclosed.
>>
>> I didn't have time to look on them.
> 
> FYI, it still happens with today's upstream's version:
> 
>   4ee99116d0ec (HEAD, origin/master, origin/HEAD) v4l2-ctl: improve the 
> fps calculation when streaming
> 
> $ gcc --version
> gcc (Raspbian 6.3.0-18+rpi1) 6.3.0 20170516
> Copyright (C) 2016 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

My guess is that it is a bogus message from gcc 6.

Regards,

Hans


Re: Please help test the new v4l-subdev support in v4l2-compliance

2018-02-05 Thread Hans Verkuil
On 02/05/2018 05:37 PM, Mauro Carvalho Chehab wrote:
> Em Mon, 5 Feb 2018 08:21:54 -0800
> Tim Harvey  escreveu:
> 
>> Hans,
>>
>> I'm failing compile (of master 4ee9911) with:
>>
>>   CXX  v4l2_compliance-media-info.o
>> media-info.cpp: In function ‘media_type media_detect_type(const char*)’:
>> media-info.cpp:79:39: error: no matching function for call to
>> ‘std::basic_ifstream::basic_ifstream(std::__cxx11::string&)’
>>   std::ifstream uevent_file(uevent_path);
>>^
> 
> Btw, while on it, a few days ago, I noticed several class warnings when
> building v4l-utils on Raspbian, saying that it was using some features
> that future versions of gcc would stop using at qv4l2. See enclosed.
> 
> I didn't have time to look on them.
> 
> Thanks,
> Mauro
> 
> In file included from /usr/include/c++/6/map:60:0,
>  from 
> /usr/include/arm-linux-gnueabihf/qt5/QtCore/qmetatype.h:57,
>  from 
> /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobject.h:54,
>  from 
> /usr/include/arm-linux-gnueabihf/qt5/QtWidgets/qwidget.h:44,
>  from 
> /usr/include/arm-linux-gnueabihf/qt5/QtWidgets/qmainwindow.h:43,
>  from 
> /usr/include/arm-linux-gnueabihf/qt5/QtWidgets/QMainWindow:1,
>  from qv4l2.h:25,
>  from ctrl-tab.cpp:20:
> /usr/include/c++/6/bits/stl_tree.h: In member function 
> ‘std::pair 
> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, 
> _Alloc>::_M_get_insert_hint_unique_pos(std::_Rb_tree<_Key, _Val, _KeyOfValue, 
> _Compare, _Alloc>::const_iterator, const key_type&) [with _Key = unsigned 
> int; _Val = std::pair; _KeyOfValue = 
> std::_Select1st; 
> _Compare = std::less; _Alloc = std::allocator >]’:
> /usr/include/c++/6/bits/stl_tree.h:1928:5: note: parameter passing for 
> argument of type ‘std::_Rb_tree v4l2_query_ext_ctrl>, std::_Select1st >, std::less, 
> std::allocator 
> >::const_iterator {aka std::_Rb_tree_const_iterator >}’ will change in GCC 7.1
>  _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
>  ^~~

I've seen it too, but I have no idea what to do with it. I'm not even sure that 
it is in my
code instead of in Qt headers or even c++ header.

It's not exactly an informative message.

Since I compile with g++ version 7.2 it appears that it is just fine since it 
doesn't complain.

Regards,

Hans


Re: Please help test the new v4l-subdev support in v4l2-compliance

2018-02-05 Thread Mauro Carvalho Chehab
Em Mon, 5 Feb 2018 14:37:29 -0200
Mauro Carvalho Chehab  escreveu:

> Em Mon, 5 Feb 2018 08:21:54 -0800
> Tim Harvey  escreveu:
> 
> > Hans,
> > 
> > I'm failing compile (of master 4ee9911) with:
> > 
> >   CXX  v4l2_compliance-media-info.o
> > media-info.cpp: In function ‘media_type media_detect_type(const char*)’:
> > media-info.cpp:79:39: error: no matching function for call to
> > ‘std::basic_ifstream::basic_ifstream(std::__cxx11::string&)’
> >   std::ifstream uevent_file(uevent_path);
> >^  
> 
> Btw, while on it, a few days ago, I noticed several class warnings when
> building v4l-utils on Raspbian, saying that it was using some features
> that future versions of gcc would stop using at qv4l2. See enclosed.
> 
> I didn't have time to look on them.

FYI, it still happens with today's upstream's version:

4ee99116d0ec (HEAD, origin/master, origin/HEAD) v4l2-ctl: improve the 
fps calculation when streaming

$ gcc --version
gcc (Raspbian 6.3.0-18+rpi1) 6.3.0 20170516
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


> 
> Thanks,
> Mauro
> 
> In file included from /usr/include/c++/6/map:60:0,
>  from 
> /usr/include/arm-linux-gnueabihf/qt5/QtCore/qmetatype.h:57,
>  from 
> /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobject.h:54,
>  from 
> /usr/include/arm-linux-gnueabihf/qt5/QtWidgets/qwidget.h:44,
>  from 
> /usr/include/arm-linux-gnueabihf/qt5/QtWidgets/qmainwindow.h:43,
>  from 
> /usr/include/arm-linux-gnueabihf/qt5/QtWidgets/QMainWindow:1,
>  from qv4l2.h:25,
>  from ctrl-tab.cpp:20:
> /usr/include/c++/6/bits/stl_tree.h: In member function 
> ‘std::pair 
> std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, 
> _Alloc>::_M_get_insert_hint_unique_pos(std::_Rb_tree<_Key, _Val, _KeyOfValue, 
> _Compare, _Alloc>::const_iterator, const key_type&) [with _Key = unsigned 
> int; _Val = std::pair; _KeyOfValue = 
> std::_Select1st; 
> _Compare = std::less; _Alloc = std::allocator >]’:
> /usr/include/c++/6/bits/stl_tree.h:1928:5: note: parameter passing for 
> argument of type ‘std::_Rb_tree v4l2_query_ext_ctrl>, std::_Select1st >, std::less, 
> std::allocator 
> >::const_iterator {aka std::_Rb_tree_const_iterator >}’ will change in GCC 7.1
>  _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
>  ^~~
> /usr/include/c++/6/bits/stl_tree.h: In function ‘std::_Rb_tree<_Key, _Val, 
> _KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, 
> _KeyOfValue, _Compare, _Alloc>::_M_emplace_hint_unique(std::_Rb_tree<_Key, 
> _Val, _KeyOfValue, _Compare, _Alloc>::const_iterator, _Args&& ...) [with 
> _Args = {const std::piecewise_construct_t&, std::tuple, 
> std::tuple<>}; _Key = unsigned int; _Val = std::pair v4l2_query_ext_ctrl>; _KeyOfValue = std::_Select1st >; _Compare = std::less; _Alloc = 
> std::allocator]’:
> /usr/include/c++/6/bits/stl_tree.h:2193:7: note: parameter passing for 
> argument of type ‘std::_Rb_tree v4l2_query_ext_ctrl>, std::_Select1st >, std::less, 
> std::allocator 
> >::const_iterator {aka std::_Rb_tree_const_iterator >}’ will change in GCC 7.1
>_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
>^~~
> In file included from /usr/include/c++/6/map:61:0,
>  from 
> /usr/include/arm-linux-gnueabihf/qt5/QtCore/qmetatype.h:57,
>  from 
> /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobject.h:54,
>  from 
> /usr/include/arm-linux-gnueabihf/qt5/QtWidgets/qwidget.h:44,
>  from 
> /usr/include/arm-linux-gnueabihf/qt5/QtWidgets/qmainwindow.h:43,
>  from 
> /usr/include/arm-linux-gnueabihf/qt5/QtWidgets/QMainWindow:1,
>  from qv4l2.h:25,
>  from ctrl-tab.cpp:20:
> /usr/include/c++/6/bits/stl_map.h: In member function ‘void 
> ApplicationWindow::setWhat(QWidget*, unsigned int, const QString&)’:
> /usr/include/c++/6/bits/stl_map.h:483:4: note: parameter passing for argument 
> of type ‘std::_Rb_tree v4l2_query_ext_ctrl>, std::_Select1st >, std::less, 
> std::allocator 
> >::const_iterator {aka std::_Rb_tree_const_iterator >}’ will change in GCC 7.1
> __i = _M_t._M_emplace_hint_unique(__i, std::piecewise_construct,
> ^~~
> 

Re: Please help test the new v4l-subdev support in v4l2-compliance

2018-02-05 Thread Tim Harvey
On Mon, Feb 5, 2018 at 8:27 AM, Hans Verkuil  wrote:
> On 02/05/2018 05:21 PM, Tim Harvey wrote:
>
> 
>
>>
>> I ran a 'make distclean; ./bootstrap.sh && ./configure && make'
>>
>> last version I built successfully was '1bb8c70 v4l2-ctl: mention that
>> --set-subdev-fps is for testing only'
>
> That's a lot of revisions ago. I've been busy last weekend :-)

right... I was up to date Thursday morning! ;)

>
> Do a new git pull and try again. I remember hitting something similar during
> the weekend where I was missing a C++ include.
>

Yes, I tried that on my x86 dev host - same failure as from my target.

>>
>> I haven't dug into the failure at all. Are you using something new
>> with c++ requiring a new lib or specific version of something that
>> needs to be added to configure?
>
> Nope, bog standard C++. Real C++ pros are probably appalled by the code.
>

Google to the rescue: The ifstream constructor expects a const char*,
so you need to do ifstream file(filename.c_str()); to make it work.

the following patch fixes it:

diff --git a/utils/common/media-info.cpp b/utils/common/media-info.cpp
index eef743e..39da9b8 100644
--- a/utils/common/media-info.cpp
+++ b/utils/common/media-info.cpp
@@ -76,7 +76,7 @@ media_type media_detect_type(const char *device)
uevent_path += num2s(major(sb.st_rdev), false) + ":" +
num2s(minor(sb.st_rdev), false) + "/uevent";

-   std::ifstream uevent_file(uevent_path);
+   std::ifstream uevent_file(uevent_path.c_str());
if (uevent_file.fail())
return MEDIA_TYPE_UNKNOWN;

@@ -117,7 +117,7 @@ std::string media_get_device(__u32 major, __u32 minor)
sprintf(fmt, "%d:%d", major, minor);
uevent_path += std::string(fmt) + "/uevent";

-   std::ifstream uevent_file(uevent_path);
+   std::ifstream uevent_file(uevent_path.c_str());
if (uevent_file.fail())
return "";

Tim


Re: Please help test the new v4l-subdev support in v4l2-compliance

2018-02-05 Thread Mauro Carvalho Chehab
Em Mon, 5 Feb 2018 08:21:54 -0800
Tim Harvey  escreveu:

> Hans,
> 
> I'm failing compile (of master 4ee9911) with:
> 
>   CXX  v4l2_compliance-media-info.o
> media-info.cpp: In function ‘media_type media_detect_type(const char*)’:
> media-info.cpp:79:39: error: no matching function for call to
> ‘std::basic_ifstream::basic_ifstream(std::__cxx11::string&)’
>   std::ifstream uevent_file(uevent_path);
>^

Btw, while on it, a few days ago, I noticed several class warnings when
building v4l-utils on Raspbian, saying that it was using some features
that future versions of gcc would stop using at qv4l2. See enclosed.

I didn't have time to look on them.

Thanks,
Mauro

In file included from /usr/include/c++/6/map:60:0,
 from 
/usr/include/arm-linux-gnueabihf/qt5/QtCore/qmetatype.h:57,
 from /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobject.h:54,
 from 
/usr/include/arm-linux-gnueabihf/qt5/QtWidgets/qwidget.h:44,
 from 
/usr/include/arm-linux-gnueabihf/qt5/QtWidgets/qmainwindow.h:43,
 from 
/usr/include/arm-linux-gnueabihf/qt5/QtWidgets/QMainWindow:1,
 from qv4l2.h:25,
 from ctrl-tab.cpp:20:
/usr/include/c++/6/bits/stl_tree.h: In member function 
‘std::pair 
std::_Rb_tree<_Key, _Val, _KeyOfValue, _Compare, 
_Alloc>::_M_get_insert_hint_unique_pos(std::_Rb_tree<_Key, _Val, _KeyOfValue, 
_Compare, _Alloc>::const_iterator, const key_type&) [with _Key = unsigned int; 
_Val = std::pair; _KeyOfValue = 
std::_Select1st; _Compare 
= std::less; _Alloc = std::allocator]’:
/usr/include/c++/6/bits/stl_tree.h:1928:5: note: parameter passing for argument 
of type ‘std::_Rb_tree, std::_Select1st, std::less, std::allocator >::const_iterator {aka 
std::_Rb_tree_const_iterator}’ will change in GCC 7.1
 _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
 ^~~
/usr/include/c++/6/bits/stl_tree.h: In function ‘std::_Rb_tree<_Key, _Val, 
_KeyOfValue, _Compare, _Alloc>::iterator std::_Rb_tree<_Key, _Val, _KeyOfValue, 
_Compare, _Alloc>::_M_emplace_hint_unique(std::_Rb_tree<_Key, _Val, 
_KeyOfValue, _Compare, _Alloc>::const_iterator, _Args&& ...) [with _Args = 
{const std::piecewise_construct_t&, std::tuple, 
std::tuple<>}; _Key = unsigned int; _Val = std::pair; _KeyOfValue = std::_Select1st; _Compare = std::less; _Alloc = 
std::allocator]’:
/usr/include/c++/6/bits/stl_tree.h:2193:7: note: parameter passing for argument 
of type ‘std::_Rb_tree, std::_Select1st, std::less, std::allocator >::const_iterator {aka 
std::_Rb_tree_const_iterator}’ will change in GCC 7.1
   _Rb_tree<_Key, _Val, _KeyOfValue, _Compare, _Alloc>::
   ^~~
In file included from /usr/include/c++/6/map:61:0,
 from 
/usr/include/arm-linux-gnueabihf/qt5/QtCore/qmetatype.h:57,
 from /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobject.h:54,
 from 
/usr/include/arm-linux-gnueabihf/qt5/QtWidgets/qwidget.h:44,
 from 
/usr/include/arm-linux-gnueabihf/qt5/QtWidgets/qmainwindow.h:43,
 from 
/usr/include/arm-linux-gnueabihf/qt5/QtWidgets/QMainWindow:1,
 from qv4l2.h:25,
 from ctrl-tab.cpp:20:
/usr/include/c++/6/bits/stl_map.h: In member function ‘void 
ApplicationWindow::setWhat(QWidget*, unsigned int, const QString&)’:
/usr/include/c++/6/bits/stl_map.h:483:4: note: parameter passing for argument 
of type ‘std::_Rb_tree, std::_Select1st, std::less, std::allocator >::const_iterator {aka 
std::_Rb_tree_const_iterator}’ will change in GCC 7.1
__i = _M_t._M_emplace_hint_unique(__i, std::piecewise_construct,
^~~
/usr/include/c++/6/bits/stl_map.h: In member function ‘void 
ApplicationWindow::setWhat(QWidget*, unsigned int, long long int)’:
/usr/include/c++/6/bits/stl_map.h:483:4: note: parameter passing for argument 
of type ‘std::_Rb_tree, std::_Select1st, std::less, std::allocator >::const_iterator {aka 
std::_Rb_tree_const_iterator}’ will change in GCC 7.1
__i = _M_t._M_emplace_hint_unique(__i, std::piecewise_construct,
^~~
In file included from /usr/include/c++/6/map:60:0,
 from 
/usr/include/arm-linux-gnueabihf/qt5/QtCore/qmetatype.h:57,
 from /usr/include/arm-linux-gnueabihf/qt5/QtCore/qobject.h:54,
 from 
/usr/include/arm-linux-gnueabihf/qt5/QtWidgets/qwidget.h:44,
 from 
/usr/include/arm-linux-gnueabihf/qt5/QtWidgets/qmainwindow.h:43,
 from 
/usr/include/arm-linux-gnueabihf/qt5/QtWidgets/QMainWindow:1,
 from qv4l2.h:25,
   

Re: Please help test the new v4l-subdev support in v4l2-compliance

2018-02-05 Thread Hans Verkuil
On 02/05/2018 05:21 PM, Tim Harvey wrote:



> 
> I ran a 'make distclean; ./bootstrap.sh && ./configure && make'
> 
> last version I built successfully was '1bb8c70 v4l2-ctl: mention that
> --set-subdev-fps is for testing only'

That's a lot of revisions ago. I've been busy last weekend :-)

Do a new git pull and try again. I remember hitting something similar during
the weekend where I was missing a C++ include.

> 
> I haven't dug into the failure at all. Are you using something new
> with c++ requiring a new lib or specific version of something that
> needs to be added to configure?

Nope, bog standard C++. Real C++ pros are probably appalled by the code.

Regards,

Hans


Re: Please help test the new v4l-subdev support in v4l2-compliance

2018-02-05 Thread Tim Harvey
On Sat, Feb 3, 2018 at 7:56 AM, Hans Verkuil  wrote:
> Hi Tim, Jacopo,
>
> I have now finished writing the v4l2-compliance tests for the various 
> v4l-subdev
> ioctls. I managed to test some with the vimc driver, but that doesn't 
> implement all
> ioctls, so I could use some help testing my test code :-)
>
> To test you first need to apply these patches to your kernel:
>
> https://patchwork.linuxtv.org/patch/46817/
> https://patchwork.linuxtv.org/patch/46822/
>
> Otherwise the compliance test will fail a lot.
>
> Now run v4l2-compliance -u /dev/v4l-subdevX (or -uX as a shortcut) and see 
> what
> happens.
>
> I have tested the following ioctls with vimc, so they are likely to be 
> correct:
>
> #define VIDIOC_SUBDEV_G_FMT _IOWR('V',  4, struct 
> v4l2_subdev_format)
> #define VIDIOC_SUBDEV_S_FMT _IOWR('V',  5, struct 
> v4l2_subdev_format)
> #define VIDIOC_SUBDEV_ENUM_MBUS_CODE_IOWR('V',  2, struct 
> v4l2_subdev_mbus_code_enum)
> #define VIDIOC_SUBDEV_ENUM_FRAME_SIZE   _IOWR('V', 74, struct 
> v4l2_subdev_frame_size_enum)
>
> All others are untested:
>
> #define VIDIOC_SUBDEV_G_FRAME_INTERVAL  _IOWR('V', 21, struct 
> v4l2_subdev_frame_interval)
> #define VIDIOC_SUBDEV_S_FRAME_INTERVAL  _IOWR('V', 22, struct 
> v4l2_subdev_frame_interval)
> #define VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL   _IOWR('V', 75, struct 
> v4l2_subdev_frame_interval_enum)
> #define VIDIOC_SUBDEV_G_CROP_IOWR('V', 59, struct 
> v4l2_subdev_crop)
> #define VIDIOC_SUBDEV_S_CROP_IOWR('V', 60, struct 
> v4l2_subdev_crop)
> #define VIDIOC_SUBDEV_G_SELECTION   _IOWR('V', 61, struct 
> v4l2_subdev_selection)
> #define VIDIOC_SUBDEV_S_SELECTION   _IOWR('V', 62, struct 
> v4l2_subdev_selection)
> #define VIDIOC_SUBDEV_G_EDID_IOWR('V', 40, struct 
> v4l2_edid)
> #define VIDIOC_SUBDEV_S_EDID_IOWR('V', 41, struct 
> v4l2_edid)
> #define VIDIOC_SUBDEV_S_DV_TIMINGS  _IOWR('V', 87, struct 
> v4l2_dv_timings)
> #define VIDIOC_SUBDEV_G_DV_TIMINGS  _IOWR('V', 88, struct 
> v4l2_dv_timings)
> #define VIDIOC_SUBDEV_ENUM_DV_TIMINGS   _IOWR('V', 98, struct 
> v4l2_enum_dv_timings)
> #define VIDIOC_SUBDEV_QUERY_DV_TIMINGS  _IOR('V', 99, struct 
> v4l2_dv_timings)
> #define VIDIOC_SUBDEV_DV_TIMINGS_CAP_IOWR('V', 100, struct 
> v4l2_dv_timings_cap)
>
> I did the best I could, but there may very well be bugs in the test code.
>
> I will also test the timings and edid ioctls myself later next week at work.
>
> The v4l2-compliance utility can now also test media devices (-m option), 
> although that's
> early days yet. Eventually I want to be able to walk the graph and test each 
> device in
> turn.
>
> I have this idea of making v4l2-compliance, cec-compliance and 
> media-compliance
> frontends that can all share the actual test code. And perhaps that can 
> include a new
> dvb-compliance as well.
>
> However, that's future music, for now I just want to get proper ioctl test 
> coverage
> so driver authors can at least have some confidence in their code by running 
> these
> tests.
>

Hans,

I'm failing compile (of master 4ee9911) with:

  CXX  v4l2_compliance-media-info.o
media-info.cpp: In function ‘media_type media_detect_type(const char*)’:
media-info.cpp:79:39: error: no matching function for call to
‘std::basic_ifstream::basic_ifstream(std::__cxx11::string&)’
  std::ifstream uevent_file(uevent_path);
   ^
In file included from media-info.cpp:35:0:
/usr/include/c++/5/fstream:495:7: note: candidate:
std::basic_ifstream<_CharT, _Traits>::basic_ifstream(const char*,
std::ios_base::openmode) [with _CharT = char; _Traits =
std::char_traits; std::ios_base::openmode = std::_Ios_Openmode]
   basic_ifstream(const char* __s, ios_base::openmode __mode = ios_base::in)
   ^
/usr/include/c++/5/fstream:495:7: note:   no known conversion for
argument 1 from ‘std::__cxx11::string {aka
std::__cxx11::basic_string}’ to ‘const char*’
In file included from media-info.cpp:35:0:
/usr/include/c++/5/fstream:481:7: note: candidate:
std::basic_ifstream<_CharT, _Traits>::basic_ifstream() [with _CharT =
char; _Traits = std::char_traits]
   basic_ifstream() : __istream_type(), _M_filebuf()
   ^
/usr/include/c++/5/fstream:481:7: note:   candidate expects 0
arguments, 1 provided
In file included from media-info.cpp:35:0:
/usr/include/c++/5/fstream:455:11: note: candidate:
std::basic_ifstream::basic_ifstream(const
std::basic_ifstream&)
 class basic_ifstream : public basic_istream<_CharT, _Traits>
   ^
/usr/include/c++/5/fstream:455:11: note:   no known conversion for
argument 1 from ‘std::__cxx11::string {aka
std::__cxx11::basic_string}’ to ‘const
std::basic_ifstream&’
media-info.cpp: In function ‘std::__cxx11::string
media_get_device(__u32, __u32)’: