Skip to content

Commit 2a264a0

Browse files
unerligejlahtine-intel
authored andcommitted
drm/i915/perf: Allow non-privileged access when OA buffer is not sampled
SAMPLE_OA_REPORT enables sampling of OA reports from the OA buffer. Since reports from OA buffer had system wide visibility, collecting samples from the OA buffer was a privileged operation on previous platforms. Prior to TGL, it was also necessary to sample the OA buffer to normalize reports from MI REPORT PERF COUNT. TGL has a dedicated OAR unit to sample perf reports for a specific render context. This removes the necessity to sample OA buffer. - If not sampling the OA buffer, allow non-privileged access. An earlier patch allows the non-privilege access: https://patchwork.freedesktop.org/patch/337716/?series=68582&rev=1 - Clear up the path for non-privileged access in this patch Signed-off-by: Umesh Nerlige Ramappa <[email protected]> Fixes: 00a7f0d ("drm/i915/tgl: Add perf support on TGL") Reviewed-by: Lionel Landwerlin <[email protected]> Signed-off-by: Lionel Landwerlin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 322d56a) Signed-off-by: Joonas Lahtinen <[email protected]>
1 parent 36deedd commit 2a264a0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/gpu/drm/i915/i915_perf.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2713,7 +2713,8 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
27132713
return -EINVAL;
27142714
}
27152715

2716-
if (!(props->sample_flags & SAMPLE_OA_REPORT)) {
2716+
if (!(props->sample_flags & SAMPLE_OA_REPORT) &&
2717+
(INTEL_GEN(perf->i915) < 12 || !stream->ctx)) {
27172718
DRM_DEBUG("Only OA report sampling supported\n");
27182719
return -EINVAL;
27192720
}
@@ -2745,7 +2746,7 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
27452746

27462747
format_size = perf->oa_formats[props->oa_format].size;
27472748

2748-
stream->sample_flags |= SAMPLE_OA_REPORT;
2749+
stream->sample_flags = props->sample_flags;
27492750
stream->sample_size += format_size;
27502751

27512752
stream->oa_buffer.format_size = format_size;

0 commit comments

Comments
 (0)