mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
To: Maxime Ripard <mripard@kernel.org>
Cc: "Màxim Pedraza Padilla" <maximpedraza@gmail.com>,
	"Neil Armstrong" <neil.armstrong@linaro.org>,
	"Jessica Zhang" <jesszhan0024@gmail.com>,
	"Jyri Sarha" <jyri.sarha@iki.fi>,
	"Uwe Kleine-König" <ukleinek@kernel.org>,
	"Andrzej Hajda" <andrzej.hajda@intel.com>,
	"Robert Foss" <rfoss@kernel.org>,
	"Laurent Pinchart" <Laurent.pinchart@ideasonboard.com>,
	"Jonas Karlman" <jonas@kwiboo.se>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Luca Ceresoli" <luca.ceresoli@bootlin.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	"David Airlie" <airlied@gmail.com>,
	"Simona Vetter" <simona@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 3/4] drm/tilcdc: Implement state readout support
Date: Wed, 25 Nov 2026 13:43:55 +0200	[thread overview]
Message-ID: <d9a10f1f-7550-49ee-9085-6ad4c662080d@ideasonboard.com> (raw)
In-Reply-To: <awazkzDVZtpUsdQb@houat>

Hi,

On 25/11/2026 12:11, Maxime Ripard wrote:
> On Tue, Nov 24, 2026 at 04:38:43PM +0200, Tomi Valkeinen wrote:
>> Hi,
>>
>> On 24/11/2026 16:11, Màxim Pedraza Padilla wrote:
>>> On Wed, Nov 18, 2026 at 10:21:14PM +0100, Màxim Pedraza Padilla wrote:
>>>> Makes sense, I'll use the same approach in tilcdc, and see if it can be
>>>> turned into a common helper along the way.
>>>
>>> A follow-up on this one, now that I've rebased on v9. I ended up doing
>>> it differently, so I'd rather explain why before sending the next
>>> version.
>>>
>>> The tidss approach rounds the clock to the closest standard refresh rate.
>>> Panels driven by tilcdc often don't use one: with the timings from its
>>> datasheet, the panel on this board runs at 56.8 Hz (33.3 MHz), which would
>>> be read back as 60 Hz and 35.19 MHz. The adopted mode would then never
>>> match the panel mode, even with U-Boot programming exactly the same one.
>>
>> I felt that approach was a bit odd (and if I recall right, failed with my
>> OLDI panel), and in my tidss version I just used the clock rate directly
>> from the clk_get_rate() (see dispc_vp_readout_mode):
> 
> The problem is that you're losing information when setting the clock.
> Especially for panels where you don't really have an established set of
> pixel clocks, the clock is very likely to not be able to give the exact
> frequency you asked for.
> 
> So when you're reading the clock frequency, the mode you're reading and
> the one you'd set at first modeset will not necessarily match, so you
> need to take that difference into account and try to get back on your
> feet.
If I understand correctly, your code in tidss is trying to guess the 
pclk rate in (say) the simple-panel driver via assuming the refresh rate 
is one of the standard ones?

I don't think that works... Even if the target refresh rate in the panel 
driver is close to (or exactly) those standard ones, it won't be the 
same clock rate except by luck. And u-boot may have a different PLL 
calculation, or different pclk in its dtso.

I think the u-boot part should be fixed just by "fix your bootloader": 
if you want SRO to work, make your bootloader use the same videomode 
(including pclk) as the kernel.

But even then it won't work. If the simple panel states pclk as 150.274 
MHz, it will cause the HW to set 150.0 MHz, and the SRO in this series 
will calculate 150.124675 MHz. This will cause a full modeset, and also 
the SRO check will given an error.

So... First, I think at least in the adjusted_mode we should have the 
real pclk. The SRO check should pass only an equals check there. For 
mode's pclk, I think setting the actual pclk makes sense, at least more 
than guessing it. Or could we, at that stage, see what modes the 
connector advertises, and pick a clock from there?

If we can't get the pclks from the connector, the mode->clock won't 
match, and we should either skip checking that in the SRO checks, or 
have plenty of tolerance. I think it still leads to a full modeset, but 
can the driver check if setting the mode->clock would results in the 
current pclk, and somehow abort the full modeset?

  Tomi


  reply	other threads:[~2026-11-25 11:44 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 14:27 [RFC PATCH 0/4] drm/tilcdc: Implement state readout Màxim Pedraza Padilla
2026-11-16 14:27 ` [RFC PATCH 1/4] drm/bridge: Add atomic_sro_install_state hook Màxim Pedraza Padilla
2026-11-16 16:58   ` Maxime Ripard
2026-11-16 14:27 ` [RFC PATCH 2/4] drm/panel: Implement state readout in the panel bridge Màxim Pedraza Padilla
2026-11-16 16:59   ` Maxime Ripard
2026-11-16 14:27 ` [RFC PATCH 3/4] drm/tilcdc: Implement state readout support Màxim Pedraza Padilla
2026-11-16 17:12   ` Maxime Ripard
2026-11-18 21:21     ` Màxim Pedraza Padilla
2026-11-20 14:01       ` Maxime Ripard
2026-11-23 10:55         ` Màxim Pedraza Padilla
2026-11-24 14:11       ` Màxim Pedraza Padilla
2026-11-24 14:38         ` Tomi Valkeinen
2026-11-25 10:11           ` Maxime Ripard
2026-11-25 11:43             ` Tomi Valkeinen [this message]
2026-11-25 10:15           ` Màxim Pedraza Padilla
2026-11-25 11:53             ` Tomi Valkeinen
2026-11-25 10:07         ` Maxime Ripard
2026-11-16 14:27 ` [RFC PATCH 4/4] drm/panel: simple: Keep the enable GPIO as left by the bootloader Màxim Pedraza Padilla
2026-11-16 16:50 ` [RFC PATCH 0/4] drm/tilcdc: Implement state readout Maxime Ripard
2026-11-18 21:21   ` Màxim Pedraza Padilla

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=d9a10f1f-7550-49ee-9085-6ad4c662080d@ideasonboard.com \
    --to=tomi.valkeinen@ideasonboard.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@gmail.com \
    --cc=andrzej.hajda@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jernej.skrabec@gmail.com \
    --cc=jesszhan0024@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=jyri.sarha@iki.fi \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luca.ceresoli@bootlin.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=maximpedraza@gmail.com \
    --cc=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    --cc=ukleinek@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

all inboxes | Powered by JetHome®