aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_drv.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2013-01-25 14:44:47 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-01-31 05:50:13 -0500
commitfe31b574fb2563f3aaa24dec302ddd0a033cda0f (patch)
tree5ca80fd131f521992de67479f1882d7a98028167 /drivers/gpu/drm/i915/i915_drv.c
parent766aa1c42362eafc53f5939cd3f83113e9d062ed (diff)
drm/i915: Kill IS_DISPLAYREG()
All display registers should now include the proper offset on VLV. That means IS_DISPLAYREG() is now useless, and we can eliminate it. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.c')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.c104
1 files changed, 1 insertions, 103 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 9cc8f8780cf8..d159d7a402e9 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1119,102 +1119,6 @@ MODULE_LICENSE("GPL and additional rights");
1119 ((HAS_FORCE_WAKE((dev_priv)->dev)) && \ 1119 ((HAS_FORCE_WAKE((dev_priv)->dev)) && \
1120 ((reg) < 0x40000) && \ 1120 ((reg) < 0x40000) && \
1121 ((reg) != FORCEWAKE)) 1121 ((reg) != FORCEWAKE))
1122
1123static bool IS_DISPLAYREG(u32 reg)
1124{
1125 /*
1126 * This should make it easier to transition modules over to the
1127 * new register block scheme, since we can do it incrementally.
1128 */
1129 if (reg >= VLV_DISPLAY_BASE)
1130 return false;
1131
1132 if (reg >= RENDER_RING_BASE &&
1133 reg < RENDER_RING_BASE + 0xff)
1134 return false;
1135 if (reg >= GEN6_BSD_RING_BASE &&
1136 reg < GEN6_BSD_RING_BASE + 0xff)
1137 return false;
1138 if (reg >= BLT_RING_BASE &&
1139 reg < BLT_RING_BASE + 0xff)
1140 return false;
1141
1142 if (reg == PGTBL_ER)
1143 return false;
1144
1145 if (reg >= IPEIR_I965 &&
1146 reg < HWSTAM)
1147 return false;
1148
1149 if (reg == MI_MODE)
1150 return false;
1151
1152 if (reg == GFX_MODE_GEN7)
1153 return false;
1154
1155 if (reg == RENDER_HWS_PGA_GEN7 ||
1156 reg == BSD_HWS_PGA_GEN7 ||
1157 reg == BLT_HWS_PGA_GEN7)
1158 return false;
1159
1160 if (reg == GEN6_BSD_SLEEP_PSMI_CONTROL ||
1161 reg == GEN6_BSD_RNCID)
1162 return false;
1163
1164 if (reg == GEN6_BLITTER_ECOSKPD)
1165 return false;
1166
1167 if (reg >= 0x4000c &&
1168 reg <= 0x4002c)
1169 return false;
1170
1171 if (reg >= 0x4f000 &&
1172 reg <= 0x4f08f)
1173 return false;
1174
1175 if (reg >= 0x4f100 &&
1176 reg <= 0x4f11f)
1177 return false;
1178
1179 if (reg >= VLV_MASTER_IER &&
1180 reg <= GEN6_PMIER)
1181 return false;
1182
1183 if (reg >= FENCE_REG_SANDYBRIDGE_0 &&
1184 reg < (FENCE_REG_SANDYBRIDGE_0 + (16*8)))
1185 return false;
1186
1187 if (reg >= VLV_IIR_RW &&
1188 reg <= VLV_ISR)
1189 return false;
1190
1191 if (reg == FORCEWAKE_VLV ||
1192 reg == FORCEWAKE_ACK_VLV)
1193 return false;
1194
1195 if (reg == GEN6_GDRST)
1196 return false;
1197
1198 switch (reg) {
1199 case _3D_CHICKEN3:
1200 case IVB_CHICKEN3:
1201 case GEN7_COMMON_SLICE_CHICKEN1:
1202 case GEN7_L3CNTLREG1:
1203 case GEN7_L3_CHICKEN_MODE_REGISTER:
1204 case GEN7_ROW_CHICKEN2:
1205 case GEN7_L3SQCREG4:
1206 case GEN7_SQ_CHICKEN_MBCUNIT_CONFIG:
1207 case GEN7_HALF_SLICE_CHICKEN1:
1208 case GEN6_MBCTL:
1209 case GEN6_UCGCTL2:
1210 return false;
1211 default:
1212 break;
1213 }
1214
1215 return true;
1216}
1217
1218static void 1122static void
1219ilk_dummy_write(struct drm_i915_private *dev_priv) 1123ilk_dummy_write(struct drm_i915_private *dev_priv)
1220{ 1124{
@@ -1238,8 +1142,6 @@ u##x i915_read##x(struct drm_i915_private *dev_priv, u32 reg) { \
1238 if (dev_priv->forcewake_count == 0) \ 1142 if (dev_priv->forcewake_count == 0) \
1239 dev_priv->gt.force_wake_put(dev_priv); \ 1143 dev_priv->gt.force_wake_put(dev_priv); \
1240 spin_unlock_irqrestore(&dev_priv->gt_lock, irqflags); \ 1144 spin_unlock_irqrestore(&dev_priv->gt_lock, irqflags); \
1241 } else if (IS_VALLEYVIEW(dev_priv->dev) && IS_DISPLAYREG(reg)) { \
1242 val = read##y(dev_priv->regs + reg + 0x180000); \
1243 } else { \ 1145 } else { \
1244 val = read##y(dev_priv->regs + reg); \ 1146 val = read##y(dev_priv->regs + reg); \
1245 } \ 1147 } \
@@ -1266,11 +1168,7 @@ void i915_write##x(struct drm_i915_private *dev_priv, u32 reg, u##x val) { \
1266 DRM_ERROR("Unknown unclaimed register before writing to %x\n", reg); \ 1168 DRM_ERROR("Unknown unclaimed register before writing to %x\n", reg); \
1267 I915_WRITE_NOTRACE(GEN7_ERR_INT, ERR_INT_MMIO_UNCLAIMED); \ 1169 I915_WRITE_NOTRACE(GEN7_ERR_INT, ERR_INT_MMIO_UNCLAIMED); \
1268 } \ 1170 } \
1269 if (IS_VALLEYVIEW(dev_priv->dev) && IS_DISPLAYREG(reg)) { \ 1171 write##y(val, dev_priv->regs + reg); \
1270 write##y(val, dev_priv->regs + reg + 0x180000); \
1271 } else { \
1272 write##y(val, dev_priv->regs + reg); \
1273 } \
1274 if (unlikely(__fifo_ret)) { \ 1172 if (unlikely(__fifo_ret)) { \
1275 gen6_gt_check_fifodbg(dev_priv); \ 1173 gen6_gt_check_fifodbg(dev_priv); \
1276 } \ 1174 } \