]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915/perf: Invalidate OA TLB on when closing perf stream
authorUmesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Mon, 9 Mar 2020 21:10:57 +0000 (14:10 -0700)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 17 Mar 2020 22:30:52 +0000 (00:30 +0200)
On running several back to back perf capture sessions involving closing
and opening the perf stream, invalid OA reports are seen in the
beginning of the OA buffer in some sessions. Fix this by invalidating OA
TLB when the perf stream is closed or disabled on gen12.

Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 00a7f0d7155c ("drm/i915/tgl: Add perf support on TGL")
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200309211057.38575-1-umesh.nerlige.ramappa@intel.com
drivers/gpu/drm/i915/i915_perf.c
drivers/gpu/drm/i915/i915_reg.h

index 4611f72cd036cfaf175ecad1f9c5680a6748a341..3222f6cd825508a823caa3077951da279cfe3e24 100644 (file)
@@ -2686,6 +2686,14 @@ static void gen12_oa_disable(struct i915_perf_stream *stream)
                                    50))
                drm_err(&stream->perf->i915->drm,
                        "wait for OA to be disabled timed out\n");
+
+       intel_uncore_write(uncore, GEN12_OA_TLB_INV_CR, 1);
+       if (intel_wait_for_register(uncore,
+                                   GEN12_OA_TLB_INV_CR,
+                                   1, 0,
+                                   50))
+               drm_err(&stream->perf->i915->drm,
+                       "wait for OA tlb invalidate timed out\n");
 }
 
 /**
index 309cb7d96b353aaccbe1b6e15bd2c68267260625..59e64acc2c5680afd514b860a258c321728ea2d9 100644 (file)
@@ -693,6 +693,8 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
 #define OABUFFER_SIZE_8M    (6 << 3)
 #define OABUFFER_SIZE_16M   (7 << 3)
 
+#define GEN12_OA_TLB_INV_CR _MMIO(0xceec)
+
 /* Gen12 OAR unit */
 #define GEN12_OAR_OACONTROL _MMIO(0x2960)
 #define  GEN12_OAR_OACONTROL_COUNTER_FORMAT_SHIFT 1