libweston: allow attaching heads to enabled outputs
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>
Fri, 8 Dec 2017 12:13:34 +0000 (14:13 +0200)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Tue, 17 Apr 2018 12:57:41 +0000 (15:57 +0300)
commitdcac351dc5710a073e81fc816c7054203f6b0588
treeb9f020f802704c668e75364145679bc18c25ab6a
parent37b7c6ebb5418fb5048edaaad1e9e5f617613c8d
libweston: allow attaching heads to enabled outputs

Move the responsibility of ensuring the head will work in the enabled
output to the backends.

A compositor cannot enable an output without heads, and removing the
last head from an output automatically disables the output, so attaching
a new head to an enabled output is only possible for clone mode.

Backends headless, rdp, and x11 forbid clone mode by not having an
attach_head hook implemented; fbdev and wayland explicitly deny clone
mode. Only the DRM backend is affected by this change and even that not
yet because MAX_CLONED_CONNECTORS is 1 in the DRM backend.

Also ensure a global is created for the head when attached to an enabled
output, and log it.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
libweston/compositor.c