Thread (66 messages) 66 messages, 7 authors, 2025-08-04

Re: [PATCH 06/13] media: v4l2-subdev: Mark both streams of a route enabled

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Date: 2025-06-19 16:56:24

Hi Sakari,

Thank you for the patch.

On Thu, Jun 19, 2025 at 11:15:39AM +0300, Sakari Ailus wrote:
Streams are stored in sink-source pairs in sub-device state.
Is it really this simple ? Don't we support for instance stream merging
where two streams on possibly different sink pads are routed to a single
stream on a source pad ?
quoted hunk ↗ jump to hunk
When a stream
was marked enabled (or disabled), only the state of one end of the stream
was modified, leaving the stream in an incoherent state. Mark both ends of
the stream enabled (or disabled).

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/media/v4l2-core/v4l2-subdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index 60b8febd3339..5afdd9d548b5 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -2254,9 +2254,11 @@ static void v4l2_subdev_set_streams_enabled(struct v4l2_subdev *sd,
 	for (unsigned int i = 0; i < state->stream_configs.num_configs; ++i) {
 		struct v4l2_subdev_stream_config *cfg =
 			&state->stream_configs.configs[i];
+		struct v4l2_subdev_stream_config *cfg2 =
+			&state->stream_configs.configs[i ^ 1U];
 
 		if (cfg->pad == pad && (streams_mask & BIT_ULL(cfg->stream)))
-			cfg->enabled = enabled;
+			cfg->enabled = cfg2->enabled = enabled;
 	}
 }
 
-- 
Regards,

Laurent Pinchart
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help