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 <ian.forbes@broadcom.com>
This commit is contained in:
Ian Forbes
2024-10-17 15:03:52 -05:00
parent a20aaf5823
commit 6eba4505da

View File

@@ -72,7 +72,8 @@ static void
crtc_dpms(xf86CrtcPtr crtc, int mode) crtc_dpms(xf86CrtcPtr crtc, int mode)
{ {
struct crtc_private *crtcp = crtc->driver_private; struct crtc_private *crtcp = crtc->driver_private;
/* ScrnInfoPtr pScrn = crtc->scrn; */ modesettingPtr ms = modesettingPTR(crtc->scrn);
drmModeCrtcPtr drm_crtc = crtcp->drm_crtc;
switch (mode) { switch (mode) {
case DPMSModeOn: case DPMSModeOn:
@@ -93,6 +94,7 @@ crtc_dpms(xf86CrtcPtr crtc, int mode)
* another dpms call, so don't release the scanout pixmap ref. * another dpms call, so don't release the scanout pixmap ref.
*/ */
if (!crtc->enabled && crtcp->entry.pixmap) { if (!crtc->enabled && crtcp->entry.pixmap) {
drmModeSetCrtc(ms->fd, drm_crtc->crtc_id, 0, 0, 0, NULL, 0, NULL);
vmwgfx_scanout_unref(&crtcp->entry); vmwgfx_scanout_unref(&crtcp->entry);
} }
break; break;