drm/omap: dynamically assign hw overlays to planes
authorBenoit Parrot <bparrot@ti.com>
Wed, 17 Nov 2021 14:19:26 +0000 (15:19 +0100)
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Wed, 8 Dec 2021 08:04:47 +0000 (10:04 +0200)
commit2e54ff0e5430883f2040450e9297ebad9f56f846
treed52a4b8164cad5be78cad055cf5109e8cb337408
parent6e42201b0ed5d3af66c107144fcd96c17afbc6f1
drm/omap: dynamically assign hw overlays to planes

(re)assign the hw overlays to planes based on required caps, and to
handle situations where we could not modify an in-use plane.

This means all planes advertise the superset of formats and properties.
Userspace must (as always) use atomic TEST_ONLY step for atomic updates,
as not all planes may be available for use on every frame.

The mapping of hwoverlays to plane is stored in omap_global_state, so
that state updates are atomically committed in the same way that
plane/etc state updates are managed.  This is needed because the
omap_plane_state keeps a pointer to the hwoverlay, and we don't want
global state to become out of sync with the plane state if an atomic
update fails, we hit deadlock/ backoff scenario, etc.  The use of
global_state_lock keeps multiple parallel updates which both re-assign
hwoverlays properly serialized.

Signed-off-by: Benoit Parrot <bparrot@ti.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211117141928.771082-8-narmstrong@baylibre.com
drivers/gpu/drm/omapdrm/omap_drv.h
drivers/gpu/drm/omapdrm/omap_overlay.c
drivers/gpu/drm/omapdrm/omap_overlay.h
drivers/gpu/drm/omapdrm/omap_plane.c