All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sylwester Nawrocki <s.nawrocki@samsung.com>
To: linux-media@vger.kernel.org
Cc: kyungmin.park@samsung.com, myungjoo.ham@samsung.com,
	dh09.lee@samsung.com, shaik.samsung@gmail.com,
	arun.kk@samsung.com, a.hajda@samsung.com,
	linux-samsung-soc@vger.kernel.org,
	Sylwester Nawrocki <s.nawrocki@samsung.com>
Subject: [PATCH v2 07/10] s5p-fimc: Ensure proper s_stream() call order in the ISP datapaths
Date: Tue, 26 Mar 2013 18:29:49 +0100	[thread overview]
Message-ID: <1364318992-20562-8-git-send-email-s.nawrocki@samsung.com> (raw)
In-Reply-To: <1364318992-20562-1-git-send-email-s.nawrocki@samsung.com>

Since the FIMC-IS firmware communicates with an image sensor directly
through the ISP I2C bus controllers data streaming cannot be simply
enabled from left to right or disabled from right to left along the
processing pipeline. Thus a subdev index to call s_stream() on is
looked up from a table, rather than doing the op call based on
increasing/decreasing indexes.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/media/platform/s5p-fimc/fimc-mdevice.c |   22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/drivers/media/platform/s5p-fimc/fimc-mdevice.c b/drivers/media/platform/s5p-fimc/fimc-mdevice.c
index d519ee7..53bfd20 100644
--- a/drivers/media/platform/s5p-fimc/fimc-mdevice.c
+++ b/drivers/media/platform/s5p-fimc/fimc-mdevice.c
@@ -225,28 +225,36 @@ static int __fimc_pipeline_close(struct fimc_pipeline *p)
 }
 
 /**
- * __fimc_pipeline_s_stream - invoke s_stream on pipeline subdevs
+ * __fimc_pipeline_s_stream - call s_stream() on pipeline subdevs
  * @pipeline: video pipeline structure
- * @on: passed as the s_stream call argument
+ * @on: passed as the s_stream() callback argument
  */
 static int __fimc_pipeline_s_stream(struct fimc_pipeline *p, bool on)
 {
-	int i, ret;
+	static const u8 seq[2][IDX_MAX] = {
+		{ IDX_FIMC, IDX_SENSOR, IDX_IS_ISP, IDX_CSIS, IDX_FLITE },
+		{ IDX_CSIS, IDX_FLITE, IDX_FIMC, IDX_SENSOR, IDX_IS_ISP },
+	};
+	int i, ret = 0;
 
 	if (p->subdevs[IDX_SENSOR] == NULL)
 		return -ENODEV;
 
 	for (i = 0; i < IDX_MAX; i++) {
-		unsigned int idx = on ? (IDX_MAX - 1) - i : i;
+		unsigned int idx = seq[on][i];
 
 		ret = v4l2_subdev_call(p->subdevs[idx], video, s_stream, on);
 
 		if (ret < 0 && ret != -ENOIOCTLCMD && ret != -ENODEV)
-			return ret;
+			goto error;
 	}
-
 	return 0;
-
+error:
+	for (; i >= 0; i--) {
+		unsigned int idx = seq[on][i];
+		v4l2_subdev_call(p->subdevs[idx], video, s_stream, !on);
+	}
+	return ret;
 }
 
 /* Media pipeline operations for the FIMC/FIMC-LITE video device driver */
-- 
1.7.9.5


  parent reply	other threads:[~2013-03-26 17:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-26 17:29 [PATCH v2 00/10] s5p-fimc: Exynos4x12 FIMC-IS support prerequisite Sylwester Nawrocki
2013-03-26 17:29 ` [PATCH v2 01/10] V4L: Add MATRIX option to V4L2_CID_EXPOSURE_METERING control Sylwester Nawrocki
2013-03-26 17:29 ` [PATCH v2 02/10] s5p-fimc: Add error checks for pipeline stream on callbacks Sylwester Nawrocki
2013-03-26 17:29 ` [PATCH v2 03/10] s5p-fimc: Update graph traversal for entities with multiple source pads Sylwester Nawrocki
2013-03-26 17:29 ` [PATCH v2 04/10] s5p-fimc: Add support for PIXELASYNCMx clocks Sylwester Nawrocki
2013-03-26 17:29 ` [PATCH v2 05/10] s5p-fimc: Add support for ISP Writeback data input bus type Sylwester Nawrocki
2013-03-26 17:29 ` [PATCH v2 06/10] s5p-fimc: Ensure CAMCLK clock can be enabled by FIMC-LITE devices Sylwester Nawrocki
2013-03-26 17:29 ` Sylwester Nawrocki [this message]
2013-03-26 17:29 ` [PATCH v2 08/10] s5p-fimc: Ensure proper s_power() call order in the ISP datapaths Sylwester Nawrocki
2013-03-26 17:29 ` [PATCH v2 09/10] s5p-fimc: Remove dependency on fimc-core.h in fimc-lite driver Sylwester Nawrocki
2013-03-26 17:29 ` [PATCH v2 10/10] s5p-fimc: Change the driver directory name to exynos4-is Sylwester Nawrocki

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=1364318992-20562-8-git-send-email-s.nawrocki@samsung.com \
    --to=s.nawrocki@samsung.com \
    --cc=a.hajda@samsung.com \
    --cc=arun.kk@samsung.com \
    --cc=dh09.lee@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=shaik.samsung@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.