Re: [RFC PATCH 0/4] drm/tilcdc: Implement state readout

From: Maxime Ripard

Date: Mon Nov 16 2026 - 11:50:50 EST


On Mon, Nov 16, 2026 at 03:27:03PM +0100, Màxim Pedraza Padilla wrote:
> 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@xxxxxxxxxx

Awesome, thanks a lot for that. I was working on sending v9 today, so
it's a nice timing :)

There's some redundancy with some work I sent since v7, but it looks
pretty ok.

> 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@xxxxxxxxx
>
> 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.

I'm not quite sure I understand what you meant here. If it does a full
modeset, I would expect to see some flicker?

> - 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.

Yeah, that's because I wasn't supporting partial pipeline updates in v7.
It should be fixed in v8 onwards.

> - mode_blob, after a modeset: the memcmp() includes the mode type, and
> DRM_MODE_TYPE_PREFERRED can't be read from the hardware.

Same thing here.

> - 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.

Ditto.

I'll review each patches individually

Thanks!
Maxime

Attachment: signature.asc
Description: PGP signature