drm/sun4i: backend: Add a custom atomic_check for the frontend
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Mon, 22 Jan 2018 09:25:24 +0000 (10:25 +0100)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Mon, 22 Jan 2018 14:17:32 +0000 (15:17 +0100)
commit96180dde23b799272ab2e7d47210c8840799d0d2
tree5b5e295d447d5c3255400d4ea753e697f4452573
parentca07b210bc5c124cc194d0c7b91354c636e36394
drm/sun4i: backend: Add a custom atomic_check for the frontend

Now that we have everything in place, we can start enabling the frontend.
This is more difficult than one would assume since there can only be one
plane using the frontend per-backend.

We therefore need to make sure that the userspace will not try to setup
multiple planes using it, since that would be impossible. In order to
prevent that, we can create an atomic_check callback that will check that
only one plane will effectively make use of the frontend in a given
configuration, and will toggle the switch in that plane state so that the
proper setup function can do their role.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/278e6c514a8311750fe627c7f28d58b3e2cbd825.1516613040.git-series.maxime.ripard@free-electrons.com
drivers/gpu/drm/sun4i/sun4i_backend.c
drivers/gpu/drm/sun4i/sun4i_backend.h