mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Nicolas Dufresne <nicolas.dufresne@collabora.com>
To: Jianfeng Liu <liujianfeng1994@gmail.com>, detlev.casanova@collabora.com
Cc: corbet@lwn.net, daniel.almeida@collabora.com,
	didi.debian@cknow.org,  ezequiel@vanguardiasur.com.ar,
	hansg@kernel.org, heiko@sntech.de,  hverkuil@kernel.org,
	james.cowgill@blaize.com, jonas@kwiboo.se,  kernel@collabora.com,
	laurent.pinchart@ideasonboard.com,
	 linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,  linux-media@vger.kernel.org,
	linux-rockchip@lists.infradead.org,  mchehab@kernel.org,
	opensource206@gmail.com, ribalda@chromium.org,
	 sakari.ailus@linux.intel.com, yunkec@google.com
Subject: Re: [PATCH v7 14/17] media: rkvdec: Add H264 support for the VDPU381 variant
Date: Wed, 24 Dec 2025 14:45:06 -0500	[thread overview]
Message-ID: <75e51a60acd161884c623c991ba87827259f7731.camel@collabora.com> (raw)
In-Reply-To: <bf4a8049f49b8d6d8a39faecee025dce51d59db3.camel@collabora.com>

[-- Attachment #1: Type: text/plain, Size: 2351 bytes --]

Hi Detlev,

Le lundi 22 décembre 2025 à 08:19 -0500, Nicolas Dufresne a écrit :
> Hi,
> 
> Le dimanche 21 décembre 2025 à 00:46 +0800, Jianfeng Liu a écrit :
> > Hi,
> > 
> > On Thu, 18 Dec 2025 18:28:24 -0500, Detlev Casanova wrote:
> > > +static int rkvdec_h264_start(struct rkvdec_ctx *ctx)
> > > +{
> > > +	struct rkvdec_dev *rkvdec = ctx->dev;
> > > +	struct rkvdec_h264_priv_tbl *priv_tbl;
> > > +	struct rkvdec_h264_ctx *h264_ctx;
> > > +	struct v4l2_ctrl *ctrl;
> > > +	int ret;
> > > +
> > > +	ctrl = v4l2_ctrl_find(&ctx->ctrl_hdl,
> > > +			      V4L2_CID_STATELESS_H264_SPS);
> > > +	if (!ctrl)
> > > +		return -EINVAL;
> > > +
> > > +	h264_ctx = kzalloc(sizeof(*h264_ctx), GFP_KERNEL);
> > > +	if (!h264_ctx)
> > > +		return -ENOMEM;
> > 
> > I can see the sps validation is removed:
> > 
> > 	ret = rkvdec_h264_validate_sps(ctx, ctrl->p_new.p_h264_sps);
> > 	if (ret)
> > 		return ret;
> > 
> > This should fix decoding issue with chromium when minimum size of h264
> > decoder is lower than 32. While I find this issue is caused by chromium
> > not following v4l2 stateless spec, and I think checking sps at start
> > should be still necessary.
> 
> One of the missing part of rkvdec is that once you set the OUTPUT format we only
> reset the capture format, but we should also reset the SPS control to a matching
> default, matching the resolution and resetting the depth. In fact, I don't even
> see code that verify the bit depth against already allocated memory, and the is
> not capable of converting.
> 
> I tend to agree with Jianfeng, that we should leave that un-modified until we
> have time to fully address and test this situation.

I digged more, and by removing this check, userspace would endup doing:

- S_FMT(OUT, 800x600)
- S_CTRL(SPS, 800x600)
- S_FMT(OUT, 640x480)

And still succeed streamon with that SPS. Since the SPS rarely changes, and
there is no requirement to send it again, a frame decode can be requested, and
this miss-match can trigger the hardware to possibly overrun.

For this reason, I cannot take v7.

Nicolas

> 
> Nicolas
> 
> > 
> > I have sent a fix to chromium[1] and it should get merged later.
> > 
> > [1] https://chromium-review.googlesource.com/c/chromium/src/+/7274555
> > 
> > Best regards,
> > Jianfeng

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2025-12-24 19:45 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-18 23:28 [PATCH v7 00/17] media: rkvdec: Add support for VDPU381 and VDPU383 Detlev Casanova
2025-12-18 23:28 ` [PATCH v7 01/17] media: uapi: HEVC: Add v4l2_ctrl_hevc_ext_sps_[ls]t_rps controls Detlev Casanova
2025-12-18 23:28 ` [PATCH v7 02/17] media: v4l2-ctrls: Add hevc_ext_sps_[ls]t_rps controls Detlev Casanova
2025-12-18 23:28 ` [PATCH v7 03/17] media: visl: Add HEVC short and long term RPS sets Detlev Casanova
2025-12-18 23:28 ` [PATCH v7 04/17] media: rkvdec: Switch to using structs instead of writel Detlev Casanova
2025-12-18 23:28 ` [PATCH v7 05/17] media: rkvdec: Move cabac tables to their own source file Detlev Casanova
2025-12-18 23:28 ` [PATCH v7 06/17] media: rkvdec: Use structs to represent the HW RPS Detlev Casanova
2025-12-18 23:28 ` [PATCH v7 07/17] media: rkvdec: Move h264 functions to common file Detlev Casanova
2025-12-18 23:28 ` [PATCH v7 08/17] media: rkvdec: Move hevc " Detlev Casanova
2025-12-18 23:28 ` [PATCH v7 09/17] media: rkvdec: Add variant specific coded formats list Detlev Casanova
2025-12-18 23:28 ` [PATCH v7 10/17] media: rkvdec: Add RCB and SRAM support Detlev Casanova
2025-12-18 23:28 ` [PATCH v7 11/17] media: rkvdec: Support per-variant interrupt handler Detlev Casanova
2025-12-18 23:28 ` [PATCH v7 12/17] media: rkvdec: Enable all clocks without naming them Detlev Casanova
2025-12-18 23:28 ` [PATCH v7 13/17] media: rkvdec: Disable multicore support Detlev Casanova
2025-12-18 23:28 ` [PATCH v7 14/17] media: rkvdec: Add H264 support for the VDPU381 variant Detlev Casanova
2025-12-19 16:33   ` Diederik de Haas
2025-12-20 16:46   ` Jianfeng Liu
2025-12-22 13:19     ` Nicolas Dufresne
2025-12-24 19:45       ` Nicolas Dufresne [this message]
2025-12-27  7:04   ` kernel test robot
2025-12-28  7:52   ` kernel test robot
2025-12-18 23:28 ` [PATCH v7 15/17] media: rkvdec: Add H264 support for the VDPU383 variant Detlev Casanova
2025-12-18 23:28 ` [PATCH v7 16/17] media: rkvdec: Add HEVC support for the VDPU381 variant Detlev Casanova
2025-12-18 23:28 ` [PATCH v7 17/17] media: rkvdec: Add HEVC support for the VDPU383 variant Detlev Casanova
2025-12-19 13:50 ` [PATCH v7 00/17] media: rkvdec: Add support for VDPU381 and VDPU383 Piotr Oniszczuk
2025-12-19 15:15   ` Detlev Casanova

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=75e51a60acd161884c623c991ba87827259f7731.camel@collabora.com \
    --to=nicolas.dufresne@collabora.com \
    --cc=corbet@lwn.net \
    --cc=daniel.almeida@collabora.com \
    --cc=detlev.casanova@collabora.com \
    --cc=didi.debian@cknow.org \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=hansg@kernel.org \
    --cc=heiko@sntech.de \
    --cc=hverkuil@kernel.org \
    --cc=james.cowgill@blaize.com \
    --cc=jonas@kwiboo.se \
    --cc=kernel@collabora.com \
    --cc=laurent.pinchart@ideasonboard.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=liujianfeng1994@gmail.com \
    --cc=mchehab@kernel.org \
    --cc=opensource206@gmail.com \
    --cc=ribalda@chromium.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=yunkec@google.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

all inboxes | Powered by JetHome®