OSDN Git Service

drm/tidss: dispc: Fix broken plane positioning code
authorJyri Sarha <jsarha@ti.com>
Thu, 27 Feb 2020 12:00:52 +0000 (14:00 +0200)
committerJyri Sarha <jsarha@ti.com>
Fri, 28 Feb 2020 12:48:58 +0000 (14:48 +0200)
commitb33b54748866f7bc29696837c472f49413169d4e
tree85563d8f0987887e553b6bd537a8f55eee128490
parentd6b8bbca6bc83b9c57e528b28df6177b9b57e19d
drm/tidss: dispc: Fix broken plane positioning code

The old implementation of placing planes on the CRTC while configuring
the planes was naive and relied on the order in which the planes were
configured, enabled, and disabled. The situation where a plane's zpos
was changed on the fly was completely broken. The usual symptoms of
this problem was scrambled display and a flood of sync lost errors,
when a plane was active in two layers at the same time, or a missing
plane, in case when a layer was accidentally disabled.

The rewrite takes a more straight forward approach when HW is
concerned. The plane positioning registers are in the CRTC (or
actually OVR) register space and it is more natural to configure them
in a one go when configuring the CRTC. To do this we need make sure we
have all the planes on the updated CRTCs in the new atomic state. The
untouched planes on CRTCs that need plane position update are added to
the atomic state in tidss_atomic_check().

Signed-off-by: Jyri Sarha <jsarha@ti.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200227120052.23168-1-jsarha@ti.com
drivers/gpu/drm/tidss/tidss_crtc.c
drivers/gpu/drm/tidss/tidss_crtc.h
drivers/gpu/drm/tidss/tidss_dispc.c
drivers/gpu/drm/tidss/tidss_dispc.h
drivers/gpu/drm/tidss/tidss_kms.c