summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-03-13 10:21:06 -0700
committerEric Anholt <eric@anholt.net>2007-03-13 16:59:38 -0700
commit5135b3a79f9c30ebce78c84c49846bba83607fed (patch)
tree8ea1d50eda1059e9b7fc93490dc9c501500a0f2e /src
parent578da7ca705c5a58c0bd397b0831e2f95140f8ae (diff)
Use a POSTING_READ(reg) macro instead of using the (void)INREG(reg) pattern.
Diffstat (limited to 'src')
-rw-r--r--src/common.h1
-rw-r--r--src/i830_display.c28
-rw-r--r--src/i830_i2c.c2
-rw-r--r--src/i830_sdvo.c4
4 files changed, 18 insertions, 17 deletions
diff --git a/src/common.h b/src/common.h
index f596eb87..a6348950 100644
--- a/src/common.h
+++ b/src/common.h
@@ -233,6 +233,7 @@ union intfloat {
#define INREG8(addr) *(volatile CARD8 *)(RecPtr->MMIOBase + (addr))
#define INREG16(addr) *(volatile CARD16 *)(RecPtr->MMIOBase + (addr))
#define INREG(addr) *(volatile CARD32 *)(RecPtr->MMIOBase + (addr))
+#define POSTING_READ(addr) (void)INREG(addr)
#define OUTREG8(addr, val) do { \
*(volatile CARD8 *)(RecPtr->MMIOBase + (addr)) = (val); \
diff --git a/src/i830_display.c b/src/i830_display.c
index e5390b38..a5d8df84 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -383,12 +383,12 @@ i830PipeSetBase(xf86CrtcPtr crtc, int x, int y)
if (IS_I965G(pI830)) {
OUTREG(dspbase, Offset);
- (void) INREG(dspbase);
+ POSTING_READ(dspbase);
OUTREG(dspsurf, Start);
- (void) INREG(dspsurf);
+ POSTING_READ(dspsurf);
} else {
OUTREG(dspbase, Start + Offset);
- (void) INREG(dspbase);
+ POSTING_READ(dspbase);
}
#ifdef XF86DRI
@@ -447,15 +447,15 @@ i830_crtc_dpms(xf86CrtcPtr crtc, int mode)
if ((temp & DPLL_VCO_ENABLE) == 0)
{
OUTREG(dpll_reg, temp);
- (void)INREG(dpll_reg);
+ POSTING_READ(dpll_reg);
/* Wait for the clocks to stabilize. */
usleep(150);
OUTREG(dpll_reg, temp | DPLL_VCO_ENABLE);
- (void)INREG(dpll_reg);
+ POSTING_READ(dpll_reg);
/* Wait for the clocks to stabilize. */
usleep(150);
OUTREG(dpll_reg, temp | DPLL_VCO_ENABLE);
- (void)INREG(dpll_reg);
+ POSTING_READ(dpll_reg);
/* Wait for the clocks to stabilize. */
usleep(150);
}
@@ -493,7 +493,7 @@ i830_crtc_dpms(xf86CrtcPtr crtc, int mode)
OUTREG(dspcntr_reg, temp & ~DISPLAY_PLANE_ENABLE);
/* Flush the plane changes */
OUTREG(dspbase_reg, INREG(dspbase_reg));
- (void)INREG(dspbase_reg);
+ POSTING_READ(dspbase_reg);
}
if (!IS_I9XX(pI830)) {
@@ -505,7 +505,7 @@ i830_crtc_dpms(xf86CrtcPtr crtc, int mode)
temp = INREG(pipeconf_reg);
if ((temp & PIPEACONF_ENABLE) != 0) {
OUTREG(pipeconf_reg, temp & ~PIPEACONF_ENABLE);
- (void)INREG(pipeconf_reg);
+ POSTING_READ(pipeconf_reg);
}
/* Wait for vblank for the disable to take effect. */
@@ -514,7 +514,7 @@ i830_crtc_dpms(xf86CrtcPtr crtc, int mode)
temp = INREG(dpll_reg);
if ((temp & DPLL_VCO_ENABLE) != 0) {
OUTREG(dpll_reg, temp & ~DPLL_VCO_ENABLE);
- (void)INREG(dpll_reg);
+ POSTING_READ(dpll_reg);
}
/* Wait for the clocks to turn off. */
@@ -876,7 +876,7 @@ i830_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
{
OUTREG(fp_reg, fp);
OUTREG(dpll_reg, dpll & ~DPLL_VCO_ENABLE);
- (void)INREG(dpll_reg);
+ POSTING_READ(dpll_reg);
usleep(150);
}
@@ -887,12 +887,12 @@ i830_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
* things on.
*/
OUTREG(LVDS, INREG(LVDS) | LVDS_PORT_EN | LVDS_PIPEB_SELECT);
- (void)INREG(LVDS);
+ POSTING_READ(LVDS);
}
OUTREG(fp_reg, fp);
OUTREG(dpll_reg, dpll);
- (void)INREG(dpll_reg);
+ POSTING_READ(dpll_reg);
/* Wait for the clocks to stabilize. */
usleep(150);
@@ -904,7 +904,7 @@ i830_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
/* write it again -- the BIOS does, after all */
OUTREG(dpll_reg, dpll);
}
- (void)INREG(dpll_reg);
+ POSTING_READ(dpll_reg);
/* Wait for the clocks to stabilize. */
usleep(150);
@@ -928,7 +928,7 @@ i830_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
OUTREG(dsppos_reg, 0);
OUTREG(pipesrc_reg, ((mode->HDisplay - 1) << 16) | (mode->VDisplay - 1));
OUTREG(pipeconf_reg, pipeconf);
- (void)INREG(pipeconf_reg);
+ POSTING_READ(pipeconf_reg);
i830WaitForVblank(pScrn);
OUTREG(dspcntr_reg, dspcntr);
diff --git a/src/i830_i2c.c b/src/i830_i2c.c
index 7fac63cd..319e8dab 100644
--- a/src/i830_i2c.c
+++ b/src/i830_i2c.c
@@ -336,7 +336,7 @@ i830I2CPutBits(I2CBusPtr b, int clock, int data)
clock_bits = GPIO_CLOCK_DIR_OUT|GPIO_CLOCK_DIR_MASK|GPIO_CLOCK_VAL_MASK;
OUTREG(b->DriverPrivate.uval, reserved | data_bits | clock_bits);
- (void)INREG(b->DriverPrivate.uval);
+ POSTING_READ(b->DriverPrivate.uval);
}
#endif
diff --git a/src/i830_sdvo.c b/src/i830_sdvo.c
index 4c543db4..cd0b115a 100644
--- a/src/i830_sdvo.c
+++ b/src/i830_sdvo.c
@@ -695,14 +695,14 @@ i830_sdvo_dpms(xf86OutputPtr output, int mode)
if ((temp & SDVO_ENABLE) == 0)
{
OUTREG(dev_priv->output_device, temp | SDVO_ENABLE);
- (void)INREG(dev_priv->output_device);
+ POSTING_READ(dev_priv->output_device);
#if 0
/* Do it again! If we remove this below register write, or the exact
* same one 2 lines up, the mac mini SDVO output doesn't turn on.
*/
OUTREG(dev_priv->output_device,
INREG(dev_priv->output_device) | SDVO_ENABLE);
- (void)INREG(dev_priv->output_device);
+ POSTING_READ(dev_priv->output_device);
#endif
}
for (i = 0; i < 2; i++)