All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] v4l: ioctl: Clear the v4l2_pix_format_mplane reserved field
@ 2016-06-28 13:20 Laurent Pinchart
  2016-06-30 12:46 ` Kieran Bingham
  2016-07-01 10:52 ` Hans Verkuil
  0 siblings, 2 replies; 4+ messages in thread
From: Laurent Pinchart @ 2016-06-28 13:20 UTC (permalink / raw)
  To: linux-media; +Cc: Hans Verkuil, Kieran Bingham

The S_FMT and TRY_FMT handlers in multiplane mode attempt at clearing
the reserved fields of the v4l2_format structure after the pix_mp
member. However, the reserved fields are inside pix_mp, not after it.

Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/media/v4l2-core/v4l2-ioctl.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Kieran, this should fix the v4l2-compliance failures you saw when not clearing
pix_mp.reserved manually in the FDP1 driver. Could you please test it ?

diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index 19d3aee3b374..86332072a575 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1508,7 +1508,7 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops,
 	case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
 		if (unlikely(!is_rx || !is_vid || !ops->vidioc_s_fmt_vid_cap_mplane))
 			break;
-		CLEAR_AFTER_FIELD(p, fmt.pix_mp);
+		CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
 		return ops->vidioc_s_fmt_vid_cap_mplane(file, fh, arg);
 	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
 		if (unlikely(!is_rx || !is_vid || !ops->vidioc_s_fmt_vid_overlay))
@@ -1536,7 +1536,7 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops,
 	case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
 		if (unlikely(!is_tx || !is_vid || !ops->vidioc_s_fmt_vid_out_mplane))
 			break;
-		CLEAR_AFTER_FIELD(p, fmt.pix_mp);
+		CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
 		return ops->vidioc_s_fmt_vid_out_mplane(file, fh, arg);
 	case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
 		if (unlikely(!is_tx || !is_vid || !ops->vidioc_s_fmt_vid_out_overlay))
@@ -1598,7 +1598,7 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops,
 	case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
 		if (unlikely(!is_rx || !is_vid || !ops->vidioc_try_fmt_vid_cap_mplane))
 			break;
-		CLEAR_AFTER_FIELD(p, fmt.pix_mp);
+		CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
 		return ops->vidioc_try_fmt_vid_cap_mplane(file, fh, arg);
 	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
 		if (unlikely(!is_rx || !is_vid || !ops->vidioc_try_fmt_vid_overlay))
@@ -1626,7 +1626,7 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops,
 	case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
 		if (unlikely(!is_tx || !is_vid || !ops->vidioc_try_fmt_vid_out_mplane))
 			break;
-		CLEAR_AFTER_FIELD(p, fmt.pix_mp);
+		CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
 		return ops->vidioc_try_fmt_vid_out_mplane(file, fh, arg);
 	case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
 		if (unlikely(!is_tx || !is_vid || !ops->vidioc_try_fmt_vid_out_overlay))
-- 
Regards,

Laurent Pinchart


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] v4l: ioctl: Clear the v4l2_pix_format_mplane reserved field
  2016-06-28 13:20 [PATCH] v4l: ioctl: Clear the v4l2_pix_format_mplane reserved field Laurent Pinchart
@ 2016-06-30 12:46 ` Kieran Bingham
  2016-07-01 10:52 ` Hans Verkuil
  1 sibling, 0 replies; 4+ messages in thread
From: Kieran Bingham @ 2016-06-30 12:46 UTC (permalink / raw)
  To: Laurent Pinchart, linux-media; +Cc: Hans Verkuil

Hi Laurent,

Thanks - this fixes the issue I saw.

On 28/06/16 14:20, Laurent Pinchart wrote:
> The S_FMT and TRY_FMT handlers in multiplane mode attempt at clearing
> the reserved fields of the v4l2_format structure after the pix_mp
> member. However, the reserved fields are inside pix_mp, not after it.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

Tested-by: Kieran Bingham <kieran@bingham.xyz>

> ---
>  drivers/media/v4l2-core/v4l2-ioctl.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> Kieran, this should fix the v4l2-compliance failures you saw when not clearing
> pix_mp.reserved manually in the FDP1 driver. Could you please test it ?
> 
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> index 19d3aee3b374..86332072a575 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -1508,7 +1508,7 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops,
>  	case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
>  		if (unlikely(!is_rx || !is_vid || !ops->vidioc_s_fmt_vid_cap_mplane))
>  			break;
> -		CLEAR_AFTER_FIELD(p, fmt.pix_mp);
> +		CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
>  		return ops->vidioc_s_fmt_vid_cap_mplane(file, fh, arg);
>  	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
>  		if (unlikely(!is_rx || !is_vid || !ops->vidioc_s_fmt_vid_overlay))
> @@ -1536,7 +1536,7 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops,
>  	case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
>  		if (unlikely(!is_tx || !is_vid || !ops->vidioc_s_fmt_vid_out_mplane))
>  			break;
> -		CLEAR_AFTER_FIELD(p, fmt.pix_mp);
> +		CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
>  		return ops->vidioc_s_fmt_vid_out_mplane(file, fh, arg);
>  	case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
>  		if (unlikely(!is_tx || !is_vid || !ops->vidioc_s_fmt_vid_out_overlay))
> @@ -1598,7 +1598,7 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops,
>  	case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
>  		if (unlikely(!is_rx || !is_vid || !ops->vidioc_try_fmt_vid_cap_mplane))
>  			break;
> -		CLEAR_AFTER_FIELD(p, fmt.pix_mp);
> +		CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
>  		return ops->vidioc_try_fmt_vid_cap_mplane(file, fh, arg);
>  	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
>  		if (unlikely(!is_rx || !is_vid || !ops->vidioc_try_fmt_vid_overlay))
> @@ -1626,7 +1626,7 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops,
>  	case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
>  		if (unlikely(!is_tx || !is_vid || !ops->vidioc_try_fmt_vid_out_mplane))
>  			break;
> -		CLEAR_AFTER_FIELD(p, fmt.pix_mp);
> +		CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
>  		return ops->vidioc_try_fmt_vid_out_mplane(file, fh, arg);
>  	case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
>  		if (unlikely(!is_tx || !is_vid || !ops->vidioc_try_fmt_vid_out_overlay))
> 

-- 
Regards

Kieran Bingham

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] v4l: ioctl: Clear the v4l2_pix_format_mplane reserved field
  2016-06-28 13:20 [PATCH] v4l: ioctl: Clear the v4l2_pix_format_mplane reserved field Laurent Pinchart
  2016-06-30 12:46 ` Kieran Bingham
@ 2016-07-01 10:52 ` Hans Verkuil
  2016-08-04 13:21   ` Laurent Pinchart
  1 sibling, 1 reply; 4+ messages in thread
From: Hans Verkuil @ 2016-07-01 10:52 UTC (permalink / raw)
  To: Laurent Pinchart, linux-media; +Cc: Kieran Bingham

On 06/28/2016 03:20 PM, Laurent Pinchart wrote:
> The S_FMT and TRY_FMT handlers in multiplane mode attempt at clearing
> the reserved fields of the v4l2_format structure after the pix_mp
> member. However, the reserved fields are inside pix_mp, not after it.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
>  drivers/media/v4l2-core/v4l2-ioctl.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> Kieran, this should fix the v4l2-compliance failures you saw when not clearing
> pix_mp.reserved manually in the FDP1 driver. Could you please test it ?
> 
> diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
> index 19d3aee3b374..86332072a575 100644
> --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> @@ -1508,7 +1508,7 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops,
>  	case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
>  		if (unlikely(!is_rx || !is_vid || !ops->vidioc_s_fmt_vid_cap_mplane))
>  			break;
> -		CLEAR_AFTER_FIELD(p, fmt.pix_mp);
> +		CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);

The same is needed in v4l_try_fmt.

Regards,

	Hans

>  		return ops->vidioc_s_fmt_vid_cap_mplane(file, fh, arg);
>  	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
>  		if (unlikely(!is_rx || !is_vid || !ops->vidioc_s_fmt_vid_overlay))
> @@ -1536,7 +1536,7 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops *ops,
>  	case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
>  		if (unlikely(!is_tx || !is_vid || !ops->vidioc_s_fmt_vid_out_mplane))
>  			break;
> -		CLEAR_AFTER_FIELD(p, fmt.pix_mp);
> +		CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
>  		return ops->vidioc_s_fmt_vid_out_mplane(file, fh, arg);
>  	case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
>  		if (unlikely(!is_tx || !is_vid || !ops->vidioc_s_fmt_vid_out_overlay))
> @@ -1598,7 +1598,7 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops,
>  	case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
>  		if (unlikely(!is_rx || !is_vid || !ops->vidioc_try_fmt_vid_cap_mplane))
>  			break;
> -		CLEAR_AFTER_FIELD(p, fmt.pix_mp);
> +		CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
>  		return ops->vidioc_try_fmt_vid_cap_mplane(file, fh, arg);
>  	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
>  		if (unlikely(!is_rx || !is_vid || !ops->vidioc_try_fmt_vid_overlay))
> @@ -1626,7 +1626,7 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops,
>  	case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
>  		if (unlikely(!is_tx || !is_vid || !ops->vidioc_try_fmt_vid_out_mplane))
>  			break;
> -		CLEAR_AFTER_FIELD(p, fmt.pix_mp);
> +		CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
>  		return ops->vidioc_try_fmt_vid_out_mplane(file, fh, arg);
>  	case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
>  		if (unlikely(!is_tx || !is_vid || !ops->vidioc_try_fmt_vid_out_overlay))
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] v4l: ioctl: Clear the v4l2_pix_format_mplane reserved field
  2016-07-01 10:52 ` Hans Verkuil
@ 2016-08-04 13:21   ` Laurent Pinchart
  0 siblings, 0 replies; 4+ messages in thread
From: Laurent Pinchart @ 2016-08-04 13:21 UTC (permalink / raw)
  To: Hans Verkuil; +Cc: Laurent Pinchart, linux-media, Kieran Bingham

Hi Hans,

On Friday 01 Jul 2016 12:52:31 Hans Verkuil wrote:
> On 06/28/2016 03:20 PM, Laurent Pinchart wrote:
> > The S_FMT and TRY_FMT handlers in multiplane mode attempt at clearing
> > the reserved fields of the v4l2_format structure after the pix_mp
> > member. However, the reserved fields are inside pix_mp, not after it.
> > 
> > Signed-off-by: Laurent Pinchart
> > <laurent.pinchart+renesas@ideasonboard.com>
> > ---
> > 
> >  drivers/media/v4l2-core/v4l2-ioctl.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > Kieran, this should fix the v4l2-compliance failures you saw when not
> > clearing pix_mp.reserved manually in the FDP1 driver. Could you please
> > test it ?
> > 
> > diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c
> > b/drivers/media/v4l2-core/v4l2-ioctl.c index 19d3aee3b374..86332072a575
> > 100644
> > --- a/drivers/media/v4l2-core/v4l2-ioctl.c
> > +++ b/drivers/media/v4l2-core/v4l2-ioctl.c
> > @@ -1508,7 +1508,7 @@ static int v4l_s_fmt(const struct v4l2_ioctl_ops
> > *ops,> 
> >  	case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
> >  		if (unlikely(!is_rx || !is_vid || !ops-
>vidioc_s_fmt_vid_cap_mplane))
> >  		
> >  			break;
> > 
> > -		CLEAR_AFTER_FIELD(p, fmt.pix_mp);
> > +		CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
> 
> The same is needed in v4l_try_fmt.

Yes it is.

[snip]

Oh, surprise, it's here already :-)

> > @@ -1598,7 +1598,7 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops
> >  	case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
> >  		if (unlikely(!is_rx || !is_vid || !ops->
> > vidioc_try_fmt_vid_cap_mplane))
> >  			break;
> > -		CLEAR_AFTER_FIELD(p, fmt.pix_mp);
> > +		CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
> >  		return ops->vidioc_try_fmt_vid_cap_mplane(file, fh, arg);
> >  	case V4L2_BUF_TYPE_VIDEO_OVERLAY:
> >  		if (unlikely(!is_rx || !is_vid || !ops->
> > vidioc_try_fmt_vid_overlay))
> > @@ -1626,7 +1626,7 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops
> >  	case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE:
> >  		if (unlikely(!is_tx || !is_vid || !ops->
> > vidioc_try_fmt_vid_out_mplane))
> >  			break;
> > -		CLEAR_AFTER_FIELD(p, fmt.pix_mp);
> > +		CLEAR_AFTER_FIELD(p, fmt.pix_mp.xfer_func);
> >  		return ops->vidioc_try_fmt_vid_out_mplane(file, fh, arg);
> >  	case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY:
> >  		if (unlikely(!is_tx || !is_vid ||
> >  		!ops->vidioc_try_fmt_vid_out_overlay))

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-08-04 13:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-28 13:20 [PATCH] v4l: ioctl: Clear the v4l2_pix_format_mplane reserved field Laurent Pinchart
2016-06-30 12:46 ` Kieran Bingham
2016-07-01 10:52 ` Hans Verkuil
2016-08-04 13:21   ` Laurent Pinchart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.