From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
To: Jonas Karlman <jonas@kwiboo.se>,
Detlev Casanova <detlev.casanova@collabora.com>
Cc: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Heiko Stuebner <heiko@sntech.de>, Alex Bee <knaerzche@gmail.com>,
Sebastian Fricke <sebastian.fricke@collabora.com>,
linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org,
devicetree@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/7] media: rkvdec: Add HEVC backend
Date: Wed, 03 Sep 2025 09:44:54 -0400 [thread overview]
Message-ID: <d70c5113608c89fd79687a7669b0fa53140bea7b.camel@collabora.com> (raw)
In-Reply-To: <8394c12a-1e1e-44fc-9bb5-92a464dfe410@kwiboo.se>
[-- Attachment #1: Type: text/plain, Size: 4377 bytes --]
Hi,
Le mercredi 03 septembre 2025 à 09:28 +0200, Jonas Karlman a écrit :
> Hi Nicolas,
>
> On 8/29/2025 10:22 PM, Nicolas Dufresne wrote:
> > Le dimanche 10 août 2025 à 21:24 +0000, Jonas Karlman a écrit :
> > > The Rockchip VDEC supports the HEVC codec with the Main and Main10
> > > Profile up to Level 5.1 High tier: 4096x2304@60 fps.
> > >
> > > Add the backend for HEVC format to the decoder.
> > >
> > > Signed-off-by: Alex Bee <knaerzche@gmail.com>
> > > Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> > > Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com>
> > > Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
> >
> > Re-reading myself, most of my comments were off or really "nitty". So let's move
> > forward and spare you the v3. Detlev is happy to rebase and work on top of your
> > series, so let's help everyone getting better RK codec support.
> >
> > Tested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> > Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> >
> > Just to be transparent, during testing, it was notice that some concurrent
> > decoding resulted into failures. I tested Detlev port to structure registers,
> > and it didn't change anything (so probably not a stalled state, or one that we
> > control). This could easily be a HW issue with older chip. Since you have used
> > this for years without major issue reported, I happy to move on.
>
> Thanks, I found some minor changes compared to the LibreELEC version
> that I am running some new tests on, plan to send out a v3 as soon as
> testing completes later today.
Ok, I will be patient then.
>
> In LibreELEC version we enable some error detection,
>
> // sw_cabac_error_e - cabac error enable
> writel(0xfdfffffd, rkvdec->regs + RKVDEC_REG_STRMD_ERR_EN);
> // slice end error enable = BIT(28)
> // frame end error enable = BIT(29)
> writel(0x30000000, rkvdec->regs + RKVDEC_REG_H264_ERR_E);
>
> and in this series it was fully disabled to closer match H264/VP9:
>
> writel(0, rkvdec->regs + RKVDEC_REG_STRMD_ERR_EN);
> writel(0, rkvdec->regs + RKVDEC_REG_H264_ERR_E);
In error detection mode, the IP will emit an IRQ on the first error. It does not
self reset, this is just to let you read the macroblock index that wasn't
decoded properly. The problem is that we don't know how to resume it. That lead
to HW lockup and timeout on packet lost during RTP streaming tests. It is likely
best to keep this off. It is meant to be used to do concealment of lost
macroblock in software.
>
> There is also an extra memset(0, ...) in rkvdec_hevc_start:
>
> memset(priv_tbl, 0, sizeof(*priv_tbl));
>
> This should not really be needed and was removed in this series.
Ack.
>
> Still unclear if any of these will result in a changed behavior. Enable
> of cabac/slice end/frame end error could possible activate some more
> states when block issue a self-reset, but I am only guessing.
>
> One thing to note for the flaky tests is that when they fail, they
> typically just end up with a different consistent checksum. I have not
> done any visual inspection of those frames, but will extract each frame
> and compare them both bitwise and visually.
Thanks, looking forward v3. Please note the fh changes, which I needed to
manually apply here.
Nicolas
>
> Regards,
> Jonas
>
> >
> > regards,
> > Nicolas
> >
> > > ---
> > > Changes in v2:
> > > - Use new_value in transpose_and_flatten_matrices()
> > > - Add NULL check for ctrl->new_elems in rkvdec_hevc_run_preamble()
> > > - Set RKVDEC_WR_DDR_ALIGN_EN for RK3328
> > > ---
> > > .../media/platform/rockchip/rkvdec/Makefile | 2 +-
> > > .../rockchip/rkvdec/rkvdec-hevc-data.c | 1848 +++++++++++++++++
> > > .../platform/rockchip/rkvdec/rkvdec-hevc.c | 817 ++++++++
> > > .../platform/rockchip/rkvdec/rkvdec-regs.h | 2 +
> > > .../media/platform/rockchip/rkvdec/rkvdec.c | 76 +
> > > .../media/platform/rockchip/rkvdec/rkvdec.h | 1 +
> > > 6 files changed, 2745 insertions(+), 1 deletion(-)
> > > create mode 100644 drivers/media/platform/rockchip/rkvdec/rkvdec-hevc-data.c
> > > create mode 100644 drivers/media/platform/rockchip/rkvdec/rkvdec-hevc.c
>
> [snip]
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2025-09-03 13:45 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-10 21:24 [PATCH v2 0/7] media: rkvdec: Add HEVC backend Jonas Karlman
2025-08-10 21:24 ` [PATCH v2 1/7] " Jonas Karlman
2025-08-11 19:12 ` Nicolas Dufresne
2025-08-11 19:46 ` Jonas Karlman
2025-08-11 20:27 ` Nicolas Dufresne
2025-08-11 21:07 ` Nicolas Dufresne
2025-08-12 0:58 ` Jonas Karlman
2025-08-12 13:07 ` Nicolas Dufresne
2025-08-12 19:54 ` Detlev Casanova
2025-08-17 16:39 ` Jonas Karlman
2025-08-18 8:25 ` Detlev Casanova
2025-08-12 20:10 ` Detlev Casanova
2025-08-17 16:46 ` Jonas Karlman
2025-08-29 20:22 ` Nicolas Dufresne
2025-09-03 7:28 ` Jonas Karlman
2025-09-03 13:44 ` Nicolas Dufresne [this message]
2025-08-10 21:24 ` [PATCH v2 2/7] media: rkvdec: Add variants support Jonas Karlman
2025-08-11 21:11 ` Nicolas Dufresne
2025-08-10 21:24 ` [PATCH v2 3/7] media: rkvdec: Implement capability filtering Jonas Karlman
2025-08-11 21:17 ` Nicolas Dufresne
2025-08-10 21:24 ` [PATCH v2 4/7] media: rkvdec: Add RK3288 variant Jonas Karlman
2025-08-11 21:17 ` Nicolas Dufresne
2025-08-10 21:24 ` [PATCH v2 5/7] media: rkvdec: Disable QoS for HEVC and VP9 on RK3328 Jonas Karlman
2025-08-11 21:25 ` Nicolas Dufresne
2025-08-11 22:22 ` Jonas Karlman
2025-08-12 12:47 ` Nicolas Dufresne
2025-08-11 23:08 ` Jonas Karlman
2025-08-12 13:00 ` Nicolas Dufresne
2025-08-17 16:18 ` Jonas Karlman
2025-08-10 21:24 ` [PATCH v2 6/7] media: dt-bindings: rockchip,vdec: Add RK3288 compatible Jonas Karlman
2025-08-10 21:24 ` [PATCH v2 7/7] ARM: dts: rockchip: Add vdec node for RK3288 Jonas Karlman
2025-08-11 21:52 ` [PATCH v2 0/7] media: rkvdec: Add HEVC backend Nicolas Dufresne
2025-08-12 0:00 ` Jonas Karlman
2025-08-12 12:38 ` Nicolas Dufresne
2025-08-12 12:44 ` Nicolas Dufresne
2025-08-12 17:31 ` Jonas Karlman
2025-08-12 18:26 ` Nicolas Dufresne
2025-08-12 18:52 ` Nicolas Dufresne
2025-08-17 16:33 ` Jonas Karlman
2025-08-12 19:57 ` Detlev Casanova
2025-08-12 21:11 ` Nicolas Dufresne
2025-08-12 12:11 ` Diederik de Haas
2025-08-12 12:55 ` Diederik de Haas
2025-08-12 13:27 ` Nicolas Dufresne
2025-08-12 14:09 ` Diederik de Haas
2025-08-14 21:25 ` Alex Bee
2025-08-12 17:11 ` Jonas Karlman
2025-08-12 18:28 ` Diederik de Haas
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=d70c5113608c89fd79687a7669b0fa53140bea7b.camel@collabora.com \
--to=nicolas.dufresne@collabora.com \
--cc=detlev.casanova@collabora.com \
--cc=devicetree@vger.kernel.org \
--cc=ezequiel@vanguardiasur.com.ar \
--cc=heiko@sntech.de \
--cc=jonas@kwiboo.se \
--cc=knaerzche@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mchehab@kernel.org \
--cc=sebastian.fricke@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: 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;
as well as URLs for NNTP newsgroup(s).