mbox series

[v2,0/4] media: uvcvideo: Prepare deprecation of nodrop

Message ID 20241218-uvc-deprecate-v2-0-ab814139e983@chromium.org (mailing list archive)
Headers show
Series media: uvcvideo: Prepare deprecation of nodrop | expand

Message

Ricardo Ribalda Dec. 18, 2024, 9:39 p.m. UTC
We intend to deprecate the nodrop parameter in the future and adopt the
default behaviour of the other media drivers: return buffers with an error
to userspace with V4L2_BUF_FLAG_ERROR set in v4l2_buffer.flags.

Make the first step in the deprecation by changing the default value of
the parameter and printing an error message when the value is changed.

While implementing this change, Hans found an error in
uvc_queue_buffer_complete(). This series also fix it.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
Changes in v2:
- Improve cover letter wording.
- Add new patch to fix vb2_buffer_done()
- Link to v1: https://lore.kernel.org/r/20241217-uvc-deprecate-v1-0-57d353f68f8f@chromium.org

---
Ricardo Ribalda (4):
      media: uvcvideo: Propagate buf->error to userspace
      media: uvcvideo: Invert default value for nodrop module param
      media: uvcvideo: Allow changing noparam on the fly
      media: uvcvideo: Announce the user our deprecation intentions

 drivers/media/usb/uvc/uvc_driver.c | 23 ++++++++++++++++++++---
 drivers/media/usb/uvc/uvc_queue.c  |  9 ++++-----
 drivers/media/usb/uvc/uvcvideo.h   |  4 +---
 3 files changed, 25 insertions(+), 11 deletions(-)
---
base-commit: d216d9cb4dd854ef0a2ec1701f403facb298af51
change-id: 20241217-uvc-deprecate-fbd6228fa1e2

Best regards,

Comments

Hans de Goede Dec. 18, 2024, 9:52 p.m. UTC | #1
Hi,

On 18-Dec-24 10:39 PM, Ricardo Ribalda wrote:
> We intend to deprecate the nodrop parameter in the future and adopt the
> default behaviour of the other media drivers: return buffers with an error
> to userspace with V4L2_BUF_FLAG_ERROR set in v4l2_buffer.flags.
> 
> Make the first step in the deprecation by changing the default value of
> the parameter and printing an error message when the value is changed.
> 
> While implementing this change, Hans found an error in
> uvc_queue_buffer_complete(). This series also fix it.
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
> Changes in v2:
> - Improve cover letter wording.
> - Add new patch to fix vb2_buffer_done()
> - Link to v1: https://lore.kernel.org/r/20241217-uvc-deprecate-v1-0-57d353f68f8f@chromium.org

Thank you the entire v2 series looks good to me:

Reviewed-by: Hans de Goede <hdegoede@redhat.com>

for the series, assuming you have tested that
the modparam magic in patch 4/4 works as expected?

Regards,

Hans




> 
> ---
> Ricardo Ribalda (4):
>       media: uvcvideo: Propagate buf->error to userspace
>       media: uvcvideo: Invert default value for nodrop module param
>       media: uvcvideo: Allow changing noparam on the fly
>       media: uvcvideo: Announce the user our deprecation intentions
> 
>  drivers/media/usb/uvc/uvc_driver.c | 23 ++++++++++++++++++++---
>  drivers/media/usb/uvc/uvc_queue.c  |  9 ++++-----
>  drivers/media/usb/uvc/uvcvideo.h   |  4 +---
>  3 files changed, 25 insertions(+), 11 deletions(-)
> ---
> base-commit: d216d9cb4dd854ef0a2ec1701f403facb298af51
> change-id: 20241217-uvc-deprecate-fbd6228fa1e2
> 
> Best regards,
Ricardo Ribalda Dec. 18, 2024, 10:01 p.m. UTC | #2
Hi Hans

[Sorry for the dup email, I forgot to reply-all before]

On Wed, 18 Dec 2024 at 22:53, Hans de Goede <hdegoede@redhat.com> wrote:
>
> Hi,
>
> On 18-Dec-24 10:39 PM, Ricardo Ribalda wrote:
> > We intend to deprecate the nodrop parameter in the future and adopt the
> > default behaviour of the other media drivers: return buffers with an error
> > to userspace with V4L2_BUF_FLAG_ERROR set in v4l2_buffer.flags.
> >
> > Make the first step in the deprecation by changing the default value of
> > the parameter and printing an error message when the value is changed.
> >
> > While implementing this change, Hans found an error in
> > uvc_queue_buffer_complete(). This series also fix it.
> >
> > Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> > ---
> > Changes in v2:
> > - Improve cover letter wording.
> > - Add new patch to fix vb2_buffer_done()
> > - Link to v1: https://lore.kernel.org/r/20241217-uvc-deprecate-v1-0-57d353f68f8f@chromium.org
>
> Thank you the entire v2 series looks good to me:
>
> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
>
> for the series, assuming you have tested that
> the modparam magic in patch 4/4 works as expected?

Yes, I have tested v1 in real hardware using ChromeOS kernel 6.6.

looks more or less like this:
# echo 100 > nodrop
# cat nodprop
1
# echo false > nodrop
# cat nodprop
0
# echo 1 > nodrop
# cat nodprop
1

With the first echo throwing a warning.

Thanks!

>
> Regards,
>
> Hans
>
>
>
>
> >
> > ---
> > Ricardo Ribalda (4):
> >       media: uvcvideo: Propagate buf->error to userspace
> >       media: uvcvideo: Invert default value for nodrop module param
> >       media: uvcvideo: Allow changing noparam on the fly
> >       media: uvcvideo: Announce the user our deprecation intentions
> >
> >  drivers/media/usb/uvc/uvc_driver.c | 23 ++++++++++++++++++++---
> >  drivers/media/usb/uvc/uvc_queue.c  |  9 ++++-----
> >  drivers/media/usb/uvc/uvcvideo.h   |  4 +---
> >  3 files changed, 25 insertions(+), 11 deletions(-)
> > ---
> > base-commit: d216d9cb4dd854ef0a2ec1701f403facb298af51
> > change-id: 20241217-uvc-deprecate-fbd6228fa1e2
> >
> > Best regards,
>