All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915/perf: Allow non-privileged access when OA buffer is not sampled
@ 2019-11-14 19:21 ` Umesh Nerlige Ramappa
  0 siblings, 0 replies; 15+ messages in thread
From: Umesh Nerlige Ramappa @ 2019-11-14 19:21 UTC (permalink / raw)
  To: intel-gfx, Lionel G Landwerlin, Chris Wilson

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 <umesh.nerlige.ramappa@intel.com>
---
 drivers/gpu/drm/i915/i915_perf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index 31e47ee23357..221c1090ae93 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -2718,7 +2718,8 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
 		return -EINVAL;
 	}
 
-	if (!(props->sample_flags & SAMPLE_OA_REPORT)) {
+	if (!(props->sample_flags & SAMPLE_OA_REPORT) &&
+	    (INTEL_GEN(perf->i915) < 12 || !stream->ctx)) {
 		DRM_DEBUG("Only OA report sampling supported\n");
 		return -EINVAL;
 	}
@@ -2750,7 +2751,7 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
 
 	format_size = perf->oa_formats[props->oa_format].size;
 
-	stream->sample_flags |= SAMPLE_OA_REPORT;
+	stream->sample_flags = props->sample_flags;
 	stream->sample_size += format_size;
 
 	stream->oa_buffer.format_size = format_size;
-- 
2.20.1

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

^ permalink raw reply related	[flat|nested] 15+ messages in thread
* [PATCH 1/2] drm/i915/perf: Allow non-privileged access when OA buffer is not sampled
@ 2019-11-11 22:09 Umesh Nerlige Ramappa
  2019-11-11 22:09 ` [PATCH 2/2] drm/i915/perf: Configure OAR for specific context Umesh Nerlige Ramappa
  0 siblings, 1 reply; 15+ messages in thread
From: Umesh Nerlige Ramappa @ 2019-11-11 22:09 UTC (permalink / raw)
  To: Lionel G Landwerlin, Chris Wilson, intel-gfx

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 <umesh.nerlige.ramappa@intel.com>
---
 drivers/gpu/drm/i915/i915_perf.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index 507236bd41ae..b922000e4b9b 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -2713,7 +2713,8 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
 		return -EINVAL;
 	}
 
-	if (!(props->sample_flags & SAMPLE_OA_REPORT)) {
+	if (!(props->sample_flags & SAMPLE_OA_REPORT) &&
+	    (INTEL_GEN(perf->i915) < 12 || !stream->ctx)) {
 		DRM_DEBUG("Only OA report sampling supported\n");
 		return -EINVAL;
 	}
@@ -2745,7 +2746,7 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
 
 	format_size = perf->oa_formats[props->oa_format].size;
 
-	stream->sample_flags |= SAMPLE_OA_REPORT;
+	stream->sample_flags = props->sample_flags;
 	stream->sample_size += format_size;
 
 	stream->oa_buffer.format_size = format_size;
-- 
2.20.1

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

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

end of thread, other threads:[~2019-11-18 18:01 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-14 19:21 [PATCH 1/2] drm/i915/perf: Allow non-privileged access when OA buffer is not sampled Umesh Nerlige Ramappa
2019-11-14 19:21 ` [Intel-gfx] " Umesh Nerlige Ramappa
2019-11-14 19:21 ` [PATCH 2/2] drm/i915/perf: Configure OAR for specific context Umesh Nerlige Ramappa
2019-11-14 19:21   ` [Intel-gfx] " Umesh Nerlige Ramappa
2019-11-14 19:45   ` Umesh Nerlige Ramappa
2019-11-14 19:45     ` [Intel-gfx] " Umesh Nerlige Ramappa
2019-11-18 13:42   ` Lionel Landwerlin
2019-11-18 13:42     ` [Intel-gfx] " Lionel Landwerlin
2019-11-18 18:01     ` Umesh Nerlige Ramappa
2019-11-18 18:01       ` [Intel-gfx] " Umesh Nerlige Ramappa
2019-11-14 20:57 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] drm/i915/perf: Allow non-privileged access when OA buffer is not sampled Patchwork
2019-11-14 20:57   ` [Intel-gfx] " Patchwork
2019-11-14 21:19 ` ✗ Fi.CI.BAT: failure " Patchwork
2019-11-14 21:19   ` [Intel-gfx] " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2019-11-11 22:09 [PATCH 1/2] " Umesh Nerlige Ramappa
2019-11-11 22:09 ` [PATCH 2/2] drm/i915/perf: Configure OAR for specific context Umesh Nerlige Ramappa

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.