devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Bara <bbara93@gmail.com>
To: alexander.stein@ew.tq-group.com
Cc: abelvesa@kernel.org, aford173@gmail.com, bbara93@gmail.com,
	benjamin.bara@skidata.com, conor+dt@kernel.org,
	devicetree@vger.kernel.org, festevam@gmail.com,
	frank@oltmanns.dev, kernel@pengutronix.de,
	krzysztof.kozlowski+dt@linaro.org, l.stach@pengutronix.de,
	linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org,
	linux-imx@nxp.com, linux-kernel@vger.kernel.org,
	linux@armlinux.org.uk, mripard@kernel.org,
	mturquette@baylibre.com, peng.fan@nxp.com, robh+dt@kernel.org,
	s.hauer@pengutronix.de, sboyd@kernel.org, shawnguo@kernel.org
Subject: Re: [PATCH 00/13] imx8mp: first clock propagation attempt (for LVDS)
Date: Wed,  4 Oct 2023 10:28:06 +0200	[thread overview]
Message-ID: <20231004082806.2895789-1-bbara93@gmail.com> (raw)
In-Reply-To: <12810050.O9o76ZdvQC@steina-w>

Hi Adam, Alexander!

On Wed, 4 Oct 2023 at 10:04, Alexander Stein <alexander.stein@ew.tq-group.com> wrote:
> Am Dienstag, 3. Oktober 2023, 15:28:05 CEST schrieb Adam Ford:
> > On Sun, Sep 17, 2023 at 5:40 PM Benjamin Bara <bbara93@gmail.com> wrote:
> > > Hi!
> > >
> > > Target of this series is to dynamically set the rate of video_pll1 to
> > > the required LVDS clock rate(s), which are configured by the panel, and
> > > the lvds-bridge respectively.
> > >
> > > Some background:
> > > The LVDS panel requires two clocks: the crtc clock and the lvds clock.
> > > The lvds rate is always 7x the crtc rate. On the imx8mp, these are
> > > assigned to media_disp2_pix and media_ldb, which are both
> >
> > Could the LDB driver be updated to take in the crtc clock as a
> > parameter, then set the media_ldb to 7x crct clock.  I wonder if that
> > might simplify the task a bit.
>
> I'm not sure if you had something different in mind, but I guess this happens
> already in fsl_ldb_atomic_enable(), although using the mode clock.
> As this might not always be possible, commit bd43a9844bc6f ("drm: bridge: ldb:
> Warn if LDB clock does not match requested link frequency") was added to
> indicate something might be wrong.
> The main problem here is that both media_ldb and crct clock are not in a
> parent<->child relationship, but are siblings, configurable individually.

Yes, this already happens. First, the mode is set (which sets the CRTC
rate). Next, LDB sets the LVDS rate. Both do not have "access" to the
PLL, because the clocks haven't configured CLK_SET_RATE_PARENT. What
might be a working (but IMHO dirty) hack, is to give the LDB the PLL
clock as input too. Then it could set the PLL, LDB, CRTC rate (CRTC rate
must be set again after PLL is set!).

> > I still have concerns that the CLK_SET_RATE_PARENT may break the
> > media_disp1_pix if media_disp2_pix is changing it.
> > I think we should consider adding some sort of configurable flag to
> > the CCM that lets people choose  if CLK_SET_RATE_PARENT should be set
> > or not in the device tree instead of hard-coding it either on or off.
> > This would give people the flexibility of stating whether
> > media_disp1_pix, media_disp2_pix, both or neither could set
> > CLK_SET_RATE_PARENT.

Probably we could do that (for now) by adding a second (optional) clock
to LDB. If it is set, the LDB driver should also set the LVDS rate on
this clock. This would then be set to the parent PLL.

> > I believe the imx8mp-evk can support both LVDS-> HDMI and DSI->HDMI
> > bridges, and I fear that if they are trying to both set different
> > clock rates, this may break something and the clocks need to be
> > selected in advance to give people a bunch of HDMI options as well as
> > being able to divide down to support the LVDS.
> >
> > I think some of the displays could be tied to one of the Audio PLL's,
> > so I might experiment with splitting the media_disp1_pix and
> > media_disp2_pix from each other to see how well .

Yes, you probably could also tie them to one of the other available
PLLs. We "could" also do that automatically, by not setting
CLK_SET_RATE_REPARENT and adapting the clk-divider driver to look for a
better suitable parent. However, I guess the outcome is currently quite
unpredictable, so this would require a lot of additional work. Just to
mention it here too: I created a small spin-off of this series[1] with
the changes of this series which affect the core.

Probably using the optional clock for LDB is a suitable short-term
solution?

Regards
Benjamin

      reply	other threads:[~2023-10-04  8:28 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-17 22:39 [PATCH 00/13] imx8mp: first clock propagation attempt (for LVDS) Benjamin Bara
2023-09-17 22:39 ` [PATCH 01/13] arm64: dts: imx8mp: lvds_bridge: use root instead of composite Benjamin Bara
2023-09-19  6:47   ` Maxime Ripard
2023-09-20  7:27     ` Benjamin Bara
2023-09-17 22:39 ` [PATCH 02/13] arm64: dts: imx8mp: re-parent IMX8MP_CLK_MEDIA_MIPI_PHY1_REF Benjamin Bara
2023-10-03 13:01   ` Adam Ford
2023-10-04  8:36     ` Benjamin Bara
2023-09-17 22:39 ` [PATCH 03/13] clk: implement clk_hw_set_rate() Benjamin Bara
2023-09-19  6:50   ` Maxime Ripard
2023-09-17 22:40 ` [PATCH 04/13] clk: print debug message if parent change is ignored Benjamin Bara
2023-09-17 22:40 ` [PATCH 05/13] clk: keep track of the trigger of an ongoing clk_set_rate Benjamin Bara
2023-09-19  7:06   ` Maxime Ripard
2023-09-20  7:50     ` Benjamin Bara
2023-09-17 22:40 ` [PATCH 06/13] clk: keep track if a clock is explicitly configured Benjamin Bara
2023-09-19  7:07   ` Maxime Ripard
2023-09-20  7:22     ` Benjamin Bara
2023-09-25 15:07       ` Maxime Ripard
2023-09-17 22:40 ` [PATCH 07/13] clk: detect unintended rate changes Benjamin Bara
2023-09-19  7:22   ` Maxime Ripard
2023-09-17 22:40 ` [PATCH 08/13] clk: divider: stop early if an optimal divider is found Benjamin Bara
2023-09-17 22:40 ` [PATCH 09/13] clk: imx: pll14xx: consider active rate for re-config Benjamin Bara
2023-09-17 22:40 ` [PATCH 10/13] clk: imx: composite-8m: convert compute_dividers to void Benjamin Bara
2023-09-17 22:40 ` [PATCH 11/13] clk: imx: composite-8m: implement CLK_SET_RATE_PARENT Benjamin Bara
2023-09-17 22:40 ` [PATCH 12/13] clk: imx: imx8mp: allow LVDS clocks to set parent rate Benjamin Bara
2023-09-17 22:40 ` [PATCH 13/13] arm64: dts: imx8mp: remove assigned-clock-rate of IMX8MP_VIDEO_PLL1 Benjamin Bara
2023-09-18  5:00 ` [PATCH 00/13] imx8mp: first clock propagation attempt (for LVDS) Adam Ford
2023-09-18 17:59   ` Benjamin Bara
2023-09-19  7:37     ` Maxime Ripard
2023-09-18 17:24 ` Frank Oltmanns
2023-09-18 18:05   ` Benjamin Bara
2023-09-19  7:39     ` Maxime Ripard
2023-09-19  7:31 ` Maxime Ripard
2023-10-03 13:28 ` Adam Ford
2023-10-04  8:04   ` Alexander Stein
2023-10-04  8:28     ` Benjamin Bara [this message]

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=20231004082806.2895789-1-bbara93@gmail.com \
    --to=bbara93@gmail.com \
    --cc=abelvesa@kernel.org \
    --cc=aford173@gmail.com \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=benjamin.bara@skidata.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=frank@oltmanns.dev \
    --cc=kernel@pengutronix.de \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=l.stach@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mripard@kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=peng.fan@nxp.com \
    --cc=robh+dt@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=sboyd@kernel.org \
    --cc=shawnguo@kernel.org \
    /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).