From f3bed68100b7187644567f89edcdb510c2911892 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Fri, 14 Oct 2022 14:54:13 +0300 Subject: [PATCH] backend-drm: do not print head info twice Before this patch, when a new head is found its information is printed first as "updated" and then as "found" in the log. The reason is that drm_head_create() calls drm_head_update_info() which printed the head as "changed". Then drm_head_create() itself prints it as "found". This fixes it to print only once as "found". Signed-off-by: Pekka Paalanen --- libweston/backend-drm/drm.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c index d7dc01f72..b5ea193c3 100644 --- a/libweston/backend-drm/drm.c +++ b/libweston/backend-drm/drm.c @@ -2215,9 +2215,6 @@ drm_head_update_info(struct drm_head *head, drmModeConnector *conn) weston_head_set_content_protection_status(&head->base, drm_head_get_current_protection(head)); - if (head->base.device_changed) - drm_head_log_info(head, "updated"); - return ret; } @@ -2534,12 +2531,15 @@ drm_backend_update_connectors(struct drm_device *device, * one of the searches must fail. */ assert(head == NULL || writeback == NULL); - if (head) + if (head) { ret = drm_head_update_info(head, conn); - else if (writeback) + if (head->base.device_changed) + drm_head_log_info(head, "updated"); + } else if (writeback) { ret = drm_writeback_update_info(writeback, conn); - else + } else { ret = drm_backend_add_connector(b->drm, conn, drm_device); + } if (ret < 0) drmModeFreeConnector(conn);