[Intel-gfx] [PATCH 07/11] drm/i915/perf: pass stream as argument to oa enable vfunc

Lionel Landwerlin lionel.g.landwerlin at intel.com
Mon Mar 26 09:08:27 UTC 2018


This will allow use to program the hardware based on the stream's
properties in a later commit.

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

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index f1a38c92bb1f..1169f0a5261f 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1515,7 +1515,8 @@ struct i915_oa_ops {
 	/**
 	 * @oa_enable: Enable periodic sampling
 	 */
-	void (*oa_enable)(struct drm_i915_private *dev_priv);
+	void (*oa_enable)(struct drm_i915_private *dev_priv,
+			  const struct i915_perf_stream *stream);
 
 	/**
 	 * @oa_disable: Disable periodic sampling
diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index 9758f4be5653..2bad0bf66d89 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -894,7 +894,7 @@ static int gen8_oa_read(struct i915_perf_stream *stream,
 			  dev_priv->perf.oa.period_exponent);
 
 		dev_priv->perf.oa.ops.oa_disable(dev_priv);
-		dev_priv->perf.oa.ops.oa_enable(dev_priv);
+		dev_priv->perf.oa.ops.oa_enable(dev_priv, stream);
 
 		/*
 		 * Note: .oa_enable() is expected to re-init the oabuffer and
@@ -1118,7 +1118,7 @@ static int gen7_oa_read(struct i915_perf_stream *stream,
 			  dev_priv->perf.oa.period_exponent);
 
 		dev_priv->perf.oa.ops.oa_disable(dev_priv);
-		dev_priv->perf.oa.ops.oa_enable(dev_priv);
+		dev_priv->perf.oa.ops.oa_enable(dev_priv, stream);
 
 		oastatus1 = I915_READ(GEN7_OASTATUS1);
 	}
@@ -1888,7 +1888,8 @@ static void gen10_disable_metric_set(struct drm_i915_private *dev_priv)
 		   I915_READ(RPM_CONFIG1) & ~GEN10_GT_NOA_ENABLE);
 }
 
-static void gen7_oa_enable(struct drm_i915_private *dev_priv)
+static void gen7_oa_enable(struct drm_i915_private *dev_priv,
+			   const struct i915_perf_stream *stream)
 {
 	struct i915_gem_context *ctx =
 			dev_priv->perf.oa.exclusive_stream->ctx;
@@ -1918,7 +1919,8 @@ static void gen7_oa_enable(struct drm_i915_private *dev_priv)
 		   GEN7_OACONTROL_ENABLE);
 }
 
-static void gen8_oa_enable(struct drm_i915_private *dev_priv)
+static void gen8_oa_enable(struct drm_i915_private *dev_priv,
+			   const struct i915_perf_stream *stream)
 {
 	u32 report_format = dev_priv->perf.oa.oa_buffer.format;
 
@@ -1956,7 +1958,7 @@ static void i915_oa_stream_enable(struct i915_perf_stream *stream)
 {
 	struct drm_i915_private *dev_priv = stream->dev_priv;
 
-	dev_priv->perf.oa.ops.oa_enable(dev_priv);
+	dev_priv->perf.oa.ops.oa_enable(dev_priv, stream);
 
 	if (dev_priv->perf.oa.periodic)
 		hrtimer_start(&dev_priv->perf.oa.poll_check_timer,
-- 
2.16.3



More information about the Intel-gfx mailing list