]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/sun4i: Fix layer zpos change/atomic modesetting
authorOndrej Jirman <megi@xff.cz>
Sat, 24 Feb 2024 15:06:00 +0000 (16:06 +0100)
committerMaxime Ripard <mripard@kernel.org>
Mon, 10 Jun 2024 10:44:41 +0000 (12:44 +0200)
commitf8d59fac575a624d1d4bd24424b3ec2bf5c4202a
treea9d96a8ea79beda8e36d1b116c4391a36292424f
parentaa0b4a69b6da861d1cb645a1a5df4a3fa8b9c86d
drm/sun4i: Fix layer zpos change/atomic modesetting

Identical configurations of planes can lead to different (and wrong)
layer -> pipe routing at HW level, depending on the order of atomic
plane changes.

For example:

- Layer 1 is configured to zpos 0 and thus uses pipe 0. No other layer
  is enabled. This is a typical situation at boot.

- When a compositor takes over and layer 3 is enabled,
  sun8i_ui_layer_enable() will get called with old_zpos=0 zpos=1, which
  will lead to incorrect disabling of pipe 0 and enabling of pipe 1.

What happens is that sun8i_ui_layer_enable() function may disable
blender pipes even if it is no longer assigned to its layer.

To correct this, move the routing setup out of individual plane's
atomic_update into crtc's atomic_update, where it can be calculated
and updated all at once.

Remove the atomic_disable callback because it is no longer needed.

Signed-off-by: Ondrej Jirman <megi@xff.cz>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Link: https://lore.kernel.org/r/20240224150604.3855534-4-megi@xff.cz
Signed-off-by: Maxime Ripard <mripard@kernel.org>
drivers/gpu/drm/sun4i/sun8i_mixer.c
drivers/gpu/drm/sun4i/sun8i_mixer.h
drivers/gpu/drm/sun4i/sun8i_ui_layer.c
drivers/gpu/drm/sun4i/sun8i_vi_layer.c