/* * SMI_DisplayPowerManagementSet -- Sets VESA Display Power Management * Signaling (DPMS) Mode. */ void SMILynx_DisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagementMode, int flags) { SMIPtr pSmi = SMIPTR(pScrn); SMIRegPtr mode = pSmi->mode; vgaHWPtr hwp = VGAHWPTR(pScrn); ENTER(); /* If we already are in the requested DPMS mode, just return */ if (pSmi->CurrentDPMS != PowerManagementMode) { /* Read the required SR registers for the DPMS handler */ CARD8 SR01 = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x01); switch (PowerManagementMode) { case DPMSModeOn: SR01 &= ~0x20; /* Screen on */ mode->SR23 &= ~0xC0; /* Disable chip activity detection */ break; case DPMSModeStandby: case DPMSModeSuspend: case DPMSModeOff: SR01 |= 0x20; /* Screen off */ mode->SR23 = (mode->SR23 & ~0x07) | 0xD8; /* Enable chip activity detection Enable internal auto-standby mode Enable both IO Write and Host Memory write detect 0 minutes timeout */ break; } /* Wait for vertical retrace */ while (hwp->readST01(hwp) & 0x8) ; while (!(hwp->readST01(hwp) & 0x8)) ; /* Write the registers */ VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x01, SR01); VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x23, mode->SR23); /* Set the DPMS mode to every output and CRTC */ xf86DPMSSet(pScrn, PowerManagementMode, flags); /* Save the current power state */ pSmi->CurrentDPMS = PowerManagementMode; } LEAVE(); }
static void imxOutputModeSet(xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr adjMode) { /** * Callback for setting up a video mode after fixups have been made. * * This is only called while the output is disabled. The dpms callback * must be all that's necessary for the output, to turn the output on * after this function is called. */ /* Access the associated screen info. */ ScrnInfoPtr pScrn = output->scrn; /* Enable the output */ xf86DPMSSet(pScrn, DPMSModeOn, 0); }
void vmwgfx_disable_scanout(ScrnInfoPtr pScrn) { int i; Bool save_enabled; xf86CrtcPtr crtc; xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); xf86DPMSSet(pScrn, DPMSModeOff, 0); for (i=0; i < config->num_crtc; ++i) { crtc = config->crtc[i]; save_enabled = crtc->enabled; crtc->enabled = FALSE; crtc_dpms(crtc, DPMSModeOff); crtc->enabled = save_enabled; } xf86RotateFreeShadow(pScrn); }