devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nicolas Dufresne <nicolas@ndufresne.ca>
To: "Sven Püschel" <s.pueschel@pengutronix.de>,
	"Jacob Chen" <jacob-chen@iotwrt.com>,
	"Ezequiel Garcia" <ezequiel@vanguardiasur.com.ar>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Heiko Stuebner" <heiko@sntech.de>,
	"Rob Herring" <robh@kernel.org>,
	"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
	"Conor Dooley" <conor+dt@kernel.org>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	 linux-rockchip@lists.infradead.org, kernel@pengutronix.de,
	 linux-arm-kernel@lists.infradead.org,
	linux-media@vger.kernel.org
Subject: Re: [PATCH 16/16] media: rockchip: rga: add rga3 support
Date: Wed, 03 Dec 2025 13:17:44 -0500	[thread overview]
Message-ID: <f1938e17e04cfd1768f90b757813f9187b424505.camel@ndufresne.ca> (raw)
In-Reply-To: <ccdcf1c3-4afd-45b7-92d0-c35a31be2188@pengutronix.de>

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

Hi,

Le mercredi 03 décembre 2025 à 10:49 +0100, Sven Püschel a écrit :
> Hi Nicolas,
> 
> On 10/7/25 9:41 PM, Nicolas Dufresne wrote:
> > Hi,
> > 
> > Le mardi 07 octobre 2025 à 10:32 +0200, Sven Püschel a écrit :
> > 
> > > +}
> > > +
> > > +static void rga3_cmd_enable_win0(struct rga_ctx *ctx)
> > > +{
> > > +	u32 *cmd = ctx->rga->cmdbuf_virt;
> > > +	unsigned int reg;
> > > +
> > > +	reg = RGA3_WIN0_RD_CTRL - RGA3_FIRST_CMD_REG;
> > > +	cmd[reg >> 2] |= FIELD_PREP(RGA3_WIN_ENABLE, 1);
> > > +}
> > > +
> > > +static void rga3_cmd_set_wr_format(struct rga_ctx *ctx)
> > > +{
> > > +	u32 *cmd = ctx->rga->cmdbuf_virt;
> > > +	const struct rga3_fmt *out = ctx->out.fmt;
> > > +	u8 wr_format;
> > > +	unsigned int reg;
> > > +
> > > +	if (out->semi_planar)
> > > +		wr_format = RGA3_RDWR_FORMAT_SEMI_PLANAR;
> > > +	else
> > > +		wr_format = RGA3_RDWR_FORMAT_INTERLEAVED;
> > > +
> > > +	reg = RGA3_WR_CTRL - RGA3_FIRST_CMD_REG;
> > > +	cmd[reg >> 2] |= FIELD_PREP(RGA3_WR_PIC_FORMAT, out->hw_format)
> > > +		      |  FIELD_PREP(RGA3_WR_YC_SWAP, out->yc_swap)
> > > +		      |  FIELD_PREP(RGA3_WR_RBUV_SWAP, out->rbuv_swap)
> > > +		      |  FIELD_PREP(RGA3_WR_FORMAT, wr_format);
> > > +}
> > > +
> > > +static void rga3_cmd_disable_wr_limitation(struct rga_ctx *ctx)
> > > +{
> > > +	u32 *cmd = ctx->rga->cmdbuf_virt;
> > > +	unsigned int reg;
> > > +
> > > +	/* Use the max value to avoid limiting the write speed */
> > > +	reg = RGA3_WR_CTRL - RGA3_FIRST_CMD_REG;
> > > +	cmd[reg >> 2] |= FIELD_PREP(RGA3_WR_SW_OUTSTANDING_MAX, 63);
> > No issue with the code, but quite an interesting feature. We did discussed in
> > pas about using the target framerate (well frame duration in v4l2) to avoid
> > bursting the memory.
> 
> Do you have any links to these discussions or some actual implementation?

That likely happened during a media summit. Philippe Zabel might remember more.
I know for stateful encoders, you can already have two timing information, but
its all vague in my memory.

> 
>  From the API perspective I didn't really find the desired API to 
> support this feature. While VIDIOC_S_PARM would allow setting an frame 
> interval, the documentation doesn't really encompass this use case (as 
> we won't configure the RGA3 depending on this nor drop frames if the 
> RGA3 is too slow).
> 
> Also limiting the potential burst size only seems practical, when it 
> causes latency issues. Otherwise it should be more efficient to have big 
> bursts (bandwidth and potentially even power consumption wise).

I have no issue with letting it to its maximum. The comment here simply
highlights it, but pretty much all other drivers will hardcore the maximum
working size and move on. In a second thought, if you multi-plex the RGA3 a lot,
you don't want any slower use of it, since it may hang up on the core for
longer. So I'd say, unless we have problems, this is fine as it is.

> 
> Sincerely
>      Sven

[...]

cheers,
Nicolas

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

  reply	other threads:[~2025-12-03 18:17 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-07  8:31 [PATCH 00/16] media: platform: rga: Add RGA3 support Sven Püschel
2025-10-07  8:31 ` [PATCH 01/16] media: rockchip: rga: use clk_bulk api Sven Püschel
2025-10-07  8:31 ` [PATCH 02/16] media: rockchip: rga: use stride for offset calculation Sven Püschel
2025-10-07  8:31 ` [PATCH 03/16] media: rockchip: rga: align stride to 16 bytes Sven Püschel
2025-10-07 18:19   ` Nicolas Dufresne
2025-12-02 14:36     ` Sven Püschel
2025-10-07  8:31 ` [PATCH 04/16] media: rockchip: rga: move hw specific parts to a dedicated struct Sven Püschel
2025-10-07  8:31 ` [PATCH 05/16] media: rockchip: rga: use card type to specify rga type Sven Püschel
2025-10-07  8:31 ` [PATCH 06/16] media: rockchip: rga: change offset to dma_addresses Sven Püschel
2025-10-07  8:32 ` [PATCH 07/16] media: rockchip: rga: support external iommus Sven Püschel
2025-10-07  8:32 ` [PATCH 08/16] media: rockchip: rga: remove size from rga_frame Sven Püschel
2025-10-07  8:32 ` [PATCH 09/16] media: rockchip: rga: remove stride " Sven Püschel
2025-10-07  8:32 ` [PATCH 10/16] media: rockchip: rga: move rga_fmt to rga-hw.h Sven Püschel
2025-10-07  8:32 ` [PATCH 11/16] media: rockchip: rga: add iommu restore function Sven Püschel
2025-10-07 18:30   ` Nicolas Dufresne
2025-10-10  8:45     ` Sven Püschel
2025-10-10 13:10       ` Nicolas Dufresne
2025-10-07  8:32 ` [PATCH 12/16] media: rockchip: rga: handle error interrupt Sven Püschel
2025-10-07 18:47   ` Nicolas Dufresne
2025-10-07  8:32 ` [PATCH 13/16] media: dt-bindings: media: rockchip-rga: add rockchip,rk3588-rga3 Sven Püschel
2025-10-07  8:38   ` Krzysztof Kozlowski
2025-10-07 18:12     ` Nicolas Dufresne
2025-10-07  8:32 ` [PATCH 14/16] arm64: dts: rockchip: add rga3 dt nodes Sven Püschel
2025-10-07  8:32 ` [PATCH 15/16] arm64: dts: rockchip: increase rga3 clock speed Sven Püschel
2025-10-07  8:39   ` Krzysztof Kozlowski
2025-10-07  8:32 ` [PATCH 16/16] media: rockchip: rga: add rga3 support Sven Püschel
2025-10-07  8:39   ` Krzysztof Kozlowski
2025-10-07 16:05     ` Sven Püschel
2025-10-08  1:55       ` Krzysztof Kozlowski
2025-10-07 18:54     ` Nicolas Dufresne
2025-10-07 19:41   ` Nicolas Dufresne
2025-10-10  9:21     ` Sven Püschel
2025-12-03  9:49     ` Sven Püschel
2025-12-03 18:17       ` Nicolas Dufresne [this message]
2025-10-11  5:32   ` kernel test robot
2025-10-07 18:06 ` [PATCH 00/16] media: platform: rga: Add RGA3 support Nicolas Dufresne
2025-10-10  8:33   ` Sven Püschel
2025-10-10 13:05     ` Nicolas Dufresne
2025-10-09 22:03 ` Rob Herring (Arm)

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=f1938e17e04cfd1768f90b757813f9187b424505.camel@ndufresne.ca \
    --to=nicolas@ndufresne.ca \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=heiko@sntech.de \
    --cc=jacob-chen@iotwrt.com \
    --cc=kernel@pengutronix.de \
    --cc=krzk+dt@kernel.org \
    --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=robh@kernel.org \
    --cc=s.pueschel@pengutronix.de \
    /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).