libweston: add weston_head_is_device_changed() API
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>
Mon, 28 Aug 2017 11:11:02 +0000 (14:11 +0300)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Tue, 17 Apr 2018 12:19:57 +0000 (15:19 +0300)
commite19970fd6ce257c84e83da182754cdd5416744b2
tree3d210f33bec770465f37ffa76403ed251dc3d799
parent2e1bedb4ed2042264cbbf0ffb4d65de2ba21efd1
libweston: add weston_head_is_device_changed() API

Reacting to DRM hotplug events is racy. It is theoretically possible to
get hotplug events for a quick swap from one monitor to another and
process both only after the new monitor is connected. Hence it is
possible for display device information to change without going through
a disconnected state for the head.

To support such cases, add API to allow detecting it in the compositor.

v6:
- change str_null_neq() to str_null_eq()
- rename weston_head_condition_device_changed()
- move the condition from weston_head_set_device_changed() to the
callers

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