mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-26 06:35:58 +01:00
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.
This commit is contained in:
parent
79248e4961
commit
72d1fd1446
1 changed files with 2 additions and 4 deletions
|
@ -976,14 +976,12 @@ static void dealloc_crtc(struct wlr_drm_connector *conn) {
|
||||||
wlr_drm_conn_log(conn, WLR_DEBUG, "De-allocating CRTC %zu",
|
wlr_drm_conn_log(conn, WLR_DEBUG, "De-allocating CRTC %zu",
|
||||||
conn->crtc - drm->crtcs);
|
conn->crtc - drm->crtcs);
|
||||||
|
|
||||||
struct wlr_output_state output_state = {
|
struct wlr_output_state state = {
|
||||||
.committed = WLR_OUTPUT_STATE_ENABLED,
|
.committed = WLR_OUTPUT_STATE_ENABLED,
|
||||||
.allow_artifacts = true,
|
.allow_artifacts = true,
|
||||||
.enabled = false,
|
.enabled = false,
|
||||||
};
|
};
|
||||||
struct wlr_drm_connector_state conn_state = {0};
|
if (!drm_connector_commit_state(conn, &state)) {
|
||||||
drm_connector_state_init(&conn_state, conn, &output_state);
|
|
||||||
if (!drm_crtc_commit(conn, &conn_state, 0, false)) {
|
|
||||||
// On GPU unplug, disabling the CRTC can fail with EPERM
|
// On GPU unplug, disabling the CRTC can fail with EPERM
|
||||||
wlr_drm_conn_log(conn, WLR_ERROR, "Failed to disable CRTC %"PRIu32,
|
wlr_drm_conn_log(conn, WLR_ERROR, "Failed to disable CRTC %"PRIu32,
|
||||||
conn->crtc->id);
|
conn->crtc->id);
|
||||||
|
|
Loading…
Reference in a new issue