diff options
| author | Drew DeVault <sir@cmpwn.com> | 2019-01-20 09:02:00 -0500 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-20 09:02:00 -0500 | 
| commit | 0db2a687b7afcfe2f52a25b175f1920700afa9ed (patch) | |
| tree | b800e1964a0e47a832915f5e04e96b5ada0ee188 /backend | |
| parent | f04a7259252b1ac08ab9b1b9103f62806fdca35f (diff) | |
| parent | d4ffa5b7a6d751ae8161cc1d301efd66342c2975 (diff) | |
| download | wlroots-0db2a687b7afcfe2f52a25b175f1920700afa9ed.tar.xz | |
Merge pull request #1479 from emersion/lost-crtc-state
backend/drm: fix state for outputs loosing their CRTC
Diffstat (limited to 'backend')
| -rw-r--r-- | backend/drm/drm.c | 17 | 
1 files changed, 14 insertions, 3 deletions
diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 735b7c29..28ee41a5 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -391,6 +391,8 @@ static void attempt_enable_needs_modeset(struct wlr_drm_backend *drm) {  		if (conn->state == WLR_DRM_CONN_NEEDS_MODESET &&  				conn->crtc != NULL && conn->desired_mode != NULL &&  				conn->desired_enabled) { +			wlr_log(WLR_DEBUG, "Output %s has a desired mode and a CRTC, " +				"attempting a modeset", conn->output.name);  			drm_connector_set_mode(&conn->output, conn->desired_mode);  		}  	} @@ -637,7 +639,7 @@ static bool drm_connector_set_cursor(struct wlr_output *output,  		plane->surf.height, output->transform);  	struct wlr_box hotspot = { .x = hotspot_x, .y = hotspot_y }; -	wlr_box_transform(&hotspot, &hotspot,  +	wlr_box_transform(&hotspot, &hotspot,  		wlr_output_transform_invert(output->transform),  		plane->surf.width, plane->surf.height); @@ -981,8 +983,17 @@ static void realloc_crtcs(struct wlr_drm_backend *drm, bool *changed_outputs) {  		i++;  		struct wlr_output_mode *mode = conn->output.current_mode; -		if (conn->state != WLR_DRM_CONN_CONNECTED || !changed_outputs[i] -				|| conn->crtc == NULL) { +		if (conn->state != WLR_DRM_CONN_CONNECTED || !changed_outputs[i]) { +			continue; +		} + +		if (conn->crtc == NULL) { +			wlr_log(WLR_DEBUG, "Output has %s lost its CRTC", +				conn->output.name); +			conn->state = WLR_DRM_CONN_NEEDS_MODESET; +			wlr_output_update_enabled(&conn->output, false); +			conn->desired_mode = conn->output.current_mode; +			wlr_output_update_mode(&conn->output, NULL);  			continue;  		}  | 
