From 3802c5cb209f6e2735c4ced7462b637a7e16bbf5 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Thu, 3 Aug 2017 17:58:09 +0100 Subject: [PATCH] drm/i915/perf: leave GDT_CHICKEN_BITS programming in configs Git-commit: 3802c5cb209f6e2735c4ced7462b637a7e16bbf5 Patch-mainline: v4.14-rc1 References: FATE#322643 bsc#1055900 There will be a need for userspaces configurations to set this register. We can apply the same model inside the kernel for test configs. Signed-off-by: Lionel Landwerlin Reviewed-by: Matthew Auld Link: https://patchwork.freedesktop.org/patch/msgid/20170803165812.2373-4-lionel.g.landwerlin@intel.com Acked-by: Takashi Iwai --- drivers/gpu/drm/i915/i915_oa_bdw.c | 2 ++ drivers/gpu/drm/i915/i915_oa_bxt.c | 1 + drivers/gpu/drm/i915/i915_oa_chv.c | 2 ++ drivers/gpu/drm/i915/i915_oa_glk.c | 1 + drivers/gpu/drm/i915/i915_oa_hsw.c | 1 + drivers/gpu/drm/i915/i915_oa_kblgt2.c | 1 + drivers/gpu/drm/i915/i915_oa_kblgt3.c | 1 + drivers/gpu/drm/i915/i915_oa_sklgt2.c | 1 + drivers/gpu/drm/i915/i915_oa_sklgt3.c | 1 + drivers/gpu/drm/i915/i915_oa_sklgt4.c | 1 + drivers/gpu/drm/i915/i915_perf.c | 7 ------- 11 files changed, 12 insertions(+), 7 deletions(-) --- a/drivers/gpu/drm/i915/i915_oa_bdw.c +++ b/drivers/gpu/drm/i915/i915_oa_bdw.c @@ -60,6 +60,7 @@ static const struct i915_oa_reg flex_eu_ }; static const struct i915_oa_reg mux_config_test_oa[] = { + { _MMIO(0x9840), 0x000000a0 }, { _MMIO(0x9888), 0x198b0000 }, { _MMIO(0x9888), 0x078b0066 }, { _MMIO(0x9888), 0x118b0000 }, @@ -72,6 +73,7 @@ static const struct i915_oa_reg mux_conf { _MMIO(0x9888), 0x4f800000 }, { _MMIO(0x9888), 0x41800000 }, { _MMIO(0x9888), 0x31800000 }, + { _MMIO(0x9840), 0x00000080 }, }; static ssize_t --- a/drivers/gpu/drm/i915/i915_oa_bxt.c +++ b/drivers/gpu/drm/i915/i915_oa_bxt.c @@ -60,6 +60,7 @@ static const struct i915_oa_reg flex_eu_ }; static const struct i915_oa_reg mux_config_test_oa[] = { + { _MMIO(0x9840), 0x00000080 }, { _MMIO(0x9888), 0x19800000 }, { _MMIO(0x9888), 0x07800063 }, { _MMIO(0x9888), 0x11800000 }, --- a/drivers/gpu/drm/i915/i915_oa_chv.c +++ b/drivers/gpu/drm/i915/i915_oa_chv.c @@ -60,6 +60,7 @@ static const struct i915_oa_reg flex_eu_ }; static const struct i915_oa_reg mux_config_test_oa[] = { + { _MMIO(0x9840), 0x000000a0 }, { _MMIO(0x9888), 0x59800000 }, { _MMIO(0x9888), 0x59800001 }, { _MMIO(0x9888), 0x338b0000 }, @@ -71,6 +72,7 @@ static const struct i915_oa_reg mux_conf { _MMIO(0x9888), 0x57800000 }, { _MMIO(0x1823a4), 0x00000000 }, { _MMIO(0x9888), 0x59800000 }, + { _MMIO(0x9840), 0x00000080 }, }; static ssize_t --- a/drivers/gpu/drm/i915/i915_oa_glk.c +++ b/drivers/gpu/drm/i915/i915_oa_glk.c @@ -60,6 +60,7 @@ static const struct i915_oa_reg flex_eu_ }; static const struct i915_oa_reg mux_config_test_oa[] = { + { _MMIO(0x9840), 0x00000080 }, { _MMIO(0x9888), 0x19800000 }, { _MMIO(0x9888), 0x07800063 }, { _MMIO(0x9888), 0x11800000 }, --- a/drivers/gpu/drm/i915/i915_oa_hsw.c +++ b/drivers/gpu/drm/i915/i915_oa_hsw.c @@ -42,6 +42,7 @@ static const struct i915_oa_reg flex_eu_ }; static const struct i915_oa_reg mux_config_render_basic[] = { + { _MMIO(0x9840), 0x00000080 }, { _MMIO(0x253a4), 0x01600000 }, { _MMIO(0x25440), 0x00100000 }, { _MMIO(0x25128), 0x00000000 }, --- a/drivers/gpu/drm/i915/i915_oa_kblgt2.c +++ b/drivers/gpu/drm/i915/i915_oa_kblgt2.c @@ -60,6 +60,7 @@ static const struct i915_oa_reg flex_eu_ }; static const struct i915_oa_reg mux_config_test_oa[] = { + { _MMIO(0x9840), 0x00000080 }, { _MMIO(0x9888), 0x11810000 }, { _MMIO(0x9888), 0x07810013 }, { _MMIO(0x9888), 0x1f810000 }, --- a/drivers/gpu/drm/i915/i915_oa_kblgt3.c +++ b/drivers/gpu/drm/i915/i915_oa_kblgt3.c @@ -60,6 +60,7 @@ static const struct i915_oa_reg flex_eu_ }; static const struct i915_oa_reg mux_config_test_oa[] = { + { _MMIO(0x9840), 0x00000080 }, { _MMIO(0x9888), 0x11810000 }, { _MMIO(0x9888), 0x07810013 }, { _MMIO(0x9888), 0x1f810000 }, --- a/drivers/gpu/drm/i915/i915_oa_sklgt2.c +++ b/drivers/gpu/drm/i915/i915_oa_sklgt2.c @@ -59,6 +59,7 @@ static const struct i915_oa_reg flex_eu_ }; static const struct i915_oa_reg mux_config_test_oa[] = { + { _MMIO(0x9840), 0x00000080 }, { _MMIO(0x9888), 0x11810000 }, { _MMIO(0x9888), 0x07810016 }, { _MMIO(0x9888), 0x1f810000 }, --- a/drivers/gpu/drm/i915/i915_oa_sklgt3.c +++ b/drivers/gpu/drm/i915/i915_oa_sklgt3.c @@ -60,6 +60,7 @@ static const struct i915_oa_reg flex_eu_ }; static const struct i915_oa_reg mux_config_test_oa[] = { + { _MMIO(0x9840), 0x00000080 }, { _MMIO(0x9888), 0x11810000 }, { _MMIO(0x9888), 0x07810013 }, { _MMIO(0x9888), 0x1f810000 }, --- a/drivers/gpu/drm/i915/i915_oa_sklgt4.c +++ b/drivers/gpu/drm/i915/i915_oa_sklgt4.c @@ -60,6 +60,7 @@ static const struct i915_oa_reg flex_eu_ }; static const struct i915_oa_reg mux_config_test_oa[] = { + { _MMIO(0x9840), 0x00000080 }, { _MMIO(0x9888), 0x11810000 }, { _MMIO(0x9888), 0x07810013 }, { _MMIO(0x9888), 0x1f810000 }, --- a/drivers/gpu/drm/i915/i915_perf.c +++ b/drivers/gpu/drm/i915/i915_perf.c @@ -1456,9 +1456,6 @@ static void config_oa_regs(struct drm_i9 static int hsw_enable_metric_set(struct drm_i915_private *dev_priv, const struct i915_oa_config *oa_config) { - I915_WRITE(GDT_CHICKEN_BITS, (I915_READ(GDT_CHICKEN_BITS) | - GT_NOA_ENABLE)); - /* PRM: * * OA unit is using “crclk” for its functionality. When trunk @@ -1818,12 +1815,8 @@ static int gen8_enable_metric_set(struct if (ret) return ret; - I915_WRITE(GDT_CHICKEN_BITS, 0xA0); - config_oa_regs(dev_priv, oa_config->mux_regs, oa_config->mux_regs_len); - I915_WRITE(GDT_CHICKEN_BITS, 0x80); - config_oa_regs(dev_priv, oa_config->b_counter_regs, oa_config->b_counter_regs_len);