Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: iris: Refine internal buffer reconfiguration logic for resolution change

Improve the condition used to determine when input internal buffers need
to be reconfigured during streamon on the capture port. Previously, the
check relied on the INPUT_PAUSE sub-state, which was also being set
during seek operations. This led to input buffers being queued multiple
times to the firmware, causing session errors due to duplicate buffer
submissions.

This change introduces a more accurate check using the FIRST_IPSC and
DRC sub-states to ensure that input buffer reconfiguration is triggered
only during resolution change scenarios, such as streamoff/on on the
capture port. This avoids duplicate buffer queuing during seek
operations.

Fixes: c1f8b2cc72ec ("media: iris: handle streamoff/on from client in dynamic resolution change")
Cc: stable@vger.kernel.org
Reported-by: Val Packett <val@packett.cool>
Closes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4700
Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>
Reviewed-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Dikshita Agarwal and committed by
Hans Verkuil
aec75e35 e81b60c4

+5 -2
+5 -2
drivers/media/platform/qcom/iris/iris_common.c
··· 91 91 int iris_process_streamon_output(struct iris_inst *inst) 92 92 { 93 93 const struct iris_hfi_command_ops *hfi_ops = inst->core->hfi_ops; 94 - bool drain_active = false, drc_active = false; 95 94 enum iris_inst_sub_state clear_sub_state = 0; 95 + bool drain_active, drc_active, first_ipsc; 96 96 int ret = 0; 97 97 98 98 iris_scale_power(inst); 99 + 100 + first_ipsc = inst->sub_state & IRIS_INST_SUB_FIRST_IPSC; 99 101 100 102 drain_active = inst->sub_state & IRIS_INST_SUB_DRAIN && 101 103 inst->sub_state & IRIS_INST_SUB_DRAIN_LAST; ··· 110 108 else if (drain_active) 111 109 clear_sub_state = IRIS_INST_SUB_DRAIN | IRIS_INST_SUB_DRAIN_LAST; 112 110 113 - if (inst->domain == DECODER && inst->sub_state & IRIS_INST_SUB_INPUT_PAUSE) { 111 + /* Input internal buffer reconfiguration required in case of resolution change */ 112 + if (first_ipsc || drc_active) { 114 113 ret = iris_alloc_and_queue_input_int_bufs(inst); 115 114 if (ret) 116 115 return ret;