mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Màxim Pedraza Padilla" <maximpedraza@gmail.com>
To: Maxime Ripard <mripard@kernel.org>
Cc: "Neil Armstrong" <neil.armstrong@linaro.org>,
	"Jessica Zhang" <jesszhan0024@gmail.com>,
	"Jyri Sarha" <jyri.sarha@iki.fi>,
	"Tomi Valkeinen" <tomi.valkeinen@ideasonboard.com>,
	"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: [RFC PATCH 0/4] drm/tilcdc: Implement state readout
Date: Mon, 16 Nov 2026 15:27:03 +0100	[thread overview]
Message-ID: <20261116142707.1299360-1-maximpedraza@gmail.com> (raw)

Hi Maxime,

Following your suggestion in the boot logo thread ("just implement readout
then"), this implements hardware state readout for tilcdc on top of your
v7:

https://lore.kernel.org/r/20261029-drm-state-readout-v7-0-25e5163d75c3@kernel.org

The goal is that the kernel takes over the display as U-Boot left it, so
the boot logo stays on screen with no blanking or flicker until userspace
replaces it.

Patch 1 adds an atomic_sro_install_state hook to bridges, and patch 2 uses
it in the panel bridge, which also reads out the connector and bridge
state: without that, the core discards the readout of any driver behind a
panel. Patch 3 is the tilcdc readout itself: CRTC mode from the raster
timings, primary plane with a non-GEM framebuffer (as tidss does), encoder
and hw_reset. Patch 4 keeps panel-simple from turning the panel off at
probe by driving its enable GPIO low.

For the backlight, pwm-tiecap needs a .get_state(), otherwise pwm_bl sees
the PWM disabled and sets duty 0 until the panel is enabled. I sent that
one separately to Uwe and linux-pwm:

https://lore.kernel.org/r/20261116142251.1296742-1-maximpedraza@gmail.com

Tested on an AM335x board (Fides T075, out-of-tree DT) with U-Boot
leaving an 800x480 RGB565 logo:
- The logo stays on screen, untouched, from U-Boot to userspace, with the
  backlight on all along.
- The U-Boot mode doesn't match the one in the DT (16.94 MHz pixel clock
  and slightly different timings), so the first commit with the panel
  mode does a full modeset, as expected.
- First commits from userspace: a framebuffer flip without modeset, a full
  modeset to the panel mode, and ACTIVE=0 then 1. No WARN or oops.
- With drm.atomic_readout=0 the old behaviour comes back: the raster stops
  and the first commit does a full modeset.
- Without video set up by U-Boot nothing is adopted and the normal path is
  taken.
- The SGX530 driver and a Qt EGLFS application take over from the adopted
  logo without visible glitches.

The DT needs a reserved-memory node for the U-Boot framebuffer, and
ti,no-reset-on-init on the GPIO banks (and on the PWMSS) so that ti-sysc
doesn't reset the panel enable and backlight lines.

The backlight needs some care. With the PWM configured by the bootloader
and the pin muxed to it, the handover is seamless. If the bootloader drives
the backlight some other way, for instance with the pin as a plain GPIO and
the PWM stopped, the light goes off when the kernel muxes the pin to the
PWM, until the panel is enabled. The bootloader has to leave the backlight
in the state the kernel will read back.

After each commit, the comparison still reports some mismatches. As far as
I can tell they come from the core rather than from tilcdc, but I'd
appreciate your view:
- connector_mask and encoder_mask, on a commit that only changes the
  framebuffer: the connector is not part of the commit, so it's not read
  back.
- mode_blob, after a modeset: the memcmp() includes the mode type, and
  DRM_MODE_TYPE_PREFERRED can't be read from the hardware.
- With ACTIVE=0: crtc, fb, enable, best_encoder and the bridge bus_cfg.
  The readout sees the raster stopped and can't tell enable=1/active=0
  from disabled.

Thanks,
Màxim

Màxim Pedraza Padilla (4):
  drm/bridge: Add atomic_sro_install_state hook
  drm/panel: Implement state readout in the panel bridge
  drm/tilcdc: Implement state readout support
  drm/panel: simple: Keep the enable GPIO as left by the bootloader

 drivers/gpu/drm/drm_bridge.c            |  12 ++
 drivers/gpu/drm/drm_panel.c             |  92 ++++++++++++-
 drivers/gpu/drm/panel/panel-simple.c    |   4 +-
 drivers/gpu/drm/tilcdc/tilcdc_crtc.c    | 173 ++++++++++++++++++++++++
 drivers/gpu/drm/tilcdc/tilcdc_drv.c     |  22 ++-
 drivers/gpu/drm/tilcdc/tilcdc_encoder.c |  29 +++-
 drivers/gpu/drm/tilcdc/tilcdc_plane.c   | 106 +++++++++++++++
 include/drm/drm_bridge.h                |  12 ++
 8 files changed, 442 insertions(+), 8 deletions(-)


base-commit: cf5d8e390e2ac2cfa24a50645efdbb9f0eebe65f
prerequisite-patch-id: dd600a02afa073bedc54e8b973d6bfdad7594dcf
prerequisite-patch-id: cb32051331d83506b8e6fd512f93595724905a9f
prerequisite-patch-id: 72acc5f5b50b767484ff995256e7fb155c05f6eb
prerequisite-patch-id: 20859bdf469e990a0d7dae3498bc90452afac2b6
prerequisite-patch-id: ca629fbb440fc4bddbf5594161eb44aadacbffdc
prerequisite-patch-id: 1a6e113d6f412d798052a924269a7dc876d91ded
prerequisite-patch-id: 8eacf9b84574fe303134a78ce9c3fcc4ec1c8dbf
prerequisite-patch-id: be45e01b10b8b0050199e379d51d80866c9bd60f
prerequisite-patch-id: 0ab25f681f68659f8a0e4f0da80fdf70952dcf8d
prerequisite-patch-id: cd456ec3d0c297910f46bbc02fdf105dc1881528
prerequisite-patch-id: 8f0adc84c688489feb0cba21f1f2292be4229095
prerequisite-patch-id: 86ba5aa9cdc784c0b7f1a63beb76925ef26a51f4
prerequisite-patch-id: 797d3d2c63a2772528c850d5058e11d064e13b81
prerequisite-patch-id: a1f2f5aa788a1615c521496408c8380bb076a906
prerequisite-patch-id: c9f90931b72f402916621991a8a8abf6f4b5ffb5
prerequisite-patch-id: e0e184d52d20bd622b3752ea73516698bedf554f
prerequisite-patch-id: 9779c50d8b08c7d2ac14017fe2825d148350e434
prerequisite-patch-id: 2dfe6357a636b3662dbd8db80bc29bd36a0329ad
prerequisite-patch-id: 704fb943477b1a761312b0ec16e9291cad7c9769
prerequisite-patch-id: 0409704173cb408067b9e69071c0af7efe299492
prerequisite-patch-id: 455ce6bd7b211ef9c772ba06efefdffd27058a87
prerequisite-patch-id: 5ed7b0ed4e054ecbd8c84e622dbac0f42d60e4a6
prerequisite-patch-id: 563c77055b805b0d640cd8517627a8c491bce385
prerequisite-patch-id: ad8a0534dbcf96480f5020f50fd68d5b78c5fac5
prerequisite-patch-id: 8fe899b77403121b41514f93b859b5e4528a79d9
prerequisite-patch-id: 4fafee08b92675ea8a6f7fb5e27ff5a769325208
prerequisite-patch-id: d7abc61edebf4b3a87d94806301a99db4e28c036
prerequisite-patch-id: 615c6d4def91d820c55f9f05afb0086734c770fa
prerequisite-patch-id: 67a600dbc806b7426a5f48b11413d3716d4729e5
prerequisite-patch-id: 86db1a90ea3b2e47a0e082b33d4f9ee5c79782e4
prerequisite-patch-id: dffc8a4bbcf134bf21a86cd197deefe5143b7210
prerequisite-patch-id: d1dea459f43a2541077a882c3282b806a7dd5ecc
prerequisite-patch-id: 0c8a54b1f9bf053b817e949eb82538e7a0630d01
prerequisite-patch-id: 4582389780efd509f9713da8c161f497f2d89bc8
-- 
2.39.5


             reply	other threads:[~2026-11-16 13:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-16 14:27 Màxim Pedraza Padilla [this message]
2026-11-16 14:27 ` [RFC PATCH 1/4] drm/bridge: Add atomic_sro_install_state hook Màxim Pedraza Padilla
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 14:27 ` [RFC PATCH 3/4] drm/tilcdc: Implement state readout support Màxim Pedraza Padilla
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

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=20261116142707.1299360-1-maximpedraza@gmail.com \
    --to=maximpedraza@gmail.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=mripard@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=rfoss@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tomi.valkeinen@ideasonboard.com \
    --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®