diff options
| author | Simon Ser <contact@emersion.fr> | 2022-10-21 11:50:15 +0200 | 
|---|---|---|
| committer | Simon Ser <contact@emersion.fr> | 2022-12-07 17:44:51 +0100 | 
| commit | 72d1fd14468d719692711819e5d0a7026cda1965 (patch) | |
| tree | 39297f1416cc922048ca282682e2b174b7fde150 | |
| parent | 79248e4961d49da1858917a902ba6b8fcc0bead1 (diff) | |
| download | wlroots-72d1fd14468d719692711819e5d0a7026cda1965.tar.xz | |
backend/drm: simplify dealloc_crtc() commit
No need to manually call drm_connector_state_init() here, we can
just let drm_connector_commit_state() handle it.
| -rw-r--r-- | backend/drm/drm.c | 6 | 
1 files changed, 2 insertions, 4 deletions
| diff --git a/backend/drm/drm.c b/backend/drm/drm.c index 00883a02..52d455db 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -976,14 +976,12 @@ static void dealloc_crtc(struct wlr_drm_connector *conn) {  	wlr_drm_conn_log(conn, WLR_DEBUG, "De-allocating CRTC %zu",  		conn->crtc - drm->crtcs); -	struct wlr_output_state output_state = { +	struct wlr_output_state state = {  		.committed = WLR_OUTPUT_STATE_ENABLED,  		.allow_artifacts = true,  		.enabled = false,  	}; -	struct wlr_drm_connector_state conn_state = {0}; -	drm_connector_state_init(&conn_state, conn, &output_state); -	if (!drm_crtc_commit(conn, &conn_state, 0, false)) { +	if (!drm_connector_commit_state(conn, &state)) {  		// On GPU unplug, disabling the CRTC can fail with EPERM  		wlr_drm_conn_log(conn, WLR_ERROR, "Failed to disable CRTC %"PRIu32,  			conn->crtc->id); | 
