From aeca2b5aad28eccbc4ed46d9422bd640f6dbf8d7 Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Tue, 13 Feb 2018 15:02:44 +0200 Subject: [PATCH] compositor-drm: use head_find_by_connector in update_unused_outputs Making this function not depend on drm_head::output field through drm_output_find_by_connector() will later allow to remove the drm_head::output field before removing the unused_connectors array. This helps keeping the commit more fine-grained. drm_backend_update_unused_outputs() was only interested in enabled outputs. The new code is 100% equivalent to the old code. The difference is that weston_head::output is only set for attached heads. A connector cannot be in use if it is not attached to an output. Signed-off-by: Pekka Paalanen Reviewed-by: Daniel Stone Acked-by: Derek Foreman --- libweston/compositor-drm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c index f34e7105..0f0b6f06 100644 --- a/libweston/compositor-drm.c +++ b/libweston/compositor-drm.c @@ -4941,11 +4941,11 @@ drm_backend_update_unused_outputs(struct drm_backend *b, drmModeRes *resources) wl_array_init(&b->unused_connectors); for (i = 0; i < resources->count_connectors; i++) { - struct drm_output *output; + struct drm_head *head; uint32_t *connector_id; - output = drm_output_find_by_connector(b, resources->connectors[i]); - if (output && output->base.enabled) + head = drm_head_find_by_connector(b, resources->connectors[i]); + if (head && weston_head_is_enabled(&head->base)) continue; connector_id = wl_array_add(&b->unused_connectors,