compositor-drm: Only check final co-ordinates for overlay scaling
authorDaniel Stone <daniels@collabora.com>
Wed, 16 Nov 2016 19:35:03 +0000 (19:35 +0000)
committerDaniel Stone <daniels@collabora.com>
Fri, 6 Jul 2018 13:52:05 +0000 (14:52 +0100)
commitce137472faab26f2c92d40efdfa64a5a937b57fb
treed3b6174a7a62169df623b3eee57997d878eca407
parentdf2726a08913ab8bd00fc6be98d7ca5626b77569
compositor-drm: Only check final co-ordinates for overlay scaling

When considering a view for placement into an overlay plane, we
previously checked that the buffer's transform and scale were identical
to the output's, and that there were no transformations applied.

We now use a more consistent set of checks through
drm_plane_state_coords_for_view. This checks the complete transformation
chain, allowing only translation and scaling; at the end, we check if
the total buffer -> surface -> view -> output chain requires scaling or
rotation, and disallow it if so.

This allows scaling in the cases where the transformation chain cancels
itself out to produce a 1:1 buffer -> output pixel scale.

An erroneously disallowed case is where buffer -> view -> output
rotations cancel each other out; we prevent a view from being on an
overlay plane if rotation is involved at all. Fixing this would require
a complete analysis of the overall transformation matrix.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Tested-by: Emre Ucan <eucan@de.adit-jv.com>
libweston/compositor-drm.c