linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: sebastian.hesselbarth@gmail.com (Sebastian Hesselbarth)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC 06/15] drm/armada: move variant initialisation to CRTC init
Date: Sun, 06 Jul 2014 11:46:56 +0200	[thread overview]
Message-ID: <53B91B10.8060009@gmail.com> (raw)
In-Reply-To: <20140705122115.GP21766@n2100.arm.linux.org.uk>

On 07/05/2014 02:21 PM, Russell King - ARM Linux wrote:
> On Sat, Jul 05, 2014 at 01:58:37PM +0200, Sebastian Hesselbarth wrote:
>> On 07/05/2014 12:38 PM, Russell King wrote:
>>> Move the variant initialisation entirely to the CRTC init function -
>>> the variant support is really about the CRTC properties than the whole
>>> system, and we want to treat each CRTC individually when we support DT.
>>>
>>> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
>>> ---
>> [...]
>>> diff --git a/drivers/gpu/drm/armada/armada_crtc.h b/drivers/gpu/drm/armada/armada_crtc.h
>>> index 531a9b0bdcfb..3f0e70bb2e9c 100644
>>> --- a/drivers/gpu/drm/armada/armada_crtc.h
>>> +++ b/drivers/gpu/drm/armada/armada_crtc.h
>>> @@ -38,6 +38,7 @@ struct armada_crtc {
>>>  	unsigned		num;
>>>  	void __iomem		*base;
>>>  	struct clk		*clk;
>>> +	struct clk		*extclk[2];
>>
>> I wonder, if we should rename above array srcclk instead of extclk
>> while moving it anyway. That way we can use it for the other variant
>> specific clocks, too.
> 
> pixelclk may be a better name for it.  I would like to think about the

The name was derived from the "SCLK_SOURCE_SELECT" bits in Dove FS, but
any other name not limited to external clocks is fine, too.

> clock handling further though - the issues surrounding clock selection
> are not limited to just Armada - imx-drm has the exact same problem.
> 
> The issue with clocking of CRTCs is that it seems to be common that:
> 
> 1. you have multiple clocks to choose from, some of which may be more
>    suitable than others depending on the type of output.

Given the limited capabilities of the internal clock dividers, on Dove
the heuristic seems to be fairly simple: always prefer the external
clock. This is true for all actively supported Dove boards (Cubox and
{d2,d3}plug) as all have an external PLL connected.

I'd even say to make the external clock mandatory. Hitting a standard
pixclk frequency with one of the internal clocks is pure coincidence.

As long as there is no board using anything else than HDMI transmitter
on dumb RGB, we shouldn't try to foresee any suitable heuristic.

> 2. clocks end up being shared between multiple CRTCs, and one CRTC
>    can (at the moment) interfere with the clock rate delivered to
>    another CRTC.
> 
> This happens on imx-drm today, where the two DIs (CRTCs) are in use -
> one for HDMI, the other for LVDS.  We end up with HDMI set first to
> 148.5MHz, and then LVDS sets it's clock to 65MHz, which results in
> HDMI receiving a clock at over 500MHz!  At the moment, there are hacks
> to solve this by adjusting the muxes in the clock paths to ensure that
> they both derive from different PLLs - moving the LVDS onto the USB OTG
> PLL rather than the video PLL.  That works fine until USB OTG wants
> to change the OTG PLL.

Again, luckily on Cubox we have 2 VCOs for the two external clocks
(audio and video) so we won't have to deal with it. For the {d2,d3}plug
I'll have to check the IDT datasheet again.

In particular, for imx maybe it is possible to identify some clock tree
configurations for specific use-cases. I don't think there is any non-
manual way to tell the best clock tree config.

> There's also the issue whether the output can cope with fractional
> clock-skipping dividers - entirely synchronous display systems can
> (such as synchronously clocked LCD panels), but asynchronous display
> systems (such as HDMI, TV out, etc) can't.  That said, the other
> parameter that needs to be taken account of here is that even with the
> fractional divider, the minimum output clock period isn't the average
> frequency, but the maximum frequency, which may violate a panel's minimum
> clock period specification.

Yeah, the fractional divider isn't made for external HDMI transmitters
for sure. I have seen from your branch that there is some Armada 610
stub for OLPC, do they have a dumb panel directly connected?

I also saw that they do have an external PLL, so maybe we should stick
to the external clock inputs as long as no other configurations pops-up
(which may never happen).

Sebastian

> I think there's lots to do on the clocking side, and as it's a fairly
> complex problem which is common to multiple implementations, I think
> that any solution should not be specific.
> 
> However, this topic isn't one which I want to work on until I have
> reduced down my patch sets to something more manageable - something
> which I'm desperate to do.  (I've been trying to avoid adding any
> further patches to any tree for some time now.)  This is why (eg) I'm
> not going to fix the kernel oops-able bugs I found in the SGTL5000
> codec - someone else can do that.

  reply	other threads:[~2014-07-06  9:46 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-05 10:37 [PATCH RFC 00/15] Armada DRM updates Russell King - ARM Linux
2014-07-05 10:37 ` [PATCH RFC 01/15] component: fix missed cleanup in case of devres failure Russell King
2014-07-05 10:38 ` [PATCH RFC 02/15] component: ignore multiple additions of the same component Russell King
2014-07-05 10:38 ` [PATCH RFC 03/15] component: add support for component match array Russell King
2014-07-05 10:38 ` [PATCH RFC 04/15] drm/armada: move IRQ handling into CRTC Russell King
2014-07-05 10:38 ` [PATCH RFC 05/15] drm/armada: use number of CRTCs registered Russell King
2014-07-05 10:38 ` [PATCH RFC 06/15] drm/armada: move variant initialisation to CRTC init Russell King
2014-07-05 11:58   ` Sebastian Hesselbarth
2014-07-05 12:21     ` Russell King - ARM Linux
2014-07-06  9:46       ` Sebastian Hesselbarth [this message]
2014-07-09  9:38         ` Russell King - ARM Linux
2014-07-11 14:37     ` Russell King - ARM Linux
2014-07-11 15:18       ` Sebastian Hesselbarth
2014-07-11 15:24         ` Russell King - ARM Linux
2014-07-05 10:38 ` [PATCH RFC 07/15] drm/armada: make variant a CRTC thing Russell King
2014-07-05 10:38 ` [PATCH RFC 08/15] drm: add of_graph endpoint helper to find possible CRTCs Russell King
2014-07-05 10:38 ` [PATCH RFC 09/15] component: fix bug with legacy API Russell King
2014-07-05 10:38 ` [PATCH RFC 10/15] drm/armada: convert to componentized support Russell King
2014-07-05 10:38 ` [PATCH RFC 11/15] drm/armada: update Armada 510 (Dove) to use "ext_ref_clk1" as the clock Russell King
2014-07-05 10:38 ` [PATCH RFC 12/15] dt-bindings: add Marvell Dove LCD controller documentation Russell King
2014-07-05 10:38 ` [PATCH RFC 13/15] drm/armada: permit CRTCs to be registered as separate devices Russell King
2014-07-05 10:39 ` [PATCH RFC 14/15] drm/armada: register crtc with port Russell King
2014-07-05 10:39 ` [PATCH RFC 15/15] ARM: dts: dove: add DT LCD controllers Russell King

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=53B91B10.8060009@gmail.com \
    --to=sebastian.hesselbarth@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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).