From: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>
Cc: David Airlie <airlied-cv59FeDIM0c@public.gmane.org>,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
Subject: Re: [PATCH 3/9] drm/sun4i: Put dotclock range into tcon quirks and check against them
Date: Fri, 7 Oct 2016 10:54:02 +0200 [thread overview]
Message-ID: <20161007085402.GI4684@lukather> (raw)
In-Reply-To: <20161006160629.11198-4-wens-jdAy2FN1RRM@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 2710 bytes --]
On Fri, Oct 07, 2016 at 12:06:23AM +0800, Chen-Yu Tsai wrote:
> In commit bb43d40d7c83 ("drm/sun4i: rgb: Validate the clock rate") the
> driver was rounding the requested clock rate and then checking the
> result against the original requested rate.
>
> This does not work well for a number of reasons:
>
> - The pixel clock does not have enough resolution to be able to
> provide all sub-MHz clock rates. This makes it filter out most modes
> found in simple-panel.
>
> - When first introduced, the main limiting factors were the video PLL
> clock range (27 ~ 381 MHz) and the lowest divider (6). On sun6i and
> later, the valid PLL clock range is extended to 30 ~ 600 MHz. The
> PLL's multiplier and divider can make it go much higher out of range,
> but the clock driver currently has no checks for it.
>
> Since the limits are well known, we can hard code the range into the
> tcon driver, and check against them. And we really only care about the
> upper limit, which affects the highest resolutions we can support.
We already discussed this, but this is really the wrong way to fix
that issue.
clk_round_rate already gives you the maximum clock rate that can be
handled in a generic and abstracted way, disregarding the current
state of the clock driver.
However, the issue that you're trying to solve is that panels might
have a pixel clock requirement that is not aligned on the resolution
on the pixel clock we can generate.
And this can actually happen at any rate, you could very well have a
display that requires a pixel clock of 63501kHz that you would reject,
while using the 63,5 MHz clock rate would be just fine.
On the other hand, (totally made up example) some panel that requires
a pixel clock of 43MHz, with a +- 1MHz tolerance, that we wouldn't be
able to generate since we would only generate 41 or 45 MHz.
And on yet another hand, the panel might be requesting a pixel clock
well below what we can generate, which is also something that we want
to reject.
I can see two way of fixing this so far, the second being a solution
if the first one fails:
- Look to a decent amount of panels and bridges datasheet to see
what their usual tolerance on the pixel clock rate is, then use
that to make a decision.
- If there's not really a common tolerance that we can find out,
extend the panel and bridges API to be able for the panel to
provide its tolerance on the timings, and make a function that we
can call to see if a given rate is within boundaries.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-10-07 8:54 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-06 16:06 [PATCH 0/9] drm/sun4i: Support first display pipeline on sun6i Chen-Yu Tsai
[not found] ` <20161006160629.11198-1-wens-jdAy2FN1RRM@public.gmane.org>
2016-10-06 16:06 ` [PATCH 1/9] drm/sun4i: sun6i-drc: Support DRC on A31 and A31s Chen-Yu Tsai
2016-10-10 14:45 ` Rob Herring
2016-10-06 16:06 ` [PATCH 2/9] drm/sun4i: tcon: Move SoC specific quirks to a DT matched data structure Chen-Yu Tsai
[not found] ` <20161006160629.11198-3-wens-jdAy2FN1RRM@public.gmane.org>
2016-10-07 8:38 ` Maxime Ripard
2016-10-11 9:16 ` Chen-Yu Tsai
[not found] ` <CAGb2v67vZLCtUOaqBwtAnHmCMpoxmh3pxjtD5TL2nWp3Lm-Pzg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-11 9:36 ` Maxime Ripard
2016-10-06 16:06 ` [PATCH 3/9] drm/sun4i: Put dotclock range into tcon quirks and check against them Chen-Yu Tsai
[not found] ` <20161006160629.11198-4-wens-jdAy2FN1RRM@public.gmane.org>
2016-10-07 8:54 ` Maxime Ripard [this message]
2016-10-06 16:06 ` [PATCH 4/9] drm/sun4i: Add compatible string for A31/A31s TCON (timing controller) Chen-Yu Tsai
[not found] ` <20161006160629.11198-5-wens-jdAy2FN1RRM@public.gmane.org>
2016-10-07 8:55 ` Maxime Ripard
2016-10-06 16:06 ` [PATCH 5/9] drm/sun4i: Add compatible strings for A31/A31s display pipelines Chen-Yu Tsai
2016-10-10 14:49 ` Rob Herring
2016-10-06 16:06 ` [PATCH 6/9] ARM: dts: sun6i: Sort pinmux setting nodes Chen-Yu Tsai
[not found] ` <20161006160629.11198-7-wens-jdAy2FN1RRM@public.gmane.org>
2016-10-07 8:57 ` Maxime Ripard
2016-10-06 16:06 ` [PATCH 7/9] ARM: dts: sun6i: Add device nodes for first display pipeline Chen-Yu Tsai
2016-10-06 16:06 ` [PATCH 8/9] ARM: dts: sun6i: Add A31 LCD0 RGB888 pins Chen-Yu Tsai
2016-10-06 16:06 ` [PATCH 9/9] [DO NOT MERGE] ARM: dts: sun6i: Enable 7" LCD panel on Sinlinx SinA31s Chen-Yu Tsai
[not found] ` <20161006160629.11198-10-wens-jdAy2FN1RRM@public.gmane.org>
2016-10-06 16:23 ` Icenowy Zheng
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=20161007085402.GI4684@lukather \
--to=maxime.ripard-wi1+55scjutkeb57/3fjtnbpr1lh4cv8@public.gmane.org \
--cc=airlied-cv59FeDIM0c@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
--cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=wens-jdAy2FN1RRM@public.gmane.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).