[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YrykoFpa5RvZV60V@eze-laptop>
Date: Wed, 29 Jun 2022 16:14:40 -0300
From: Ezequiel Garcia <ezequiel@...guardiasur.com.ar>
To: Jernej Skrabec <jernej.skrabec@...il.com>
Cc: p.zabel@...gutronix.de, mchehab@...nel.org,
hverkuil-cisco@...all.nl, benjamin.gaignard@...labora.com,
nicolas.dufresne@...labora.com, gregkh@...uxfoundation.org,
linux-media@...r.kernel.org, linux-staging@...ts.linux.dev,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-rockchip@...ts.infradead.org
Subject: Re: [PATCH v2 5/7] media: hantro: postproc: Properly calculate
chroma offset
Hi Jernej,
On Thu, Jun 16, 2022 at 10:25:11PM +0200, Jernej Skrabec wrote:
> Currently chroma offset calculation assumes only 1 byte per luma, with
> no consideration for stride.
>
> Take necessary information from destination pixel format which makes
> calculation completely universal.
>
> Signed-off-by: Jernej Skrabec <jernej.skrabec@...il.com>
Reviewed-by: Ezequiel Garcia <ezequiel@...guardiasur.com.ar>
Thanks,
Ezequiel
> ---
> drivers/staging/media/hantro/hantro_postproc.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/staging/media/hantro/hantro_postproc.c b/drivers/staging/media/hantro/hantro_postproc.c
> index 8933b4af73ed..a0928c508434 100644
> --- a/drivers/staging/media/hantro/hantro_postproc.c
> +++ b/drivers/staging/media/hantro/hantro_postproc.c
> @@ -113,12 +113,14 @@ static void hantro_postproc_g2_enable(struct hantro_ctx *ctx)
> {
> struct hantro_dev *vpu = ctx->dev;
> struct vb2_v4l2_buffer *dst_buf;
> - size_t chroma_offset = ctx->dst_fmt.width * ctx->dst_fmt.height;
> int down_scale = down_scale_factor(ctx);
> + size_t chroma_offset;
> dma_addr_t dst_dma;
>
> dst_buf = hantro_get_dst_buf(ctx);
> dst_dma = vb2_dma_contig_plane_dma_addr(&dst_buf->vb2_buf, 0);
> + chroma_offset = ctx->dst_fmt.plane_fmt[0].bytesperline *
> + ctx->dst_fmt.height;
>
> if (down_scale) {
> hantro_reg_write(vpu, &g2_down_scale_e, 1);
> --
> 2.36.1
>
Powered by blists - more mailing lists