From: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@xxxxxxxxx> Correct values for OAR counters are still dependent on enabling the GEN12_OAG_OACONTROL_OA_COUNTER_ENABLE in OAG_OACONTROL. Enabling this bit means OAG unit will write reports to the OAG buffer, so initialize the OAG buffer unconditionally for all use cases. BSpec: 46822 Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@xxxxxxxxx> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@xxxxxxxxx> --- drivers/gpu/drm/i915/i915_perf.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c index 1347e4ec9dd5a..30cf37d6e79be 100644 --- a/drivers/gpu/drm/i915/i915_perf.c +++ b/drivers/gpu/drm/i915/i915_perf.c @@ -3032,12 +3032,12 @@ static void gen12_oa_enable(struct i915_perf_stream *stream) u32 val; /* - * If we don't want OA reports from the OA buffer, then we don't even - * need to program the OAG unit. + * BSpec: 46822 + * Correct values for OAR counters are still dependent on enabling the + * GEN12_OAG_OACONTROL_OA_COUNTER_ENABLE in OAG_OACONTROL. Enabling this + * bit means OAG unit will write reports to the OAG buffer, so + * initialize the OAG buffer correctly. */ - if (!(stream->sample_flags & SAMPLE_OA_REPORT)) - return; - gen12_init_oa_buffer(stream); regs = __oa_regs(stream); -- 2.41.0