backend/drm: fix FPE when disabling output

Fixes: 65836ce357 ("backend/drm: log modesetting commits")
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3534
This commit is contained in:
Simon Ser 2022-11-15 10:06:23 +01:00
parent 5b34fe5513
commit a40ba16a64

View file

@ -582,9 +582,13 @@ bool drm_connector_commit_state(struct wlr_drm_connector *conn,
}
if (pending.modeset) {
wlr_drm_conn_log(conn, WLR_INFO, "Modesetting with %dx%d @ %.3f Hz",
pending.mode.hdisplay, pending.mode.vdisplay,
(float)calculate_refresh_rate(&pending.mode) / 1000);
if (pending.active) {
wlr_drm_conn_log(conn, WLR_INFO, "Modesetting with %dx%d @ %.3f Hz",
pending.mode.hdisplay, pending.mode.vdisplay,
(float)calculate_refresh_rate(&pending.mode) / 1000);
} else {
wlr_drm_conn_log(conn, WLR_INFO, "Turning off");
}
}
if (!drm_crtc_commit(conn, &pending, flags, false)) {