]> git.baikalelectronics.ru Git - kernel.git/commit
drm/sun4i: backend: Assign the pipes automatically
authorMaxime Ripard <maxime.ripard@bootlin.com>
Fri, 16 Feb 2018 17:39:32 +0000 (18:39 +0100)
committerMaxime Ripard <maxime.ripard@bootlin.com>
Thu, 22 Feb 2018 15:19:52 +0000 (16:19 +0100)
commit4db32208145ce04f8bba1028be851ddc3b85b6a6
treed1e5a19d80d6ca7e6c02285aa2278da622600330
parent0e19c120e809a7cd94e116aa5618c290b2c888b5
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
drivers/gpu/drm/sun4i/sun4i_backend.c
drivers/gpu/drm/sun4i/sun4i_layer.c
drivers/gpu/drm/sun4i/sun4i_layer.h