linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: l.stach@pengutronix.de (Lucas Stach)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC] drm/sun4i: rgb: Add 5% tolerance to dot clock frequency check
Date: Fri, 24 Feb 2017 10:51:12 +0100	[thread overview]
Message-ID: <1487929872.6887.11.camel@pengutronix.de> (raw)
In-Reply-To: <20170223155437.GA24066@art_vandelay>

+CC Thierry, as the drm_panel maintainer.

Am Donnerstag, den 23.02.2017, 10:54 -0500 schrieb Sean Paul:
> On Wed, Dec 07, 2016 at 11:48:55AM +0200, Laurent Pinchart wrote:
> > Hello,
> > 
> > On Wednesday 07 Dec 2016 10:26:25 Chen-Yu Tsai wrote:
> > > On Wed, Dec 7, 2016 at 1:29 AM, Maxime Ripard wrote:
> > > > On Thu, Nov 24, 2016 at 07:22:31PM +0800, Chen-Yu Tsai wrote:
> > > >> The panels shipped with Allwinner devices are very "generic", i.e.
> > > >> they do not have model numbers or reliable sources of information
> > > >> for the timings (that we know of) other than the fex files shipped
> > > >> on them. The dot clock frequency provided in the fex files have all
> > > >> been rounded to the nearest MHz, as that is the unit used in them.
> > > >> 
> > > >> We were using the simple panel "urt,umsh-8596md-t" as a substitute
> > > >> for the A13 Q8 tablets in the absence of a specific model for what
> > > >> may be many different but otherwise timing compatible panels. This
> > > >> was usable without any visual artifacts or side effects, until the
> > > >> dot clock rate check was added in commit bb43d40d7c83 ("drm/sun4i:
> > > >> rgb: Validate the clock rate").
> > > >> 
> > > >> The reason this check fails is because the dotclock frequency for
> > > >> this model is 33.26 MHz, which is not achievable with our dot clock
> > > >> hardware, and the rate returned by clk_round_rate deviates slightly,
> > > >> causing the driver to reject the display mode.
> > > >> 
> > > >> The LCD panels have some tolerance on the dot clock frequency, even
> > > >> if it's not specified in their datasheets.
> > > >> 
> > > >> This patch adds a 5% tolerence to the dot clock check.
> > > > 
> > > > As we discussed already, I really believe this is just as arbitrary as
> > > > the current behaviour.
> > > 
> > > Yes. I agree. This patch is mainly to give something that works for
> > > people who don't care about the details, and to get some feedback
> > > from people that do.
> > > 
> > > > Some panels require an exact frequency,
> > 
> > There's no such thing as an exact frequency, there will always be some 
> > tolerance (and if your display controller can really generate an exact 
> > frequency I'd be very interested in that hardware :-)).
> 
> There is such thing as exact frequency when you have to worry about panel
> warranty. We are fortunate, since we can talk to the panel manufacturer and
> discuss which frequencies are tolerable inside the warranty. We usually hand
> pick a rate/mode within these constraints.
> 
> Also, even though things *look* ok on the panel at a certain clock rate, running
> outside the specified clock could damage the hardware.
> 
> I don't think it's unreasonable to add tolerances to drm_panel, since they will
> differ in what is acceptable. The tricky part is teasing out what the tolerances
> are.

The drm_panel already allows to specify all panel timings in pairs of
min/typical/max. Just use this instead of some arbitrary tolerance.

I know most panels currently only expose a fixed mode, but it's not hard
to convert this into a display_timing if you can get hold of the display
datasheet. A lot of the panel datasheets I had to deal with lately
actually specify all the required information. Most of the time you need
to sanity check things, as most vendors seem to produce them by "copy
the last datasheet we made and change only necessary fields", but that
really isn't a hard job.

Regards,
Lucas

  reply	other threads:[~2017-02-24  9:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-24 11:22 [PATCH RFC] drm/sun4i: rgb: Add 5% tolerance to dot clock frequency check Chen-Yu Tsai
2016-11-24 15:15 ` Icenowy Zheng
2016-12-06 17:29 ` Maxime Ripard
2016-12-07  2:26   ` Chen-Yu Tsai
2016-12-07  9:48     ` Laurent Pinchart
2016-12-09  8:57       ` Maxime Ripard
2017-02-23 15:54       ` Sean Paul
2017-02-24  9:51         ` Lucas Stach [this message]
2017-02-24 10:20           ` [linux-sunxi] " Chen-Yu Tsai
2017-02-27  7:47           ` Thierry Reding
2017-02-27  8:26         ` Laurent Pinchart
2016-12-09  9:36     ` Maxime Ripard
2016-12-07 19:16   ` Eric Anholt
2016-12-07 19:32     ` Laurent Pinchart
2016-12-09  8:39     ` Maxime Ripard
2017-02-22 12:46   ` 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=1487929872.6887.11.camel@pengutronix.de \
    --to=l.stach@pengutronix.de \
    --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).