compositor-drm: Extract overlay FB import to helper

... in order to be able to use it from scanout as well.

In doing this, the check for format compatibility is moved from after
selecting a plane to before selecting a plane. If different planes have
disjoint format support, this ensures that we don't reject the view from
all overlay consideration, just because the first plane we found didn't
support its format.

Signed-off-by: Daniel Stone <>
Reviewed-by: Pekka Paalanen <>
Tested-by: Emre Ucan <>
1 file changed