diff mbox

[01/11] drm/i915/perf: pass stream to enable metric set vfuncs

Message ID 20180326090831.22686-2-lionel.g.landwerlin@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Lionel Landwerlin March 26, 2018, 9:08 a.m. UTC
We want to use some of the properties of the perf stream to program
the hardware in a later commit.

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

Comments

Matthew Auld March 26, 2018, 7:21 p.m. UTC | #1
On 26 March 2018 at 10:08, Lionel Landwerlin
<lionel.g.landwerlin@intel.com> wrote:
> We want to use some of the properties of the perf stream to program
> the hardware in a later commit.
>
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h  |  2 +-
>  drivers/gpu/drm/i915/i915_perf.c | 10 ++++++----
>  2 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 800230ba1c3b..f1a38c92bb1f 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1504,7 +1504,7 @@ struct i915_oa_ops {
>          * disabling EU clock gating as required.
>          */
>         int (*enable_metric_set)(struct drm_i915_private *dev_priv,
> -                                const struct i915_oa_config *oa_config);
> +                                const struct i915_perf_stream *stream);

We can just drop dev_priv, since we have stream->dev_priv.

With that:
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Matthew Auld March 26, 2018, 7:33 p.m. UTC | #2
On 26 March 2018 at 20:21, Matthew Auld <matthew.william.auld@gmail.com> wrote:
> On 26 March 2018 at 10:08, Lionel Landwerlin
> <lionel.g.landwerlin@intel.com> wrote:
>> We want to use some of the properties of the perf stream to program
>> the hardware in a later commit.
>>
>> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
>> ---
>>  drivers/gpu/drm/i915/i915_drv.h  |  2 +-
>>  drivers/gpu/drm/i915/i915_perf.c | 10 ++++++----
>>  2 files changed, 7 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
>> index 800230ba1c3b..f1a38c92bb1f 100644
>> --- a/drivers/gpu/drm/i915/i915_drv.h
>> +++ b/drivers/gpu/drm/i915/i915_drv.h
>> @@ -1504,7 +1504,7 @@ struct i915_oa_ops {
>>          * disabling EU clock gating as required.
>>          */
>>         int (*enable_metric_set)(struct drm_i915_private *dev_priv,
>> -                                const struct i915_oa_config *oa_config);
>> +                                const struct i915_perf_stream *stream);
>
> We can just drop dev_priv, since we have stream->dev_priv.
>
> With that:
> Reviewed-by: Matthew Auld <matthew.auld@intel.com>

Actually can we also do the same thing for disable_metric_set, for symmetry?
Lionel Landwerlin March 27, 2018, 10:15 a.m. UTC | #3
On 26/03/18 20:33, Matthew Auld wrote:
> On 26 March 2018 at 20:21, Matthew Auld <matthew.william.auld@gmail.com> wrote:
>> On 26 March 2018 at 10:08, Lionel Landwerlin
>> <lionel.g.landwerlin@intel.com> wrote:
>>> We want to use some of the properties of the perf stream to program
>>> the hardware in a later commit.
>>>
>>> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
>>> ---
>>>   drivers/gpu/drm/i915/i915_drv.h  |  2 +-
>>>   drivers/gpu/drm/i915/i915_perf.c | 10 ++++++----
>>>   2 files changed, 7 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
>>> index 800230ba1c3b..f1a38c92bb1f 100644
>>> --- a/drivers/gpu/drm/i915/i915_drv.h
>>> +++ b/drivers/gpu/drm/i915/i915_drv.h
>>> @@ -1504,7 +1504,7 @@ struct i915_oa_ops {
>>>           * disabling EU clock gating as required.
>>>           */
>>>          int (*enable_metric_set)(struct drm_i915_private *dev_priv,
>>> -                                const struct i915_oa_config *oa_config);
>>> +                                const struct i915_perf_stream *stream);
>> We can just drop dev_priv, since we have stream->dev_priv.
>>
>> With that:
>> Reviewed-by: Matthew Auld <matthew.auld@intel.com>
> Actually can we also do the same thing for disable_metric_set, for symmetry?
>
Sure, thanks.
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 800230ba1c3b..f1a38c92bb1f 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1504,7 +1504,7 @@  struct i915_oa_ops {
 	 * disabling EU clock gating as required.
 	 */
 	int (*enable_metric_set)(struct drm_i915_private *dev_priv,
-				 const struct i915_oa_config *oa_config);
+				 const struct i915_perf_stream *stream);
 
 	/**
 	 * @disable_metric_set: Remove system constraints associated with using
diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index abaca6edeb71..3beb24bc9277 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -1507,8 +1507,10 @@  static void config_oa_regs(struct drm_i915_private *dev_priv,
 }
 
 static int hsw_enable_metric_set(struct drm_i915_private *dev_priv,
-				 const struct i915_oa_config *oa_config)
+				 const struct i915_perf_stream *stream)
 {
+	const struct i915_oa_config *oa_config = stream->oa_config;
+
 	/* PRM:
 	 *
 	 * OA unit is using “crclk” for its functionality. When trunk
@@ -1813,8 +1815,9 @@  static int gen8_configure_all_contexts(struct drm_i915_private *dev_priv,
 }
 
 static int gen8_enable_metric_set(struct drm_i915_private *dev_priv,
-				  const struct i915_oa_config *oa_config)
+				  const struct i915_perf_stream *stream)
 {
+	struct i915_oa_config *oa_config = stream->oa_config;
 	int ret;
 
 	/*
@@ -2130,8 +2133,7 @@  static int i915_oa_stream_init(struct i915_perf_stream *stream,
 	if (ret)
 		goto err_lock;
 
-	ret = dev_priv->perf.oa.ops.enable_metric_set(dev_priv,
-						      stream->oa_config);
+	ret = dev_priv->perf.oa.ops.enable_metric_set(dev_priv, stream);
 	if (ret)
 		goto err_enable;