[Intel-gfx] [PATCH 02/11] drm/i915/perf: Tidy up unpinning the oa_context

Chris Wilson chris at chris-wilson.co.uk
Wed Oct 9 20:36:32 UTC 2019


Rename the function for consistency, and remove the redundant test.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_perf.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index 6fa5c9dc38d3..147d55e5fc8d 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -1304,13 +1304,13 @@ static int oa_get_render_ctx_id(struct i915_perf_stream *stream)
 }
 
 /**
- * oa_put_render_ctx_id - counterpart to oa_get_render_ctx_id releases hold
+ * put_oa_context - counterpart to oa_get_render_ctx_id releases hold
  * @stream: An i915-perf stream opened for OA metrics
  *
  * In case anything needed doing to ensure the context HW ID would remain valid
  * for the lifetime of the stream, then that can be undone here.
  */
-static void oa_put_render_ctx_id(struct i915_perf_stream *stream)
+static void put_oa_context(struct i915_perf_stream *stream)
 {
 	struct intel_context *ce;
 
@@ -1347,9 +1347,7 @@ static void i915_oa_stream_destroy(struct i915_perf_stream *stream)
 	perf->ops.disable_metric_set(stream);
 
 	free_oa_buffer(stream);
-
-	if (stream->ctx)
-		oa_put_render_ctx_id(stream);
+	put_oa_context(stream);
 
 	put_oa_config(stream->oa_config);
 
@@ -2220,8 +2218,7 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
 	put_oa_config(stream->oa_config);
 
 err_config:
-	if (stream->ctx)
-		oa_put_render_ctx_id(stream);
+	put_oa_context(stream);
 
 	return ret;
 }
-- 
2.23.0



More information about the Intel-gfx mailing list