[Intel-gfx] [PATCH 06/11] drm/i915: Save all MMIO WAs and apply them at a later time
Joonas Lahtinen
joonas.lahtinen at linux.intel.com
Thu Oct 12 10:35:10 UTC 2017
On Wed, 2017-10-11 at 11:15 -0700, Oscar Mateo wrote:
> By doing this, we can dump these workarounds in debugfs for
> validation (which,
> at the moment, we are only able to do for the contexts WAs).
>
> v2:
> - Wrong macro used for MMIO set bit masked
> - Improved naming
> - Rebased
>
> Signed-off-by: Oscar Mateo <oscar.mateo at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala at linux.intel.com>
<SNIP>
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1960,12 +1960,16 @@ struct i915_wa_reg {
> u32 mask;
> };
>
> -#define I915_MAX_WA_REGS 16
> +#define I915_MAX_CTX_WA_REGS 16
> +#define I915_MAX_MMIO_WA_REGS 32
>
> struct i915_workarounds {
> - struct i915_wa_reg ctx_wa_reg[I915_MAX_WA_REGS];
> + struct i915_wa_reg ctx_wa_reg[I915_MAX_CTX_WA_REGS];
> u32 ctx_wa_count;
>
> + struct i915_wa_reg mmio_wa_reg[I915_MAX_MMIO_WA_REGS];
> + u32 mmio_wa_count;
> +
> u32 hw_whitelist_count[I915_NUM_ENGINES];
> };
Could we instead consider a constant structure with platform bitmasks?
If that's not dynamic enough, then a bitmap which is initialized by the
platform bitmasks as a default. So instead of running code to add to
list, make it bit more declarative. Pseudo-code;
struct i915_workaround {
u16 gen_mask;
enum {
I915_WA_CTX,
I915_WA_MMIO,
I915_WA_WHITELIST,
} type;
u32 reg;
}
... elsewhere in .c file
static const struct i915_workaround i915_workarounds[] = { {
/* WaSomethingSomewhereUMDFoo:skl */
.gen_mask = INTEL_GEN_MASK(X, Y),
.type = I915_WA_CTX,
.reg = ...
} };
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
More information about the Intel-gfx
mailing list