drm/sun4i: engine: Add a custom crtc atomic_check

We have some restrictions on what the planes and CRTC can provide that are
tied to only one generation of display engines.

For example, on the first generation, we can only have one YUV plane or one
plane that uses the frontend output.

Let's allow our engines to provide an atomic_check callback to validate the
current configuration.

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/e5f5f144e5c20d348cdb29933ae876c105bec017.1516613040.git-series.maxime.ripard@free-electrons.com
This commit is contained in:
Maxime Ripard
2018-01-22 10:25:19 +01:00
parent d540f82adf
commit 656e5f6549
2 changed files with 31 additions and 0 deletions

View File

@@ -22,6 +22,23 @@ struct sunxi_engine;
* implement the proper behaviour.
*/
struct sunxi_engine_ops {
/**
* @atomic_check:
*
* This callback allows to validate plane-update related CRTC
* constraints specific to engines. This is mirroring the
* &drm_crtc_helper_funcs.atomic_check callback, so any
* documentation there applies.
*
* This function is optional.
*
* RETURNS:
*
* 0 on success or a negative error code.
*/
int (*atomic_check)(struct sunxi_engine *engine,
struct drm_crtc_state *state);
/**
* @commit:
*