lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yko61YA2DpHi7/4B@eze-laptop>
Date:   Sun, 3 Apr 2022 21:24:53 -0300
From:   Ezequiel Garcia <ezequiel@...guardiasur.com.ar>
To:     Jernej Skrabec <jernej.skrabec@...il.com>
Cc:     p.zabel@...gutronix.de, mchehab@...nel.org, nicolas@...fresne.ca,
        hverkuil-cisco@...all.nl, gregkh@...uxfoundation.org,
        wens@...e.org, samuel@...lland.org, linux-media@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-rockchip@...ts.infradead.org,
        linux-staging@...ts.linux.dev,
        linux-arm-kernel@...ts.infradead.org, linux-sunxi@...ts.linux.dev
Subject: Re: [RFC PATCH 5/8] media: hantro: postproc: Fix legacy regs
 configuration

On Sun, Feb 27, 2022 at 03:49:23PM +0100, Jernej Skrabec wrote:
> Some postproc legacy registers were set in VP9 code. Move them to
> postproc and fix their value.
> 
> Signed-off-by: Jernej Skrabec <jernej.skrabec@...il.com>

Reviewed-by: Ezequiel Garcia <ezequiel@...guardiasur.com.ar>

> ---
>  drivers/staging/media/hantro/hantro_g2_vp9_dec.c |  8 --------
>  drivers/staging/media/hantro/hantro_postproc.c   | 10 ++++++++++
>  2 files changed, 10 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/staging/media/hantro/hantro_g2_vp9_dec.c b/drivers/staging/media/hantro/hantro_g2_vp9_dec.c
> index 91c21b634fab..c9cb11fd95af 100644
> --- a/drivers/staging/media/hantro/hantro_g2_vp9_dec.c
> +++ b/drivers/staging/media/hantro/hantro_g2_vp9_dec.c
> @@ -515,16 +515,8 @@ static void
>  config_bit_depth(struct hantro_ctx *ctx, const struct v4l2_ctrl_vp9_frame *dec_params)
>  {
>  	if (ctx->dev->variant->legacy_regs) {
> -		u8 pp_shift = 0;
> -
>  		hantro_reg_write(ctx->dev, &g2_bit_depth_y, dec_params->bit_depth);
>  		hantro_reg_write(ctx->dev, &g2_bit_depth_c, dec_params->bit_depth);
> -		hantro_reg_write(ctx->dev, &g2_rs_out_bit_depth, dec_params->bit_depth);
> -
> -		if (dec_params->bit_depth > 8)
> -			pp_shift = 16 - dec_params->bit_depth;
> -
> -		hantro_reg_write(ctx->dev, &g2_pp_pix_shift, pp_shift);
>  		hantro_reg_write(ctx->dev, &g2_pix_shift, 0);
>  	} else {
>  		hantro_reg_write(ctx->dev, &g2_bit_depth_y_minus8, dec_params->bit_depth - 8);
> diff --git a/drivers/staging/media/hantro/hantro_postproc.c b/drivers/staging/media/hantro/hantro_postproc.c
> index 1a76628d5754..11ae663f11b7 100644
> --- a/drivers/staging/media/hantro/hantro_postproc.c
> +++ b/drivers/staging/media/hantro/hantro_postproc.c
> @@ -113,6 +113,16 @@ static void hantro_postproc_g2_enable(struct hantro_ctx *ctx)
>  
>  	hantro_write_addr(vpu, G2_RS_OUT_LUMA_ADDR, dst_dma);
>  	hantro_write_addr(vpu, G2_RS_OUT_CHROMA_ADDR, dst_dma + chroma_offset);
> +	if (ctx->dev->variant->legacy_regs) {
> +		int out_depth = hantro_get_formath_depth(ctx->dst_fmt.pixelformat);
> +		u8 pp_shift = 0;
> +
> +		if (out_depth > 8)
> +			pp_shift = 16 - out_depth;
> +
> +		hantro_reg_write(ctx->dev, &g2_rs_out_bit_depth, out_depth);
> +		hantro_reg_write(ctx->dev, &g2_pp_pix_shift, pp_shift);
> +	}
>  	hantro_reg_write(vpu, &g2_out_rs_e, 1);
>  }
>  
> -- 
> 2.35.1
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ