compositor-drm: combine mode list from heads
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>
Fri, 10 Nov 2017 14:34:39 +0000 (16:34 +0200)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Wed, 18 Apr 2018 09:00:52 +0000 (12:00 +0300)
commitf005f25d62e048877dee96564a6b8c25a2b8752a
treedf2e3c28e489f8d791c756a7df6bf84ca1d25460
parent456dc73777d985776317958f5d99c9bcb985d435
compositor-drm: combine mode list from heads

A single list of modes needs to be combined from the mode lists in each
attached head. We could just concatenate the lists, but that might
introduce duplicates. Try to avoid duplicates instead by using partially
fuzzy matching.

When a duplicate is found, try to figure out which is more suitable to
use in place of both. If one has the preferred flag and the other
doesn't, take the preferred one. Otherwise use the one already in the
list.

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