public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hansg@kernel.org>
To: Ricardo Ribalda <ribalda@chromium.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Hans Verkuil <hans@jjverkuil.nl>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 5/5] media: uvcvideo: Use prio state from v4l2_device
Date: Mon, 16 Jun 2025 22:50:54 +0200	[thread overview]
Message-ID: <843b32df-64d5-4711-8415-4044174e575f@kernel.org> (raw)
In-Reply-To: <CANiDSCur8zys_CSZC9+-QdD0U556A7HLLdSN8mJuOpXm+Ls8Wg@mail.gmail.com>

Hi Ricardo,

On 16-Jun-25 8:30 PM, Ricardo Ribalda wrote:
> Hello All
> 
> On Mon, 16 Jun 2025 at 17:24, Ricardo Ribalda <ribalda@chromium.org> wrote:
>>
>> Currently, a UVC device can have multiple chains, and each chain maintains
>> its own priority state. While this behavior is technically correct for UVC,
>> uvcvideo is the *only* V4L2 driver that does not utilize the priority state
>> defined within `v4l2_device`.
>>
>> This patch modifies uvcvideo to use the `v4l2_device` priority state. While
>> this might not be strictly "correct" for uvcvideo's multi-chain design, it
>> aligns uvcvideo with the rest of the V4L2 drivers, providing "correct enough"
>> behavior and enabling code cleanup in v4l2-core. Also, multi-chain
>> devices are extremely rare, they are typically implemented as two
>> independent usb devices.
> 
> As the cover letter says, this last patch 5/5 is a RFC. We can decide
> if it is worth to keep it or not.
> 
> The pros is that we can do some cleanup in the core, the cons is that
> it might break kAPI.

I've no objections against this change, but lets wait and see what
Laurent has to say.

Regards,

Hans




>> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
>> ---
>>  drivers/media/usb/uvc/uvc_driver.c | 2 --
>>  drivers/media/usb/uvc/uvcvideo.h   | 1 -
>>  2 files changed, 3 deletions(-)
>>
>> diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
>> index accfb4ca3c72cb899185ddc8ecf4e29143d58fc6..e3795e40f14dc325e5bd120f5f45b60937841641 100644
>> --- a/drivers/media/usb/uvc/uvc_driver.c
>> +++ b/drivers/media/usb/uvc/uvc_driver.c
>> @@ -1728,7 +1728,6 @@ static struct uvc_video_chain *uvc_alloc_chain(struct uvc_device *dev)
>>         INIT_LIST_HEAD(&chain->entities);
>>         mutex_init(&chain->ctrl_mutex);
>>         chain->dev = dev;
>> -       v4l2_prio_init(&chain->prio);
>>
>>         return chain;
>>  }
>> @@ -2008,7 +2007,6 @@ int uvc_register_video_device(struct uvc_device *dev,
>>         vdev->fops = fops;
>>         vdev->ioctl_ops = ioctl_ops;
>>         vdev->release = uvc_release;
>> -       vdev->prio = &stream->chain->prio;
>>         vdev->queue = &queue->queue;
>>         vdev->lock = &queue->mutex;
>>         if (type == V4L2_BUF_TYPE_VIDEO_OUTPUT)
>> diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
>> index 3e6d2d912f3a1cfcf63b2bc8edd3f86f3da305db..5ed9785d59c698cc7e0ac69955b892f932961617 100644
>> --- a/drivers/media/usb/uvc/uvcvideo.h
>> +++ b/drivers/media/usb/uvc/uvcvideo.h
>> @@ -354,7 +354,6 @@ struct uvc_video_chain {
>>                                                  * uvc_fh.pending_async_ctrls
>>                                                  */
>>
>> -       struct v4l2_prio_state prio;            /* V4L2 priority state */
>>         u32 caps;                               /* V4L2 chain-wide caps */
>>         u8 ctrl_class_bitmap;                   /* Bitmap of valid classes */
>>  };
>>
>> --
>> 2.50.0.rc1.591.g9c95f17f64-goog
>>
> 
> 


  reply	other threads:[~2025-06-16 20:50 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-16 15:24 [PATCH v4 0/5] media: uvcvideo: use vb2 ioctl and fop helpers Ricardo Ribalda
2025-06-16 15:24 ` [PATCH v4 1/5] media: uvcvideo: Use " Ricardo Ribalda
2025-06-16 15:24 ` [PATCH v4 2/5] media: uvcvideo: Handle locks in uvc_queue_return_buffers Ricardo Ribalda
2025-06-17  9:21   ` Hans Verkuil
2025-06-16 15:24 ` [PATCH v4 3/5] media: uvcvideo: Split uvc_stop_streaming() Ricardo Ribalda
2025-06-17  9:27   ` Hans Verkuil
2025-06-30 12:59     ` Hans de Goede
2025-06-30 13:10       ` Laurent Pinchart
2025-06-30 13:12         ` Hans de Goede
2025-06-30 13:24           ` Laurent Pinchart
2025-06-30 13:26             ` Ricardo Ribalda
2025-06-30 14:17   ` Laurent Pinchart
2025-06-30 15:12     ` Hans de Goede
2025-06-30 15:24       ` Laurent Pinchart
2025-06-16 15:24 ` [PATCH v4 4/5] media: uvcvideo: Remove stream->is_streaming field Ricardo Ribalda
2025-06-17  9:29   ` Hans Verkuil
2025-06-16 15:24 ` [PATCH v4 5/5] media: uvcvideo: Use prio state from v4l2_device Ricardo Ribalda
2025-06-16 18:30   ` Ricardo Ribalda
2025-06-16 20:50     ` Hans de Goede [this message]
2025-06-17 10:07     ` Laurent Pinchart
2025-06-17 11:09       ` Ricardo Ribalda
2025-06-17 14:06         ` Laurent Pinchart
2025-06-17  9:35   ` Hans Verkuil

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=843b32df-64d5-4711-8415-4044174e575f@kernel.org \
    --to=hansg@kernel.org \
    --cc=hans@jjverkuil.nl \
    --cc=hdegoede@redhat.com \
    --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