From: Daniel Golle <daniel@makrotopia.org>
To: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Cc: Detlev Casanova <detlev.casanova@collabora.com>,
Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Heiko Stuebner <heiko@sntech.de>, Alex Bee <knaerzche@gmail.com>,
Hans Verkuil <hverkuil+cisco@kernel.org>,
Jonas Karlman <jonas@kwiboo.se>,
Sebastian Fricke <sebastian.fricke@collabora.com>,
linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/7] media: rkvdec: hevc: bound the RPS reads by the control size
Date: Fri, 20 Nov 2026 23:23:08 +0000 [thread overview]
Message-ID: <awDWVpqEBcOGsCuu@makrotopia.org> (raw)
In-Reply-To: <6ae6d1101d3f7095d11462579a5a3313153533e6.camel@collabora.com>
Hi again,
I missed the part of your review which was inlined with the code.
See my reply below.
On Mon, Nov 16, 2026 at 08:49:44AM -0500, Nicolas Dufresne wrote:
> [...]
> > --- a/drivers/media/platform/rockchip/rkvdec/rkvdec-hevc-common.c
> > +++ b/drivers/media/platform/rockchip/rkvdec/rkvdec-hevc-common.c
> > @@ -448,18 +448,18 @@ void rkvdec_hevc_run_preamble(struct rkvdec_ctx *ctx,
> > V4L2_CID_STATELESS_HEVC_SCALING_MATRIX);
> > run->scaling_matrix = ctrl ? ctrl->p_cur.p : NULL;
> >
> > + run->ext_sps_st_rps = NULL;
> > if (ctx->has_sps_st_rps) {
> > ctrl = v4l2_ctrl_find(&ctx->ctrl_hdl,
> > V4L2_CID_STATELESS_HEVC_EXT_SPS_ST_RPS);
> > - run->ext_sps_st_rps = ctrl ? ctrl->p_cur.p : NULL;
> > - } else {
> > - run->ext_sps_st_rps = NULL;
> > + if (ctrl && ctrl->elems >= run->sps->num_short_term_ref_pic_sets)
> > + run->ext_sps_st_rps = ctrl->p_cur.p;
> > }
> > + run->ext_sps_lt_rps = NULL;
> > if (ctx->has_sps_lt_rps) {
> > ctrl = v4l2_ctrl_find(&ctx->ctrl_hdl,
> > V4L2_CID_STATELESS_HEVC_EXT_SPS_LT_RPS);
> > - run->ext_sps_lt_rps = ctrl ? ctrl->p_cur.p : NULL;
> > - } else {
> > - run->ext_sps_lt_rps = NULL;
> > + if (ctrl && ctrl->elems >= run->sps->num_long_term_ref_pics_sps)
> > + run->ext_sps_lt_rps = ctrl->p_cur.p;
>
> So you are saying that if the passed array is too short, we should use an older
> entry to none? That seems a little strange, what about up-front rejecting bad
> entries?
That's what I do, but only after patch 5, before that the decoder would
still run with the previous table. I will reorder the series so the
refusal comes first.
Rejecting when the control is set does not work, as the count and the
array are separate controls which can be set in any order, also in
different requests. The first point where both are known is when the
request is applied in device_run.
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
next prev parent reply other threads:[~2026-11-20 23:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-14 10:22 [PATCH 0/7] media: rkvdec: Fix the HEVC reference picture set handling Daniel Golle
2026-11-14 10:22 ` [PATCH 1/7] media: rkvdec: hevc: apply request controls first Daniel Golle
2026-11-14 10:22 ` [PATCH 2/7] media: rkvdec: vdpu383: complete refused HEVC requests Daniel Golle
2026-11-14 10:22 ` [PATCH 3/7] media: rkvdec: hevc: bound the RPS reads by the control size Daniel Golle
2026-11-16 13:49 ` Nicolas Dufresne
2026-11-20 23:17 ` Daniel Golle
2026-11-20 23:23 ` Daniel Golle [this message]
2026-11-14 10:23 ` [PATCH 5/7] media: rkvdec: vdpu381: refuse HEVC jobs without RPS sets Daniel Golle
2026-11-14 10:23 ` [PATCH 6/7] media: rkvdec: hevc: cache every short-term RPS set Daniel Golle
2026-11-14 10:23 ` [PATCH 7/7] media: rkvdec: hevc: check the RPS scratch allocation Daniel Golle
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=awDWVpqEBcOGsCuu@makrotopia.org \
--to=daniel@makrotopia.org \
--cc=detlev.casanova@collabora.com \
--cc=ezequiel@vanguardiasur.com.ar \
--cc=heiko@sntech.de \
--cc=hverkuil+cisco@kernel.org \
--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=nicolas.dufresne@collabora.com \
--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