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: <eddd4f29-851b-fa2a-19f6-3a09db938e69@quicinc.com>
Date: Tue, 29 Apr 2025 15:54:56 +0530
From: Vikash Garodia <quic_vgarodia@...cinc.com>
To: Dikshita Agarwal <quic_dikshita@...cinc.com>,
        Abhinav Kumar
	<quic_abhinavk@...cinc.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Stefan Schmidt <stefan.schmidt@...aro.org>,
        Hans Verkuil
	<hverkuil@...all.nl>,
        Bjorn Andersson <andersson@...nel.org>,
        Konrad Dybcio
	<konradybcio@...nel.org>, Rob Herring <robh@...nel.org>,
        Krzysztof Kozlowski
	<krzk+dt@...nel.org>,
        Conor Dooley <conor+dt@...nel.org>
CC: Bryan O'Donoghue <bryan.odonoghue@...aro.org>,
        Dmitry Baryshkov
	<dmitry.baryshkov@....qualcomm.com>,
        Neil Armstrong
	<neil.armstrong@...aro.org>,
        Nicolas Dufresne
	<nicolas.dufresne@...labora.com>,
        <linux-media@...r.kernel.org>, <linux-arm-msm@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>, <devicetree@...r.kernel.org>
Subject: Re: [PATCH v2 11/23] media: iris: Remove redundant buffer count check
 in stream off



On 4/28/2025 2:58 PM, Dikshita Agarwal wrote:
> Currently, the stream off process checks the count of buffers in
> v4l2_m2m_queues using v4l2_m2m_for_each_src_buf_safe and
> v4l2_m2m_for_each_dst_buf_safe APIs. If the count is non-zero, it
> returns an error. This check is redundant as the V4L2 framework already
> handles buffer management internally.
> 
> Remove the unnecessary buffer count check in stream off, simplifying the
> process and relying on V4L2's internal mechanisms for buffer management.
> 
> Signed-off-by: Dikshita Agarwal <quic_dikshita@...cinc.com>
> ---
>  drivers/media/platform/qcom/iris/iris_vdec.c | 36 ----------------------------
>  1 file changed, 36 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/drivers/media/platform/qcom/iris/iris_vdec.c
> index d162cc9650f5..30a9969bc368 100644
> --- a/drivers/media/platform/qcom/iris/iris_vdec.c
> +++ b/drivers/media/platform/qcom/iris/iris_vdec.c
> @@ -244,35 +244,6 @@ void iris_vdec_src_change(struct iris_inst *inst)
>  	v4l2_event_queue_fh(&inst->fh, &event);
>  }
>  
> -static int iris_vdec_get_num_queued_buffers(struct iris_inst *inst,
> -					    enum iris_buffer_type type)
> -{
> -	struct v4l2_m2m_ctx *m2m_ctx = inst->m2m_ctx;
> -	struct v4l2_m2m_buffer *buffer, *n;
> -	struct iris_buffer *buf;
> -	u32 count = 0;
> -
> -	switch (type) {
> -	case BUF_INPUT:
> -		v4l2_m2m_for_each_src_buf_safe(m2m_ctx, buffer, n) {
> -			buf = to_iris_buffer(&buffer->vb);
> -			if (!(buf->attr & BUF_ATTR_QUEUED))
> -				continue;
> -			count++;
> -		}
> -		return count;
> -	case BUF_OUTPUT:
> -		v4l2_m2m_for_each_dst_buf_safe(m2m_ctx, buffer, n) {
> -			buf = to_iris_buffer(&buffer->vb);
> -			if (!(buf->attr & BUF_ATTR_QUEUED))
> -				continue;
> -			count++;
> -		}
> -		return count;
> -	default:
> -		return count;
> -	}
> -}
>  
>  static void iris_vdec_flush_deferred_buffers(struct iris_inst *inst,
>  					     enum iris_buffer_type type)
> @@ -321,7 +292,6 @@ int iris_vdec_session_streamoff(struct iris_inst *inst, u32 plane)
>  {
>  	const struct iris_hfi_command_ops *hfi_ops = inst->core->hfi_ops;
>  	enum iris_buffer_type buffer_type;
> -	u32 count;
>  	int ret;
>  
>  	switch (plane) {
> @@ -339,12 +309,6 @@ int iris_vdec_session_streamoff(struct iris_inst *inst, u32 plane)
>  	if (ret)
>  		goto error;
>  
> -	count = iris_vdec_get_num_queued_buffers(inst, buffer_type);
> -	if (count) {
> -		ret = -EINVAL;
> -		goto error;
> -	}
> -
>  	ret = iris_inst_state_change_streamoff(inst, plane);
>  	if (ret)
>  		goto error;
> 

Acked-by: Vikash Garodia <quic_vgarodia@...cinc.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ