mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hans de Goede <hansg@kernel.org>
To: Ricardo Ribalda <ribalda@chromium.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 9/9] media: uvcvideo: Support granular power saving for compat syscalls
Date: Mon, 16 Jun 2025 16:15:30 +0200	[thread overview]
Message-ID: <a059f615-8afe-4e9b-8b03-b3fcdf0b0b0a@kernel.org> (raw)
In-Reply-To: <20250602-uvc-grannular-invert-v2-9-c871934ad880@chromium.org>

Hi Ricardo,

On 2-Jun-25 15:06, Ricardo Ribalda wrote:
> Right now we cannot support granular power saving on compat syscalls
> because the VIDIOC_*32 NRs defines are not accessible to drivers.
> 
> Use the v4l2_compat_translate_cmd  helper to convert the compat syscall
> NRs into syscall NRs.
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>

Thanks, patch looks good to me:

Reviewed-by: Hans de Goede <hansg@kernel.org>

Regards,

Hans


> ---
>  drivers/media/usb/uvc/uvc_v4l2.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c
> index 13388879091c46ff74582226146521b5b5eb3d10..8358ca54b248dd1cf7c984b206b8e550cd883e54 100644
> --- a/drivers/media/usb/uvc/uvc_v4l2.c
> +++ b/drivers/media/usb/uvc/uvc_v4l2.c
> @@ -1237,15 +1237,13 @@ static long uvc_v4l2_pm_ioctl(struct file *file,
>  static long uvc_v4l2_unlocked_ioctl(struct file *file,
>  				    unsigned int cmd, unsigned long arg)
>  {
> -	/*
> -	 * For now, we do not support granular power saving for compat
> -	 * syscalls.
> -	 */
> +	unsigned int converted_cmd = cmd;
> +
>  	if (in_compat_syscall())
> -		return uvc_v4l2_pm_ioctl(file, cmd, arg);
> +		converted_cmd = v4l2_compat_translate_cmd(cmd);
>  
>  	/* The following IOCTLs do need to turn on the camera. */
> -	switch (cmd) {
> +	switch (converted_cmd) {
>  	case UVCIOC_CTRL_QUERY:
>  	case VIDIOC_G_CTRL:
>  	case VIDIOC_G_EXT_CTRLS:
> 


  reply	other threads:[~2025-06-16 14:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-02 13:06 [PATCH v2 0/9] media: uvcvideo: Invert granular PM logic + PM fix Ricardo Ribalda
2025-06-02 13:06 ` [PATCH v2 1/9] media: uvcvideo: Refactor uvc_queue_streamon Ricardo Ribalda
2025-06-02 13:06 ` [PATCH v2 2/9] media: uvcvideo: Refactor uvc_v4l2_compat_ioctl32 Ricardo Ribalda
2025-06-02 13:06 ` [PATCH v2 3/9] media: uvcvideo: Use vb2 ioctl and fop helpers Ricardo Ribalda
2025-06-02 13:06 ` [PATCH v2 4/9] media: uvcvideo: Remove stream->is_streaming field Ricardo Ribalda
2025-06-02 13:06 ` [PATCH v2 5/9] media: uvcvideo: Turn on the camera if V4L2_EVENT_SUB_FL_SEND_INITIAL Ricardo Ribalda
2025-06-02 13:06 ` [PATCH v2 6/9] media: uvcvideo: Do not enable camera during UVCIOC_CTRL_MAP* Ricardo Ribalda
2025-06-02 13:06 ` [PATCH v2 7/9] media: uvcvideo: uvc_v4l2_unlocked_ioctl: Invert PM logic Ricardo Ribalda
2025-06-16 14:14   ` Hans de Goede
2025-06-30 13:21     ` Hans de Goede
2025-06-30 13:35   ` Hans Verkuil
2025-06-02 13:06 ` [PATCH v2 8/9] media: core: export v4l2_compat_translate_cmd() Ricardo Ribalda
2025-06-16 14:14   ` Hans de Goede
2025-06-30 13:06   ` Hans de Goede
2025-06-30 13:38   ` hans
2025-06-02 13:06 ` [PATCH v2 9/9] media: uvcvideo: Support granular power saving for compat syscalls Ricardo Ribalda
2025-06-16 14:15   ` Hans de Goede [this message]
2025-06-30 13:39   ` hans

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=a059f615-8afe-4e9b-8b03-b3fcdf0b0b0a@kernel.org \
    --to=hansg@kernel.org \
    --cc=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --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®