mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC PATCH v3 0/2] drm/tilcdc: Implement state readout
@ 2026-12-01  9:26 Màxim Pedraza Padilla
  2026-12-01  9:26 ` [RFC PATCH v3 1/2] drm/tilcdc: Implement state readout support Màxim Pedraza Padilla
  2026-12-01  9:26 ` [RFC PATCH v3 2/2] drm/panel: simple: Keep the enable GPIO as left by the bootloader Màxim Pedraza Padilla
  0 siblings, 2 replies; 3+ messages in thread
From: Màxim Pedraza Padilla @ 2026-12-01  9:26 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: Neil Armstrong, Jessica Zhang, Jyri Sarha, Tomi Valkeinen,
	Maarten Lankhorst, Thomas Zimmermann, David Airlie,
	Simona Vetter, dri-devel, linux-kernel

Hi,

This implements hardware state readout for tilcdc, so that the kernel
takes over the display as the bootloader left it and a boot logo stays on
screen, with no blanking or flicker, until userspace replaces it.

It applies on top of Maxime's state readout series v10 and his patch
switching tilcdc to drm_mode_config_create_initial_state(), from the
no-more-config-reset series:

https://lore.kernel.org/r/20261127-drm-state-readout-v10-0-0259582d45a8@kernel.org
https://lore.kernel.org/r/20261116-drm-no-more-config-reset-v2-43-0bb471f4d1e0@kernel.org

Patch 1 is the tilcdc readout itself. Patch 2 keeps panel-simple from
turning the panel off at probe by driving its enable GPIO low.

For the backlight, the pwm-tiecap .get_state() is now in Uwe's
pwm/for-next.

Tested on an AM335x board (out-of-tree DT) with U-Boot leaving an 800x480
RGB565 logo, programmed with the panel mode from the DT at exactly 60 Hz
(33.264 MHz):
- The logo stays on screen, untouched, from U-Boot to userspace, and the
  mode is read back exactly, with no state comparison warning and no WARN
  or oops.
- First commits from userspace: a framebuffer flip without modeset, a
  commit with the panel mode that doesn't trigger a modeset, and ACTIVE=0
  then 1, which scans the adopted framebuffer out again.
- The SGX530 driver and a Qt EGLFS application take over from the adopted
  logo without a modeset.
- Without video set up by U-Boot nothing is adopted, and the first commit
  does a regular modeset.
- Suspend and resume with pm_test=devices bring the adopted logo back.
  This needs a tilcdc fix sent separately, unrelated to this series:
  https://lore.kernel.org/r/20261201091036.230021-1-maximpedraza@gmail.com

About the pixel clock, now read back with
drm_atomic_helper_sro_find_refresh_from_clk(): modesets at 20 pixel clocks
between 16.9 and 45 MHz give no warning, except at 33.3 and 33.333 MHz,
close to but not exactly 60 Hz. The readout reports them as 33.264 MHz and
the state comparison complains about the mode clock. With a DT mode at an
exact standard rate, as on this board, there's no such mismatch.

The DT needs a reserved-memory node for the U-Boot framebuffer, and
ti,no-reset-on-init on the GPIO banks and the PWMSS so that ti-sysc doesn't
reset the panel enable and backlight lines. The panel timings must describe
the VSYNC polarity, and a panel needing an active low HSYNC has to leave
hsync-active out, because of tilcdc_crtc_mode_fixup().

Changes in v3:
- Rebase on v10.
- Read the pixel clock back with
  drm_atomic_helper_sro_find_refresh_from_clk(), and drop the custom state
  comparison with a 1% pixel clock tolerance.
- Back the adopted framebuffer with a GEM object from
  drm_atomic_helper_sro_create_gem_dma_object(), since v10 drops
  framebuffers without one.
- Initialize the adopted mode with drm_mode_init(), and shut the adopted
  CRTC down if the probe fails after the readout (sashiko).
- Link to v2: https://lore.kernel.org/r/20261124141908.443764-1-maximpedraza@gmail.com

Thanks,
Màxim

Màxim Pedraza Padilla (2):
  drm/tilcdc: Implement state readout support
  drm/panel: simple: Keep the enable GPIO as left by the bootloader

 drivers/gpu/drm/panel/panel-simple.c    |   4 +-
 drivers/gpu/drm/tilcdc/tilcdc_crtc.c    | 182 ++++++++++++++++++++++++
 drivers/gpu/drm/tilcdc/tilcdc_drv.c     |  12 ++
 drivers/gpu/drm/tilcdc/tilcdc_encoder.c |  29 +++-
 drivers/gpu/drm/tilcdc/tilcdc_plane.c   | 133 +++++++++++++++++
 5 files changed, 355 insertions(+), 5 deletions(-)


base-commit: 5ce32a0c94a827ff44ee60898c28060714dcff75
prerequisite-message-id: <20261127-drm-state-readout-v10-0-0259582d45a8@kernel.org>
prerequisite-message-id: <20261116-drm-no-more-config-reset-v2-43-0bb471f4d1e0@kernel.org>
prerequisite-patch-id: 0b49abc230751bbc8235b4f23e5b2f5bc154f807
prerequisite-patch-id: cb32051331d83506b8e6fd512f93595724905a9f
prerequisite-patch-id: 72acc5f5b50b767484ff995256e7fb155c05f6eb
prerequisite-patch-id: cf8b32c78f343143906b208946b82c5975cad22f
prerequisite-patch-id: 1a6e113d6f412d798052a924269a7dc876d91ded
prerequisite-patch-id: 81f93bf511a83182db2358e0779ab6f455cd4f8a
prerequisite-patch-id: e55453981968570dc5994174f615f0996ad7adf0
prerequisite-patch-id: e89c26a662f6fa1996675b0e40e27be09fce9ddf
prerequisite-patch-id: 8d11298411f0ac5aac955e01a94ec127d29dbdc1
prerequisite-patch-id: 91a42599fcc7bdb50016e3e91352ac7b5d14bdc3
prerequisite-patch-id: 3459ea8c4e46c2e87bce3a79af06e19bd24c5f0a
prerequisite-patch-id: 2b97b25f6be119eac52a1bb726b9a8cd9c8a17e9
prerequisite-patch-id: 2dfe6357a636b3662dbd8db80bc29bd36a0329ad
prerequisite-patch-id: a6261679a50cb9f18f0a47d8f519939e1a414acb
prerequisite-patch-id: d4425072933d272b80572f5309851afcbac6f984
prerequisite-patch-id: dd9a285884e7f3bb96e4950f6f473f7ed18a865b
prerequisite-patch-id: fa9e31271f79e3e9103135bc2e8efd252e18af99
prerequisite-patch-id: 563c77055b805b0d640cd8517627a8c491bce385
prerequisite-patch-id: c15cdbb845bbd252a037d410f806a910c0831917
prerequisite-patch-id: e3362ce0dbcc48a39f1cc14de6098d8ac68431c7
prerequisite-patch-id: 4fafee08b92675ea8a6f7fb5e27ff5a769325208
prerequisite-patch-id: 6c0369731a723fdef00863dfb1d083ecf4de5d10
prerequisite-patch-id: c2ac26af16bce3d138ec2946ddaa0e57d53b529a
prerequisite-patch-id: 1830e22c10c8af8a7c9884d3a91c3a35dfa68543
prerequisite-patch-id: 52f7fe449e4812a1aef27bd1182e537002e1f9b4
prerequisite-patch-id: 0889a5c6a812cf2cc675ac64d66c8a241dad9b05
prerequisite-patch-id: ab15a09bb9e176330cd6f9991e841513315f07dc
prerequisite-patch-id: 402669fd5f97dfc3c3577a104cd8fdb14462cc90
prerequisite-patch-id: e0eb2c02c507fffa786135636227a5cda60f9d3d
prerequisite-patch-id: 19ae36e5a132726669496c36f11d22ab2cd677da
prerequisite-patch-id: 0c8a54b1f9bf053b817e949eb82538e7a0630d01
prerequisite-patch-id: ed873cdcbb8a12ab5ea8b33878dd5112d5e284d5
prerequisite-patch-id: 76b67bf5eab8683095aa758a46efbcb4f0be297b
prerequisite-patch-id: b878fee755a682f5af5f89b74f0ef2cd4eeb9ff8
prerequisite-patch-id: 4de5c8ffb89150dc1475f0ad8eb5ba05102d7022
prerequisite-patch-id: b41f34105087422cbb9386e311033b486a66859d
prerequisite-patch-id: 9e54b77c687ec32b156c2af70d62c2ac24859478
-- 
2.39.5


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-12-01  9:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-12-01  9:26 [RFC PATCH v3 0/2] drm/tilcdc: Implement state readout Màxim Pedraza Padilla
2026-12-01  9:26 ` [RFC PATCH v3 1/2] drm/tilcdc: Implement state readout support Màxim Pedraza Padilla
2026-12-01  9:26 ` [RFC PATCH v3 2/2] drm/panel: simple: Keep the enable GPIO as left by the bootloader Màxim Pedraza Padilla

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®