mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
To: "Màxim Pedraza Padilla" <maximpedraza@gmail.com>
Cc: "Maxime Ripard" <mripard@kernel.org>,
	"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:53:23 +0200	[thread overview]
Message-ID: <7783b523-3d37-4a10-b541-bf9ae8013e78@ideasonboard.com> (raw)
In-Reply-To: <20261125101541.463585-1-maximpedraza@gmail.com>

Hi,

On 25/11/2026 12:15, Màxim Pedraza Padilla wrote:
> On Tue, Nov 24, 2026 at 04:38:43PM +0200, Tomi Valkeinen wrote:
>> 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):
> 
> Thanks, good to know I'm not the only one it didn't work for. v2 does the
> same: the functional clock rate divided by the LCDC divider, rounded to
> the nearest kHz.
> 
> What I added is a 1% tolerance on the pixel clock in tilcdc's CRTC
> compare hook. When tilcdc_crtc_set_clk() can't get the exact rate, the
> clock read back after a commit differs from the mode by a few kHz: here,
> asking for 16941 kHz gets 16940.69 kHz from the display PLL. Out of 20
> pixel clocks between 16.9 and 45 MHz, four were off by up to 0.015% and
> the exact comparison reported them as mismatches.
> 
> Since you know tilcdc: do you know why tilcdc_crtc_mode_fixup() flips the
> HSYNC polarity? Its comment says the LCDC aligns VS on the second edge of
> HS, but I couldn't find that in the AM335x TRM, where IHS directly sets
> the polarity of the HSYNC pin. As it is, a panel needing an active low
> HSYNC has to leave hsync-active out of its DT timings.
Sorry, I don't remember. It's been quite a while, and that part wasn't 
my code. The original commit says:

+        * We use adjusted_mode, to fixup sync by aligning both rising
+        * edges and add HSKEW offset to let the slave encoder fix it up.

which sounds like the encoder (I think at that time there was really 
just a single encoder used) supports hskew, so the encoder then adjusted 
the syncs horizontally, and also used the correct polarities. You could 
have a look at the old kernel sources.

If I had to guess, the hack helps on some particular panel/encoder. And 
breaks some other. If you remove the hack, you get it the other way 
around =).

  Tomi


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

Thread overview: 21+ 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
2026-11-25 12:21               ` Maxime Ripard
2026-11-25 10:15           ` Màxim Pedraza Padilla
2026-11-25 11:53             ` Tomi Valkeinen [this message]
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=7783b523-3d37-4a10-b541-bf9ae8013e78@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®