aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsagar.a.kamble@intel.com <sagar.a.kamble@intel.com>2017-06-27 13:39:41 -0400
committerJani Nikula <jani.nikula@intel.com>2017-07-03 09:13:02 -0400
commit04941829b0049d2446c7042ab9686dd057d809a6 (patch)
treebdad0553b226fc76e2d374d368c177e2afeb4801
parentc379b897ba1a7f786419e8c36a3438ce856f016a (diff)
drm/i915: Hold RPM wakelock while initializing OA buffer
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: Sagar Arun Kamble <sagar.a.kamble@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Signed-off-by: Maarten 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: d79651522e89c ("drm/i915: Enable i915 perf stream for Haswell OA unit") Cc: <stable@vger.kernel.org> # v4.11+ (cherry picked from commit 987f8c444aa2c33d98e7030d0c5f0a5325cc84ea) Signed-off-by: Jani Nikula <jani.nikula@intel.com>
-rw-r--r--drivers/gpu/drm/i915/i915_perf.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index 38c44407bafc..9cd22f83b0cf 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -2067,10 +2067,6 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
2067 return ret; 2067 return ret;
2068 } 2068 }
2069 2069
2070 ret = alloc_oa_buffer(dev_priv);
2071 if (ret)
2072 goto err_oa_buf_alloc;
2073
2074 /* PRM - observability performance counters: 2070 /* PRM - observability performance counters:
2075 * 2071 *
2076 * OACONTROL, performance counter enable, note: 2072 * OACONTROL, performance counter enable, note:
@@ -2086,6 +2082,10 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
2086 intel_runtime_pm_get(dev_priv); 2082 intel_runtime_pm_get(dev_priv);
2087 intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL); 2083 intel_uncore_forcewake_get(dev_priv, FORCEWAKE_ALL);
2088 2084
2085 ret = alloc_oa_buffer(dev_priv);
2086 if (ret)
2087 goto err_oa_buf_alloc;
2088
2089 ret = dev_priv->perf.oa.ops.enable_metric_set(dev_priv); 2089 ret = dev_priv->perf.oa.ops.enable_metric_set(dev_priv);
2090 if (ret) 2090 if (ret)
2091 goto err_enable; 2091 goto err_enable;
@@ -2097,11 +2097,11 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
2097 return 0; 2097 return 0;
2098 2098
2099err_enable: 2099err_enable:
2100 intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
2101 intel_runtime_pm_put(dev_priv);
2102 free_oa_buffer(dev_priv); 2100 free_oa_buffer(dev_priv);
2103 2101
2104err_oa_buf_alloc: 2102err_oa_buf_alloc:
2103 intel_uncore_forcewake_put(dev_priv, FORCEWAKE_ALL);
2104 intel_runtime_pm_put(dev_priv);
2105 if (stream->ctx) 2105 if (stream->ctx)
2106 oa_put_render_ctx_id(stream); 2106 oa_put_render_ctx_id(stream);
2107 2107