compositor-drm: get current mode on head discovery
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>
Mon, 11 Sep 2017 11:06:11 +0000 (14:06 +0300)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Wed, 18 Apr 2018 08:53:54 +0000 (11:53 +0300)
commit13d233edba558b6be642e3ec3544073120f53888
tree1d2944757c61f83a6f543bee3fe7f89eb2f20d11
parentf857046559abc36e250540455a6f6c82fe87479f
compositor-drm: get current mode on head discovery

The inherited mode is the video mode on the connector when we have not
yet reconfigured the connector, if set.

Get the inherited mode the moment we create a drm_head, not when we
determine the mode for a drm_output. This way we are sure to read all
inherited modes before we reconfigure a single CRTC. Enabling one output
may grab the CRTC from another connector, overwriting whatever mode that
connector might have had.

The inherited mode is stored in drm_head, where we can keep it for the
lifetime of the head, rather than relying on re-loading it from the
kernel at set_mode() time.

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-drm.c