All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/perf: Set the exclusive stream under perf->lock
@ 2019-10-07 13:38 Chris Wilson
  2019-10-07 14:02 ` Lionel Landwerlin
  2019-10-07 15:04 ` ✗ Fi.CI.BUILD: failure for " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2019-10-07 13:38 UTC (permalink / raw)
  To: intel-gfx

The BKL struct_mutex is no more, the only serialisation we required for
setting the exclusive stream is already managed by ce->pin_mutex in
gen8_configure_all_contexts(). As such, we can manipulate
i915_perf.exclusive_stream underneath our own perf->lock.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
---
 drivers/gpu/drm/i915/i915_perf.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index ef5e48ebaaa6..45167c595322 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -1343,10 +1343,10 @@ static void i915_oa_stream_destroy(struct i915_perf_stream *stream)
 	 * Unset exclusive_stream first, it will be checked while disabling
 	 * the metric set on gen8+.
 	 */
-	mutex_lock(&perf->i915->drm.struct_mutex);
+	mutex_lock(&perf->lock);
 	perf->exclusive_stream = NULL;
 	perf->ops.disable_metric_set(stream);
-	mutex_unlock(&perf->i915->drm.struct_mutex);
+	mutex_unlock(&perf->lock);
 
 	free_oa_buffer(stream);
 
@@ -1853,7 +1853,7 @@ static int gen8_configure_all_contexts(struct i915_perf_stream *stream,
 	for (i = 2; i < ARRAY_SIZE(regs); i++)
 		regs[i].value = oa_config_flex_reg(oa_config, regs[i].reg);
 
-	lockdep_assert_held(&i915->drm.struct_mutex);
+	lockdep_assert_held(&stream->perf->lock);
 
 	/*
 	 * The OA register config is setup through the context image. This image
@@ -2220,7 +2220,7 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
 	if (ret)
 		goto err_oa_buf_alloc;
 
-	ret = i915_mutex_lock_interruptible(&stream->gt->i915->drm);
+	ret = mutex_lock_interruptible(&perf->lock);
 	if (ret)
 		goto err_lock;
 
@@ -2233,7 +2233,7 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
 		goto err_enable;
 	}
 
-	mutex_unlock(&stream->gt->i915->drm.struct_mutex);
+	mutex_unlock(&perf->lock);
 
 	hrtimer_init(&stream->poll_check_timer,
 		     CLOCK_MONOTONIC, HRTIMER_MODE_REL);
@@ -2246,7 +2246,7 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
 err_enable:
 	perf->exclusive_stream = NULL;
 	perf->ops.disable_metric_set(stream);
-	mutex_unlock(&stream->gt->i915->drm.struct_mutex);
+	mutex_unlock(&perf->lock);
 
 err_lock:
 	free_oa_buffer(stream);
-- 
2.23.0

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

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

* Re: [PATCH] drm/i915/perf: Set the exclusive stream under perf->lock
  2019-10-07 13:38 [PATCH] drm/i915/perf: Set the exclusive stream under perf->lock Chris Wilson
@ 2019-10-07 14:02 ` Lionel Landwerlin
  2019-10-07 15:04 ` ✗ Fi.CI.BUILD: failure for " Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Lionel Landwerlin @ 2019-10-07 14:02 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

On 07/10/2019 16:38, Chris Wilson wrote:
> The BKL struct_mutex is no more, the only serialisation we required for
> setting the exclusive stream is already managed by ce->pin_mutex in
> gen8_configure_all_contexts(). As such, we can manipulate
> i915_perf.exclusive_stream underneath our own perf->lock.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
> Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>

Long time coming:


Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>

> ---
>   drivers/gpu/drm/i915/i915_perf.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
> index ef5e48ebaaa6..45167c595322 100644
> --- a/drivers/gpu/drm/i915/i915_perf.c
> +++ b/drivers/gpu/drm/i915/i915_perf.c
> @@ -1343,10 +1343,10 @@ static void i915_oa_stream_destroy(struct i915_perf_stream *stream)
>   	 * Unset exclusive_stream first, it will be checked while disabling
>   	 * the metric set on gen8+.
>   	 */
> -	mutex_lock(&perf->i915->drm.struct_mutex);
> +	mutex_lock(&perf->lock);
>   	perf->exclusive_stream = NULL;
>   	perf->ops.disable_metric_set(stream);
> -	mutex_unlock(&perf->i915->drm.struct_mutex);
> +	mutex_unlock(&perf->lock);
>   
>   	free_oa_buffer(stream);
>   
> @@ -1853,7 +1853,7 @@ static int gen8_configure_all_contexts(struct i915_perf_stream *stream,
>   	for (i = 2; i < ARRAY_SIZE(regs); i++)
>   		regs[i].value = oa_config_flex_reg(oa_config, regs[i].reg);
>   
> -	lockdep_assert_held(&i915->drm.struct_mutex);
> +	lockdep_assert_held(&stream->perf->lock);
>   
>   	/*
>   	 * The OA register config is setup through the context image. This image
> @@ -2220,7 +2220,7 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
>   	if (ret)
>   		goto err_oa_buf_alloc;
>   
> -	ret = i915_mutex_lock_interruptible(&stream->gt->i915->drm);
> +	ret = mutex_lock_interruptible(&perf->lock);
>   	if (ret)
>   		goto err_lock;
>   
> @@ -2233,7 +2233,7 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
>   		goto err_enable;
>   	}
>   
> -	mutex_unlock(&stream->gt->i915->drm.struct_mutex);
> +	mutex_unlock(&perf->lock);
>   
>   	hrtimer_init(&stream->poll_check_timer,
>   		     CLOCK_MONOTONIC, HRTIMER_MODE_REL);
> @@ -2246,7 +2246,7 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
>   err_enable:
>   	perf->exclusive_stream = NULL;
>   	perf->ops.disable_metric_set(stream);
> -	mutex_unlock(&stream->gt->i915->drm.struct_mutex);
> +	mutex_unlock(&perf->lock);
>   
>   err_lock:
>   	free_oa_buffer(stream);


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

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

* ✗ Fi.CI.BUILD: failure for drm/i915/perf: Set the exclusive stream under perf->lock
  2019-10-07 13:38 [PATCH] drm/i915/perf: Set the exclusive stream under perf->lock Chris Wilson
  2019-10-07 14:02 ` Lionel Landwerlin
@ 2019-10-07 15:04 ` Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2019-10-07 15:04 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915/perf: Set the exclusive stream under perf->lock
URL   : https://patchwork.freedesktop.org/series/67687/
State : failure

== Summary ==

Applying: drm/i915/perf: Set the exclusive stream under perf->lock
error: sha1 information is lacking or useless (drivers/gpu/drm/i915/i915_perf.c).
error: could not build fake ancestor
hint: Use 'git am --show-current-patch' to see the failed patch
Patch failed at 0001 drm/i915/perf: Set the exclusive stream under perf->lock
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

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

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

end of thread, other threads:[~2019-10-07 15:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-07 13:38 [PATCH] drm/i915/perf: Set the exclusive stream under perf->lock Chris Wilson
2019-10-07 14:02 ` Lionel Landwerlin
2019-10-07 15:04 ` ✗ Fi.CI.BUILD: failure for " Patchwork

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.