From a40ba16a6414f72ae0224164bb08cd8479dc52ee Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 15 Nov 2022 10:06:23 +0100 Subject: [PATCH] backend/drm: fix FPE when disabling output Fixes: 65836ce357e4 ("backend/drm: log modesetting commits") Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3534 --- backend/drm/drm.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/backend/drm/drm.c b/backend/drm/drm.c index c577bffc..a3daf23f 100644 --- a/backend/drm/drm.c +++ b/backend/drm/drm.c @@ -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)) {