Skip to content
/ linux Public

Commit 77f69aa

Browse files
Vishnu ReddySasha Levin
authored andcommitted
media: iris: Prevent output buffer queuing before stream-on completes
[ Upstream commit 2c73cfd ] During normal playback, stream-on for input is followed by output, and only after input stream-on does actual streaming begin. However, when gst-play performs a seek, both input and output streams are stopped, and on restart, output stream-on occurs first. At this point, firmware has not yet started streaming. Queuing output buffers before the firmware begins streaming causes it to process buffers in an invalid state, leading to an error response. These buffers are returned to the driver as errors, forcing the driver into an error state and stopping playback. Fix this by deferring output buffer queuing until stream-on completes. Input buffers can still be queued before stream-on as required. Fixes: 92e007c ("media: iris: Add V4L2 streaming support for encoder video device") Signed-off-by: Vishnu Reddy <busanna.reddy@oss.qualcomm.com> Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com> Reviewed-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com> Cc: stable@vger.kernel.org Signed-off-by: Bryan O'Donoghue <bod@kernel.org> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 7284644 commit 77f69aa

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,14 @@ int iris_vb2_start_streaming(struct vb2_queue *q, unsigned int count)
193193
buf_type = iris_v4l2_type_to_driver(q->type);
194194

195195
if (inst->domain == DECODER) {
196-
if (inst->state == IRIS_INST_STREAMING)
196+
if (buf_type == BUF_INPUT)
197+
ret = iris_queue_deferred_buffers(inst, BUF_INPUT);
198+
199+
if (!ret && inst->state == IRIS_INST_STREAMING) {
197200
ret = iris_queue_internal_deferred_buffers(inst, BUF_DPB);
198-
if (!ret)
199-
ret = iris_queue_deferred_buffers(inst, buf_type);
201+
if (!ret)
202+
ret = iris_queue_deferred_buffers(inst, BUF_OUTPUT);
203+
}
200204
} else {
201205
if (inst->state == IRIS_INST_STREAMING) {
202206
ret = iris_queue_deferred_buffers(inst, BUF_INPUT);

0 commit comments

Comments
 (0)