Hi,

On 17/11/2026 17:17, Tomi Valkeinen wrote:
Hi,

On 06/11/2026 15:14, Maxime Ripard wrote:
Hi,

Here's a series that implement what i915 calls "fastboot", ie,
initializing the initial KMS state from the hardware state at boot, to
skip the first modeset if the firmware already set up the display.

This series creates the infrastructure in KMS to create that state by
relying on driver specific hooks. It also implements some infrastructure
to check during non-blocking commits that the readout helpers work
properly by reading out the state that was just committed and comparing
it to what was supposed to be committed.

This relies on another set of driver hooks to compare the entities
states, with helpers providing the default implementation.

It then implements the readout support in the TIDSS driver, and was
tested with the SK-AM62 board. This board in particular is pretty
interesting, since it relies on an DPI to HDMI bridge, and uses the
drm_bridge_connector infrastructure.

So the readout works with the current state of the art on embedded-ish
platforms.

Unlike the earlier RFCs, it now works fine: the state is picked up
properly, doesn't trigger a modeset if what was programmed is the one
the first modeset tries to pick as well, will switch properly if it
isn't, etc.
Sorry for taking so long with this, even if I said already a long time back that I have additional patches for you. I now finally managed to get them into some kind of order, and I have pushed a branch to:

git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux.git ti/boot- splash-v8.5

It's based on today's drm-misc-next, with the following posted series on top:

- [PATCH RESEND 00/83] drm: Switch drivers to drm_mode_config_create_initial_state
- [PATCH v8 00/39] drm: Implement state readout support

However, from the SRO series, I dropped all the tidss patches. It was getting so difficult to make my changes at changes on top, so I decided to just make fresh clean ones. I've tried to keep authorship where applicable, but I could have missed some.

After the SRO series, I have a pile of patches on top. It starts with tidss patches that are not quite SRO related, but fix things or change the structure so that SRO gets easier to add:

drm/tidss: Fix the plane staying disabled after a CRTC off and on
drm/tidss: Remove the unused 'is_enabled'
drm/tidss: Split requesting the interrupt from enabling it
drm/tidss: Split dispc_init_hw() into steps called from probe
drm/tidss: Reset the DSS after the probe steps that can defer
drm/tidss: Keep the DSS enabled from the reset to the end of probe

Then I have some non-tidss patches. Some of these, I think, you already had in a local tree or were posted in the tilcdc series. The panel side is lacking, so I labeled those as hacks. I'm not quite sure how to correctly implement that.

drm/atomic_sro: Do not compare the plane zpos
drm/atomic_sro: Do not compare planes on an inactive CRTC
drm/atomic_sro: Add a device-level atomic_sro_install_state hook
drm/bridge: Add an atomic_sro_install_state hook for bridges
HACK: drm/bridge: panel: Prepare and enable the panel when installing the state HACK: drm/panel: simple: Set the sync polarities of Microtips MF-101HIEBCAF0

Then I have tidss SRO patches. Many of these are based on yours, but there are plenty of details that have changed, fixing issues I found when testing different combinations.

drm/tidss: Implement .hw_reset hook
drm/tidss: Reset the DISPC at runtime suspend if probe did not reset it
drm/tidss: dispc: Add helpers for the state readout
drm/tidss: encoder: Implement atomic_sro_get_current_crtc
drm/tidss: oldi: Implement hw readout support
drm/tidss: dispc: Keep DPIENABLE of an active VP in dispc_vp_init()
drm/tidss: crtc: Implement hw readout support
drm/tidss: plane: Implement hw readout support
drm/tidss: encoder: Implement bridge state readout
drm/tidss: Implement hw readout support

I have been testing these with AM62-SK, HDMI and OLDI, with all the different combinations I've come up with. However, I realized just today that the bootloader could still do things a bit differently, which wouldn't work with the current patches. I decided to ignore that for now.

I also need to test all this on other TI boards, without SRO, or perhaps adding SRO if it's easy-ish.

So... Again, thanks Maxime for the great work you've done here, I really like this series. It's annoyingly complicated to get to work reliably, though, but maybe we'll get there =). With all my tests now working, I'll try to find the time to actually review the series.

Feel free to use, abuse, or not use the commits from my branch in any way you want.
A few more issues I found while testing.

The SRO can never fully recover the state we have on the SW side. One particular case is the fb/plane sizes and offsets. E.g.

kmstest -c lvds -p 1:800x800 -f 2000x2000 -v 10,10-800x800

*ERROR* plane-1 configuration mismatch in src_x expected 10.000000, got 0.000000
*ERROR* plane-1 configuration mismatch in src.x1 expected 655360, got 0
[PLANE:45:plane-1] Committed and Readout PLANE state don't match

There's no offset in the HW, so the SRO just gives 0. Another with the width and height:

kmstest -c lvds -p 1:800x800 -f 1200x1200 -v 0,0-900x900

*ERROR* framebuffer configuration mismatch in width expected 1200, got 900
*ERROR* framebuffer configuration mismatch in height expected 1200, got 900
[PLANE:45:plane-1] Committed and Readout PLANE state don't match

I think we can fix the fb width, at least for tidss, as we should be able to read out the stride. But for fb height, there's nothing in the HW.

Another, tidss specific one, is when we downscale enough, and the driver switches to decimating. We don't do a proper readout for that.

Then a possibly wider issue: with two displays, the driver assigns the planes as primary planes for each display. If the bootloader has configured the planes on two displays the other way, we run into trouble with legacy modesetting. In my case the bootloader sets up plane 0 on HDMI, plane 1 on LVDS. The driver's init configures plane 1 as the primary plane for HDMI, and plane 0 for LVDS. If I then do:

KMSXX_DISABLE_ATOMIC=1 kmstest -c hdmi

it fails.

Another, perhaps tidss related issue is with bus formats & flags. Changing them doesn't cause a full modeset, so if the bootloader e.g. sets up DE to active high, but the kernel wants to use a different value, and we have a connector related commit that's not a modeset:

import kms
card = kms.Card()
conn = next(c for c in card.connectors if c.fullname == 'LVDS-1')
req = kms.AtomicReq(card)
req.add(conn, 'CRTC_ID', conn.get_prop_value('CRTC_ID'))
req.commit_sync(allow_modeset=False)

results in:

*ERROR* crtc-0 configuration mismatch in bus_flags expected 0000008a, got 00000086
[CRTC:42:crtc-0] Committed and Readout CRTC state don't match
*ERROR* bridge-30200000.dss configuration mismatch in input_bus_cfg.flags expected 0000008a, got 00000086 *ERROR* bridge-30200000.dss configuration mismatch in output_bus_cfg.flags expected 0000008a, got 00000086
Committed and Readout private object state don't match
*ERROR* bridge-30200000.dss configuration mismatch in input_bus_cfg.flags expected 0000008a, got 00000089 *ERROR* bridge-30200000.dss configuration mismatch in output_bus_cfg.flags expected 00000002, got 00000001
Committed and Readout private object state don't match


I don't have proper fixes for these yet, but SRO does bring out all kinds of interest corner cases =).

 Tomi

Reply via email to