Skip to content

Commit

Permalink
drm/i915/perf: Prefer using the pinned_ctx for emitting delays on config
Browse files Browse the repository at this point in the history
When we are watching a particular context, we want the OA config to be
applied inline with that context such that it takes effect before the
next submission.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191012091056.28686-1-chris@chris-wilson.co.uk
  • Loading branch information
Chris Wilson committed Oct 12, 2019
1 parent 15d0ace commit 5f5c382
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/gpu/drm/i915/i915_perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1903,6 +1903,11 @@ static int emit_oa_config(struct i915_perf_stream *stream,
return err;
}

static struct intel_context *oa_context(struct i915_perf_stream *stream)
{
return stream->pinned_ctx ?: stream->engine->kernel_context;
}

static int hsw_enable_metric_set(struct i915_perf_stream *stream)
{
struct intel_uncore *uncore = stream->uncore;
Expand All @@ -1922,7 +1927,7 @@ static int hsw_enable_metric_set(struct i915_perf_stream *stream)
intel_uncore_rmw(uncore, GEN6_UCGCTL1,
0, GEN6_CSUNIT_CLOCK_GATE_DISABLE);

return emit_oa_config(stream, stream->engine->kernel_context);
return emit_oa_config(stream, oa_context(stream));
}

static void hsw_disable_metric_set(struct i915_perf_stream *stream)
Expand Down Expand Up @@ -2286,7 +2291,7 @@ static int gen8_enable_metric_set(struct i915_perf_stream *stream)
if (ret)
return ret;

return emit_oa_config(stream, stream->engine->kernel_context);
return emit_oa_config(stream, oa_context(stream));
}

static void gen8_disable_metric_set(struct i915_perf_stream *stream)
Expand Down

0 comments on commit 5f5c382

Please sign in to comment.