summaryrefslogtreecommitdiff
path: root/src/i830_dvo.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2006-10-04 15:00:19 -0700
committerEric Anholt <eric@anholt.net>2006-10-04 18:48:17 -0700
commit103b4edce7859ddf58f3e1fadeb427a5e85c7acd (patch)
tree3907bea3aa233a1587d075fe81bd515d8d5fa4c5 /src/i830_dvo.c
parent3e6f81f70f65a5ba6b5c3a4e0eeaf67776a5f54d (diff)
Move the save, restore, and DPMS per-output settings to per-output files.
Diffstat (limited to 'src/i830_dvo.c')
-rw-r--r--src/i830_dvo.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/i830_dvo.c b/src/i830_dvo.c
index 242e3dd0..f64a8e85 100644
--- a/src/i830_dvo.c
+++ b/src/i830_dvo.c
@@ -54,6 +54,51 @@ struct _I830DVODriver i830_dvo_drivers[] =
#define I830_NUM_DVO_DRIVERS (sizeof(i830_dvo_drivers)/sizeof(struct _I830DVODriver))
+void
+I830DVODPMS(ScrnInfoPtr pScrn, I830OutputPtr output, int mode)
+{
+ if (output->i2c_drv == NULL)
+ return;
+
+ if (mode == DPMSModeOn)
+ output->i2c_drv->vid_rec->Power(output->i2c_drv->dev_priv, TRUE);
+ else
+ output->i2c_drv->vid_rec->Power(output->i2c_drv->dev_priv, FALSE);
+}
+
+void
+I830DVOSave(ScrnInfoPtr pScrn, I830OutputPtr output)
+{
+ I830Ptr pI830 = I830PTR(pScrn);
+
+ if (output->i2c_drv == NULL)
+ return;
+
+ /* Each output should probably just save the registers it touches, but for
+ * now, use more overkill.
+ */
+ pI830->saveDVOA = INREG(DVOA);
+ pI830->saveDVOB = INREG(DVOB);
+ pI830->saveDVOC = INREG(DVOC);
+
+ output->i2c_drv->vid_rec->SaveRegs(output->i2c_drv->dev_priv);
+}
+
+void
+I830DVORestore(ScrnInfoPtr pScrn, I830OutputPtr output)
+{
+ I830Ptr pI830 = I830PTR(pScrn);
+
+ if (output->i2c_drv == NULL)
+ return;
+
+ OUTREG(DVOA, pI830->saveDVOA);
+ OUTREG(DVOB, pI830->saveDVOB);
+ OUTREG(DVOC, pI830->saveDVOC);
+
+ output->i2c_drv->vid_rec->RestoreRegs(output->i2c_drv->dev_priv);
+}
+
Bool
I830I2CDetectDVOControllers(ScrnInfoPtr pScrn, I2CBusPtr pI2CBus,
struct _I830DVODriver **retdrv)