Skip to content

Commit 55a2bc0

Browse files
Dikshita Agarwalgregkh
authored andcommitted
media: iris: Fix buffer preparation failure during resolution change
commit 91c6d55 upstream. When the resolution changes, the driver internally updates the width and height, but the client continue to queue buffers with the older resolution until the last flag is received. This results in a mismatch when the buffers are prepared, causing failure due to outdated size. Introduce a check to prevent size validation during buffer preparation if a resolution reconfiguration is in progress, to handle this. Cc: stable@vger.kernel.org Fixes: 17f2a48 ("media: iris: implement vb2 ops for buf_queue and firmware response") Reviewed-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 Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com> Tested-by: Vikash Garodia <quic_vgarodia@quicinc.com> # on sa8775p-ride Signed-off-by: Bryan O'Donoghue <bod@kernel.org> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 3b26317 commit 55a2bc0

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

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

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,14 @@ int iris_vb2_buf_prepare(struct vb2_buffer *vb)
259259
return -EINVAL;
260260
}
261261

262-
if (vb->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE &&
263-
vb2_plane_size(vb, 0) < iris_get_buffer_size(inst, BUF_OUTPUT))
264-
return -EINVAL;
265-
if (vb->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE &&
266-
vb2_plane_size(vb, 0) < iris_get_buffer_size(inst, BUF_INPUT))
267-
return -EINVAL;
268-
262+
if (!(inst->sub_state & IRIS_INST_SUB_DRC)) {
263+
if (vb->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE &&
264+
vb2_plane_size(vb, 0) < iris_get_buffer_size(inst, BUF_OUTPUT))
265+
return -EINVAL;
266+
if (vb->type == V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE &&
267+
vb2_plane_size(vb, 0) < iris_get_buffer_size(inst, BUF_INPUT))
268+
return -EINVAL;
269+
}
269270
return 0;
270271
}
271272

0 commit comments

Comments
 (0)