libweston: log head detach on enabled output
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>
Fri, 8 Dec 2017 14:11:17 +0000 (16:11 +0200)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Tue, 17 Apr 2018 12:57:41 +0000 (15:57 +0300)
Helps debugging.

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

index 14fa126..a9de4ac 100644 (file)
@@ -4699,6 +4699,7 @@ WL_EXPORT void
 weston_head_detach(struct weston_head *head)
 {
        struct weston_output *output = head->output;
+       char *head_names;
 
        wl_list_remove(&head->output_link);
        wl_list_init(&head->output_link);
@@ -4713,8 +4714,16 @@ weston_head_detach(struct weston_head *head)
        if (output->enabled) {
                weston_head_remove_global(head);
 
-               if (wl_list_empty(&output->head_list))
+               if (wl_list_empty(&output->head_list)) {
+                       weston_log("Output '%s' no heads left, disabling.\n",
+                                  output->name);
                        weston_output_disable(output);
+               } else {
+                       head_names = weston_output_create_heads_string(output);
+                       weston_log("Output '%s' updated to have head(s) %s\n",
+                                  output->name, head_names);
+                       free(head_names);
+               }
        }
 }