linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacopo Mondi <jacopo+renesas@jmondi.org>
To: sakari.ailus@linux.intel.com, laurent.pinchart@ideasonboard.com,
	niklas.soderlund+renesas@ragnatech.se,
	kieran.bingham@ideasonboard.com
Cc: Jacopo Mondi <jacopo+renesas@jmondi.org>,
	linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	dave.stevenson@raspberrypi.org
Subject: [RFC 0/5] media: Implement negotiation of CSI-2 data lanes
Date: Sat, 16 Mar 2019 16:47:56 +0100	[thread overview]
Message-ID: <20190316154801.20460-1-jacopo+renesas@jmondi.org> (raw)

Hello,
   this RFC series implements negotiation of CSI-2 data lanes number and
position by extending the v4l2_mbus_frame_desc structure with a 'phy' field
that describes the media bus configuration.

The use case this series cover is the following one:
the Gen-3 R-Car boards include an ADV748x HDMI/CVBS to CSI-2 converter
connected to its CSI-2 receivers. The ADV748x chip has recently gained support
for routing both HDMI and analogue video streams through its 4 lanes TXA
transmitter, specifically to support the Ebisu board that has a single CSI-2
receiver, compared to all other Gen-3 board where the ADV748x TXes are connected
to different CSI-2 receivers, and where analogue video is streamed out from the
ADV748x single lane TXB transmitter.

To properly support transmission of analogue video through TXA, the number of
data lanes shall be dynamically reduced to 1, in order to comply with the MIPI
CSI-2 minimum clock frequency requirements.

So far, the number of data lanes has always come from DT as a static parameter,
preventing its run-time modifications. This series moves the adv748x and
the R-Car CSI-2 one to use the DT property as an indication of the number of
physically available lanes instead, and to negotiate the number of lanes in
use based on the transmitter requirements, in this case the selected
analogue video routing path.

Sending as RFC as this series is based on the in-review v4l2-multiplexed support
which extends the frame descriptor with CSI-2 specific informations:
[PATCH v3 00/31] v4l: add support for multiplexed streams

In detail on the patches:
1/5 expands the frame descriptor with D-PHY (and a TODO C-PHY) configurations
2/5 is possibly for inclusion as it addresses the same issue tackled by the
    not-so-welcome "[PATCH] media: adv748x: Don't disable CSI-2 on link_setup"
3/5 moves the adv748x to dynamically select the number of data lanes to
    use based on the selected routing
4/5 adds to the adv748x frame descriptor the D-PHY bus configuration parameters
5/5 makes the R-Car CSI-2 receiver configure itself using the bus configuration
    reported by the remote subdevice

Tested on Ebisu E3 board capturing HDMI and analogue video from TXA output,
and on Salvator-X M3-W capturing analogue video from TXA and making sure the
most canonical use case of capturing HDMI through TXA and analogue through TXB
still works. The image quality on E3 is the expected one, while on Salvator-X
the AFE->TXA routing produces images with visible artifacts and mangled colors,
but for an RFC I consider this good enough as a proof of concept.

Sending to renesas-soc and linux-media with Dave in Cc has I recall he expressed
interest for this feature during review of some adv748x patch series.

For the interested ones, the series is available at:
git://jmondi.org/linux v4l2-mux/media-master/v3-/data-lanes-negotiation

Thanks
  j

Jacopo Mondi (5):
  v4l: subdev: Add MIPI CSI-2 PHY to frame desc
  media: adv748x: Post-pone IO10 write to power up
  media: adv748x: Make lanes number depend on routing
  media: adv748x: Report D-PHY configuration
  media: rcar-csi2: Configure CSI-2 with frame desc

 drivers/media/i2c/adv748x/adv748x-core.c    | 72 ++++++++++++++-------
 drivers/media/i2c/adv748x/adv748x-csi2.c    | 21 ++++--
 drivers/media/i2c/adv748x/adv748x.h         |  3 +
 drivers/media/platform/rcar-vin/rcar-csi2.c | 71 ++++++++++++--------
 include/media/v4l2-subdev.h                 | 42 ++++++++++--
 5 files changed, 147 insertions(+), 62 deletions(-)

--
2.21.0


             reply	other threads:[~2019-03-16 15:47 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-16 15:47 Jacopo Mondi [this message]
2019-03-16 15:47 ` [RFC 1/5] v4l: subdev: Add MIPI CSI-2 PHY to frame desc Jacopo Mondi
2019-03-16 16:20   ` Sergei Shtylyov
2019-03-18  8:23     ` Jacopo Mondi
2019-03-16 17:51   ` Sakari Ailus
2019-03-18  8:31     ` Jacopo Mondi
2019-03-18 15:29       ` Dave Stevenson
2019-03-20 16:45         ` Jacopo Mondi
2019-04-04  8:49         ` Sakari Ailus
2019-04-04 16:36           ` Dave Stevenson
2019-04-10 16:51   ` Jacopo Mondi
2019-03-16 15:47 ` [RFC 2/5] media: adv748x: Post-pone IO10 write to power up Jacopo Mondi
2019-04-12 14:15   ` Kieran Bingham
2019-04-12 14:45     ` Jacopo Mondi
2019-04-12 15:57       ` Kieran Bingham
2019-04-15  7:00         ` Jacopo Mondi
2020-06-10  9:50           ` Kieran Bingham
2019-03-16 15:47 ` [RFC 3/5] media: adv748x: Make lanes number depend on routing Jacopo Mondi
2019-04-12 14:45   ` Kieran Bingham
2019-03-16 15:48 ` [RFC 4/5] media: adv748x: Report D-PHY configuration Jacopo Mondi
2019-03-16 15:48 ` [RFC 5/5] media: rcar-csi2: Configure CSI-2 with frame desc Jacopo Mondi
2019-03-20 19:50   ` Niklas Söderlund
2019-03-21  0:51     ` Jacopo Mondi

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=20190316154801.20460-1-jacopo+renesas@jmondi.org \
    --to=jacopo+renesas@jmondi.org \
    --cc=dave.stevenson@raspberrypi.org \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=sakari.ailus@linux.intel.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).