Hi,
On 26/10/2025 19:39, Linus Walleij wrote:
> commit c9b1150a68d9362a0827609fc0dc1664c0d8bfe1
> "drm/atomic-helper: Re-order bridge chain pre-enable and post-disable"
> caused a series of regressions in all panels that send
> DSI commands in their .prepare() and .unprepare()
> callbacks.
>
> As the CRTC is no longer online at bridge_pre_enable()
> and gone at brige_post_disable() which maps to the panel
> bridge .prepare()/.unprepare() callbacks, any CRTC that
> enable/disable the DSI transmitter in it's enable/disable
> callbacks will be unable to send any DSI commands in the
> .prepare() and .unprepare() callbacks.
Well, that wasn't the intention...
We also have this pre_enable_prev_first hack in the drm_bridge, but I
guess that doesn't help in this case?
More generally speaking, I think the core issue is that we have the DSI
video stream as a dependency for DSI commands. It would be better if the
DSI hosts dealt with DSI commands independent of the video stream, in
other words, one could send a DSI command at any time.
Unfortunately in some cases that might be impossible, if the DSI host
depends on the incoming pixel clock to function...
In this particular case, if the same driver is dealing with the crtc and
the dsi host, wouldn't it be possible to make the
mipi_dsi_host_ops.transfer() work regardless of the enable/disable status?
Tomi
> This is also evident from device trees with the DSI
> inside the CRTC such as this:
>
> mcde@a0350000 {
> status = "okay";
> pinctrl-names = "default";
> pinctrl-0 = <&dsi_default_mode>;
>
> dsi@a0351000 {
> panel {
> compatible = "hydis,hva40wv1", "novatek,nt35510";
> reg = <0>;
> vdd-supply = <&ab8500_ldo_aux4_reg>;
> vddi-supply = <&ab8500_ldo_aux6_reg>;
> };
> };
> };
>
> The panel is inside the DSI which is inside the CRTC
> (MCDE).
>
> This is in a way natural, so let's just fix it in all
> affected panel drivers that I know of and can test.
> Mostly Ux500 phones, and only those with the display
> directly on DSI (not e.g. using DPI and SPI).
>
> Other panel drivers may be affected.
>
> Signed-off-by: Linus Walleij <[email protected]>
> ---
> Changes in v2:
> - Fix half-baked NT35510 patch that was still sending init commands
> in the prepare() callback.
> - Link to v1:
> https://lore.kernel.org/r/[email protected]
>
> ---
> Linus Walleij (4):
> drm: panel: nt355510: Move DSI commands to enable/disable
> drm: panel: s6d16d0: Move DSI commands to enable/disable
> drm: panel: nt35560: Move DSI commands to enable/disable
> drm: panel: s6e63m0: Move DSI commands to enable/disable
>
> drivers/gpu/drm/panel/panel-novatek-nt35510.c | 31 +++++++++++++++++++-----
> drivers/gpu/drm/panel/panel-novatek-nt35560.c | 24 ++++++++++++------
> drivers/gpu/drm/panel/panel-samsung-s6d16d0.c | 35
> ++++++++++++---------------
> drivers/gpu/drm/panel/panel-samsung-s6e63m0.c | 31 +++++++++---------------
> 4 files changed, 70 insertions(+), 51 deletions(-)
> ---
> base-commit: 6548d364a3e850326831799d7e3ea2d7bb97ba08
> change-id: 20251022-fix-mcde-drm-regression-c9ac0cc20bae
>
> Best regards,