summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <anholt@FreeBSD.org>2006-02-27 13:08:46 -0800
committerEric Anholt <anholt@leguin.anholt.net>2006-04-06 15:52:34 -0700
commit767944e3782f9941e9fc72a6705cc3115a6e24ac (patch)
treee9cc738be9029325c3a086624be748d6b2a98dbf /src
parent4955cd267e7f8ed70e90b2a3de6f93de2ef859c8 (diff)
Replace a few magic numbers with symbolic names. Reviewed by md5.
Diffstat (limited to 'src')
-rw-r--r--src/i810_reg.h7
-rw-r--r--src/i830_driver.c32
2 files changed, 24 insertions, 15 deletions
diff --git a/src/i810_reg.h b/src/i810_reg.h
index 8afe855d..7af23e73 100644
--- a/src/i810_reg.h
+++ b/src/i810_reg.h
@@ -658,6 +658,12 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define PIPEBSRC 0x6101c
#define BCLRPAT_B 0x61020
+#define PP_STATUS 0x61200
+# define PP_ON (1 << 31)
+
+#define PP_CONTROL 0x61204
+# define POWER_TARGET_ON (1 << 0)
+
#define DPLL_A 0x06014
#define DPLL_B 0x06018
# define DPLL_VCO_ENABLE (1 << 31)
@@ -736,6 +742,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define DVOC_SRCDIM 0x61164
#define LVDS 0x61180
+# define LVDS_PORT_EN (1 << 31)
#define PIPEACONF 0x70008
#define PIPEACONF_ENABLE (1<<31)
diff --git a/src/i830_driver.c b/src/i830_driver.c
index b1beafd0..b7d13225 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1061,36 +1061,38 @@ SetDisplayDevices(ScrnInfoPtr pScrn, int devices)
/* Disable LVDS */
if (singlepipe & PIPE_LFP) {
/* LFP on PipeA is unlikely! */
- OUTREG(0x61200, INREG(0x61200) & ~0x80000000);
- OUTREG(0x61204, INREG(0x61204) & ~0x00000001);
- while ((INREG(0x61200) & 0x80000000) || (INREG(0x61204) & 1));
+ OUTREG(PP_STATUS, INREG(PP_STATUS) & ~PP_ON);
+ OUTREG(PP_CONTROL, INREG(PP_CONTROL) & ~POWER_TARGET_ON);
+ while ((INREG(PP_STATUS) & PP_ON) || (INREG(PP_CONTROL) & 1));
/* Fix up LVDS */
OUTREG(LVDS, (INREG(LVDS) & ~1<<30) | 0x80000300);
/* Enable LVDS */
- OUTREG(0x61200, INREG(0x61200) | 0x80000000);
- OUTREG(0x61204, INREG(0x61204) | 0x00000001);
- while (!(INREG(0x61200) & 0x80000000) && !(INREG(0x61204) & 1));
+ OUTREG(PP_STATUS, INREG(PP_STATUS) | PP_ON);
+ OUTREG(PP_CONTROL, INREG(PP_CONTROL) | POWER_TARGET_ON);
+ while (!(INREG(PP_STATUS) & PP_ON) && !(INREG(PP_CONTROL) & 1));
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Enabling LVDS directly. Pipe A.\n");
} else
if (singlepipe & (PIPE_LFP << 8)) {
- OUTREG(0x61200, INREG(0x61200) & ~0x80000000);
- OUTREG(0x61204, INREG(0x61204) & ~0x00000001);
- while ((INREG(0x61200) & 0x80000000) || (INREG(0x61204) & 1));
+ OUTREG(PP_STATUS, INREG(PP_STATUS) & ~PP_ON);
+ OUTREG(PP_CONTROL, INREG(PP_CONTROL) & ~POWER_TARGET_ON);
+ while ((INREG(PP_STATUS) & PP_ON) || (INREG(PP_CONTROL) & 1));
/* Fix up LVDS */
OUTREG(LVDS, (INREG(LVDS) | 1<<30) | 0x80000300);
/* Enable LVDS */
- OUTREG(0x61200, INREG(0x61200) | 0x80000000);
- OUTREG(0x61204, INREG(0x61204) | 0x00000001);
- while (!(INREG(0x61200) & 0x80000000) && !(INREG(0x61204) & 1));
+ OUTREG(PP_STATUS, INREG(PP_STATUS) | PP_ON);
+ OUTREG(PP_CONTROL, INREG(PP_CONTROL) | POWER_TARGET_ON);
+ while (!(INREG(PP_STATUS) & PP_ON) &&
+ !(INREG(PP_CONTROL) & POWER_TARGET_ON));
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Enabling LVDS directly. Pipe B.\n");
}
else if (!(IS_I830(pI830) || IS_845G(pI830) || IS_I865G(pI830))) {
if (!(devices & (PIPE_LFP | PIPE_LFP<<8))) {
- OUTREG(0x61200, INREG(0x61200) & ~0x80000000);
- OUTREG(0x61204, INREG(0x61204) & ~0x00000001);
- while ((INREG(0x61200) & 0x80000000) || (INREG(0x61204) & 1));
+ OUTREG(PP_STATUS, INREG(PP_STATUS) & ~PP_ON);
+ OUTREG(PP_CONTROL, INREG(PP_CONTROL) & ~POWER_TARGET_ON);
+ while ((INREG(PP_STATUS) & PP_ON) ||
+ (INREG(PP_CONTROL) & POWER_TARGET_ON));
/* Fix up LVDS */
OUTREG(LVDS, (INREG(LVDS) | 1<<30) & ~0x80000300);
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,