Skip to content
Snippets Groups Projects
Commit 94e14764 authored by Pekka Paalanen's avatar Pekka Paalanen
Browse files

compositor-drm: remove unused_connectors array


Replace the unused_connectors array by iterating through the head list
instead. A head that is not enabled (attached to an enabled output) is
basically an unused connector.

The primary motivation here is to remove a user of
drm_output_find_by_connector() so that a following patch can remove the
function.

This fixes some confusion on which connectors should have been in
unused_connectors array. When an output was created due to hotplug, even
before taking it into use, it would count as a used connector because of
drm_output_find_by_connector() used in drm_backend_update_outputs().
OTOH, drm_output_enable() removed the connector from unused_connectors
while drm_output_disable() puts the connector into unused_connectors. A
connector can be both unused or not when a non-enabled output exists for
it.

A second hotplug event would cause drm_backend_update_outputs() to
override any previous enable/disable setup. So we also relied on hotplug
events to not occur before the compositor configured the new outputs.

Now I realize it was meant to avoid flicker. After hotplug, if weston
repaints before the compositor explicitly configures the output, this
"confusion" avoids automatically turning off the connector. If the
compositor chooses to drive the connector, we might flicker.

However, in what circumstances can a connector be hotplugged while
already active? That should only happen on compositor start-up, because
later we have already disabled all connectors and CRTCs we are not
using.

Therefore removing the "confusion" is harmless. On compositor start-up,
we detect all connected connectors and create outputs for them, and then
the explicit call to weston_compositor_flush_heads_changed() will
guarantee all connectors will be set up before Weston goes into the
first repaint that will disable all unused connectors.

What about VT-switch in?

Signed-off-by: Pekka Paalanen's avatarPekka Paalanen <pekka.paalanen@collabora.co.uk>
parent 31d12792
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment