[v16,04/13] drm/i915/perf: store the associated engine of a stream

Submitted by Lionel Landwerlin on Sept. 9, 2019, 9:31 a.m.

Details

Message ID 20190909093116.7747-5-lionel.g.landwerlin@intel.com
State New
Headers show
Series "drm/i915: Vulkan performance query support" ( rev: 17 ) in Intel GFX

Not browsing as part of any series.

Commit Message

Lionel Landwerlin Sept. 9, 2019, 9:31 a.m.
We'll use this information later to verify that a client trying to
reconfigure the stream does so on the right engine.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h  | 5 +++++
 drivers/gpu/drm/i915/i915_perf.c | 7 +++++++
 2 files changed, 12 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 75607450ba00..274a1193d4f0 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1088,6 +1088,11 @@  struct i915_perf_stream {
 	 */
 	intel_wakeref_t wakeref;
 
+	/**
+	 * @engine: Engine associated with this performance stream.
+	 */
+	struct intel_engine_cs *engine;
+
 	/**
 	 * @sample_flags: Flags representing the `DRM_I915_PERF_PROP_SAMPLE_*`
 	 * properties given when opening a stream, representing the contents
diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index d18cd332afb7..9d5a3522aa35 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -363,6 +363,8 @@  struct perf_open_properties {
 	int oa_format;
 	bool oa_periodic;
 	int oa_period_exponent;
+
+	struct intel_engine_cs *engine;
 };
 
 static enum hrtimer_restart oa_poll_check_timer_cb(struct hrtimer *hrtimer);
@@ -2201,6 +2203,8 @@  static int i915_oa_stream_init(struct i915_perf_stream *stream,
 
 	format_size = dev_priv->perf.oa_formats[props->oa_format].size;
 
+	stream->engine = props->engine;
+
 	stream->sample_flags |= SAMPLE_OA_REPORT;
 	stream->sample_size += format_size;
 
@@ -2843,6 +2847,9 @@  static int read_properties_unlocked(struct drm_i915_private *dev_priv,
 		return -EINVAL;
 	}
 
+	/* At the moment we only support using i915-perf on the RCS. */
+	props->engine = dev_priv->engine[RCS0];
+
 	/* Considering that ID = 0 is reserved and assuming that we don't
 	 * (currently) expect any configurations to ever specify duplicate
 	 * values for a particular property ID then the last _PROP_MAX value is

Comments

Reviewed-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>

Regards,
Umesh

On Mon, Sep 09, 2019 at 12:31:07PM +0300, Lionel Landwerlin wrote:
>We'll use this information later to verify that a client trying to
>reconfigure the stream does so on the right engine.
>
>Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
>---
> drivers/gpu/drm/i915/i915_drv.h  | 5 +++++
> drivers/gpu/drm/i915/i915_perf.c | 7 +++++++
> 2 files changed, 12 insertions(+)
>
>diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
>index 75607450ba00..274a1193d4f0 100644
>--- a/drivers/gpu/drm/i915/i915_drv.h
>+++ b/drivers/gpu/drm/i915/i915_drv.h
>@@ -1088,6 +1088,11 @@ struct i915_perf_stream {
> 	 */
> 	intel_wakeref_t wakeref;
>
>+	/**
>+	 * @engine: Engine associated with this performance stream.
>+	 */
>+	struct intel_engine_cs *engine;
>+
> 	/**
> 	 * @sample_flags: Flags representing the `DRM_I915_PERF_PROP_SAMPLE_*`
> 	 * properties given when opening a stream, representing the contents
>diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
>index d18cd332afb7..9d5a3522aa35 100644
>--- a/drivers/gpu/drm/i915/i915_perf.c
>+++ b/drivers/gpu/drm/i915/i915_perf.c
>@@ -363,6 +363,8 @@ struct perf_open_properties {
> 	int oa_format;
> 	bool oa_periodic;
> 	int oa_period_exponent;
>+
>+	struct intel_engine_cs *engine;
> };
>
> static enum hrtimer_restart oa_poll_check_timer_cb(struct hrtimer *hrtimer);
>@@ -2201,6 +2203,8 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
>
> 	format_size = dev_priv->perf.oa_formats[props->oa_format].size;
>
>+	stream->engine = props->engine;
>+
> 	stream->sample_flags |= SAMPLE_OA_REPORT;
> 	stream->sample_size += format_size;
>
>@@ -2843,6 +2847,9 @@ static int read_properties_unlocked(struct drm_i915_private *dev_priv,
> 		return -EINVAL;
> 	}
>
>+	/* At the moment we only support using i915-perf on the RCS. */
>+	props->engine = dev_priv->engine[RCS0];
>+
> 	/* Considering that ID = 0 is reserved and assuming that we don't
> 	 * (currently) expect any configurations to ever specify duplicate
> 	 * values for a particular property ID then the last _PROP_MAX value is
>-- 
>2.23.0
>
>_______________________________________________
>Intel-gfx mailing list
>Intel-gfx@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/intel-gfx