diff options
author | Maxime Ripard <maxime.ripard@bootlin.com> | 2018-02-16 20:39:32 +0300 |
---|---|---|
committer | Maxime Ripard <maxime.ripard@bootlin.com> | 2018-02-22 18:19:52 +0300 |
commit | 8f1f25534fff09f54d75ea8fac4ea8f35fb385d6 (patch) | |
tree | d1e5a19d80d6ca7e6c02285aa2278da622600330 /drivers/gpu/drm/sun4i/sun4i_layer.h | |
parent | 8a1949455aaa22b3ff581766a640ed7f92cf8cef (diff) | |
download | linux-8f1f25534fff09f54d75ea8fac4ea8f35fb385d6.tar.xz |
drm/sun4i: backend: Assign the pipes automatically
Since we now have a way to enforce the zpos, check for the number of alpha
planes, the only missing part is to assign our pipe automatically instead
of hardcoding it.
The algorithm is quite simple, but requires two iterations over the list of
planes.
In the first one (which is the same one that we've had to check for alpha,
the frontend usage, and so on), we order the planes by their zpos.
We can then do a second iteration over that array by ascending zpos
starting with the pipe 0. When and if we encounter our alpha plane, we put
it and all the other subsequent planes in the second pipe.
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/e9caf21d831438d36a3ccc7cef229c9a7ea7f69f.1518802627.git-series.maxime.ripard@bootlin.com
Diffstat (limited to 'drivers/gpu/drm/sun4i/sun4i_layer.h')
-rw-r--r-- | drivers/gpu/drm/sun4i/sun4i_layer.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_layer.h b/drivers/gpu/drm/sun4i/sun4i_layer.h index 75b4868ba87c..36b20265bd31 100644 --- a/drivers/gpu/drm/sun4i/sun4i_layer.h +++ b/drivers/gpu/drm/sun4i/sun4i_layer.h @@ -24,6 +24,7 @@ struct sun4i_layer { struct sun4i_layer_state { struct drm_plane_state state; + unsigned int pipe; bool uses_frontend; }; |