From: Michael Rodin <mrodin@de.adit-jv.com>
To: Nicolas Dufresne <nicolas@ndufresne.ca>
Cc: "Michael Rodin" <mrodin@de.adit-jv.com>,
"Mauro Carvalho Chehab" <mchehab@kernel.org>,
"Niklas Söderlund" <niklas.soderlund@ragnatech.se>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-renesas-soc@vger.kernel.org, michael@rodin.online,
erosca@de.adit-jv.com,
"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
Subject: Re: [PATCH 1/3] media: videobuf2: Add a transfer error event
Date: Fri, 15 Jul 2022 18:15:43 +0200 [thread overview]
Message-ID: <20220715161346.GA1116690@vmlxhi-182> (raw)
In-Reply-To: <5e8c50cdc031bffd96b19929508f034d1263c8b7.camel@ndufresne.ca>
Hi Nicolas,
On Mon, Jul 04, 2022 at 11:59:58AM -0400, Nicolas Dufresne wrote:
> Hi Micheal,
>
> thanks for your work, I have some questions below ...
Thank you for your feedback!
> Le mardi 28 juin 2022 à 20:00 +0200, Michael Rodin a écrit :
> > From: Niklas Söderlund <https://urldefense.proofpoint.com/v2/url?u=http-3A__niklas.soderlund-2Brenesas-40ragnatech.se&d=DwIFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=sWsgk3pKkv5GeIDM2RZlPY8TjNFU2D0oBeOj6QNBadE&m=7ktiIpDjee6bMSPLXXR7KVvJ_y234VytWEydKF2TWEo&s=-GUWUbGDkkrTAXiF_75xnL13cn3HYL2r2ZN0XwlG41U&e=>
> >
> > Add a new V4L2_EVENT_XFER_ERROR event to signal if an error happens during
> > video transfer.
> >
> > The use-case that sparked this new event is to signal to the video
> > device driver that an error has happen on the CSI-2 bus from the CSI-2
> > receiver subdevice.
> >
> > Signed-off-by: Niklas Söderlund <https://urldefense.proofpoint.com/v2/url?u=http-3A__niklas.soderlund-2Brenesas-40ragnatech.se&d=DwIFaQ&c=euGZstcaTDllvimEN8b7jXrwqOf-v5A_CdpgnVfiiMM&r=sWsgk3pKkv5GeIDM2RZlPY8TjNFU2D0oBeOj6QNBadE&m=7ktiIpDjee6bMSPLXXR7KVvJ_y234VytWEydKF2TWEo&s=-GUWUbGDkkrTAXiF_75xnL13cn3HYL2r2ZN0XwlG41U&e=>
> > [mrodin@de.adit-jv.com: adapted information what to do if this new event is received]
> > Signed-off-by: Michael Rodin <mrodin@de.adit-jv.com>
> > ---
> > .../userspace-api/media/v4l/vidioc-dqevent.rst | 10 ++++++++++
> > .../userspace-api/media/videodev2.h.rst.exceptions | 1 +
> > include/uapi/linux/videodev2.h | 1 +
> > 3 files changed, 12 insertions(+)
> >
> > diff --git a/Documentation/userspace-api/media/v4l/vidioc-dqevent.rst b/Documentation/userspace-api/media/v4l/vidioc-dqevent.rst
> > index 6eb40073c906..3cf0b4859784 100644
> > --- a/Documentation/userspace-api/media/v4l/vidioc-dqevent.rst
> > +++ b/Documentation/userspace-api/media/v4l/vidioc-dqevent.rst
> > @@ -182,6 +182,16 @@ call.
> > the regions changes. This event has a struct
> > :c:type:`v4l2_event_motion_det`
> > associated with it.
> > + * - ``V4L2_EVENT_XFER_ERROR``
>
> I'm not sure why this event is specific to XFER. Is there uses cases were a
> future implementation would have both XFER and RECEIVER error ?
I am not sure whether I understand you correctly, do you mean that there is
already a method to signal a receiver error? Or that we should name it
V4L2_EVENT_RECEIVER_ERROR? I think that "transfer error" is a good name for
this event, because it could be sent by receiver or by transmitter drivers,
depending on their hardware error detection capabilities. We could have
e.g. a video transmitter which can detect an error coupled with a video
receiver which can not detect any errors.
> > + - 7
> > + - This event is triggered when an transfer error is detected while
> > + streaming. For example if an error is detected on a video bus in
> > + the pipeline. If a driver receives this event from an upstream
> > + subdevice, it has to forward the event to userspace. The streaming
> > + application has to check if the transfer error is unrecoverable,
> > + i.e. no new buffers can be dequeued from the kernel after the
> > + expected time. If the error is unrecoverable, the streaming
> > + application should restart streaming if it wants to continue.
>
> The process to determine if an error is recoverable or not isn't clear to me. As
> an application developer, I would not know what to do here. Recoverable error
> already have a designed mechanism, it consist of marking done a buffer with the
> flag V4L2_BUF_FLAG_ERROR. I would like to understand what the existing mechanism
> needed to be replaced, and the placement should be documented.
"Recoverable" means in this context that kernel space continues to capture
video buffers (which do not necessarily have the flag V4L2_BUF_FLAG_ERROR).
So probably we should not say "recoverable" or "unrecoverable" in the
context of this event to avoid confusion. V4L2_EVENT_XFER_ERROR just tells
userspace that it should restart streaming if the buffer flow stops after
this event. So would it be sufficient for an application developer if we
drop all statements about "recoverability" from the event description?
> Nicolas
>
> > * - ``V4L2_EVENT_PRIVATE_START``
> > - 0x08000000
> > - Base event number for driver-private events.
> > diff --git a/Documentation/userspace-api/media/videodev2.h.rst.exceptions b/Documentation/userspace-api/media/videodev2.h.rst.exceptions
> > index 9cbb7a0c354a..25bde61a1519 100644
> > --- a/Documentation/userspace-api/media/videodev2.h.rst.exceptions
> > +++ b/Documentation/userspace-api/media/videodev2.h.rst.exceptions
> > @@ -500,6 +500,7 @@ replace define V4L2_EVENT_CTRL event-type
> > replace define V4L2_EVENT_FRAME_SYNC event-type
> > replace define V4L2_EVENT_SOURCE_CHANGE event-type
> > replace define V4L2_EVENT_MOTION_DET event-type
> > +replace define V4L2_EVENT_XFER_ERROR event-type
> > replace define V4L2_EVENT_PRIVATE_START event-type
> >
> > replace define V4L2_EVENT_CTRL_CH_VALUE ctrl-changes-flags
> > diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> > index 5311ac4fde35..44db724d4541 100644
> > --- a/include/uapi/linux/videodev2.h
> > +++ b/include/uapi/linux/videodev2.h
> > @@ -2385,6 +2385,7 @@ struct v4l2_streamparm {
> > #define V4L2_EVENT_FRAME_SYNC 4
> > #define V4L2_EVENT_SOURCE_CHANGE 5
> > #define V4L2_EVENT_MOTION_DET 6
> > +#define V4L2_EVENT_XFER_ERROR 7
> > #define V4L2_EVENT_PRIVATE_START 0x08000000
> >
> > /* Payload for V4L2_EVENT_VSYNC */
>
--
Best Regards,
Michael
next prev parent reply other threads:[~2022-07-15 16:15 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-19 18:00 Improve error handling in the rcar-vin driver Michael Rodin
2022-05-19 18:00 ` [PATCH 1/3] media: videobuf2: Add a transfer error event Michael Rodin
2022-05-19 18:00 ` [PATCH 2/3] rcar-csi2: Do not try to recover after transfer error Michael Rodin
2022-05-19 18:00 ` [PATCH 3/3] rcar-vin: handle transfer errors from subdevices and stop streaming if required Michael Rodin
2022-05-19 21:00 ` Niklas Söderlund
2022-05-20 19:50 ` Michael Rodin
2022-06-08 21:04 ` Niklas Söderlund
2022-06-28 18:00 ` [PATCH v2 0/3] Improve error handling in the rcar-vin driver Michael Rodin
2022-06-28 18:00 ` [PATCH 1/3] media: videobuf2: Add a transfer error event Michael Rodin
2022-07-04 15:59 ` Nicolas Dufresne
2022-07-15 16:15 ` Michael Rodin [this message]
2022-08-02 9:32 ` Hans Verkuil
2022-08-08 17:03 ` Michael Rodin
2022-08-09 7:12 ` Hans Verkuil
2022-06-28 18:00 ` [PATCH 2/3] rcar-csi2: Do not try to recover after transfer error Michael Rodin
2022-06-28 18:00 ` [PATCH 3/3] media: rcar-vin: Allow userspace to subscribe to V4L2_EVENT_XFER_ERROR Michael Rodin
2022-07-05 9:46 ` [PATCH v2 0/3] Improve error handling in the rcar-vin driver Niklas Söderlund
2022-07-15 13:42 ` Michael Rodin
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=20220715161346.GA1116690@vmlxhi-182 \
--to=mrodin@de.adit-jv.com \
--cc=erosca@de.adit-jv.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=michael@rodin.online \
--cc=nicolas@ndufresne.ca \
--cc=niklas.soderlund+renesas@ragnatech.se \
--cc=niklas.soderlund@ragnatech.se \
/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