From b877daded11612891af0406fb43cb8bcf1e02809 Mon Sep 17 00:00:00 2001 From: emersion Date: Tue, 4 Sep 2018 15:09:07 +0200 Subject: backend/drm: better hotplug handling This commit handles better situations in which the number of connected outputs is greater than the number of available CRTCs. It'll enable as many outputs as possible, and transfer CRTCs to outputs that need one on unplug. This changes CRTC and plane reallocation to happen after scanning DRM connectors instead of on modeset. This cleanups CRTCs and planes on unplug to allow them to be re-used for other outputs. On modeset, if an output doesn't have a CRTC, the desired mode is saved and used later when the output gains a CRTC. Future work includes giving priority to enabled outputs over disabled ones for CRTC allocation. This requires the compositor to know about all outputs (even outputs without CRTCs) to properly modeset outputs enabled in the compositor config file and disable outputs disabled in the config file. --- include/backend/drm/drm.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/backend/drm/drm.h') diff --git a/include/backend/drm/drm.h b/include/backend/drm/drm.h index 5d6ff231..fe279917 100644 --- a/include/backend/drm/drm.h +++ b/include/backend/drm/drm.h @@ -119,6 +119,7 @@ struct wlr_drm_connector { struct wlr_output output; enum wlr_drm_connector_state state; + struct wlr_output_mode *desired_mode; uint32_t id; struct wlr_drm_crtc *crtc; -- cgit v1.2.3