lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240410091026.50272-5-changhuang.liang@starfivetech.com>
Date: Wed, 10 Apr 2024 02:10:22 -0700
From: Changhuang Liang <changhuang.liang@...rfivetech.com>
To: Mauro Carvalho Chehab <mchehab@...nel.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Hans Verkuil <hverkuil-cisco@...all.nl>,
	Bryan O'Donoghue <bryan.odonoghue@...aro.org>,
	Laurent Pinchart <laurent.pinchart@...asonboard.com>,
	Jack Zhu <jack.zhu@...rfivetech.com>,
	Changhuang Liang <changhuang.liang@...rfivetech.com>,
	Dan Carpenter <dan.carpenter@...aro.org>,
	linux-media@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	linux-staging@...ts.linux.dev
Subject: [PATCH v2 4/8] staging: media: starfive: Introduce isp_stream

The ISP can support multiple output streams. Introduce isp_stream to
store the number of streams.

Signed-off-by: Changhuang Liang <changhuang.liang@...rfivetech.com>
---
 .../staging/media/starfive/camss/stf-camss.h  |  1 +
 .../staging/media/starfive/camss/stf-video.c  | 28 +++++++++++++++----
 2 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/media/starfive/camss/stf-camss.h b/drivers/staging/media/starfive/camss/stf-camss.h
index 328318d61c6b..6b9215c92cfa 100644
--- a/drivers/staging/media/starfive/camss/stf-camss.h
+++ b/drivers/staging/media/starfive/camss/stf-camss.h
@@ -55,6 +55,7 @@ struct stfcamss {
 	struct media_pipeline pipe;
 	struct device *dev;
 	struct stf_isp_dev isp_dev;
+	unsigned int isp_stream;
 	struct stf_capture captures[STF_CAPTURE_NUM];
 	struct stf_output output;
 	struct v4l2_async_notifier notifier;
diff --git a/drivers/staging/media/starfive/camss/stf-video.c b/drivers/staging/media/starfive/camss/stf-video.c
index 4ca889a7b757..69e3e4f9e56b 100644
--- a/drivers/staging/media/starfive/camss/stf-video.c
+++ b/drivers/staging/media/starfive/camss/stf-video.c
@@ -295,10 +295,22 @@ static int video_start_streaming(struct vb2_queue *q, unsigned int count)
 
 	video->ops->start_streaming(video);
 
-	ret = v4l2_subdev_call(video->source_subdev, video, s_stream, true);
-	if (ret) {
-		dev_err(video->stfcamss->dev, "stream on failed\n");
-		goto err_pm_put;
+	if (video->source_subdev != &video->stfcamss->isp_dev.subdev) {
+		ret = v4l2_subdev_call(video->source_subdev, video, s_stream, true);
+		if (ret) {
+			dev_err(video->stfcamss->dev, "stream on failed\n");
+			goto err_pm_put;
+		}
+	} else {
+		if (!video->stfcamss->isp_stream) {
+			ret = v4l2_subdev_call(video->source_subdev, video, s_stream, true);
+			if (ret) {
+				dev_err(video->stfcamss->dev, "stream on failed\n");
+				goto err_pm_put;
+			}
+		}
+
+		video->stfcamss->isp_stream++;
 	}
 
 	return 0;
@@ -319,7 +331,13 @@ static void video_stop_streaming(struct vb2_queue *q)
 
 	video->ops->stop_streaming(video);
 
-	v4l2_subdev_call(video->source_subdev, video, s_stream, false);
+	if (video->source_subdev != &video->stfcamss->isp_dev.subdev) {
+		v4l2_subdev_call(video->source_subdev, video, s_stream, false);
+	} else {
+		video->stfcamss->isp_stream--;
+		if (!video->stfcamss->isp_stream)
+			v4l2_subdev_call(video->source_subdev, video, s_stream, false);
+	}
 
 	pm_runtime_put(video->stfcamss->dev);
 
-- 
2.25.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ