From patchwork Tue Apr 23 15:41:27 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: 2478271 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 47DBA3FD1A for ; Tue, 23 Apr 2013 15:41:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756719Ab3DWPln (ORCPT ); Tue, 23 Apr 2013 11:41:43 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:53132 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756031Ab3DWPlm (ORCPT ); Tue, 23 Apr 2013 11:41:42 -0400 Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MLP00L1ZSXHU830@mailout3.samsung.com> for linux-media@vger.kernel.org; Wed, 24 Apr 2013 00:41:41 +0900 (KST) X-AuditID: cbfee61a-b7f156d000002a55-e3-5176abb52ff1 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 9F.E1.10837.5BBA6715; Wed, 24 Apr 2013 00:41:41 +0900 (KST) Received: from amdc1344.digital.local ([106.116.147.32]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MLP003PMSX6FQ70@mmp1.samsung.com>; Wed, 24 Apr 2013 00:41:41 +0900 (KST) From: Sylwester Nawrocki To: linux-media@vger.kernel.org Cc: Sylwester Nawrocki , Kyungmin Park Subject: [PATCH] exynos4-is: Fix TRY format propagation at MIPI-CSIS subdev Date: Tue, 23 Apr 2013 17:41:27 +0200 Message-id: <1366731687-32566-1-git-send-email-s.nawrocki@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrOJMWRmVeSWpSXmKPExsVy+t9jAd2tq8sCDZq/c1icbXrDbtGzYSur xeE37awOzB59W1YxenzeJBfAFMVlk5Kak1mWWqRvl8CV8XXLTvaChwIVM646NTB28HUxcnJI CJhIzLv0hxHCFpO4cG89WxcjF4eQwCJGiZ9/fjNDOB1MEms2XmUCqWITMJToPdoH1iEiIC/x pPcGG4jNLBAj8e3nJbC4sIC3xO0rp8DiLAKqEvsPvmUGsXkF3CRabzcAzeEA2qYgMWeSzQRG 7gWMDKsYRVMLkguKk9JzDfWKE3OLS/PS9ZLzczcxgr37TGoH48oGi0OMAhyMSjy8L2aVBQqx JpYVV+YeYpTgYFYS4bWeDRTiTUmsrEotyo8vKs1JLT7EKM3BoiTOe6DVOlBIID2xJDU7NbUg tQgmy8TBKdXA6FN1L2Of8i8zJm/h7rA9W1kLjR/eXv9w4rSHbr0uX6SVp25qy344eZWenm54 If8+psSZrf67/ixnD/vgZ/v70qsdOYGn7z7ii9E57/9wddHhTd2XjJQ/NC9j2Cb5NPsbj1dA 3uozyw8FL1PZ7FFx19f1adCKsASNyGylxNcSQUvL72cd3PPaUImlOCPRUIu5qDgRAFUf/rXq AQAA Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Ensure TRY format is propagated from the sink to source pad. The format at both pads is always same so the TRY format buffer for pad 0 is used to hold format for both pads. While at it remove redundant fmt->pad checking. Reported-by: Jacek Anaszewski Signed-off-by: Sylwester Nawrocki Signed-off-by: Kyungmin Park Reviewed-by: Laurent Pinchart --- drivers/media/platform/exynos4-is/mipi-csis.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/media/platform/exynos4-is/mipi-csis.c b/drivers/media/platform/exynos4-is/mipi-csis.c index d62b0d2..50f3c5c 100644 --- a/drivers/media/platform/exynos4-is/mipi-csis.c +++ b/drivers/media/platform/exynos4-is/mipi-csis.c @@ -579,10 +579,10 @@ static struct csis_pix_format const *s5pcsis_try_format( static struct v4l2_mbus_framefmt *__s5pcsis_get_format( struct csis_state *state, struct v4l2_subdev_fh *fh, - u32 pad, enum v4l2_subdev_format_whence which) + enum v4l2_subdev_format_whence which) { if (which == V4L2_SUBDEV_FORMAT_TRY) - return fh ? v4l2_subdev_get_try_format(fh, pad) : NULL; + return fh ? v4l2_subdev_get_try_format(fh, 0) : NULL; return &state->format; } @@ -594,10 +594,7 @@ static int s5pcsis_set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, struct csis_pix_format const *csis_fmt; struct v4l2_mbus_framefmt *mf; - if (fmt->pad != CSIS_PAD_SOURCE && fmt->pad != CSIS_PAD_SINK) - return -EINVAL; - - mf = __s5pcsis_get_format(state, fh, fmt->pad, fmt->which); + mf = __s5pcsis_get_format(state, fh, fmt->which); if (fmt->pad == CSIS_PAD_SOURCE) { if (mf) { @@ -624,10 +621,7 @@ static int s5pcsis_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_fh *fh, struct csis_state *state = sd_to_csis_state(sd); struct v4l2_mbus_framefmt *mf; - if (fmt->pad != CSIS_PAD_SOURCE && fmt->pad != CSIS_PAD_SINK) - return -EINVAL; - - mf = __s5pcsis_get_format(state, fh, fmt->pad, fmt->which); + mf = __s5pcsis_get_format(state, fh, fmt->which); if (!mf) return -EINVAL;