mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Ricardo Ribalda <ribalda@chromium.org>
Cc: Hans de Goede <hansg@kernel.org>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: uvcvideo: Fix comments in uvc_meta_detect_msxu
Date: Wed, 16 Jul 2025 02:15:32 +0300	[thread overview]
Message-ID: <20250715231532.GA13915@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20250714-uvc-meta-followup-v1-1-67bd2dc05ef2@chromium.org>

Hi Ricardo,

On Mon, Jul 14, 2025 at 04:45:43PM +0000, Ricardo Ribalda wrote:
> The comments can be more precise. Let's fix them.
> 
> Fixes: 6cb786f040ad ("media: uvcvideo: Auto-set UVC_QUIRK_MSXU_META")
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
> This series fixes the uvc metadata series landed in:
> https://patchwork.linuxtv.org/project/linux-media/patch/998c5fb0-8d32-496c-a1e2-cc9c1a73ede0@kernel.org/
> 
> There is no need to Cc: stable, because the series have not landed in
> any stable kernel.
> ---
>  drivers/media/usb/uvc/uvc_metadata.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/usb/uvc/uvc_metadata.c b/drivers/media/usb/uvc/uvc_metadata.c
> index 229e08ff323eed9129d835b24ea2e8085bb713b8..2905e46514d74cee09215d86e8eb7ad6e787ece1 100644
> --- a/drivers/media/usb/uvc/uvc_metadata.c
> +++ b/drivers/media/usb/uvc/uvc_metadata.c
> @@ -196,7 +196,10 @@ static int uvc_meta_detect_msxu(struct uvc_device *dev)
>  	if (!data)
>  		return -ENOMEM;
>  
> -	/* Check if the metadata is already enabled. */
> +	/*
> +	 * Check if the metadata is already enabled, or if the device always
> +	 * returns metadata.
> +	 */
>  	ret = uvc_query_ctrl(dev, UVC_GET_CUR, entity->id, dev->intfnum,
>  			     MSXU_CONTROL_METADATA, data, sizeof(*data));
>  	if (ret)
> @@ -208,9 +211,9 @@ static int uvc_meta_detect_msxu(struct uvc_device *dev)
>  	}
>  
>  	/*
> -	 * We have seen devices that require 1 to enable the metadata, others
> -	 * requiring a value != 1 and others requiring a value >1. Luckily for
> -	 * us, the value from GET_MAX seems to work all the time.
> +	 * Set the value of MSXU_CONTROL_METADATA to the value from GET_MAX to
> +	 * enable the production of MSXU metadata.

Let's expand this to tell why we return early when GET_MAX returns 0.

	 * Set the value of MSXU_CONTROL_METADATA to the value reported by
	 * GET_MAX to enable production of MSXU metadata. The GET_MAX request
	 * reports the maximum size of the metadata, if its value is 0 then MSXU
	 * metadata is not supported. For more information, see
	 * https://learn.microsoft.com/en-us/windows-hardware/drivers/stream/uvc-extensions-1-5#2229-metadata-control

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> +	 * https://learn.microsoft.com/en-us/windows-hardware/drivers/stream/uvc-extensions-1-5#2229-metadata-control
>  	 */
>  	ret = uvc_query_ctrl(dev, UVC_GET_MAX, entity->id, dev->intfnum,
>  			     MSXU_CONTROL_METADATA, data, sizeof(*data));
> 
> ---
> base-commit: d968e50b5c26642754492dea23cbd3592bde62d8
> change-id: 20250714-uvc-meta-followup-1ccb6e8efc2b

-- 
Regards,

Laurent Pinchart

      reply	other threads:[~2025-07-15 23:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-14 16:45 Ricardo Ribalda
2025-07-15 23:15 ` Laurent Pinchart [this message]

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=20250715231532.GA13915@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=hansg@kernel.org \
    --cc=hverkuil@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=ribalda@chromium.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

all inboxes | Powered by JetHome®