Commit 5c5f5877 authored by sagar.a.kamble@intel.com's avatar sagar.a.kamble@intel.com Committed by Greg Kroah-Hartman

drm/i915: Hold RPM wakelock while initializing OA buffer

commit 04941829 upstream.

OA buffer initialization involves access to HW registers to set
the OA base, head and tail. Ensure device is awake while setting
these. With this, all oa.ops are covered under RPM and forcewake
wakelock.

Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: default avatarSagar Arun Kamble <sagar.a.kamble@intel.com>
Reviewed-by: default avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1498585181-23048-1-git-send-email-sagar.a.kamble@intel.com
Fixes: d7965152 ("drm/i915: Enable i915 perf stream for Haswell OA unit")
(cherry picked from commit 987f8c44)
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 76c8933a
...@@ -1210,10 +1210,6 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream, ...@@ -1210,10 +1210,6 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
return ret; return ret;
} }
ret = alloc_oa_buffer(dev_priv);
if (ret)
goto err_oa_buf_alloc;
/* PRM - observability performance counters: /* PRM - observability performance counters:
* *
* OACONTROL, performance counter enable, note: * OACONTROL, performance counter enable, note:
...@@ -1229,6 +1225,10 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream, ...@@ -1229,6 +1225,10 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
intel_runtime_pm_get(dev_priv); intel_runtime_pm_get(dev_priv);
intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL); intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL);
ret = alloc_oa_buffer(dev_priv);
if (ret)
goto err_oa_buf_alloc;
ret = dev_priv->perf.oa.ops.enable_metric_set(dev_priv); ret = dev_priv->perf.oa.ops.enable_metric_set(dev_priv);
if (ret) if (ret)
goto err_enable; goto err_enable;
...@@ -1240,11 +1240,11 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream, ...@@ -1240,11 +1240,11 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
return 0; return 0;
err_enable: err_enable:
intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
intel_runtime_pm_put(dev_priv);
free_oa_buffer(dev_priv); free_oa_buffer(dev_priv);
err_oa_buf_alloc: err_oa_buf_alloc:
intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
intel_runtime_pm_put(dev_priv);
if (stream->ctx) if (stream->ctx)
oa_put_render_ctx_id(stream); oa_put_render_ctx_id(stream);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment