[PATCH weston v5 09/36] cms-colord: find a good head
Pekka Paalanen
ppaalanen at gmail.com
Thu Dec 14 11:40:46 UTC 2017
From: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
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.
Signed-off-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
---
compositor/cms-colord.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/compositor/cms-colord.c b/compositor/cms-colord.c
index f421773b..9061091b 100644
--- a/compositor/cms-colord.c
+++ b/compositor/cms-colord.c
@@ -102,10 +102,13 @@ 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? */
+ head = weston_output_get_first_head(o);
+
/* 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 +234,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 +242,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);
--
2.13.6
More information about the wayland-devel
mailing list