[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9f0edfe5-0bde-43ca-9238-2c84897c56a8@collabora.com>
Date: Thu, 9 Nov 2023 15:12:26 +0100
From: Andrzej Pietrasiewicz <andrzej.p@...labora.com>
To: Benjamin Gaignard <benjamin.gaignard@...labora.com>,
mchehab@...nel.org, tfiga@...omium.org, m.szyprowski@...sung.com,
ming.qian@....com, ezequiel@...guardiasur.com.ar,
p.zabel@...gutronix.de, gregkh@...uxfoundation.org,
hverkuil-cisco@...all.nl, nicolas.dufresne@...labora.com
Cc: linux-media@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, linux-arm-msm@...r.kernel.org,
linux-rockchip@...ts.infradead.org, linux-staging@...ts.linux.dev,
kernel@...labora.com
Subject: Re: [PATCH v14 48/56] media: verisilicon: Store chroma and motion
vectors offset
W dniu 31.10.2023 o 17:30, Benjamin Gaignard pisze:
> Store computed values of chroma and motion vectors offset because
> they depends on width and height values which change if the resolution
> change.
>
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@...labora.com>
Reviewed-by: Andrzej Pietrasiewicz <andrzej.p@...labora.com>
> CC: Ezequiel Garcia <ezequiel@...guardiasur.com.ar>
> CC: Philipp Zabel <p.zabel@...gutronix.de>
> ---
> drivers/media/platform/verisilicon/hantro.h | 2 ++
> drivers/media/platform/verisilicon/hantro_g2_vp9_dec.c | 6 ++++--
> 2 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/platform/verisilicon/hantro.h b/drivers/media/platform/verisilicon/hantro.h
> index 0948b04a9f8d..6f5eb975d0e3 100644
> --- a/drivers/media/platform/verisilicon/hantro.h
> +++ b/drivers/media/platform/verisilicon/hantro.h
> @@ -328,6 +328,8 @@ struct hantro_vp9_decoded_buffer_info {
> /* Info needed when the decoded frame serves as a reference frame. */
> unsigned short width;
> unsigned short height;
> + size_t chroma_offset;
> + size_t mv_offset;
> u32 bit_depth : 4;
> };
>
> diff --git a/drivers/media/platform/verisilicon/hantro_g2_vp9_dec.c b/drivers/media/platform/verisilicon/hantro_g2_vp9_dec.c
> index 6fc4b555517f..6db1c32fce4d 100644
> --- a/drivers/media/platform/verisilicon/hantro_g2_vp9_dec.c
> +++ b/drivers/media/platform/verisilicon/hantro_g2_vp9_dec.c
> @@ -158,9 +158,11 @@ static void config_output(struct hantro_ctx *ctx,
>
> chroma_addr = luma_addr + chroma_offset(ctx, dec_params);
> hantro_write_addr(ctx->dev, G2_OUT_CHROMA_ADDR, chroma_addr);
> + dst->vp9.chroma_offset = chroma_offset(ctx, dec_params);
>
> mv_addr = luma_addr + mv_offset(ctx, dec_params);
> hantro_write_addr(ctx->dev, G2_OUT_MV_ADDR, mv_addr);
> + dst->vp9.mv_offset = mv_offset(ctx, dec_params);
> }
>
> struct hantro_vp9_ref_reg {
> @@ -195,7 +197,7 @@ static void config_ref(struct hantro_ctx *ctx,
> luma_addr = hantro_get_dec_buf_addr(ctx, &buf->base.vb.vb2_buf);
> hantro_write_addr(ctx->dev, ref_reg->y_base, luma_addr);
>
> - chroma_addr = luma_addr + chroma_offset(ctx, dec_params);
> + chroma_addr = luma_addr + buf->vp9.chroma_offset;
> hantro_write_addr(ctx->dev, ref_reg->c_base, chroma_addr);
> }
>
> @@ -238,7 +240,7 @@ static void config_ref_registers(struct hantro_ctx *ctx,
> config_ref(ctx, dst, &ref_regs[2], dec_params, dec_params->alt_frame_ts);
>
> mv_addr = hantro_get_dec_buf_addr(ctx, &mv_ref->base.vb.vb2_buf) +
> - mv_offset(ctx, dec_params);
> + mv_ref->vp9.mv_offset;
> hantro_write_addr(ctx->dev, G2_REF_MV_ADDR(0), mv_addr);
>
> hantro_reg_write(ctx->dev, &vp9_last_sign_bias,
Powered by blists - more mailing lists