linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil+cisco@kernel.org>
To: tumic@gpxsee.org, Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Martin Tůma" <martin.tuma@digiteqautomotive.com>
Subject: Re: [PATCH] media: pci: mgb4: Fix timings comparison in VIDIOC_S_DV_TIMINGS
Date: Mon, 25 Aug 2025 17:03:37 +0200	[thread overview]
Message-ID: <7ce56415-77d9-4952-bf7a-a8610d393ded@kernel.org> (raw)
In-Reply-To: <20250804092032.1639-1-tumic@gpxsee.org>

On 04/08/2025 11:20, tumic@gpxsee.org wrote:
> From: Martin Tůma <martin.tuma@digiteqautomotive.com>
> 
> Compare the whole v4l2_bt_timings struct, not just the width/height when
> setting new timings. Timings with the same resolution and different
> pixelclock can now be properly set.
> 
> Signed-off-by: Martin Tůma <martin.tuma@digiteqautomotive.com>
> ---
>  drivers/media/pci/mgb4/mgb4_vin.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/pci/mgb4/mgb4_vin.c b/drivers/media/pci/mgb4/mgb4_vin.c
> index 989e93f67f75..15182549d108 100644
> --- a/drivers/media/pci/mgb4/mgb4_vin.c
> +++ b/drivers/media/pci/mgb4/mgb4_vin.c
> @@ -610,8 +610,8 @@ static int vidioc_s_dv_timings(struct file *file, void *fh,
>  	    timings->bt.height < video_timings_cap.bt.min_height ||
>  	    timings->bt.height > video_timings_cap.bt.max_height)
>  		return -EINVAL;
> -	if (timings->bt.width == vindev->timings.bt.width &&
> -	    timings->bt.height == vindev->timings.bt.height)
> +	if (!memcmp(&timings->bt, &vindev->timings.bt,
> +		    sizeof(struct v4l2_bt_timings)))

I would recommend calling v4l2_match_dv_timings() instead.
Otherwise you would also match on the reserved fields and 'standards'
and 'flags' fields.

Regards,

	Hans

>  		return 0;
>  	if (vb2_is_busy(&vindev->queue))
>  		return -EBUSY;
> 
> base-commit: d968e50b5c26642754492dea23cbd3592bde62d8


  reply	other threads:[~2025-08-25 15:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-04  9:20 [PATCH] media: pci: mgb4: Fix timings comparison in VIDIOC_S_DV_TIMINGS tumic
2025-08-25 15:03 ` Hans Verkuil [this message]
2025-08-25 15:22   ` Martin Tůma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7ce56415-77d9-4952-bf7a-a8610d393ded@kernel.org \
    --to=hverkuil+cisco@kernel.org \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=martin.tuma@digiteqautomotive.com \
    --cc=mchehab@kernel.org \
    --cc=tumic@gpxsee.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).