All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maxime Ripard <mripard@kernel.org>
To: Marek Vasut <marex@denx.de>
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	 dri-devel@lists.freedesktop.org,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	 David Airlie <airlied@gmail.com>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	 Jonas Karlman <jonas@kwiboo.se>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	 Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	 Robert Foss <rfoss@kernel.org>, Simona Vetter <simona@ffwll.ch>,
	 Thomas Zimmermann <tzimmermann@suse.de>
Subject: Re: [PATCH v2 2/2] drm/bridge: tc358767: Improve DPI output pixel clock accuracy
Date: Tue, 26 Nov 2024 16:56:08 +0100	[thread overview]
Message-ID: <20241126-splendid-amber-bobcat-164efa@houat> (raw)
In-Reply-To: <a17f2bf7-1ea3-4ba3-80a8-338623d9d888@denx.de>

[-- Attachment #1: Type: text/plain, Size: 3240 bytes --]

On Tue, Nov 26, 2024 at 12:48:20AM +0100, Marek Vasut wrote:
> On 11/22/24 2:32 PM, Dmitry Baryshkov wrote:
> > On Tue, Nov 12, 2024 at 03:05:37AM +0100, Marek Vasut wrote:
> > > The Pixel PLL is not very capable and may come up with wildly inaccurate
> > > clock. Since DPI panels are often tolerant to slightly higher pixel clock
> > > without being operated outside of specification, calculate two Pixel PLL
> > > from either mode clock or display_timing .pixelclock.max , whichever is
> > > higher. Since the Pixel PLL output clock frequency calculation always
> > > returns lower frequency than the requested clock frequency, passing in
> > > the higher clock frequency should result in output clock frequency which
> > > is closer to the expected pixel clock.
> > > 
> > > For the Chefree CH101 panel with 13 MHz Xtal input clock, the frequency
> > > without this patch is 65 MHz which is out of the panel specification of
> > > 68.9..73.4 MHz, while with this patch it is 71.5 MHz which is well within
> > > the specification and far more accurate.
> > 
> > Granted that most of the panel drivers do not implement get_timings()
> > and granted that there are no current users of that interface, I think
> > we should move away from it (and maybe even drop it completely from
> > drm_panel).
> 
> It does fit DPI and LVDS panels and their descriptions in datasheets the
> best.
> 
> > What about achieving the same via slightly different approach: register
> > a non-preferred mode with the clock equal to the max clock allowed. The
> > bridge driver can then use the default and the "max" mode to select PLL
> > clock.
> > 
> > I understand that this suggestion doesn't follow the DPI panel
> > specifics, which are closer to the continuous timings rather than fixed
> > set of modes, however I really don't think that it's worth keeping the
> > interface for the sake of a single driver. Original commit 2938931f3732
> > ("drm/panel: Add display timing support") from 2014 mentions using those
> > timings for .mode_fixup(), but I couldn't find a trace of the
> > corresponding implementation.
> > 
> > Another possible option might be to impletent adjusting modes in
> > .atomic_check() / .mode_fixup().
> Something like this ?
> 
> static const struct display_timing chefree_ch101olhlwh_002_timing = {
>   .pixelclock = { 68900000, 71100000, 73400000 },
>   ...
> };
> 
> static const struct panel_desc chefree_ch101olhlwh_002 = {
>   .timings = &chefree_ch101olhlwh_002_timing,
>   .num_timings = 1,
>   ...
> };
> 
> ... would turn into ...
> 
> static const struct drm_display_mode chefree_ch101olhlwh_002_mode[3] = {
>   {
>     .clock = 68900000,
>     ...
>   }, {
>     .clock = 71100000,
>     ...
>   }, {
>     .clock = 73400000,
>     ...
>   }
> };
> 
> static const struct panel_desc chefree_ch101olhlwh_002 = {
>   .modes = &chefree_ch101olhlwh_002_mode,
>   .num_timings = 3,
>   ...
> };
> 
> ?

Except that doesn't work if you want to keep your driver at the expected
framerate. To reduce the pixel clock, you also need to reduce the
blanking period within the acceptable boundaries if you want to keep the
same framerate.

Maxime

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 273 bytes --]

  reply	other threads:[~2024-11-26 15:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-12  2:05 [PATCH v2 1/2] drm/bridge/panel: Add drm_bridge_get_panel to extract panel from last bridge Marek Vasut
2024-11-12  2:05 ` [PATCH v2 2/2] drm/bridge: tc358767: Improve DPI output pixel clock accuracy Marek Vasut
2024-11-12  5:29   ` Laurent Pinchart
2024-11-22 13:32   ` Dmitry Baryshkov
2024-11-25 13:17     ` Maxime Ripard
2024-11-25 22:07       ` Dmitry Baryshkov
2024-11-26 15:59         ` Maxime Ripard
2024-11-26 18:06           ` Dmitry Baryshkov
2024-11-25 23:50       ` Marek Vasut
2024-11-25 23:48     ` Marek Vasut
2024-11-26 15:56       ` Maxime Ripard [this message]
2024-11-26 16:30         ` Marek Vasut

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=20241126-splendid-amber-bobcat-164efa@houat \
    --to=mripard@kernel.org \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=marex@denx.de \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.