From: Sebastian Fricke <sebastian.fricke@collabora.com> To: Nicolas Dufresne <nicolas.dufresne@collabora.com> Cc: linux-media@vger.kernel.org, Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>, Mauro Carvalho Chehab <mchehab@kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, kernel@collabora.com, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 5/5] media: rkvdec: Improve error handling Date: Fri, 10 Jun 2022 21:14:13 +0200 [thread overview] Message-ID: <20220610191413.xgwfw5n6snje3khj@basti-XPS-13-9310> (raw) In-Reply-To: <20220610125215.240539-6-nicolas.dufresne@collabora.com> Hey Nicolas, Tested with: python3 fluster.py run -d GStreamer-H.264-V4L2SL-Gst1.0 -ts JVT-AVC_ V1 -so /tmp/h264_test.csv -f csv -j1 Ran 129/135 tests successfully in 82.280 secs On 10.06.2022 08:52, Nicolas Dufresne wrote: >There is two way decode errors can occur. In one case, the ready s/There is two way decode/There are two ways decoding/ >status is not set and nothing have been written into the destination, s/nothing have been/nothing has been/ >while in the other case, the buffer is written but may contain a >certain amount of errors. In order to differentiate these, we set >the payload for the first case to 0. > >Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Tested-by: Sebastian Fricke <sebastian.fricke@collabora.com> >--- > drivers/staging/media/rkvdec/rkvdec.c | 26 ++++++++++++++++++++++---- > 1 file changed, 22 insertions(+), 4 deletions(-) > >diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c >index 7e76f8b72885..27f1f7276dd2 100644 >--- a/drivers/staging/media/rkvdec/rkvdec.c >+++ b/drivers/staging/media/rkvdec/rkvdec.c >@@ -954,14 +954,32 @@ static irqreturn_t rkvdec_irq_handler(int irq, void *priv) > enum vb2_buffer_state state; > u32 status; > >+ ctx = v4l2_m2m_get_curr_priv(rkvdec->m2m_dev); > status = readl(rkvdec->regs + RKVDEC_REG_INTERRUPT); >- state = (status & RKVDEC_RDY_STA) ? >- VB2_BUF_STATE_DONE : VB2_BUF_STATE_ERROR; >+ >+ if (!(status & RKVDEC_RDY_STA)) { >+ struct vb2_v4l2_buffer *dst_buf = NULL; >+ >+ if (status & RKVDEC_TIMEOUT_STA) >+ pr_debug("Decoder stopped due to internal timeout."); >+ else >+ pr_debug("Decoder stopped due to internal error."); (Just personal preference.. I would prefer "due to an internal" over "due to internal") >+ >+ /* >+ * When this happens, the buffer is left unmodified. As it >+ * contains no meaningful data we mark is a empty. s/is a empty/it as empty/ The rest looks nice. Thanks. Greetings, Sebastian >+ */ >+ dst_buf = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx); >+ vb2_set_plane_payload(&dst_buf->vb2_buf, 0, 0); >+ state = VB2_BUF_STATE_ERROR; >+ } else { >+ state = VB2_BUF_STATE_DONE; >+ } > > writel(0, rkvdec->regs + RKVDEC_REG_INTERRUPT); >- ctx = v4l2_m2m_get_curr_priv(rkvdec->m2m_dev); > >- if (ctx->coded_fmt_desc->ops->check_error_info) >+ if (ctx->coded_fmt_desc->ops->check_error_info && >+ state == VB2_BUF_STATE_DONE) > state = ctx->coded_fmt_desc->ops->check_error_info(ctx); > > if (cancel_delayed_work(&rkvdec->watchdog_work)) >-- >2.36.1 >
WARNING: multiple messages have this Message-ID (diff)
From: Sebastian Fricke <sebastian.fricke@collabora.com> To: Nicolas Dufresne <nicolas.dufresne@collabora.com> Cc: linux-media@vger.kernel.org, Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>, Mauro Carvalho Chehab <mchehab@kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, kernel@collabora.com, linux-rockchip@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 5/5] media: rkvdec: Improve error handling Date: Fri, 10 Jun 2022 21:14:13 +0200 [thread overview] Message-ID: <20220610191413.xgwfw5n6snje3khj@basti-XPS-13-9310> (raw) In-Reply-To: <20220610125215.240539-6-nicolas.dufresne@collabora.com> Hey Nicolas, Tested with: python3 fluster.py run -d GStreamer-H.264-V4L2SL-Gst1.0 -ts JVT-AVC_ V1 -so /tmp/h264_test.csv -f csv -j1 Ran 129/135 tests successfully in 82.280 secs On 10.06.2022 08:52, Nicolas Dufresne wrote: >There is two way decode errors can occur. In one case, the ready s/There is two way decode/There are two ways decoding/ >status is not set and nothing have been written into the destination, s/nothing have been/nothing has been/ >while in the other case, the buffer is written but may contain a >certain amount of errors. In order to differentiate these, we set >the payload for the first case to 0. > >Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Tested-by: Sebastian Fricke <sebastian.fricke@collabora.com> >--- > drivers/staging/media/rkvdec/rkvdec.c | 26 ++++++++++++++++++++++---- > 1 file changed, 22 insertions(+), 4 deletions(-) > >diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c >index 7e76f8b72885..27f1f7276dd2 100644 >--- a/drivers/staging/media/rkvdec/rkvdec.c >+++ b/drivers/staging/media/rkvdec/rkvdec.c >@@ -954,14 +954,32 @@ static irqreturn_t rkvdec_irq_handler(int irq, void *priv) > enum vb2_buffer_state state; > u32 status; > >+ ctx = v4l2_m2m_get_curr_priv(rkvdec->m2m_dev); > status = readl(rkvdec->regs + RKVDEC_REG_INTERRUPT); >- state = (status & RKVDEC_RDY_STA) ? >- VB2_BUF_STATE_DONE : VB2_BUF_STATE_ERROR; >+ >+ if (!(status & RKVDEC_RDY_STA)) { >+ struct vb2_v4l2_buffer *dst_buf = NULL; >+ >+ if (status & RKVDEC_TIMEOUT_STA) >+ pr_debug("Decoder stopped due to internal timeout."); >+ else >+ pr_debug("Decoder stopped due to internal error."); (Just personal preference.. I would prefer "due to an internal" over "due to internal") >+ >+ /* >+ * When this happens, the buffer is left unmodified. As it >+ * contains no meaningful data we mark is a empty. s/is a empty/it as empty/ The rest looks nice. Thanks. Greetings, Sebastian >+ */ >+ dst_buf = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx); >+ vb2_set_plane_payload(&dst_buf->vb2_buf, 0, 0); >+ state = VB2_BUF_STATE_ERROR; >+ } else { >+ state = VB2_BUF_STATE_DONE; >+ } > > writel(0, rkvdec->regs + RKVDEC_REG_INTERRUPT); >- ctx = v4l2_m2m_get_curr_priv(rkvdec->m2m_dev); > >- if (ctx->coded_fmt_desc->ops->check_error_info) >+ if (ctx->coded_fmt_desc->ops->check_error_info && >+ state == VB2_BUF_STATE_DONE) > state = ctx->coded_fmt_desc->ops->check_error_info(ctx); > > if (cancel_delayed_work(&rkvdec->watchdog_work)) >-- >2.36.1 > _______________________________________________ Linux-rockchip mailing list Linux-rockchip@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-rockchip
next prev parent reply other threads:[~2022-06-10 19:14 UTC|newest] Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-06-10 12:52 [PATCH v1 0/5] media: rkvdec: Fix H.264 error resilience Nicolas Dufresne 2022-06-10 12:52 ` [PATCH v1 1/5] media: rkvdec: Disable H.264 error detection Nicolas Dufresne 2022-06-10 12:52 ` Nicolas Dufresne 2022-06-10 13:26 ` Dmitry Osipenko 2022-06-10 13:26 ` Dmitry Osipenko 2022-06-10 16:39 ` Brian Norris 2022-06-10 16:39 ` Brian Norris 2022-06-27 17:44 ` Ezequiel Garcia 2022-06-27 17:44 ` Ezequiel Garcia 2022-06-10 12:52 ` [PATCH v1 2/5] media: rkvdec: Add an ops to check for decode errors Nicolas Dufresne 2022-06-10 12:52 ` Nicolas Dufresne 2022-06-14 14:44 ` Hans Verkuil 2022-06-14 14:44 ` Hans Verkuil 2022-06-14 16:14 ` Nicolas Dufresne 2022-06-14 16:14 ` Nicolas Dufresne 2022-11-24 10:28 ` Hans Verkuil 2022-11-24 10:28 ` Hans Verkuil 2022-06-10 12:52 ` [PATCH v1 3/5] media: rkvdec: Fix RKVDEC_ERR_PKT_NUM macro Nicolas Dufresne 2022-06-10 12:52 ` Nicolas Dufresne 2022-06-10 12:52 ` [PATCH v1 4/5] media: rkvdec: Re-enable H.264 error detection Nicolas Dufresne 2022-06-10 12:52 ` Nicolas Dufresne 2022-06-10 13:20 ` Dan Carpenter 2022-06-10 13:20 ` Dan Carpenter 2022-06-10 13:48 ` Dmitry Osipenko 2022-06-10 13:48 ` Dmitry Osipenko 2022-06-10 16:23 ` Nicolas Dufresne 2022-06-10 16:23 ` Nicolas Dufresne 2022-06-10 15:01 ` Ezequiel Garcia 2022-06-10 15:01 ` Ezequiel Garcia 2022-06-10 16:38 ` Nicolas Dufresne 2022-06-10 16:38 ` Nicolas Dufresne 2022-06-11 12:08 ` Alex Bee 2022-06-11 12:08 ` Alex Bee 2022-06-13 13:09 ` Nicolas Dufresne 2022-06-13 13:09 ` Nicolas Dufresne 2022-06-10 12:52 ` [PATCH v1 5/5] media: rkvdec: Improve error handling Nicolas Dufresne 2022-06-10 12:52 ` Nicolas Dufresne 2022-06-10 19:14 ` Sebastian Fricke [this message] 2022-06-10 19:14 ` Sebastian Fricke
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=20220610191413.xgwfw5n6snje3khj@basti-XPS-13-9310 \ --to=sebastian.fricke@collabora.com \ --cc=ezequiel@vanguardiasur.com.ar \ --cc=gregkh@linuxfoundation.org \ --cc=kernel@collabora.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-media@vger.kernel.org \ --cc=linux-rockchip@lists.infradead.org \ --cc=linux-staging@lists.linux.dev \ --cc=mchehab@kernel.org \ --cc=nicolas.dufresne@collabora.com \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.