[PATCH weston v5 09/36] cms-colord: find a good head

Derek Foreman derekf at osg.samsung.com
Thu Feb 1 22:00:28 UTC 2018


On 2017-12-14 05:40 AM, Pekka Paalanen wrote:
> 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.

I am a complete non-expert in this area, so if I'm making no sense feel 
free to tell me to shut up...

I think if someone's going through the effort to properly setup color 
management, then we can't use cloned heads off a single CRTC?

We should probably disallow a CRTCs to drive multiple heads if two or 
more of those heads have differing color profiles?

If I went to the trouble of calibrating two displays, I would probably 
be extremely surprised to see them looking different with clone mode 
enabled.

(All previous patches have my RB, but I'm worried about this one.)

Thanks,
Derek

> 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);
> 



More information about the wayland-devel mailing list