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 <pekka.paalanen@collabora.co.uk>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Derek Foreman <derekf@osg.samsung.com>
dev
Pekka Paalanen 7 years ago
parent 54cc47cf30
commit aeca2b5aad
  1. 6
      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); wl_array_init(&b->unused_connectors);
for (i = 0; i < resources->count_connectors; i++) { for (i = 0; i < resources->count_connectors; i++) {
struct drm_output *output; struct drm_head *head;
uint32_t *connector_id; uint32_t *connector_id;
output = drm_output_find_by_connector(b, resources->connectors[i]); head = drm_head_find_by_connector(b, resources->connectors[i]);
if (output && output->base.enabled) if (head && weston_head_is_enabled(&head->base))
continue; continue;
connector_id = wl_array_add(&b->unused_connectors, connector_id = wl_array_add(&b->unused_connectors,

Loading…
Cancel
Save