Message ID | 1607022002-26575-11-git-send-email-skomatineni@nvidia.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Hans Verkuil |
Headers |
Received: from vger.kernel.org ([23.128.96.18]) by www.linuxtv.org with esmtp (Exim 4.92) (envelope-from <linux-media-owner@vger.kernel.org>) id 1kktrr-003m9s-W4; Thu, 03 Dec 2020 19:02:16 +0000 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2501984AbgLCTBb (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Thu, 3 Dec 2020 14:01:31 -0500 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:18470 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731806AbgLCTBa (ORCPT <rfc822;linux-media@vger.kernel.org>); Thu, 3 Dec 2020 14:01:30 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id <B5fc935c10000>; Thu, 03 Dec 2020 11:00:17 -0800 Received: from HQMAIL109.nvidia.com (172.20.187.15) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 3 Dec 2020 19:00:14 +0000 Received: from skomatineni-linux.nvidia.com (172.20.13.39) by mail.nvidia.com (172.20.187.15) with Microsoft SMTP Server id 15.0.1473.3 via Frontend Transport; Thu, 3 Dec 2020 19:00:12 +0000 From: Sowjanya Komatineni <skomatineni@nvidia.com> To: <skomatineni@nvidia.com>, <thierry.reding@gmail.com>, <jonathanh@nvidia.com>, <hverkuil@xs4all.nl>, <sakari.ailus@iki.fi>, <robh+dt@kernel.org> CC: <bparrot@ti.com>, <mchehab@kernel.org>, <linux-media@vger.kernel.org>, <linux-tegra@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH v3 10/13] media: v4l2-fwnode: Update V4L2_FWNODE_CSI2_MAX_DATA_LANES to 8 Date: Thu, 3 Dec 2020 10:59:59 -0800 Message-ID: <1607022002-26575-11-git-send-email-skomatineni@nvidia.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607022002-26575-1-git-send-email-skomatineni@nvidia.com> References: <1607022002-26575-1-git-send-email-skomatineni@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1607022017; bh=0r1CsjXAcGhStr4lTll4w2YEjN3lzY3myJy7gJpTSd0=; h=From:To:CC:Subject:Date:Message-ID:X-Mailer:In-Reply-To: References:X-NVConfidentiality:MIME-Version:Content-Type; b=FLA6zt4bNo4HUuBxxWxqVcnEn/mDagSr61KhfzzFhxTii8sn0v6S0WM1dzxZb7Yxf lu8xoIfsDM2g7b6AQr5bVlT9nm3ryIUbOsTtshMZK6rtd5q/rrybctr98wiCyo5cix 76k0s94mD4c41bky/oqv2dqCKQsbyQhLere7JaSsCMy15Wq+h5HsJ05eAhHBwpzB4b dEq29VGh9FJJ9Yu2c6gMyWT4TKprGpukzSupuPZ9PhAO3D7aU5viNZdnOHObqetGhG ptJEnXccaI0OB2hv3DxR4D3eZIL5ISi/g1TWlFtYQKa+xzO7pal76nSlIFS4uKkxeC 1oz6iDIXZcU8A== Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-LSpam-Score: -2.5 (--) X-LSpam-Report: No, score=-2.5 required=5.0 tests=BAYES_00=-1.9,DKIMWL_WL_HIGH=0.001,DKIM_SIGNED=0.1,DKIM_VALID=-0.1,DKIM_VALID_AU=-0.1,HEADER_FROM_DIFFERENT_DOMAINS=0.5,MAILING_LIST_MULTI=-1 autolearn=ham autolearn_force=no |
Series |
tegra-video: Add support for capturing from HDMI-to-CSI bridge
|
|
Commit Message
Sowjanya Komatineni
Dec. 3, 2020, 6:59 p.m. UTC
Some CSI2 receivers support 8 data lanes.
So, this patch updates CSI2 maximum data lanes to be 8.
Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com>
---
drivers/media/platform/ti-vpe/cal-camerarx.c | 2 +-
include/media/v4l2-fwnode.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Comments
On Thu, Dec 03, 2020 at 10:59:59AM -0800, Sowjanya Komatineni wrote: > Some CSI2 receivers support 8 data lanes. > > So, this patch updates CSI2 maximum data lanes to be 8. > > Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
On 03/12/2020 19:59, Sowjanya Komatineni wrote: > Some CSI2 receivers support 8 data lanes. > > So, this patch updates CSI2 maximum data lanes to be 8. > > Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com> > --- > drivers/media/platform/ti-vpe/cal-camerarx.c | 2 +- > include/media/v4l2-fwnode.h | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/platform/ti-vpe/cal-camerarx.c b/drivers/media/platform/ti-vpe/cal-camerarx.c > index 806cbf1..47e2143 100644 > --- a/drivers/media/platform/ti-vpe/cal-camerarx.c > +++ b/drivers/media/platform/ti-vpe/cal-camerarx.c > @@ -534,7 +534,7 @@ static int cal_camerarx_parse_dt(struct cal_camerarx *phy) > { > struct v4l2_fwnode_endpoint *endpoint = &phy->endpoint; > struct device_node *ep_node; > - char data_lanes[V4L2_FWNODE_CSI2_MAX_DATA_LANES * 2]; > + char data_lanes[V4L2_FWNODE_CSI2_MAX_DATA_LANES]; > unsigned int i; > int ret; > I'm not so sure about this change: it relies on the implicit knowledge that this cal driver can handle only 4 lanes max, so that doubling V4L2_FWNODE_CSI2_MAX_DATA_LANES is the same as the old 'V4L2_FWNODE_CSI2_MAX_DATA_LANES * 2'. I think we should either keep the existing code (which means data_lanes is now larger than needed, so stack usage increases by 8 bytes), or perhaps create a new define for this driver like CAL_MAX_DATA_LANES and use that. In my opinion the original code should just be kept, but I've CC-ed Laurent on this to hear what he thinks. Regards, Hans > diff --git a/include/media/v4l2-fwnode.h b/include/media/v4l2-fwnode.h > index 4e1f6e1d..92401c1 100644 > --- a/include/media/v4l2-fwnode.h > +++ b/include/media/v4l2-fwnode.h > @@ -25,7 +25,7 @@ struct fwnode_handle; > struct v4l2_async_notifier; > struct v4l2_async_subdev; > > -#define V4L2_FWNODE_CSI2_MAX_DATA_LANES 4 > +#define V4L2_FWNODE_CSI2_MAX_DATA_LANES 8 > > /** > * struct v4l2_fwnode_bus_mipi_csi2 - MIPI CSI-2 bus data structure >
Hi Hans, On Mon, Dec 07, 2020 at 11:47:38AM +0100, Hans Verkuil wrote: > On 03/12/2020 19:59, Sowjanya Komatineni wrote: > > Some CSI2 receivers support 8 data lanes. > > > > So, this patch updates CSI2 maximum data lanes to be 8. > > > > Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com> > > --- > > drivers/media/platform/ti-vpe/cal-camerarx.c | 2 +- > > include/media/v4l2-fwnode.h | 2 +- > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/media/platform/ti-vpe/cal-camerarx.c b/drivers/media/platform/ti-vpe/cal-camerarx.c > > index 806cbf1..47e2143 100644 > > --- a/drivers/media/platform/ti-vpe/cal-camerarx.c > > +++ b/drivers/media/platform/ti-vpe/cal-camerarx.c > > @@ -534,7 +534,7 @@ static int cal_camerarx_parse_dt(struct cal_camerarx *phy) > > { > > struct v4l2_fwnode_endpoint *endpoint = &phy->endpoint; > > struct device_node *ep_node; > > - char data_lanes[V4L2_FWNODE_CSI2_MAX_DATA_LANES * 2]; > > + char data_lanes[V4L2_FWNODE_CSI2_MAX_DATA_LANES]; > > unsigned int i; > > int ret; > > > > I'm not so sure about this change: it relies on the implicit knowledge that > this cal driver can handle only 4 lanes max, so that doubling > V4L2_FWNODE_CSI2_MAX_DATA_LANES is the same as the old 'V4L2_FWNODE_CSI2_MAX_DATA_LANES * 2'. > > I think we should either keep the existing code (which means data_lanes > is now larger than needed, so stack usage increases by 8 bytes), or perhaps > create a new define for this driver like CAL_MAX_DATA_LANES and use that. > > In my opinion the original code should just be kept, but I've CC-ed Laurent > on this to hear what he thinks. I further looked at the code there and it does *depend* on a particular value of V4L2_FWNODE_CSI2_MAX_DATA_LANES. That needs to be fixed. This part can (or should) be dropped from the patch though.
On 12/8/20 11:59 AM, Sakari Ailus wrote: > Hi Hans, > > On Mon, Dec 07, 2020 at 11:47:38AM +0100, Hans Verkuil wrote: >> On 03/12/2020 19:59, Sowjanya Komatineni wrote: >>> Some CSI2 receivers support 8 data lanes. >>> >>> So, this patch updates CSI2 maximum data lanes to be 8. >>> >>> Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com> >>> --- >>> drivers/media/platform/ti-vpe/cal-camerarx.c | 2 +- >>> include/media/v4l2-fwnode.h | 2 +- >>> 2 files changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/drivers/media/platform/ti-vpe/cal-camerarx.c b/drivers/media/platform/ti-vpe/cal-camerarx.c >>> index 806cbf1..47e2143 100644 >>> --- a/drivers/media/platform/ti-vpe/cal-camerarx.c >>> +++ b/drivers/media/platform/ti-vpe/cal-camerarx.c >>> @@ -534,7 +534,7 @@ static int cal_camerarx_parse_dt(struct cal_camerarx *phy) >>> { >>> struct v4l2_fwnode_endpoint *endpoint = &phy->endpoint; >>> struct device_node *ep_node; >>> - char data_lanes[V4L2_FWNODE_CSI2_MAX_DATA_LANES * 2]; >>> + char data_lanes[V4L2_FWNODE_CSI2_MAX_DATA_LANES]; >>> unsigned int i; >>> int ret; >>> >> I'm not so sure about this change: it relies on the implicit knowledge that >> this cal driver can handle only 4 lanes max, so that doubling >> V4L2_FWNODE_CSI2_MAX_DATA_LANES is the same as the old 'V4L2_FWNODE_CSI2_MAX_DATA_LANES * 2'. >> >> I think we should either keep the existing code (which means data_lanes >> is now larger than needed, so stack usage increases by 8 bytes), or perhaps >> create a new define for this driver like CAL_MAX_DATA_LANES and use that. >> >> In my opinion the original code should just be kept, but I've CC-ed Laurent >> on this to hear what he thinks. > I further looked at the code there and it does *depend* on a particular > value of V4L2_FWNODE_CSI2_MAX_DATA_LANES. That needs to be fixed. This part > can (or should) be dropped from the patch though. > Thanks Sakari and Hans. OK. Will drop updating cal-camerarx.c from this patch in next version.
diff --git a/drivers/media/platform/ti-vpe/cal-camerarx.c b/drivers/media/platform/ti-vpe/cal-camerarx.c index 806cbf1..47e2143 100644 --- a/drivers/media/platform/ti-vpe/cal-camerarx.c +++ b/drivers/media/platform/ti-vpe/cal-camerarx.c @@ -534,7 +534,7 @@ static int cal_camerarx_parse_dt(struct cal_camerarx *phy) { struct v4l2_fwnode_endpoint *endpoint = &phy->endpoint; struct device_node *ep_node; - char data_lanes[V4L2_FWNODE_CSI2_MAX_DATA_LANES * 2]; + char data_lanes[V4L2_FWNODE_CSI2_MAX_DATA_LANES]; unsigned int i; int ret; diff --git a/include/media/v4l2-fwnode.h b/include/media/v4l2-fwnode.h index 4e1f6e1d..92401c1 100644 --- a/include/media/v4l2-fwnode.h +++ b/include/media/v4l2-fwnode.h @@ -25,7 +25,7 @@ struct fwnode_handle; struct v4l2_async_notifier; struct v4l2_async_subdev; -#define V4L2_FWNODE_CSI2_MAX_DATA_LANES 4 +#define V4L2_FWNODE_CSI2_MAX_DATA_LANES 8 /** * struct v4l2_fwnode_bus_mipi_csi2 - MIPI CSI-2 bus data structure