Skip to content

Commit 6a8b2e4

Browse files
lucasdemarchijnikula
authored andcommitted
drm/i915: Fix GEN8_MISCCPCTL
Register 0x9424 is not replicated on any platform, so it shouldn't be declared with REG_MCR(). Declaring it with _MMIO() is basically duplicate of the GEN7 version, so just remove the GEN8 and change all the callers to use the right functions. Old versions of the gen8 bspec page used to contain a table with MCR registers, apparently implying 0x9400 - 0x94ff registers were replicated. However that table went away and there is no information related to the ranges for gen8 anymore. Moreover the current behavior of the driver wouldn't do anything special for 0x9424 since there is no equivalent table in intel_gt_mcr.c: the driver would just fallback to intel_uncore_{read,write}(). Therefore, do not care about the possible special case for gen8 and just use the register as non-MCR for all the platforms. One place doing read + write is also converted to intel_uncore_rmw(). v2: Reword commit message adding the justification wrt gen8 Fixes: a9e6942 ("drm/i915: Define MCR registers explicitly") Cc: Balasubramani Vivekanandan <[email protected]> Cc: Rodrigo Vivi <[email protected]> Cc: Gustavo Sousa <[email protected]> Cc: Matt Atwood <[email protected]> Cc: Ashutosh Dixit <[email protected]> Signed-off-by: Lucas De Marchi <[email protected]> Reviewed-by: Matt Roper <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 869bace) Signed-off-by: Jani Nikula <[email protected]>
1 parent effc090 commit 6a8b2e4

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
lines changed

drivers/gpu/drm/i915/gt/intel_gt_regs.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -686,10 +686,7 @@
686686
#define GEN6_RSTCTL _MMIO(0x9420)
687687

688688
#define GEN7_MISCCPCTL _MMIO(0x9424)
689-
#define GEN7_DOP_CLOCK_GATE_ENABLE (1 << 0)
690-
691-
#define GEN8_MISCCPCTL MCR_REG(0x9424)
692-
#define GEN8_DOP_CLOCK_GATE_ENABLE REG_BIT(0)
689+
#define GEN7_DOP_CLOCK_GATE_ENABLE REG_BIT(0)
693690
#define GEN12_DOP_CLOCK_GATE_RENDER_ENABLE REG_BIT(1)
694691
#define GEN8_DOP_CLOCK_GATE_CFCLK_ENABLE (1 << 2)
695692
#define GEN8_DOP_CLOCK_GATE_GUC_ENABLE (1 << 4)

drivers/gpu/drm/i915/gt/intel_workarounds.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1682,7 +1682,7 @@ dg2_gt_workarounds_init(struct intel_gt *gt, struct i915_wa_list *wal)
16821682
wa_mcr_write_or(wal, XEHP_SQCM, EN_32B_ACCESS);
16831683

16841684
/* Wa_14015795083 */
1685-
wa_mcr_write_clr(wal, GEN8_MISCCPCTL, GEN12_DOP_CLOCK_GATE_RENDER_ENABLE);
1685+
wa_write_clr(wal, GEN7_MISCCPCTL, GEN12_DOP_CLOCK_GATE_RENDER_ENABLE);
16861686

16871687
/* Wa_18018781329 */
16881688
wa_mcr_write_or(wal, RENDER_MOD_CTRL, FORCE_MISS_FTLB);
@@ -1701,7 +1701,7 @@ pvc_gt_workarounds_init(struct intel_gt *gt, struct i915_wa_list *wal)
17011701
pvc_init_mcr(gt, wal);
17021702

17031703
/* Wa_14015795083 */
1704-
wa_mcr_write_clr(wal, GEN8_MISCCPCTL, GEN12_DOP_CLOCK_GATE_RENDER_ENABLE);
1704+
wa_write_clr(wal, GEN7_MISCCPCTL, GEN12_DOP_CLOCK_GATE_RENDER_ENABLE);
17051705

17061706
/* Wa_18018781329 */
17071707
wa_mcr_write_or(wal, RENDER_MOD_CTRL, FORCE_MISS_FTLB);

drivers/gpu/drm/i915/gt/uc/intel_guc_fw.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,8 @@ static void guc_prepare_xfer(struct intel_gt *gt)
3939

4040
if (GRAPHICS_VER(uncore->i915) == 9) {
4141
/* DOP Clock Gating Enable for GuC clocks */
42-
intel_gt_mcr_multicast_write(gt, GEN8_MISCCPCTL,
43-
GEN8_DOP_CLOCK_GATE_GUC_ENABLE |
44-
intel_gt_mcr_read_any(gt, GEN8_MISCCPCTL));
42+
intel_uncore_rmw(uncore, GEN7_MISCCPCTL, 0,
43+
GEN8_DOP_CLOCK_GATE_GUC_ENABLE);
4544

4645
/* allows for 5us (in 10ns units) before GT can go to RC6 */
4746
intel_uncore_write(uncore, GUC_ARAT_C6DIS, 0x1FF);

drivers/gpu/drm/i915/intel_pm.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4300,8 +4300,8 @@ static void gen8_set_l3sqc_credits(struct drm_i915_private *dev_priv,
43004300
u32 val;
43014301

43024302
/* WaTempDisableDOPClkGating:bdw */
4303-
misccpctl = intel_gt_mcr_multicast_rmw(to_gt(dev_priv), GEN8_MISCCPCTL,
4304-
GEN8_DOP_CLOCK_GATE_ENABLE, 0);
4303+
misccpctl = intel_uncore_rmw(&dev_priv->uncore, GEN7_MISCCPCTL,
4304+
GEN7_DOP_CLOCK_GATE_ENABLE, 0);
43054305

43064306
val = intel_gt_mcr_read_any(to_gt(dev_priv), GEN8_L3SQCREG1);
43074307
val &= ~L3_PRIO_CREDITS_MASK;
@@ -4315,7 +4315,7 @@ static void gen8_set_l3sqc_credits(struct drm_i915_private *dev_priv,
43154315
*/
43164316
intel_gt_mcr_read_any(to_gt(dev_priv), GEN8_L3SQCREG1);
43174317
udelay(1);
4318-
intel_gt_mcr_multicast_write(to_gt(dev_priv), GEN8_MISCCPCTL, misccpctl);
4318+
intel_uncore_write(&dev_priv->uncore, GEN7_MISCCPCTL, misccpctl);
43194319
}
43204320

43214321
static void icl_init_clock_gating(struct drm_i915_private *dev_priv)
@@ -4466,8 +4466,8 @@ static void skl_init_clock_gating(struct drm_i915_private *dev_priv)
44664466
gen9_init_clock_gating(dev_priv);
44674467

44684468
/* WaDisableDopClockGating:skl */
4469-
intel_gt_mcr_multicast_rmw(to_gt(dev_priv), GEN8_MISCCPCTL,
4470-
GEN8_DOP_CLOCK_GATE_ENABLE, 0);
4469+
intel_uncore_rmw(&dev_priv->uncore, GEN7_MISCCPCTL,
4470+
GEN7_DOP_CLOCK_GATE_ENABLE, 0);
44714471

44724472
/* WAC6entrylatency:skl */
44734473
intel_uncore_rmw(&dev_priv->uncore, FBC_LLC_READ_CTRL, 0, FBC_LLC_FULLY_OPEN);

0 commit comments

Comments
 (0)