Commit 305b3bb5 authored by Lucas De Marchi's avatar Lucas De Marchi Committed by Chris Wilson

drm/i915/gt: rename wa_write_masked_or()

The use of "masked" in this function is due to its history. Once upon a
time it received a mask and a value as parameter. Since
commit eeec73f8 ("drm/i915/gt: Skip rmw for masked registers")
that is not true anymore and now there is a clear and a set parameter.
Depending on the case, that can still be thought as a mask and value,
but there are some subtle differences: what we clear doesn't need to be
the same bits we are setting, particularly when we are using masked
registers.

The fact that we also have "masked registers", i.e. registers whose mask
is stored in the upper 16 bits of the register, makes it even more
confusing, because "masked" in wa_write_masked_or() has little to do
with masked registers, but rather refers to the old mask parameter the
function received (that can also, but not exclusively, be used to write
to masked register).

Avoid the ambiguity and misnomer by renaming it to something else,
hopefully less confusing: wa_write_clr_set(), to designate that we are
doing both clr and set operations in the register.
Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20201209045246.2905675-2-lucas.demarchi@intel.com
parent 61b3b0d1
...@@ -194,7 +194,7 @@ static void wa_add(struct i915_wa_list *wal, i915_reg_t reg, ...@@ -194,7 +194,7 @@ static void wa_add(struct i915_wa_list *wal, i915_reg_t reg,
} }
static void static void
wa_write_masked_or(struct i915_wa_list *wal, i915_reg_t reg, u32 clear, u32 set) wa_write_clr_set(struct i915_wa_list *wal, i915_reg_t reg, u32 clear, u32 set)
{ {
wa_add(wal, reg, clear, set, clear); wa_add(wal, reg, clear, set, clear);
} }
...@@ -202,19 +202,19 @@ wa_write_masked_or(struct i915_wa_list *wal, i915_reg_t reg, u32 clear, u32 set) ...@@ -202,19 +202,19 @@ wa_write_masked_or(struct i915_wa_list *wal, i915_reg_t reg, u32 clear, u32 set)
static void static void
wa_write(struct i915_wa_list *wal, i915_reg_t reg, u32 set) wa_write(struct i915_wa_list *wal, i915_reg_t reg, u32 set)
{ {
wa_write_masked_or(wal, reg, ~0, set); wa_write_clr_set(wal, reg, ~0, set);
} }
static void static void
wa_write_or(struct i915_wa_list *wal, i915_reg_t reg, u32 set) wa_write_or(struct i915_wa_list *wal, i915_reg_t reg, u32 set)
{ {
wa_write_masked_or(wal, reg, set, set); wa_write_clr_set(wal, reg, set, set);
} }
static void static void
wa_write_clr(struct i915_wa_list *wal, i915_reg_t reg, u32 clr) wa_write_clr(struct i915_wa_list *wal, i915_reg_t reg, u32 clr)
{ {
wa_write_masked_or(wal, reg, clr, 0); wa_write_clr_set(wal, reg, clr, 0);
} }
static void static void
...@@ -603,7 +603,7 @@ static void icl_ctx_workarounds_init(struct intel_engine_cs *engine, ...@@ -603,7 +603,7 @@ static void icl_ctx_workarounds_init(struct intel_engine_cs *engine,
GEN11_BLEND_EMB_FIX_DISABLE_IN_RCC); GEN11_BLEND_EMB_FIX_DISABLE_IN_RCC);
/* WaEnableFloatBlendOptimization:icl */ /* WaEnableFloatBlendOptimization:icl */
wa_write_masked_or(wal, wa_write_clr_set(wal,
GEN10_CACHE_MODE_SS, GEN10_CACHE_MODE_SS,
0, /* write-only, so skip validation */ 0, /* write-only, so skip validation */
_MASKED_BIT_ENABLE(FLOAT_BLEND_OPTIMIZATION_ENABLE)); _MASKED_BIT_ENABLE(FLOAT_BLEND_OPTIMIZATION_ENABLE));
...@@ -619,7 +619,7 @@ static void icl_ctx_workarounds_init(struct intel_engine_cs *engine, ...@@ -619,7 +619,7 @@ static void icl_ctx_workarounds_init(struct intel_engine_cs *engine,
/* Wa_1604278689:icl,ehl */ /* Wa_1604278689:icl,ehl */
wa_write(wal, IVB_FBC_RT_BASE, 0xFFFFFFFF & ~ILK_FBC_RT_VALID); wa_write(wal, IVB_FBC_RT_BASE, 0xFFFFFFFF & ~ILK_FBC_RT_VALID);
wa_write_masked_or(wal, IVB_FBC_RT_BASE_UPPER, wa_write_clr_set(wal, IVB_FBC_RT_BASE_UPPER,
0, /* write-only register; skip validation */ 0, /* write-only register; skip validation */
0xFFFFFFFF); 0xFFFFFFFF);
...@@ -881,7 +881,7 @@ ivb_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal) ...@@ -881,7 +881,7 @@ ivb_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
* This actually overrides the dispatch * This actually overrides the dispatch
* mode for all thread types. * mode for all thread types.
*/ */
wa_write_masked_or(wal, GEN7_FF_THREAD_MODE, wa_write_clr_set(wal, GEN7_FF_THREAD_MODE,
GEN7_FF_SCHED_MASK, GEN7_FF_SCHED_MASK,
GEN7_FF_TS_SCHED_HW | GEN7_FF_TS_SCHED_HW |
GEN7_FF_VS_SCHED_HW | GEN7_FF_VS_SCHED_HW |
...@@ -933,7 +933,7 @@ vlv_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal) ...@@ -933,7 +933,7 @@ vlv_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
* This actually overrides the dispatch * This actually overrides the dispatch
* mode for all thread types. * mode for all thread types.
*/ */
wa_write_masked_or(wal, wa_write_clr_set(wal,
GEN7_FF_THREAD_MODE, GEN7_FF_THREAD_MODE,
GEN7_FF_SCHED_MASK, GEN7_FF_SCHED_MASK,
GEN7_FF_TS_SCHED_HW | GEN7_FF_TS_SCHED_HW |
...@@ -1172,7 +1172,7 @@ wa_init_mcr(struct drm_i915_private *i915, struct i915_wa_list *wal) ...@@ -1172,7 +1172,7 @@ wa_init_mcr(struct drm_i915_private *i915, struct i915_wa_list *wal)
drm_dbg(&i915->drm, "MCR slice/subslice = %x\n", mcr); drm_dbg(&i915->drm, "MCR slice/subslice = %x\n", mcr);
wa_write_masked_or(wal, GEN8_MCR_SELECTOR, mcr_mask, mcr); wa_write_clr_set(wal, GEN8_MCR_SELECTOR, mcr_mask, mcr);
} }
static void static void
...@@ -1197,7 +1197,7 @@ icl_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal) ...@@ -1197,7 +1197,7 @@ icl_gt_workarounds_init(struct drm_i915_private *i915, struct i915_wa_list *wal)
GAMT_ECO_ENABLE_IN_PLACE_DECOMPRESS); GAMT_ECO_ENABLE_IN_PLACE_DECOMPRESS);
/* WaModifyGamTlbPartitioning:icl */ /* WaModifyGamTlbPartitioning:icl */
wa_write_masked_or(wal, wa_write_clr_set(wal,
GEN11_GACB_PERF_CTRL, GEN11_GACB_PERF_CTRL,
GEN11_HASH_CTRL_MASK, GEN11_HASH_CTRL_MASK,
GEN11_HASH_CTRL_BIT0 | GEN11_HASH_CTRL_BIT4); GEN11_HASH_CTRL_BIT0 | GEN11_HASH_CTRL_BIT4);
...@@ -1844,11 +1844,11 @@ rcs_engine_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal) ...@@ -1844,11 +1844,11 @@ rcs_engine_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal)
* Wa_1604223664:icl * Wa_1604223664:icl
* Formerly known as WaL3BankAddressHashing * Formerly known as WaL3BankAddressHashing
*/ */
wa_write_masked_or(wal, wa_write_clr_set(wal,
GEN8_GARBCNTL, GEN8_GARBCNTL,
GEN11_HASH_CTRL_EXCL_MASK, GEN11_HASH_CTRL_EXCL_MASK,
GEN11_HASH_CTRL_EXCL_BIT0); GEN11_HASH_CTRL_EXCL_BIT0);
wa_write_masked_or(wal, wa_write_clr_set(wal,
GEN11_GLBLINVL, GEN11_GLBLINVL,
GEN11_BANK_HASH_ADDR_EXCL_MASK, GEN11_BANK_HASH_ADDR_EXCL_MASK,
GEN11_BANK_HASH_ADDR_EXCL_BIT0); GEN11_BANK_HASH_ADDR_EXCL_BIT0);
...@@ -1880,7 +1880,7 @@ rcs_engine_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal) ...@@ -1880,7 +1880,7 @@ rcs_engine_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal)
GEN7_DISABLE_SAMPLER_PREFETCH); GEN7_DISABLE_SAMPLER_PREFETCH);
/* Wa_1409178092:icl */ /* Wa_1409178092:icl */
wa_write_masked_or(wal, wa_write_clr_set(wal,
GEN11_SCRATCH2, GEN11_SCRATCH2,
GEN11_COHERENT_PARTIAL_WRITE_MERGE_ENABLE, GEN11_COHERENT_PARTIAL_WRITE_MERGE_ENABLE,
0); 0);
...@@ -1957,7 +1957,7 @@ rcs_engine_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal) ...@@ -1957,7 +1957,7 @@ rcs_engine_wa_init(struct intel_engine_cs *engine, struct i915_wa_list *wal)
/* WaProgramL3SqcReg1DefaultForPerf:bxt,glk */ /* WaProgramL3SqcReg1DefaultForPerf:bxt,glk */
if (IS_GEN9_LP(i915)) if (IS_GEN9_LP(i915))
wa_write_masked_or(wal, wa_write_clr_set(wal,
GEN8_L3SQCREG1, GEN8_L3SQCREG1,
L3_PRIO_CREDITS_MASK, L3_PRIO_CREDITS_MASK,
L3_GENERAL_PRIO_CREDITS(62) | L3_GENERAL_PRIO_CREDITS(62) |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment