linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
	Francesco Dolcini <francesco@dolcini.it>,
	Sakari Ailus <sakari.ailus@iki.fi>,
	Marcel Ziswiler <marcel@ziswiler.com>,
	linux-media@vger.kernel.org, kernel@pengutronix.de,
	Francesco Dolcini <francesco.dolcini@toradex.com>,
	Aishwarya Kothari <aishwarya.kothari@toradex.com>,
	Marcel Ziswiler <marcel.ziswiler@toradex.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Steve Longerbeam <slongerbeam@gmail.com>,
	linux-kernel@vger.kernel.org,
	Marco Felsch <m.felsch@pengutronix.de>
Subject: Re: [PATCH v2] media: i2c: ov5640: Implement get_mbus_config
Date: Mon, 20 Mar 2023 13:47:12 +0100	[thread overview]
Message-ID: <20230320124712.q67dqlldkqsdwyke@uno.localdomain> (raw)
In-Reply-To: <9b4f0896a3a3e97b44197de263c30f0d31333abd.camel@pengutronix.de>

Hi Philipp

On Mon, Mar 20, 2023 at 12:26:26PM +0100, Philipp Zabel wrote:
> On Mo, 2023-03-20 at 11:55 +0200, Laurent Pinchart wrote:
> > On Mon, Mar 20, 2023 at 11:37:33AM +0200, Sakari Ailus wrote:
> > > Hi Laurent,
> > >
> > > On Mon, Mar 20, 2023 at 11:26:02AM +0200, Laurent Pinchart wrote:
> > > > In a (simplified) nutshell,
> > > >
> > > > ---------+     +----------+     +---------+     +-----+     +-----+
> > > > > Camera | --> | CSI-2 RX | --> | CSI2IPU | --> | Mux | --> | IPU |
> > > > > Sensor |     |          |     | Gasket  |     |     |     |     |
> > > > ---------+     +----------+     +---------+     +-----+     +-----+
> > >
> > > Thank you, this is helpful.
> > >
> > > I suppose the mux here at least won't actively do anything to the data. So
> > > presumably its endpoint won't contain the active configuration, but its
> > > superset.
> > >
> > > >
> > > > All those blocks, except for the gasket, have a node in DT.
> > > >
> > > > The IPU driver needs to know the number of CSI-2 data lanes, which is
> > > > encoded in the data-lanes DT property present in both the sensor output
> > > > endpoint and the CSI-2 RX input endpoint, but not the other endpoints in
> > > > the pipeline.
> > >
> > > This doesn't yet explain why the sensor would need to implement
> > > get_mbus_config if its bus configuration remains constant.
> >
> > If I recall correctly, the IPU driver calls .g_mbus_config() on the
> > camera sensor to get the number of lanes, as it can't get it from its
> > own endpoint. That's a hack, and as Jacopo proposed, calling
> > .g_mbus_config() on the CSI-2 RX would be better, as the CSI-2 RX driver
> > can then get the value from its own endpoint, without requiring all
> > sensor drivers to implement .g_mbus_config().
>
> The IPU driver doesn't call get_mbus_config, the CSI-2 RX driver does

Am I confusing IPU CSI with CSI-2 ?
https://elixir.bootlin.com/linux/latest/source/drivers/staging/media/imx/imx-media-csi.c#L211

> (csi2_get_active_lanes in imx6-mipi-csi2.c). It could just fall back to
> looking at its own endpoint if the upstream driver does not implement
> get_mbus_config.
>
> Of course that will only help if the DT contains this information and
> all connected lanes are active.

We should assume DTs are correct, otherwise we're screwed most of the
times...

>
> regards
> Philipp

  reply	other threads:[~2023-03-20 12:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06  6:36 [PATCH v2] media: i2c: ov5640: Implement get_mbus_config Marcel Ziswiler
2023-03-14 12:13 ` Sakari Ailus
2023-03-14 12:32   ` Francesco Dolcini
2023-03-14 12:45     ` Sakari Ailus
2023-03-14 12:59       ` Francesco Dolcini
2023-03-20  8:48         ` Jacopo Mondi
2023-03-20  9:00           ` Sakari Ailus
2023-03-20  9:26             ` Laurent Pinchart
2023-03-20  9:37               ` Sakari Ailus
2023-03-20  9:55                 ` Laurent Pinchart
2023-03-20 10:15                   ` Sakari Ailus
2023-03-20 13:32                     ` Philipp Zabel
2023-03-20 14:00                       ` Laurent Pinchart
2023-03-20 18:31                         ` Dave Stevenson
2023-03-20 21:53                           ` Laurent Pinchart
2023-03-20 21:53                         ` Sakari Ailus
2023-03-20 11:26                   ` Philipp Zabel
2023-03-20 12:47                     ` Jacopo Mondi [this message]
2023-03-20 13:28                       ` Philipp Zabel
2023-03-20 11:13           ` Francesco Dolcini
2023-03-22 13:53             ` Aishwarya Kothari

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=20230320124712.q67dqlldkqsdwyke@uno.localdomain \
    --to=jacopo.mondi@ideasonboard.com \
    --cc=aishwarya.kothari@toradex.com \
    --cc=francesco.dolcini@toradex.com \
    --cc=francesco@dolcini.it \
    --cc=kernel@pengutronix.de \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=m.felsch@pengutronix.de \
    --cc=marcel.ziswiler@toradex.com \
    --cc=marcel@ziswiler.com \
    --cc=mchehab@kernel.org \
    --cc=p.zabel@pengutronix.de \
    --cc=sakari.ailus@iki.fi \
    --cc=sakari.ailus@linux.intel.com \
    --cc=slongerbeam@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).