From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Ricardo Ribalda <ribalda@chromium.org>
Cc: Isaac Scott <isaac.scott@ideasonboard.com>,
mchehab@kernel.org, linux-media@vger.kernel.org
Subject: Re: [RFC PATCH 1/1] media: uvcvideo: Add no drop parameter for MJPEG_NO_EOF quirk
Date: Tue, 17 Dec 2024 19:02:29 +0200 [thread overview]
Message-ID: <20241217170229.GK20432@pendragon.ideasonboard.com> (raw)
In-Reply-To: <CANiDSCv-KqBk9UQrdTztzS7+zczu-chFw7owECcfOoGLEtXa0w@mail.gmail.com>
On Tue, Dec 17, 2024 at 05:02:43PM +0100, Ricardo Ribalda wrote:
> On Tue, 17 Dec 2024 at 16:43, Isaac Scott wrote:
> > On Tue, 2024-12-17 at 13:08 +0100, Ricardo Ribalda wrote:
> > > On Tue, 17 Dec 2024 at 12:58, Ricardo Ribalda wrote:
> > > > On Tue, 17 Dec 2024 at 12:22, Isaac Scott wrote:
> > > > >
> > > > > In use cases where a camera needs to use the UVC_QUIRK_MJPEG_NO_EOF,
> > > > > erroneous frames that do not conform to MJPEG standards are correctly
> > > > > being marked as erroneous. However, when using the camera in a product,
> > > > > manufacturers usually want to enable the quirk in order to pass the
> > > > > buffers into user space. To do this, they have to enable the uvc_no_drop
> > > > > parameter. To avoid the extra steps to configure the kernel in such a
> > > > > way, enable the no_drop parameter by default to comply with this use
> > > > > case.
> > > >
> > > > I am not sure what you want to do with this patch.
> > > >
> > > > Why can't people simply set the quirk with
> > > >
> > > > modprobe uvcvideo quirks=0x20000
> > >
> > > Sorry, I meant
> > >
> > > modprobe uvcvideo nodrop=1
> > >
> > > or
> > >
> > > echo 1 > /sys/module/uvcvideo/parameters/nodrop
> > >
> >
> > That would also work, absolutely!
> >
> > If a user has these cameras, they should always add the no_drop to
> > avoid losing frames that would otherwise be discarded as they are
> > erroneous.
> >
> > This quirk will always trigger, and it is likely they would want to
> > have all the frames sent by the camera, while still marking them as
> > errors they can handle later in user space if they want to.
>
> Besides what Laurent is saying:
> ```
> One issue with this is that it becomes impossible for someone to unset
> the no_drop parameter.
> ```
>
> There is also the issue that with your current implementation you are
> changing the module parameter for ALL the cameras probed after this
> one:
>
> I believe that you have to do:
> - ret = uvc_queue_init(queue, type, !uvc_no_drop_param);
> + ret = uvc_queue_init(queue, type, !uvc_no_drop_param &&
> + !(dev->quirks &
> UVC_QUIRK_MJPEG_NO_EOF))
>
>
> But maybe before that we need to have the discussion about: shall we
> remove uvc_no_drop_param altogether?. We could start by swapping the
> default value and see what happens....
Unless someone objects, I think swapping the default value and waiting a
bit is a good idea. If the universe doesn't collapse immediately, we
could later drop the parameter.
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2024-12-17 17:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-17 11:21 [RFC PATCH 0/1] Set uvc_no_drop parameter for MJPEG_NO_EOF quirk Isaac Scott
2024-12-17 11:21 ` [RFC PATCH 1/1] media: uvcvideo: Add no drop " Isaac Scott
2024-12-17 11:58 ` Ricardo Ribalda
2024-12-17 12:08 ` Ricardo Ribalda
2024-12-17 15:43 ` Isaac Scott
2024-12-17 16:02 ` Ricardo Ribalda
2024-12-17 17:02 ` Laurent Pinchart [this message]
2024-12-18 12:35 ` Ricardo Ribalda
2024-12-17 12:02 ` Laurent Pinchart
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=20241217170229.GK20432@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=isaac.scott@ideasonboard.com \
--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