Skip to content

Commit c5f359a

Browse files
author
Dikshita Agarwal
committed
FROMLIST: media: iris: Remove redundant buffer count check in stream off
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. Link: https://lore.kernel.org/linux-arm-msm/20250509-video-iris-hevc-vp9-v5-20-59b4ff7d331c@quicinc.com/ Acked-by: Vikash Garodia <quic_vgarodia@quicinc.com> Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8550-QRD Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8550-HDK Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-QRD Tested-by: Neil Armstrong <neil.armstrong@linaro.org> # on SM8650-HDK Tested-by: Vikash Garodia <quic_vgarodia@quicinc.com> # on sa8775p-ride Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
1 parent c908282 commit c5f359a

1 file changed

Lines changed: 0 additions & 36 deletions

File tree

drivers/media/platform/qcom/iris/iris_vdec.c

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -244,35 +244,6 @@ void iris_vdec_src_change(struct iris_inst *inst)
244244
v4l2_event_queue_fh(&inst->fh, &event);
245245
}
246246

247-
static int iris_vdec_get_num_queued_buffers(struct iris_inst *inst,
248-
enum iris_buffer_type type)
249-
{
250-
struct v4l2_m2m_ctx *m2m_ctx = inst->m2m_ctx;
251-
struct v4l2_m2m_buffer *buffer, *n;
252-
struct iris_buffer *buf;
253-
u32 count = 0;
254-
255-
switch (type) {
256-
case BUF_INPUT:
257-
v4l2_m2m_for_each_src_buf_safe(m2m_ctx, buffer, n) {
258-
buf = to_iris_buffer(&buffer->vb);
259-
if (!(buf->attr & BUF_ATTR_QUEUED))
260-
continue;
261-
count++;
262-
}
263-
return count;
264-
case BUF_OUTPUT:
265-
v4l2_m2m_for_each_dst_buf_safe(m2m_ctx, buffer, n) {
266-
buf = to_iris_buffer(&buffer->vb);
267-
if (!(buf->attr & BUF_ATTR_QUEUED))
268-
continue;
269-
count++;
270-
}
271-
return count;
272-
default:
273-
return count;
274-
}
275-
}
276247

277248
static void iris_vdec_flush_deferred_buffers(struct iris_inst *inst,
278249
enum iris_buffer_type type)
@@ -321,7 +292,6 @@ int iris_vdec_session_streamoff(struct iris_inst *inst, u32 plane)
321292
{
322293
const struct iris_hfi_command_ops *hfi_ops = inst->core->hfi_ops;
323294
enum iris_buffer_type buffer_type;
324-
u32 count;
325295
int ret;
326296

327297
switch (plane) {
@@ -339,12 +309,6 @@ int iris_vdec_session_streamoff(struct iris_inst *inst, u32 plane)
339309
if (ret)
340310
goto error;
341311

342-
count = iris_vdec_get_num_queued_buffers(inst, buffer_type);
343-
if (count) {
344-
ret = -EINVAL;
345-
goto error;
346-
}
347-
348312
ret = iris_inst_state_change_streamoff(inst, plane);
349313
if (ret)
350314
goto error;

0 commit comments

Comments
 (0)