diff options
author | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2017-04-04 16:36:07 +0300 |
---|---|---|
committer | Pekka Paalanen <pekka.paalanen@collabora.co.uk> | 2018-04-12 14:26:17 +0300 |
commit | cf0a476b8e22950b2f4183b12b0690d8ab392d92 (patch) | |
tree | 52e07ea2cd943ad843b62db63aa3f92fffb9380a /compositor | |
parent | 06f99efc9c417eefb8046bf64a84869d698a0be5 (diff) | |
download | weston-cf0a476b8e22950b2f4183b12b0690d8ab392d92.tar.gz weston-cf0a476b8e22950b2f4183b12b0690d8ab392d92.tar.bz2 weston-cf0a476b8e22950b2f4183b12b0690d8ab392d92.zip |
cms-colord: find a good head
The 'head' member of 'struct weston_output' is going to go unused and
then disappear, so stop using it and find a head from the proper list.
However, this leaves a problem in cms-colord: if you have multiple
monitors driver with the same CRTC, what do you say to the color
management system? The monitors could be different, but all the color
LUTs etc. are in the CRTC and are shared, as is the framebuffer.
Do the simple hack here and just use whatever head happens to be the
first in the list.
The warning is printed in get_output_id(), because if heads are added or
removed while the output is enabled, the id could change.
v6:
- add weston_output_get_first_head(), at first use
- add warning message for nr. heads > 1
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>
Diffstat (limited to 'compositor')
-rw-r--r-- | compositor/cms-colord.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/compositor/cms-colord.c b/compositor/cms-colord.c index f421773b..b68e4921 100644 --- a/compositor/cms-colord.c +++ b/compositor/cms-colord.c @@ -102,10 +102,20 @@ edid_value_valid(const char *str) static gchar * get_output_id(struct cms_colord *cms, struct weston_output *o) { - struct weston_head *head = &o->head; + struct weston_head *head; const gchar *tmp; GString *device_id; + /* XXX: What to do with multiple heads? + * This is potentially unstable, if head configuration is changed + * while the output is enabled. */ + head = weston_output_get_first_head(o); + + if (wl_list_length(&o->head_list) > 1) { + weston_log("colord: WARNING: multiple heads are not supported (output %s).\n", + o->name); + } + /* see https://github.com/hughsie/colord/blob/master/doc/device-and-profile-naming-spec.txt * for format and allowed values */ device_id = g_string_new("xrandr"); @@ -231,7 +241,7 @@ colord_notifier_output_destroy(struct wl_listener *listener, void *data) static void colord_output_created(struct cms_colord *cms, struct weston_output *o) { - struct weston_head *head = &o->head; + struct weston_head *head; CdDevice *device; const gchar *tmp; gchar *device_id; @@ -239,6 +249,9 @@ colord_output_created(struct cms_colord *cms, struct weston_output *o) GHashTable *device_props; struct cms_output *ocms; + /* XXX: What to do with multiple heads? */ + head = weston_output_get_first_head(o); + /* create device */ device_id = get_output_id(cms, o); weston_log("colord: output added %s\n", device_id); |