Linux Media Controller development
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: linux-media@vger.kernel.org
Cc: "Yan, Dongcheng" <dongcheng.yan@intel.com>,
	Mehdi Djait <mehdi.djait@linux.intel.com>,
	"Yu, Ong Hock" <ong.hock.yu@intel.com>,
	"Ng, Khai Wen" <khai.wen.ng@intel.com>,
	Antti Laakso <antti.laakso@linux.intel.com>,
	"Bajpai, Manik" <manik.bajpai@intel.com>,
	Divyamani Tripathi <divyamani.tripathi@intel.com>
Subject: [PATCH v2 08/21] media: ipu6: Collect IPU streams into CSI-2 receiver sub-device context
Date: Thu, 17 Sep 2026 14:39:10 +0300	[thread overview]
Message-ID: <20260917113923.59004-9-sakari.ailus@linux.intel.com> (raw)
In-Reply-To: <20260917113923.59004-1-sakari.ailus@linux.intel.com>

Collect the IPU streams to the CSI-2 receiver sub-device's context.

The background is that an IPU stream is bound to a CSI-2 virtual channel
but in a V4L2 pipeline there's no such assumption. Therefore a pipeline
may contain multiple virtual channels and so multiple IPU streams, too.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c  | 6 ++++++
 drivers/media/pci/intel/ipu6/ipu6-isys-csi2.h  | 1 +
 drivers/media/pci/intel/ipu6/ipu6-isys-video.h | 1 +
 3 files changed, 8 insertions(+)

diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c b/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c
index 0fd4171b50ac..f92577054d89 100644
--- a/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c
+++ b/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c
@@ -457,6 +457,8 @@ static int ipu6_isys_csi2_enable_streams(struct v4l2_subdev *sd,
 		return ret;
 	}
 
+	list_add(&av->csi2_entry, &csi2->av_head);
+
 	ret = ipu6_isys_start_stream_firmware(av, &bl);
 	if (ret) {
 		dev_err(sd->dev, "start stream of firmware failed\n");
@@ -493,6 +495,7 @@ static int ipu6_isys_csi2_enable_streams(struct v4l2_subdev *sd,
 	ipu6_isys_close_streaming_firmware(av);
 
 err_return_buffers:
+	list_del(&av->csi2_entry);
 	ipu6_isys_buffer_list_queue(&bl, IPU6_ISYS_BUFFER_LIST_FL_INCOMING, 0);
 
 	return ret;
@@ -530,6 +533,8 @@ static int ipu6_isys_csi2_disable_streams(struct v4l2_subdev *sd,
 
 	ipu6_isys_close_streaming_firmware(av);
 
+	list_del(&av->csi2_entry);
+
 	return 0;
 }
 
@@ -675,6 +680,7 @@ int ipu6_isys_csi2_init(struct ipu6_isys_csi2 *csi2,
 	if (ret)
 		goto fail;
 
+	INIT_LIST_HEAD(&csi2->av_head);
 	csi2->asd.source = IPU6_FW_ISYS_STREAM_SRC_CSI2_PORT0 + index;
 	csi2->asd.supported_codes = csi2_supported_codes;
 	snprintf(csi2->asd.sd.name, sizeof(csi2->asd.sd.name),
diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.h b/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.h
index dbaaf00af623..7c936154691e 100644
--- a/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.h
+++ b/drivers/media/pci/intel/ipu6/ipu6-isys-csi2.h
@@ -41,6 +41,7 @@ struct ipu6_isys_csi2 {
 	struct ipu6_isys_subdev asd;
 	struct ipu6_isys *isys;
 	struct ipu6_isys_video av[NR_OF_CSI2_SRC_PADS];
+	struct list_head av_head;
 
 	void __iomem *base;
 	u32 receiver_errors;
diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-video.h b/drivers/media/pci/intel/ipu6/ipu6-isys-video.h
index 4c890c6af8f5..cb4b45f0dae2 100644
--- a/drivers/media/pci/intel/ipu6/ipu6-isys-video.h
+++ b/drivers/media/pci/intel/ipu6/ipu6-isys-video.h
@@ -78,6 +78,7 @@ struct video_stream_watermark {
 
 struct ipu6_isys_video {
 	struct ipu6_isys_queue aq;
+	struct list_head csi2_entry;
 	/* Serialise access to other fields in the struct. */
 	struct mutex mutex;
 	struct media_pad pad;
-- 
2.47.3


  parent reply	other threads:[~2026-09-17 11:39 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-17 11:39 [PATCH v2 00/21] IPU6 multi-stream and metadata support preparation Sakari Ailus
2026-09-17 11:39 ` [PATCH v2 01/21] media: ipu6: Fix releasing resources at failing streamon Sakari Ailus
2026-09-17 11:39 ` [PATCH v2 02/21] media: ipu6: Move streaming control to CSI-2 receiver driver Sakari Ailus
2026-09-17 11:39 ` [PATCH v2 03/21] media: ipu6: Stream number on CSI-2 receiver source pads is always 0 Sakari Ailus
2026-09-17 11:39 ` [PATCH v2 04/21] media: ipu6: Rename misnamed out_free_watermark label in video init Sakari Ailus
2026-09-17 11:39 ` [PATCH v2 05/21] media: ipu6: Always request a capture ack Sakari Ailus
2026-09-17 11:39 ` [PATCH v2 06/21] media: ipu6: Clean up link frequency calculation Sakari Ailus
2026-09-17 11:39 ` [PATCH v2 07/21] media: ipu6: Get watermark configuration directly from ipdata Sakari Ailus
2026-09-17 11:39 ` Sakari Ailus [this message]
2026-09-17 11:39 ` [PATCH v2 09/21] media: ipu6: Start streaming once all streams have started, stop when not Sakari Ailus
2026-09-18  7:36   ` Nicola Fiorillo
2026-09-18 20:56     ` Sakari Ailus
2026-09-17 11:39 ` [PATCH v2 10/21] media: ipu6: Add lockdep checks for CSI-2 streaming enable and disable Sakari Ailus
2026-09-17 11:39 ` [PATCH v2 11/21] media: ipu6: Remove nr_queues and nr_streaming fields in ipu6_isys_stream Sakari Ailus
2026-09-17 11:39 ` [PATCH v2 12/21] media: ipu6: Collect enabled stream IDs Sakari Ailus
2026-09-17 11:39 ` [PATCH v2 13/21] media: ipu6: Avoid accessing av->streams before streaming Sakari Ailus
2026-09-17 11:39 ` [PATCH v2 14/21] media: ipu6: Rework watermark calculation Sakari Ailus
2026-09-17 11:39 ` [PATCH v2 15/21] media: ipu6: Rework watermark setting Sakari Ailus
2026-09-17 11:39 ` [PATCH v2 16/21] media: ipu6: Bridge the gap between streams in V4L2 and IPU6 firmware Sakari Ailus
2026-09-17 11:39 ` [PATCH v2 17/21] media: ipu6: Drop {get,put}_streams_opened() Sakari Ailus
2026-09-17 11:39 ` [PATCH v2 18/21] media: ipu6: Serialise access to stream pointers by isys stream_lock Sakari Ailus
2026-09-17 11:39 ` [PATCH v2 19/21] media: ipu6: Move firmware init/cleanup to RPM callbacks Sakari Ailus
2026-09-17 11:39 ` [PATCH v2 20/21] media: ipu6: Don't track power status, rely on runtime PM Sakari Ailus
2026-09-22  9:16   ` Manik Bajpai
2026-09-17 11:39 ` [PATCH v2 21/21] media: ipu6: Support upstream sub-devices without get_frame_desc() Sakari Ailus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260917113923.59004-9-sakari.ailus@linux.intel.com \
    --to=sakari.ailus@linux.intel.com \
    --cc=antti.laakso@linux.intel.com \
    --cc=divyamani.tripathi@intel.com \
    --cc=dongcheng.yan@intel.com \
    --cc=khai.wen.ng@intel.com \
    --cc=linux-media@vger.kernel.org \
    --cc=manik.bajpai@intel.com \
    --cc=mehdi.djait@linux.intel.com \
    --cc=ong.hock.yu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox