xf86-video-intel: Branch 'modesetting' - 2 commits - src/i830_display.c src/i830_driver.c
Eric Anholt
anholt at kemper.freedesktop.org
Tue Dec 19 19:46:58 EET 2006
src/i830_display.c | 42 +++++++-----------------------------------
src/i830_driver.c | 4 ++--
2 files changed, 9 insertions(+), 37 deletions(-)
New commits:
diff-tree d89e211b12ff715d7475421af69157b102accaca (from 3fc9feec7b29e0b908e3b90e0f6634117d66ba6d)
Author: Eric Anholt <eric at anholt.net>
Date: Fri Dec 15 14:39:14 2006 -0800
Disable configure-disabled outputs before mode setting.
We're not supposed to turn off pipes/planes/dplls with outputs attached, which
we could have done before this.
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 7da4bf5..09488ab 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -3173,6 +3173,8 @@ I830EnterVT(int scrnIndex, int flags)
ResetState(pScrn, FALSE);
SetHWOperatingState(pScrn);
+ i830DisableUnusedFunctions(pScrn);
+
for (i = 0; i < xf86_config->num_crtc; i++)
{
xf86CrtcPtr crtc = xf86_config->crtc[i];
@@ -3188,8 +3190,6 @@ I830EnterVT(int scrnIndex, int flags)
i830PipeSetBase(crtc, crtc->x, crtc->y);
}
- i830DisableUnusedFunctions(pScrn);
-
i830DumpRegs (pScrn);
i830DescribeOutputConfiguration(pScrn);
diff-tree 3fc9feec7b29e0b908e3b90e0f6634117d66ba6d (from 7b8056e3e347b15b37be0116315d7d3a23aef99f)
Author: Eric Anholt <eric at anholt.net>
Date: Fri Dec 15 14:38:23 2006 -0800
Simplify i830DisableUnusedFunctions() by using the CRTC dpms routines.
diff --git a/src/i830_display.c b/src/i830_display.c
index f87aadc..4899763 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -962,7 +962,6 @@ void
i830DisableUnusedFunctions(ScrnInfoPtr pScrn)
{
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
- I830Ptr pI830 = I830PTR(pScrn);
int o, pipe;
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Disabling unused functions\n");
@@ -970,51 +969,24 @@ i830DisableUnusedFunctions(ScrnInfoPtr p
for (o = 0; o < xf86_config->num_output; o++)
{
xf86OutputPtr output = xf86_config->output[o];
- if (!output->crtc)
+ if (!output->crtc) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Disabling output %s\n",
+ output->name);
(*output->funcs->dpms)(output, DPMSModeOff);
+ }
}
- /* Now, any unused plane, pipe, and DPLL (FIXME: except for DVO, i915
- * internal TV) should have no outputs trying to pull data out of it, so
- * we're ready to turn those off.
- */
for (pipe = 0; pipe < xf86_config->num_crtc; pipe++)
{
xf86CrtcPtr crtc = xf86_config->crtc[pipe];
I830CrtcPrivatePtr intel_crtc = crtc->driver_private;
int pipe = intel_crtc->pipe;
- int dspcntr_reg = pipe == 0 ? DSPACNTR : DSPBCNTR;
- int pipeconf_reg = pipe == 0 ? PIPEACONF : PIPEBCONF;
- int dpll_reg = pipe == 0 ? DPLL_A : DPLL_B;
- CARD32 dspcntr, pipeconf, dpll;
char *pipe_name = pipe == 0 ? "A" : "B";
- if (crtc->enabled)
- continue;
-
- dspcntr = INREG(dspcntr_reg);
- if (dspcntr & DISPLAY_PLANE_ENABLE) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Disabling plane %s\n",
- pipe_name);
-
- OUTREG(dspcntr_reg, dspcntr & ~DISPLAY_PLANE_ENABLE);
-
- /* Wait for vblank for the disable to take effect */
- i830WaitForVblank(pScrn);
- }
-
- pipeconf = INREG(pipeconf_reg);
- if (pipeconf & PIPEACONF_ENABLE) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Disabling pipe %s\n",
- pipe_name);
- OUTREG(pipeconf_reg, pipeconf & ~PIPEACONF_ENABLE);
- }
-
- dpll = INREG(dpll_reg);
- if (dpll & DPLL_VCO_ENABLE) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Disabling DPLL %s\n",
+ if (!crtc->enabled) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Disabling CRTC %s\n",
pipe_name);
- OUTREG(dpll_reg, dpll & ~DPLL_VCO_ENABLE);
+ crtc->funcs->dpms(crtc, DPMSModeOff);
}
memset(&crtc->curMode, 0, sizeof(crtc->curMode));
More information about the xorg-commit
mailing list