All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolas Dufresne <nicolas@ndufresne.ca>
To: Ezequiel Garcia <ezequiel@collabora.com>, linux-media@vger.kernel.org
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Heiko Stuebner <heiko@sntech.de>, Alex Bee <knaerzche@gmail.com>,
	kernel@collabora.com
Subject: Re: [PATCH 1/2] hantro: vp8: Move noisy WARN_ON to vpu_debug
Date: Wed, 23 Jun 2021 16:39:22 -0400	[thread overview]
Message-ID: <b79f0b84998148b869ba90dc555a60e1807dd0a5.camel@ndufresne.ca> (raw)
In-Reply-To: <20210621231157.226962-2-ezequiel@collabora.com>

Le lundi 21 juin 2021 à 20:11 -0300, Ezequiel Garcia a écrit :
> When the VP8 decoders can't find a reference frame,
> the driver falls back to the current output frame.
> 
> This will probably produce some undesirable results,
> leading to frame corruption, but shouldn't cause
> noisy warnings.
> 
> Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>

Greatly appreciated fix.

Acked-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>

> ---
>  drivers/staging/media/hantro/hantro_g1_vp8_dec.c    | 13 ++++++++++---
>  .../staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c | 13 ++++++++++---
>  2 files changed, 20 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/staging/media/hantro/hantro_g1_vp8_dec.c b/drivers/staging/media/hantro/hantro_g1_vp8_dec.c
> index 96622a7f8279..7f88dcee1473 100644
> --- a/drivers/staging/media/hantro/hantro_g1_vp8_dec.c
> +++ b/drivers/staging/media/hantro/hantro_g1_vp8_dec.c
> @@ -376,12 +376,17 @@ static void cfg_ref(struct hantro_ctx *ctx,
>  	vb2_dst = hantro_get_dst_buf(ctx);
>  
>  	ref = hantro_get_ref(ctx, hdr->last_frame_ts);
> -	if (!ref)
> +	if (!ref) {
> +		vpu_debug(0, "failed to find last frame ts=%ld\n",
> +			  hdr->last_frame_ts);
>  		ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);
> +	}
>  	vdpu_write_relaxed(vpu, ref, G1_REG_ADDR_REF(0));
>  
>  	ref = hantro_get_ref(ctx, hdr->golden_frame_ts);
> -	WARN_ON(!ref && hdr->golden_frame_ts);
> +	if (!ref && hdr->golden_frame_ts)
> +		vpu_debug(0, "failed to find golden frame ts=%ld\n",
> +			  hdr->golden_frame_ts);
>  	if (!ref)
>  		ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);
>  	if (hdr->flags & V4L2_VP8_FRAME_FLAG_SIGN_BIAS_GOLDEN)
> @@ -389,7 +394,9 @@ static void cfg_ref(struct hantro_ctx *ctx,
>  	vdpu_write_relaxed(vpu, ref, G1_REG_ADDR_REF(4));
>  
>  	ref = hantro_get_ref(ctx, hdr->alt_frame_ts);
> -	WARN_ON(!ref && hdr->alt_frame_ts);
> +	if (!ref && hdr->alt_frame_ts)
> +		vpu_debug(0, "failed to find alt frame ts=%ld\n",
> +			  hdr->alt_frame_ts);
>  	if (!ref)
>  		ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);
>  	if (hdr->flags & V4L2_VP8_FRAME_FLAG_SIGN_BIAS_ALT)
> diff --git a/drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c b/drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c
> index 951b55f58a61..cd53748efe4e 100644
> --- a/drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c
> +++ b/drivers/staging/media/hantro/rockchip_vpu2_hw_vp8_dec.c
> @@ -453,12 +453,17 @@ static void cfg_ref(struct hantro_ctx *ctx,
>  	vb2_dst = hantro_get_dst_buf(ctx);
>  
>  	ref = hantro_get_ref(ctx, hdr->last_frame_ts);
> -	if (!ref)
> +	if (!ref) {
> +		vpu_debug(0, "failed to find last frame ts=%ld\n",
> +			  hdr->last_frame_ts);
>  		ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);
> +	}
>  	vdpu_write_relaxed(vpu, ref, VDPU_REG_VP8_ADDR_REF0);
>  
>  	ref = hantro_get_ref(ctx, hdr->golden_frame_ts);
> -	WARN_ON(!ref && hdr->golden_frame_ts);
> +	if (!ref && hdr->golden_frame_ts)
> +		vpu_debug(0, "failed to find golden frame ts=%ld\n",
> +			  hdr->golden_frame_ts);
>  	if (!ref)
>  		ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);
>  	if (hdr->flags & V4L2_VP8_FRAME_FLAG_SIGN_BIAS_GOLDEN)
> @@ -466,7 +471,9 @@ static void cfg_ref(struct hantro_ctx *ctx,
>  	vdpu_write_relaxed(vpu, ref, VDPU_REG_VP8_ADDR_REF2_5(2));
>  
>  	ref = hantro_get_ref(ctx, hdr->alt_frame_ts);
> -	WARN_ON(!ref && hdr->alt_frame_ts);
> +	if (!ref && hdr->alt_frame_ts)
> +		vpu_debug(0, "failed to find alt frame ts=%ld\n",
> +			  hdr->alt_frame_ts);
>  	if (!ref)
>  		ref = vb2_dma_contig_plane_dma_addr(&vb2_dst->vb2_buf, 0);
>  	if (hdr->flags & V4L2_VP8_FRAME_FLAG_SIGN_BIAS_ALT)



  parent reply	other threads:[~2021-06-23 20:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-21 23:11 [PATCH 0/2] hantro: Small nitpicks Ezequiel Garcia
2021-06-21 23:11 ` [PATCH 1/2] hantro: vp8: Move noisy WARN_ON to vpu_debug Ezequiel Garcia
2021-06-22  5:52   ` kernel test robot
2021-06-22  5:52     ` kernel test robot
2021-06-23 11:38   ` kernel test robot
2021-06-23 11:38     ` kernel test robot
2021-06-23 20:39   ` Nicolas Dufresne [this message]
2021-06-21 23:11 ` [PATCH 2/2] hantro: Make struct hantro_variant.init() optional Ezequiel Garcia

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=b79f0b84998148b869ba90dc555a60e1807dd0a5.camel@ndufresne.ca \
    --to=nicolas@ndufresne.ca \
    --cc=ezequiel@collabora.com \
    --cc=heiko@sntech.de \
    --cc=hverkuil@xs4all.nl \
    --cc=kernel@collabora.com \
    --cc=knaerzche@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=p.zabel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.