summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>2018-02-09 13:31:50 +0200
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>2018-02-12 16:40:25 +0200
commit9068e011cd8b45798d53d92b3adef9be9167d252 (patch)
treef126974f93ed84171f87d7e3315d3545167351e0
parentc1bcce6a259fa658129e6356098c3985dc50b0a0 (diff)
downloadweston-9068e011cd8b45798d53d92b3adef9be9167d252.tar.gz
compositor-drm: drm_output_enable updates unused_crtcs/connectors
Let drm_output_enable() remove the CRTC and the connector from the unused id arrays. In the future when a list of drm_heads supersedes unused_connectors array, the usedness of a connector will be determined by the enabled state of the output the connector (head) is attached to. The enabled state is turned on by drm_output_enable(). If unused_crtcs array was still updated in drm_output_repaint(), the CRTC and connector usedness would be tracked in different places. Logically the two belong together. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Ian Ray <ian.ray@ge.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
-rw-r--r--libweston/compositor-drm.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/libweston/compositor-drm.c b/libweston/compositor-drm.c
index 50c0ebac..e3043b2e 100644
--- a/libweston/compositor-drm.c
+++ b/libweston/compositor-drm.c
@@ -2380,7 +2380,6 @@ drm_output_repaint(struct weston_output *output_base,
{
struct drm_pending_state *pending_state = repaint_data;
struct drm_output *output = to_drm_output(output_base);
- struct drm_backend *backend = to_drm_backend(output_base->compositor);
struct drm_output_state *state = NULL;
struct drm_plane_state *scanout_state;
@@ -2405,10 +2404,6 @@ drm_output_repaint(struct weston_output *output_base,
if (!scanout_state || !scanout_state->fb)
goto err;
- wl_array_remove_uint32(&backend->unused_connectors,
- output->connector_id);
- wl_array_remove_uint32(&backend->unused_crtcs, output->crtc_id);
-
return 0;
err:
@@ -4626,6 +4621,9 @@ drm_output_enable(struct weston_output *base)
&output->scanout_plane->base,
&b->compositor->primary_plane);
+ wl_array_remove_uint32(&b->unused_connectors, output->connector_id);
+ wl_array_remove_uint32(&b->unused_crtcs, output->crtc_id);
+
weston_log("Output %s, (connector %d, crtc %d)\n",
output->base.name, output->connector_id, output->crtc_id);
wl_list_for_each(m, &output->base.mode_list, link)