LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: "Jernej Škrabec" <jernej.skrabec@gmail.com>
To: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Cc: linux-media@vger.kernel.org, nicolas.dufresne@collabora.com,
	mchehab@kernel.org, robh+dt@kernel.org, mripard@kernel.org,
	wens@csie.org, p.zabel@pengutronix.de, andrzej.p@collabora.com,
	gregkh@linuxfoundation.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org,
	linux-staging@lists.linux.dev
Subject: Re: [PATCH 4/7] media: hantro: move postproc enablement for old cores
Date: Thu, 25 Nov 2021 20:21:41 +0100	[thread overview]
Message-ID: <4693726.31r3eYUQgx@jernej-laptop> (raw)
In-Reply-To: <YZ962CvUbKoiIGyZ@eze-laptop>

Hi Ezequiel,

Dne četrtek, 25. november 2021 ob 13:00:24 CET je Ezequiel Garcia napisal(a):
> Hi Jernej,
> 
> On Mon, Nov 22, 2021 at 07:46:59PM +0100, Jernej Skrabec wrote:
> > Older G2 cores, like that in Allwinner H6, seem to have issue with
> > latching postproc register values if this is first thing done in job.
> > Moving that to the end solves the issue.
> 
> Any idea what exact register should be written before the post-processor
> is enabled, for H6 to work? Also, which of the PP registers need
> to be written "at the end"?

No, there is too much registers to determine this exactly. Vendor library 
actually stores register values in buffer and write them all at once in 
increasing order. This is probably the reason why HDL engineers missed this 
issue...

> 
> > Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
> > ---
> > 
> >  drivers/staging/media/hantro/hantro_drv.c | 9 ++++++++-
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/staging/media/hantro/hantro_drv.c
> > b/drivers/staging/media/hantro/hantro_drv.c index
> > 8c3de31f51b3..530994ab3024 100644
> > --- a/drivers/staging/media/hantro/hantro_drv.c
> > +++ b/drivers/staging/media/hantro/hantro_drv.c
> > @@ -130,7 +130,7 @@ void hantro_start_prepare_run(struct hantro_ctx *ctx)
> > 
> >  	v4l2_ctrl_request_setup(src_buf->vb2_buf.req_obj.req,
> >  	
> >  				&ctx->ctrl_handler);
> > 
> > -	if (!ctx->is_encoder) {
> > +	if (!ctx->is_encoder && !ctx->dev->variant->legacy_regs) {
> 
> To make this less fragile, do you think it would make sense to
> have a dedicated quirk flag, something like "legacy_post_proc",
> instead of overloading the meaning of legacy_regs.

Sure, it can be done :) But then I suggest "late_post_proc" - it better 
describes what it does.

Best regards,
Jernej

> 
> What do you think?
> 
> Thanks,
> Ezequiel
> 
> >  		if (hantro_needs_postproc(ctx, ctx->vpu_dst_fmt))
> >  		
> >  			hantro_postproc_enable(ctx);
> >  		
> >  		else
> > 
> > @@ -142,6 +142,13 @@ void hantro_end_prepare_run(struct hantro_ctx *ctx)
> > 
> >  {
> >  
> >  	struct vb2_v4l2_buffer *src_buf;
> > 
> > +	if (ctx->dev->variant->legacy_regs && !ctx->is_encoder) {
> > +		if (hantro_needs_postproc(ctx, ctx->vpu_dst_fmt))
> > +			hantro_postproc_enable(ctx);
> > +		else
> > +			hantro_postproc_disable(ctx);
> > +	}
> > +
> > 
> >  	src_buf = hantro_get_src_buf(ctx);
> >  	v4l2_ctrl_request_complete(src_buf->vb2_buf.req_obj.req,
> >  	
> >  				   &ctx->ctrl_handler);





  reply	other threads:[~2021-11-25 19:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-22 18:46 [PATCH 0/7] media: hantro: add Allwinner H6 support Jernej Skrabec
2021-11-22 18:46 ` [PATCH 1/7] media: hantro: add support for reset lines Jernej Skrabec
2021-11-23 11:09   ` Andrzej Pietrasiewicz
2021-11-23 14:59     ` Dan Carpenter
2021-11-23 16:36       ` Andrzej Pietrasiewicz
2021-11-23 16:46         ` Jernej Škrabec
     [not found]           ` <CAAEAJfD3d4zjwvbv967+oe6awnAkZiGNKroYF5jvoTy=0sn+Pw@mail.gmail.com>
2021-11-30 10:39             ` Andrzej Pietrasiewicz
2021-11-22 18:46 ` [PATCH 2/7] media: hantro: vp9: use double buffering if needed Jernej Skrabec
2021-11-23 11:22   ` Andrzej Pietrasiewicz
2021-11-22 18:46 ` [PATCH 3/7] media: hantro: vp9: add support for legacy register set Jernej Skrabec
2021-11-23 12:06   ` Andrzej Pietrasiewicz
2021-11-22 18:46 ` [PATCH 4/7] media: hantro: move postproc enablement for old cores Jernej Skrabec
2021-11-23 12:12   ` Andrzej Pietrasiewicz
2021-11-25 12:00   ` Ezequiel Garcia
2021-11-25 19:21     ` Jernej Škrabec [this message]
2021-11-22 18:47 ` [PATCH 5/7] media: dt-bindings: allwinner: document H6 Hantro G2 binding Jernej Skrabec
2021-11-22 18:47 ` [PATCH 6/7] media: hantro: Add support for Allwinner H6 Jernej Skrabec
2021-11-23 12:23   ` Andrzej Pietrasiewicz
2021-11-22 18:47 ` [PATCH 7/7] arm64: dts: allwinner: h6: Add Hantro G2 node Jernej Skrabec
2021-11-22 18:51 ` [PATCH 0/7] media: hantro: add Allwinner H6 support Jernej Škrabec

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=4693726.31r3eYUQgx@jernej-laptop \
    --to=jernej.skrabec@gmail.com \
    --cc=andrzej.p@collabora.com \
    --cc=devicetree@vger.kernel.org \
    --cc=ezequiel@vanguardiasur.com.ar \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=mripard@kernel.org \
    --cc=nicolas.dufresne@collabora.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh+dt@kernel.org \
    --cc=wens@csie.org \
    /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).