From 6eba4505da22067029483f3a8508013dccea49fe Mon Sep 17 00:00:00 2001 From: Ian Forbes Date: Thu, 17 Oct 2024 15:03:52 -0500 Subject: [PATCH] Disable the kernel CRTC when DPMS Mode OFF is called If the CRTC is supposed to be disabled we need to inform the kernel. Fixes a bug where a secondary screen is left blank, but enabled, when switching from two displays to one. Signed-off-by: Ian Forbes --- vmwgfx/vmwgfx_crtc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vmwgfx/vmwgfx_crtc.c b/vmwgfx/vmwgfx_crtc.c index 60e4de2..7321e20 100644 --- a/vmwgfx/vmwgfx_crtc.c +++ b/vmwgfx/vmwgfx_crtc.c @@ -72,7 +72,8 @@ static void crtc_dpms(xf86CrtcPtr crtc, int mode) { struct crtc_private *crtcp = crtc->driver_private; - /* ScrnInfoPtr pScrn = crtc->scrn; */ + modesettingPtr ms = modesettingPTR(crtc->scrn); + drmModeCrtcPtr drm_crtc = crtcp->drm_crtc; switch (mode) { case DPMSModeOn: @@ -93,6 +94,7 @@ crtc_dpms(xf86CrtcPtr crtc, int mode) * another dpms call, so don't release the scanout pixmap ref. */ if (!crtc->enabled && crtcp->entry.pixmap) { + drmModeSetCrtc(ms->fd, drm_crtc->crtc_id, 0, 0, 0, NULL, 0, NULL); vmwgfx_scanout_unref(&crtcp->entry); } break;