Skip to content

Commit c06aa1b

Browse files
unerligerodrigovivi
authored andcommitted
drm/i915/perf: Invalidate OA TLB on when closing perf stream
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 <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Fixes: 00a7f0d ("drm/i915/tgl: Add perf support on TGL") Signed-off-by: Lionel Landwerlin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit a639b0c) Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 16e5c2f commit c06aa1b

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

drivers/gpu/drm/i915/i915_perf.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2700,6 +2700,14 @@ static void gen12_oa_disable(struct i915_perf_stream *stream)
27002700
50))
27012701
drm_err(&stream->perf->i915->drm,
27022702
"wait for OA to be disabled timed out\n");
2703+
2704+
intel_uncore_write(uncore, GEN12_OA_TLB_INV_CR, 1);
2705+
if (intel_wait_for_register(uncore,
2706+
GEN12_OA_TLB_INV_CR,
2707+
1, 0,
2708+
50))
2709+
drm_err(&stream->perf->i915->drm,
2710+
"wait for OA tlb invalidate timed out\n");
27032711
}
27042712

27052713
/**

drivers/gpu/drm/i915/i915_reg.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,6 +693,8 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
693693
#define OABUFFER_SIZE_8M (6 << 3)
694694
#define OABUFFER_SIZE_16M (7 << 3)
695695

696+
#define GEN12_OA_TLB_INV_CR _MMIO(0xceec)
697+
696698
/* Gen12 OAR unit */
697699
#define GEN12_OAR_OACONTROL _MMIO(0x2960)
698700
#define GEN12_OAR_OACONTROL_COUNTER_FORMAT_SHIFT 1

0 commit comments

Comments
 (0)