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: <0d4f6b3a-16ab-6289-0b56-490cf8667a65@gmail.com>
Date:   Thu, 14 Jul 2022 21:56:30 +0300
From:   Dmitry Osipenko <digetx@...il.com>
To:     Ezequiel Garcia <ezequiel@...guardiasur.com.ar>,
        linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     Hans Verkuil <hverkuil-cisco@...all.nl>,
        Tomasz Figa <tfiga@...omium.org>,
        Marek Szyprowski <m.szyprowski@...sung.com>
Subject: Re: [PATCH v2 3/8] tegra-vde: Use vb2_find_buffer

12.07.2022 00:11, Ezequiel Garcia пишет:
> Use the newly introduced vb2_find_buffer API to get a vb2_buffer
> given a buffer timestamp.
> 
> Cc: Dmitry Osipenko <digetx@...il.com>
> Signed-off-by: Ezequiel Garcia <ezequiel@...guardiasur.com.ar>
> Acked-by: Tomasz Figa <tfiga@...omium.org>
> ---
>  drivers/media/platform/nvidia/tegra-vde/h264.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/media/platform/nvidia/tegra-vde/h264.c b/drivers/media/platform/nvidia/tegra-vde/h264.c
> index 88f81a134ba0..204e474d57f7 100644
> --- a/drivers/media/platform/nvidia/tegra-vde/h264.c
> +++ b/drivers/media/platform/nvidia/tegra-vde/h264.c
> @@ -659,20 +659,19 @@ static struct vb2_buffer *get_ref_buf(struct tegra_ctx *ctx,
>  {
>  	const struct v4l2_h264_dpb_entry *dpb = ctx->h264.decode_params->dpb;
>  	struct vb2_queue *cap_q = &ctx->fh.m2m_ctx->cap_q_ctx.q;
> -	int buf_idx = -1;
> +	struct vb2_buffer *vb = NULL;
>  
>  	if (dpb[dpb_idx].flags & V4L2_H264_DPB_ENTRY_FLAG_ACTIVE)
> -		buf_idx = vb2_find_timestamp(cap_q,
> -					     dpb[dpb_idx].reference_ts, 0);
> +		vb = vb2_find_buffer(cap_q, dpb[dpb_idx].reference_ts);
>  
>  	/*
>  	 * If a DPB entry is unused or invalid, address of current destination
>  	 * buffer is returned.
>  	 */
> -	if (buf_idx < 0)
> +	if (!vb)
>  		return &dst->vb2_buf;
>  
> -	return vb2_get_buffer(cap_q, buf_idx);
> +	return vb;
>  }
>  
>  static int tegra_vde_validate_vb_size(struct tegra_ctx *ctx,

Acked-by: Dmitry Osipenko <digetx@...il.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ