All of lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915/perf: Enable application triggered OA reports
@ 2020-03-31 11:46 Lionel Landwerlin
  2020-03-31 18:44 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork
  2020-04-01 18:43 ` [Intel-gfx] [PATCH] " Umesh Nerlige Ramappa
  0 siblings, 2 replies; 4+ messages in thread
From: Lionel Landwerlin @ 2020-03-31 11:46 UTC (permalink / raw)
  To: intel-gfx

Gen12 brought an important redesign of the OA unit, splitting it in 2
with a per context part (OAR) and a global part (OAG).

OAR deals with per context counters and implements the
MI_REPORT_PERF_COUNT command.

OAG deals with global counters and the OA buffer.

Unfortunately some of the counters available in OAG are not available
in OAR, for instance counters that would report global caches
utilization.

Since applications making use of this want to access those additional
OAG counters we can enable them to generate a report from their
command buffer into the OA buffer. This is somewhat equivalent to
having them doing their own MI_REPORT_PERF_COUNT. The application then
parse the OA buffer as they were doing previously, only looking for a
begin/end OA report with the appropriate reason field in the OA buffer
instead of using MI_REPORT_PERF_COUNT generated reports for begin/end.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
---
 drivers/gpu/drm/i915/gt/intel_workarounds.c | 18 ++++++++++++++++++
 drivers/gpu/drm/i915/i915_perf.c            | 10 +++++++---
 drivers/gpu/drm/i915/i915_reg.h             |  2 ++
 3 files changed, 27 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_workarounds.c b/drivers/gpu/drm/i915/gt/intel_workarounds.c
index e96cc7fa0936..552eadaa6f9a 100644
--- a/drivers/gpu/drm/i915/gt/intel_workarounds.c
+++ b/drivers/gpu/drm/i915/gt/intel_workarounds.c
@@ -1127,6 +1127,10 @@ static void gen9_whitelist_build(struct i915_wa_list *w)
 
 	/* WaSendPushConstantsFromMMIO:skl,bxt */
 	whitelist_reg(w, COMMON_SLICE_CHICKEN2);
+
+	/* Allow userspace trigger OA report generation in OA buffer. */
+	whitelist_reg(w, OAREPORTTRIG2);
+	whitelist_reg(w, OAREPORTTRIG6);
 }
 
 static void skl_whitelist_build(struct intel_engine_cs *engine)
@@ -1208,6 +1212,10 @@ static void cnl_whitelist_build(struct intel_engine_cs *engine)
 
 	/* WaEnablePreemptionGranularityControlByUMD:cnl */
 	whitelist_reg(w, GEN8_CS_CHICKEN1);
+
+	/* Allow userspace trigger OA report generation in OA buffer. */
+	whitelist_reg(w, OAREPORTTRIG2);
+	whitelist_reg(w, OAREPORTTRIG6);
 }
 
 static void icl_whitelist_build(struct intel_engine_cs *engine)
@@ -1237,6 +1245,12 @@ static void icl_whitelist_build(struct intel_engine_cs *engine)
 		whitelist_reg_ext(w, PS_INVOCATION_COUNT,
 				  RING_FORCE_TO_NONPRIV_ACCESS_RD |
 				  RING_FORCE_TO_NONPRIV_RANGE_4);
+
+		/*
+		 * Allow userspace trigger OA report generation in OA buffer.
+		 */
+		whitelist_reg(w, OAREPORTTRIG2);
+		whitelist_reg(w, OAREPORTTRIG6);
 		break;
 
 	case VIDEO_DECODE_CLASS:
@@ -1281,6 +1295,10 @@ static void tgl_whitelist_build(struct intel_engine_cs *engine)
 
 		/* Wa_1806527549:tgl */
 		whitelist_reg(w, HIZ_CHICKEN);
+
+		/* Allow userspace trigger OA report generation in OA buffer. */
+		whitelist_reg(w, GEN12_OAG_OAREPORTTRIG2);
+		whitelist_reg(w, GEN12_OAG_OAREPORTTRIG6);
 		break;
 	default:
 		break;
diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index 28e3d76fa2e6..ae935b1b1ae3 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -1450,7 +1450,8 @@ static void gen8_init_oa_buffer(struct i915_perf_stream *stream)
 	 *  bit."
 	 */
 	intel_uncore_write(uncore, GEN8_OABUFFER, gtt_offset |
-		   OABUFFER_SIZE_16M | GEN8_OABUFFER_MEM_SELECT_GGTT);
+		   OABUFFER_SIZE_16M | GEN8_OABUFFER_MEM_SELECT_GGTT |
+		   GEN8_OABUFFER_EDGE_TRIGGER);
 	intel_uncore_write(uncore, GEN8_OATAILPTR, gtt_offset & GEN8_OATAILPTR_MASK);
 
 	/* Mark that we need updated tail pointers to read from... */
@@ -1503,7 +1504,8 @@ static void gen12_init_oa_buffer(struct i915_perf_stream *stream)
 	 *  bit."
 	 */
 	intel_uncore_write(uncore, GEN12_OAG_OABUFFER, gtt_offset |
-			   OABUFFER_SIZE_16M | GEN8_OABUFFER_MEM_SELECT_GGTT);
+			   OABUFFER_SIZE_16M | GEN8_OABUFFER_MEM_SELECT_GGTT |
+			   GEN12_OAG_OABUFFER_EDGE_TRIGGER);
 	intel_uncore_write(uncore, GEN12_OAG_OATAILPTR,
 			   gtt_offset & GEN12_OAG_OATAILPTR_MASK);
 
@@ -4481,8 +4483,10 @@ int i915_perf_ioctl_version(void)
 	 *
 	 * 5: Add DRM_I915_PERF_PROP_POLL_OA_PERIOD parameter that controls the
 	 *    interval for the hrtimer used to check for OA data.
+	 *
+	 * 6. Add edge trigger report generation support.
 	 */
-	return 5;
+	return 6;
 }
 
 #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 17484345cb80..813ae77ffeb7 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -661,6 +661,7 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
 
 #define GEN8_OABUFFER_UDW _MMIO(0x23b4)
 #define GEN8_OABUFFER _MMIO(0x2b14)
+#define  GEN8_OABUFFER_EDGE_TRIGGER         (1 << 2)
 #define  GEN8_OABUFFER_MEM_SELECT_GGTT      (1 << 0)  /* 0: PPGTT, 1: GGTT */
 
 #define GEN7_OASTATUS1 _MMIO(0x2364)
@@ -712,6 +713,7 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
 #define GEN12_OAG_OABUFFER  _MMIO(0xdb08)
 #define  GEN12_OAG_OABUFFER_BUFFER_SIZE_MASK  (0x7)
 #define  GEN12_OAG_OABUFFER_BUFFER_SIZE_SHIFT (3)
+#define  GEN12_OAG_OABUFFER_EDGE_TRIGGER      (1 << 2)
 #define  GEN12_OAG_OABUFFER_MEMORY_SELECT     (1 << 0) /* 0: PPGTT, 1: GGTT */
 
 #define GEN12_OAG_OAGLBCTXCTRL _MMIO(0x2b28)
-- 
2.26.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/perf: Enable application triggered OA reports
  2020-03-31 11:46 [Intel-gfx] [PATCH] drm/i915/perf: Enable application triggered OA reports Lionel Landwerlin
@ 2020-03-31 18:44 ` Patchwork
  2020-04-01 18:43 ` [Intel-gfx] [PATCH] " Umesh Nerlige Ramappa
  1 sibling, 0 replies; 4+ messages in thread
From: Patchwork @ 2020-03-31 18:44 UTC (permalink / raw)
  To: Lionel Landwerlin; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/perf: Enable application triggered OA reports
URL   : https://patchwork.freedesktop.org/series/75310/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8228 -> Patchwork_17154
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with Patchwork_17154 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_17154, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/index.html

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in Patchwork_17154:

### IGT changes ###

#### Possible regressions ####

  * igt@i915_selftest@live@workarounds:
    - fi-skl-6700k2:      [PASS][1] -> [DMESG-FAIL][2]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-skl-6700k2/igt@i915_selftest@live@workarounds.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-skl-6700k2/igt@i915_selftest@live@workarounds.html
    - fi-cml-s:           [PASS][3] -> [DMESG-FAIL][4]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-cml-s/igt@i915_selftest@live@workarounds.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-cml-s/igt@i915_selftest@live@workarounds.html
    - fi-icl-y:           [PASS][5] -> [DMESG-FAIL][6]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-icl-y/igt@i915_selftest@live@workarounds.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-icl-y/igt@i915_selftest@live@workarounds.html
    - fi-kbl-x1275:       [PASS][7] -> [DMESG-FAIL][8]
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-kbl-x1275/igt@i915_selftest@live@workarounds.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-kbl-x1275/igt@i915_selftest@live@workarounds.html
    - fi-cfl-guc:         [PASS][9] -> [DMESG-FAIL][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-cfl-guc/igt@i915_selftest@live@workarounds.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-cfl-guc/igt@i915_selftest@live@workarounds.html
    - fi-skl-guc:         [PASS][11] -> [DMESG-FAIL][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-skl-guc/igt@i915_selftest@live@workarounds.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-skl-guc/igt@i915_selftest@live@workarounds.html
    - fi-skl-6600u:       [PASS][13] -> [DMESG-FAIL][14]
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-skl-6600u/igt@i915_selftest@live@workarounds.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-skl-6600u/igt@i915_selftest@live@workarounds.html
    - fi-icl-dsi:         [PASS][15] -> [DMESG-FAIL][16]
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-icl-dsi/igt@i915_selftest@live@workarounds.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-icl-dsi/igt@i915_selftest@live@workarounds.html
    - fi-glk-dsi:         [PASS][17] -> [DMESG-FAIL][18]
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-glk-dsi/igt@i915_selftest@live@workarounds.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-glk-dsi/igt@i915_selftest@live@workarounds.html
    - fi-apl-guc:         [PASS][19] -> [DMESG-FAIL][20]
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-apl-guc/igt@i915_selftest@live@workarounds.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-apl-guc/igt@i915_selftest@live@workarounds.html
    - fi-kbl-8809g:       [PASS][21] -> [DMESG-FAIL][22]
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-kbl-8809g/igt@i915_selftest@live@workarounds.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-kbl-8809g/igt@i915_selftest@live@workarounds.html
    - fi-cfl-8700k:       [PASS][23] -> [DMESG-FAIL][24]
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-cfl-8700k/igt@i915_selftest@live@workarounds.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-cfl-8700k/igt@i915_selftest@live@workarounds.html
    - fi-kbl-r:           [PASS][25] -> [DMESG-FAIL][26]
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-kbl-r/igt@i915_selftest@live@workarounds.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-kbl-r/igt@i915_selftest@live@workarounds.html
    - fi-icl-guc:         [PASS][27] -> [DMESG-FAIL][28]
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-icl-guc/igt@i915_selftest@live@workarounds.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-icl-guc/igt@i915_selftest@live@workarounds.html
    - fi-icl-u2:          [PASS][29] -> [DMESG-FAIL][30]
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-icl-u2/igt@i915_selftest@live@workarounds.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-icl-u2/igt@i915_selftest@live@workarounds.html
    - fi-cfl-8109u:       [PASS][31] -> [DMESG-FAIL][32]
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-cfl-8109u/igt@i915_selftest@live@workarounds.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-cfl-8109u/igt@i915_selftest@live@workarounds.html
    - fi-skl-lmem:        [PASS][33] -> [DMESG-FAIL][34]
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-skl-lmem/igt@i915_selftest@live@workarounds.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-skl-lmem/igt@i915_selftest@live@workarounds.html
    - fi-kbl-7500u:       [PASS][35] -> [DMESG-FAIL][36]
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-kbl-7500u/igt@i915_selftest@live@workarounds.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-kbl-7500u/igt@i915_selftest@live@workarounds.html
    - fi-kbl-guc:         [PASS][37] -> [DMESG-FAIL][38]
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-kbl-guc/igt@i915_selftest@live@workarounds.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-kbl-guc/igt@i915_selftest@live@workarounds.html
    - fi-kbl-soraka:      NOTRUN -> [DMESG-FAIL][39]
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-kbl-soraka/igt@i915_selftest@live@workarounds.html
    - fi-bxt-dsi:         [PASS][40] -> [DMESG-FAIL][41]
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-bxt-dsi/igt@i915_selftest@live@workarounds.html
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-bxt-dsi/igt@i915_selftest@live@workarounds.html
    - fi-cml-u2:          [PASS][42] -> [DMESG-FAIL][43]
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-cml-u2/igt@i915_selftest@live@workarounds.html
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-cml-u2/igt@i915_selftest@live@workarounds.html

  
#### Suppressed ####

  The following results come from untrusted machines, tests, or statuses.
  They do not affect the overall result.

  * igt@i915_selftest@live@workarounds:
    - {fi-ehl-1}:         [PASS][44] -> [DMESG-FAIL][45]
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-ehl-1/igt@i915_selftest@live@workarounds.html
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-ehl-1/igt@i915_selftest@live@workarounds.html
    - {fi-tgl-u}:         [PASS][46] -> [DMESG-FAIL][47]
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-tgl-u/igt@i915_selftest@live@workarounds.html
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-tgl-u/igt@i915_selftest@live@workarounds.html
    - {fi-kbl-7560u}:     [PASS][48] -> [DMESG-FAIL][49]
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-kbl-7560u/igt@i915_selftest@live@workarounds.html
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-kbl-7560u/igt@i915_selftest@live@workarounds.html

  
Known issues
------------

  Here are the changes found in Patchwork_17154 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@i915_selftest@live@execlists:
    - fi-bxt-dsi:         [PASS][50] -> [INCOMPLETE][51] ([i915#1430] / [i915#656])
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8228/fi-bxt-dsi/igt@i915_selftest@live@execlists.html
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/fi-bxt-dsi/igt@i915_selftest@live@execlists.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [i915#1430]: https://gitlab.freedesktop.org/drm/intel/issues/1430
  [i915#656]: https://gitlab.freedesktop.org/drm/intel/issues/656


Participating hosts (48 -> 41)
------------------------------

  Additional (1): fi-kbl-soraka 
  Missing    (8): fi-bdw-5557u fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-bwr-2160 fi-ctg-p8600 fi-byt-clapper fi-bdw-samus 


Build changes
-------------

  * CI: CI-20190529 -> None
  * Linux: CI_DRM_8228 -> Patchwork_17154

  CI-20190529: 20190529
  CI_DRM_8228: 1f33fcd4f840355af75a61ce7204f39bafc52018 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5548: d9e70dc1b35633b7d5c81cbfa165e331189eb260 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_17154: e4c33963fe8200515cf78f1abe36555071d7a029 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

e4c33963fe82 drm/i915/perf: Enable application triggered OA reports

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_17154/index.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Intel-gfx] [PATCH] drm/i915/perf: Enable application triggered OA reports
  2020-03-31 11:46 [Intel-gfx] [PATCH] drm/i915/perf: Enable application triggered OA reports Lionel Landwerlin
  2020-03-31 18:44 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork
@ 2020-04-01 18:43 ` Umesh Nerlige Ramappa
  2020-04-02  6:07   ` Lionel Landwerlin
  1 sibling, 1 reply; 4+ messages in thread
From: Umesh Nerlige Ramappa @ 2020-04-01 18:43 UTC (permalink / raw)
  To: Lionel Landwerlin; +Cc: intel-gfx

On Tue, Mar 31, 2020 at 02:46:46PM +0300, Lionel Landwerlin wrote:
>Gen12 brought an important redesign of the OA unit, splitting it in 2
>with a per context part (OAR) and a global part (OAG).
>
>OAR deals with per context counters and implements the
>MI_REPORT_PERF_COUNT command.
>
>OAG deals with global counters and the OA buffer.
>
>Unfortunately some of the counters available in OAG are not available
>in OAR, for instance counters that would report global caches
>utilization.
>
>Since applications making use of this want to access those additional
>OAG counters we can enable them to generate a report from their
>command buffer into the OA buffer. This is somewhat equivalent to
>having them doing their own MI_REPORT_PERF_COUNT. The application then
>parse the OA buffer as they were doing previously, only looking for a
>begin/end OA report with the appropriate reason field in the OA buffer
>instead of using MI_REPORT_PERF_COUNT generated reports for begin/end.
>
>Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
>---
> drivers/gpu/drm/i915/gt/intel_workarounds.c | 18 ++++++++++++++++++
> drivers/gpu/drm/i915/i915_perf.c            | 10 +++++++---
> drivers/gpu/drm/i915/i915_reg.h             |  2 ++
> 3 files changed, 27 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/gpu/drm/i915/gt/intel_workarounds.c b/drivers/gpu/drm/i915/gt/intel_workarounds.c
>index e96cc7fa0936..552eadaa6f9a 100644
>--- a/drivers/gpu/drm/i915/gt/intel_workarounds.c
>+++ b/drivers/gpu/drm/i915/gt/intel_workarounds.c
>@@ -1127,6 +1127,10 @@ static void gen9_whitelist_build(struct i915_wa_list *w)
>
> 	/* WaSendPushConstantsFromMMIO:skl,bxt */
> 	whitelist_reg(w, COMMON_SLICE_CHICKEN2);
>+
>+	/* Allow userspace trigger OA report generation in OA buffer. */
>+	whitelist_reg(w, OAREPORTTRIG2);
>+	whitelist_reg(w, OAREPORTTRIG6);
> }
>
> static void skl_whitelist_build(struct intel_engine_cs *engine)
>@@ -1208,6 +1212,10 @@ static void cnl_whitelist_build(struct intel_engine_cs *engine)
>
> 	/* WaEnablePreemptionGranularityControlByUMD:cnl */
> 	whitelist_reg(w, GEN8_CS_CHICKEN1);
>+
>+	/* Allow userspace trigger OA report generation in OA buffer. */
>+	whitelist_reg(w, OAREPORTTRIG2);
>+	whitelist_reg(w, OAREPORTTRIG6);
> }
>
> static void icl_whitelist_build(struct intel_engine_cs *engine)
>@@ -1237,6 +1245,12 @@ static void icl_whitelist_build(struct intel_engine_cs *engine)
> 		whitelist_reg_ext(w, PS_INVOCATION_COUNT,
> 				  RING_FORCE_TO_NONPRIV_ACCESS_RD |
> 				  RING_FORCE_TO_NONPRIV_RANGE_4);
>+
>+		/*
>+		 * Allow userspace trigger OA report generation in OA buffer.
>+		 */
>+		whitelist_reg(w, OAREPORTTRIG2);
>+		whitelist_reg(w, OAREPORTTRIG6);
> 		break;
>
> 	case VIDEO_DECODE_CLASS:
>@@ -1281,6 +1295,10 @@ static void tgl_whitelist_build(struct intel_engine_cs *engine)
>
> 		/* Wa_1806527549:tgl */
> 		whitelist_reg(w, HIZ_CHICKEN);
>+
>+		/* Allow userspace trigger OA report generation in OA buffer. */
>+		whitelist_reg(w, GEN12_OAG_OAREPORTTRIG2);
>+		whitelist_reg(w, GEN12_OAG_OAREPORTTRIG6);
> 		break;
> 	default:
> 		break;
>diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
>index 28e3d76fa2e6..ae935b1b1ae3 100644
>--- a/drivers/gpu/drm/i915/i915_perf.c
>+++ b/drivers/gpu/drm/i915/i915_perf.c
>@@ -1450,7 +1450,8 @@ static void gen8_init_oa_buffer(struct i915_perf_stream *stream)
> 	 *  bit."
> 	 */
> 	intel_uncore_write(uncore, GEN8_OABUFFER, gtt_offset |
>-		   OABUFFER_SIZE_16M | GEN8_OABUFFER_MEM_SELECT_GGTT);
>+		   OABUFFER_SIZE_16M | GEN8_OABUFFER_MEM_SELECT_GGTT |
>+		   GEN8_OABUFFER_EDGE_TRIGGER);
> 	intel_uncore_write(uncore, GEN8_OATAILPTR, gtt_offset & GEN8_OATAILPTR_MASK);
>
> 	/* Mark that we need updated tail pointers to read from... */
>@@ -1503,7 +1504,8 @@ static void gen12_init_oa_buffer(struct i915_perf_stream *stream)
> 	 *  bit."
> 	 */
> 	intel_uncore_write(uncore, GEN12_OAG_OABUFFER, gtt_offset |
>-			   OABUFFER_SIZE_16M | GEN8_OABUFFER_MEM_SELECT_GGTT);
>+			   OABUFFER_SIZE_16M | GEN8_OABUFFER_MEM_SELECT_GGTT |
>+			   GEN12_OAG_OABUFFER_EDGE_TRIGGER);
> 	intel_uncore_write(uncore, GEN12_OAG_OATAILPTR,
> 			   gtt_offset & GEN12_OAG_OATAILPTR_MASK);
>
>@@ -4481,8 +4483,10 @@ int i915_perf_ioctl_version(void)
> 	 *
> 	 * 5: Add DRM_I915_PERF_PROP_POLL_OA_PERIOD parameter that controls the
> 	 *    interval for the hrtimer used to check for OA data.
>+	 *
>+	 * 6. Add edge trigger report generation support.
> 	 */
>-	return 5;
>+	return 6;

Do you think we should be adding a comment in uapi for revision 6?

If not, this patch looks good and is:

Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>

Thanks,
Umesh

> }
>
> #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
>diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
>index 17484345cb80..813ae77ffeb7 100644
>--- a/drivers/gpu/drm/i915/i915_reg.h
>+++ b/drivers/gpu/drm/i915/i915_reg.h
>@@ -661,6 +661,7 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
>
> #define GEN8_OABUFFER_UDW _MMIO(0x23b4)
> #define GEN8_OABUFFER _MMIO(0x2b14)
>+#define  GEN8_OABUFFER_EDGE_TRIGGER         (1 << 2)
> #define  GEN8_OABUFFER_MEM_SELECT_GGTT      (1 << 0)  /* 0: PPGTT, 1: GGTT */
>
> #define GEN7_OASTATUS1 _MMIO(0x2364)
>@@ -712,6 +713,7 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
> #define GEN12_OAG_OABUFFER  _MMIO(0xdb08)
> #define  GEN12_OAG_OABUFFER_BUFFER_SIZE_MASK  (0x7)
> #define  GEN12_OAG_OABUFFER_BUFFER_SIZE_SHIFT (3)
>+#define  GEN12_OAG_OABUFFER_EDGE_TRIGGER      (1 << 2)
> #define  GEN12_OAG_OABUFFER_MEMORY_SELECT     (1 << 0) /* 0: PPGTT, 1: GGTT */
>
> #define GEN12_OAG_OAGLBCTXCTRL _MMIO(0x2b28)
>-- 
>2.26.0
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Intel-gfx] [PATCH] drm/i915/perf: Enable application triggered OA reports
  2020-04-01 18:43 ` [Intel-gfx] [PATCH] " Umesh Nerlige Ramappa
@ 2020-04-02  6:07   ` Lionel Landwerlin
  0 siblings, 0 replies; 4+ messages in thread
From: Lionel Landwerlin @ 2020-04-02  6:07 UTC (permalink / raw)
  To: Umesh Nerlige Ramappa; +Cc: intel-gfx

On 01/04/2020 21:43, Umesh Nerlige Ramappa wrote:
> On Tue, Mar 31, 2020 at 02:46:46PM +0300, Lionel Landwerlin wrote:
>> Gen12 brought an important redesign of the OA unit, splitting it in 2
>> with a per context part (OAR) and a global part (OAG).
>>
>> OAR deals with per context counters and implements the
>> MI_REPORT_PERF_COUNT command.
>>
>> OAG deals with global counters and the OA buffer.
>>
>> Unfortunately some of the counters available in OAG are not available
>> in OAR, for instance counters that would report global caches
>> utilization.
>>
>> Since applications making use of this want to access those additional
>> OAG counters we can enable them to generate a report from their
>> command buffer into the OA buffer. This is somewhat equivalent to
>> having them doing their own MI_REPORT_PERF_COUNT. The application then
>> parse the OA buffer as they were doing previously, only looking for a
>> begin/end OA report with the appropriate reason field in the OA buffer
>> instead of using MI_REPORT_PERF_COUNT generated reports for begin/end.
>>
>> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
>> ---
>> drivers/gpu/drm/i915/gt/intel_workarounds.c | 18 ++++++++++++++++++
>> drivers/gpu/drm/i915/i915_perf.c            | 10 +++++++---
>> drivers/gpu/drm/i915/i915_reg.h             |  2 ++
>> 3 files changed, 27 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/gt/intel_workarounds.c 
>> b/drivers/gpu/drm/i915/gt/intel_workarounds.c
>> index e96cc7fa0936..552eadaa6f9a 100644
>> --- a/drivers/gpu/drm/i915/gt/intel_workarounds.c
>> +++ b/drivers/gpu/drm/i915/gt/intel_workarounds.c
>> @@ -1127,6 +1127,10 @@ static void gen9_whitelist_build(struct 
>> i915_wa_list *w)
>>
>>     /* WaSendPushConstantsFromMMIO:skl,bxt */
>>     whitelist_reg(w, COMMON_SLICE_CHICKEN2);
>> +
>> +    /* Allow userspace trigger OA report generation in OA buffer. */
>> +    whitelist_reg(w, OAREPORTTRIG2);
>> +    whitelist_reg(w, OAREPORTTRIG6);
>> }
>>
>> static void skl_whitelist_build(struct intel_engine_cs *engine)
>> @@ -1208,6 +1212,10 @@ static void cnl_whitelist_build(struct 
>> intel_engine_cs *engine)
>>
>>     /* WaEnablePreemptionGranularityControlByUMD:cnl */
>>     whitelist_reg(w, GEN8_CS_CHICKEN1);
>> +
>> +    /* Allow userspace trigger OA report generation in OA buffer. */
>> +    whitelist_reg(w, OAREPORTTRIG2);
>> +    whitelist_reg(w, OAREPORTTRIG6);
>> }
>>
>> static void icl_whitelist_build(struct intel_engine_cs *engine)
>> @@ -1237,6 +1245,12 @@ static void icl_whitelist_build(struct 
>> intel_engine_cs *engine)
>>         whitelist_reg_ext(w, PS_INVOCATION_COUNT,
>>                   RING_FORCE_TO_NONPRIV_ACCESS_RD |
>>                   RING_FORCE_TO_NONPRIV_RANGE_4);
>> +
>> +        /*
>> +         * Allow userspace trigger OA report generation in OA buffer.
>> +         */
>> +        whitelist_reg(w, OAREPORTTRIG2);
>> +        whitelist_reg(w, OAREPORTTRIG6);
>>         break;
>>
>>     case VIDEO_DECODE_CLASS:
>> @@ -1281,6 +1295,10 @@ static void tgl_whitelist_build(struct 
>> intel_engine_cs *engine)
>>
>>         /* Wa_1806527549:tgl */
>>         whitelist_reg(w, HIZ_CHICKEN);
>> +
>> +        /* Allow userspace trigger OA report generation in OA 
>> buffer. */
>> +        whitelist_reg(w, GEN12_OAG_OAREPORTTRIG2);
>> +        whitelist_reg(w, GEN12_OAG_OAREPORTTRIG6);
>>         break;
>>     default:
>>         break;
>> diff --git a/drivers/gpu/drm/i915/i915_perf.c 
>> b/drivers/gpu/drm/i915/i915_perf.c
>> index 28e3d76fa2e6..ae935b1b1ae3 100644
>> --- a/drivers/gpu/drm/i915/i915_perf.c
>> +++ b/drivers/gpu/drm/i915/i915_perf.c
>> @@ -1450,7 +1450,8 @@ static void gen8_init_oa_buffer(struct 
>> i915_perf_stream *stream)
>>      *  bit."
>>      */
>>     intel_uncore_write(uncore, GEN8_OABUFFER, gtt_offset |
>> -           OABUFFER_SIZE_16M | GEN8_OABUFFER_MEM_SELECT_GGTT);
>> +           OABUFFER_SIZE_16M | GEN8_OABUFFER_MEM_SELECT_GGTT |
>> +           GEN8_OABUFFER_EDGE_TRIGGER);
>>     intel_uncore_write(uncore, GEN8_OATAILPTR, gtt_offset & 
>> GEN8_OATAILPTR_MASK);
>>
>>     /* Mark that we need updated tail pointers to read from... */
>> @@ -1503,7 +1504,8 @@ static void gen12_init_oa_buffer(struct 
>> i915_perf_stream *stream)
>>      *  bit."
>>      */
>>     intel_uncore_write(uncore, GEN12_OAG_OABUFFER, gtt_offset |
>> -               OABUFFER_SIZE_16M | GEN8_OABUFFER_MEM_SELECT_GGTT);
>> +               OABUFFER_SIZE_16M | GEN8_OABUFFER_MEM_SELECT_GGTT |
>> +               GEN12_OAG_OABUFFER_EDGE_TRIGGER);
>>     intel_uncore_write(uncore, GEN12_OAG_OATAILPTR,
>>                gtt_offset & GEN12_OAG_OATAILPTR_MASK);
>>
>> @@ -4481,8 +4483,10 @@ int i915_perf_ioctl_version(void)
>>      *
>>      * 5: Add DRM_I915_PERF_PROP_POLL_OA_PERIOD parameter that 
>> controls the
>>      *    interval for the hrtimer used to check for OA data.
>> +     *
>> +     * 6. Add edge trigger report generation support.
>>      */
>> -    return 5;
>> +    return 6;
>
> Do you think we should be adding a comment in uapi for revision 6?
>
> If not, this patch looks good and is:
>
> Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
>
> Thanks,
> Umesh


Not sure what to do to be fair. The command parser version details are 
only in the source file, nothing in the header for instance.


-Lionel


>
>> }
>>
>> #if IS_ENABLED(CONFIG_DRM_I915_SELFTEST)
>> diff --git a/drivers/gpu/drm/i915/i915_reg.h 
>> b/drivers/gpu/drm/i915/i915_reg.h
>> index 17484345cb80..813ae77ffeb7 100644
>> --- a/drivers/gpu/drm/i915/i915_reg.h
>> +++ b/drivers/gpu/drm/i915/i915_reg.h
>> @@ -661,6 +661,7 @@ static inline bool i915_mmio_reg_valid(i915_reg_t 
>> reg)
>>
>> #define GEN8_OABUFFER_UDW _MMIO(0x23b4)
>> #define GEN8_OABUFFER _MMIO(0x2b14)
>> +#define  GEN8_OABUFFER_EDGE_TRIGGER         (1 << 2)
>> #define  GEN8_OABUFFER_MEM_SELECT_GGTT      (1 << 0)  /* 0: PPGTT, 1: 
>> GGTT */
>>
>> #define GEN7_OASTATUS1 _MMIO(0x2364)
>> @@ -712,6 +713,7 @@ static inline bool i915_mmio_reg_valid(i915_reg_t 
>> reg)
>> #define GEN12_OAG_OABUFFER  _MMIO(0xdb08)
>> #define  GEN12_OAG_OABUFFER_BUFFER_SIZE_MASK  (0x7)
>> #define  GEN12_OAG_OABUFFER_BUFFER_SIZE_SHIFT (3)
>> +#define  GEN12_OAG_OABUFFER_EDGE_TRIGGER      (1 << 2)
>> #define  GEN12_OAG_OABUFFER_MEMORY_SELECT     (1 << 0) /* 0: PPGTT, 
>> 1: GGTT */
>>
>> #define GEN12_OAG_OAGLBCTXCTRL _MMIO(0x2b28)
>> -- 
>> 2.26.0
>>

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-04-02  6:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-31 11:46 [Intel-gfx] [PATCH] drm/i915/perf: Enable application triggered OA reports Lionel Landwerlin
2020-03-31 18:44 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork
2020-04-01 18:43 ` [Intel-gfx] [PATCH] " Umesh Nerlige Ramappa
2020-04-02  6:07   ` Lionel Landwerlin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.