From patchwork Mon Mar 11 19:00:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sylwester Nawrocki/Kernel \\(PLT\\) /SRPOL/Staff Engineer/Samsung Electronics" X-Patchwork-Id: 2250011 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id C03113FC8F for ; Mon, 11 Mar 2013 19:01:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754485Ab3CKTBR (ORCPT ); Mon, 11 Mar 2013 15:01:17 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:24364 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754451Ab3CKTBQ (ORCPT ); Mon, 11 Mar 2013 15:01:16 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MJI00D20FI22F50@mailout2.samsung.com>; Tue, 12 Mar 2013 04:01:15 +0900 (KST) X-AuditID: cbfee61a-b7fa86d0000045ae-2f-513e29fad394 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id AC.50.17838.AF92E315; Tue, 12 Mar 2013 04:01:14 +0900 (KST) Received: from amdc1344.digital.local ([106.116.147.32]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MJI00F2XFGXUP00@mmp2.samsung.com>; Tue, 12 Mar 2013 04:01:14 +0900 (KST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: kyungmin.park@samsung.com, myungjoo.ham@samsung.com, shaik.samsung@gmail.com, arun.kk@samsung.com, a.hajda@samsung.com, linux-samsung-soc@vger.kernel.org, Sylwester Nawrocki Subject: [PATCH RFC 08/11] s5p-fimc: Ensure proper s_stream() call order in the ISP datapaths Date: Mon, 11 Mar 2013 20:00:23 +0100 Message-id: <1363028426-2771-9-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1363028426-2771-1-git-send-email-s.nawrocki@samsung.com> References: <1363028426-2771-1-git-send-email-s.nawrocki@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplluLIzCtJLcpLzFFi42I5/e+xoO4vTbtAg2lzLC1urTvHavHx1G1W i7NNb9gtejZsZbWYcX4fk8XtxhVsFofftLNarNs5id2Bw2PnrLvsHn1bVjF6fN4kF8AcxWWT kpqTWZZapG+XwJWx7u1floIPAhWXmmYxNjBe5e1i5OCQEDCRWHCAp4uRE8gUk7hwbz0biC0k MJ1RomuCaxcjF5DdwSTRtrqPESTBJmAo0XsUwhYRkJd40nuDDaSIWeAco8SbG69ZQRLCAvES D34/B7NZBFQltk9Yzw5i8wq4SnR/38IEsVhBYs4kG5Awp4CbxJonC6AWu0r8+HmGfQIj7wJG hlWMoqkFyQXFSem5hnrFibnFpXnpesn5uZsYwYH0TGoH48oGi0OMAhyMSjy8it9sA4VYE8uK K3MPMUpwMCuJ8K7cZBMoxJuSWFmVWpQfX1Sak1p8iFGag0VJnPdAq3WgkEB6YklqdmpqQWoR TJaJg1OqgVFGLoi7zChpt9u00896GB4tPr3wz7bFF7Lmid/pXHC7+s7jV0GV1TsaHL5c7tl4 8OveyPw3pVdZ2jRWaCwp0Z3RJ9ESebKbZcnfWEstfV6VlMVZ11NuPtkhq8S8xGqbyiqFohkc 5c/C96//9f79xq0PPCzPNNy2+pRdlqWlYTbnqOM9u0MuU84rsRRnJBpqMRcVJwIAZRo0IiAC AAA= Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org 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 Signed-off-by: Kyungmin Park --- 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 c336ed1..c99802d 100644 --- a/drivers/media/platform/s5p-fimc/fimc-mdevice.c +++ b/drivers/media/platform/s5p-fimc/fimc-mdevice.c @@ -194,28 +194,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 */