From: Robert Bragg <robert@sixbynine.org>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v3 7/7] drm/i915/perf: remove perf.hook_lock
Date: Wed, 5 Apr 2017 17:23:20 +0100 [thread overview]
Message-ID: <20170405162320.30094-8-robert@sixbynine.org> (raw)
In-Reply-To: <20170405162320.30094-1-robert@sixbynine.org>
In earlier iterations of the i915-perf driver we had a number of
callbacks/hooks from other parts of the i915 driver to e.g. notify us
when a legacy context was pinned and these could run asynchronously with
respect to the stream file operations and might also run in atomic
context.
dev_priv->perf.hook_lock had been for serialising access to state needed
within these callbacks, but as the code has evolved some of the hooks
have gone away or are implemented to avoid needing to lock any state.
The remaining use of this lock was actually redundant considering how
the gen7 oacontrol state used to be updated as part of a context pin
hook.
Signed-off-by: Robert Bragg <robert@sixbynine.org>
---
drivers/gpu/drm/i915/i915_drv.h | 2 --
drivers/gpu/drm/i915/i915_perf.c | 32 ++++++++++----------------------
2 files changed, 10 insertions(+), 24 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 48b07d706f06..67ac4e6dbccb 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2444,8 +2444,6 @@ struct drm_i915_private {
struct mutex lock;
struct list_head streams;
- spinlock_t hook_lock;
-
struct {
struct i915_perf_stream *exclusive_stream;
diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index 87c0d1ce1b9f..63a1152766f8 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -1677,9 +1677,17 @@ static void gen8_disable_metric_set(struct drm_i915_private *dev_priv)
/* NOP */
}
-static void gen7_update_oacontrol_locked(struct drm_i915_private *dev_priv)
+static void gen7_oa_enable(struct drm_i915_private *dev_priv)
{
- lockdep_assert_held(&dev_priv->perf.hook_lock);
+ /* Reset buf pointers so we don't forward reports from before now.
+ *
+ * Think carefully if considering trying to avoid this, since it
+ * also ensures status flags and the buffer itself are cleared
+ * in error paths, and we have checks for invalid reports based
+ * on the assumption that certain fields are written to zeroed
+ * memory which this helps maintains.
+ */
+ gen7_init_oa_buffer(dev_priv);
if (dev_priv->perf.oa.exclusive_stream->enabled) {
struct i915_gem_context *ctx =
@@ -1702,25 +1710,6 @@ static void gen7_update_oacontrol_locked(struct drm_i915_private *dev_priv)
I915_WRITE(GEN7_OACONTROL, 0);
}
-static void gen7_oa_enable(struct drm_i915_private *dev_priv)
-{
- unsigned long flags;
-
- /* Reset buf pointers so we don't forward reports from before now.
- *
- * Think carefully if considering trying to avoid this, since it
- * also ensures status flags and the buffer itself are cleared
- * in error paths, and we have checks for invalid reports based
- * on the assumption that certain fields are written to zeroed
- * memory which this helps maintains.
- */
- gen7_init_oa_buffer(dev_priv);
-
- spin_lock_irqsave(&dev_priv->perf.hook_lock, flags);
- gen7_update_oacontrol_locked(dev_priv);
- spin_unlock_irqrestore(&dev_priv->perf.hook_lock, flags);
-}
-
static void gen8_oa_enable(struct drm_i915_private *dev_priv)
{
u32 report_format = dev_priv->perf.oa.oa_buffer.format;
@@ -2999,7 +2988,6 @@ void i915_perf_init(struct drm_i915_private *dev_priv)
INIT_LIST_HEAD(&dev_priv->perf.streams);
mutex_init(&dev_priv->perf.lock);
- spin_lock_init(&dev_priv->perf.hook_lock);
spin_lock_init(&dev_priv->perf.oa.oa_buffer.ptr_lock);
dev_priv->perf.sysctl_header = register_sysctl_table(dev_root);
--
2.12.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-04-05 16:23 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-05 16:23 [PATCH v3 0/7] Enable OA unit for Gen 8 and 9 in i915 perf Robert Bragg
2017-04-05 16:23 ` [PATCH v3 1/7] drm/i915: expose _SLICE_MASK GETPARM Robert Bragg
2017-04-05 16:23 ` [PATCH v3 2/7] drm/i915: expose _SUBSLICE_MASK GETPARM Robert Bragg
2017-04-05 16:23 ` [PATCH v3 3/7] drm/i915/perf: Add 'render basic' Gen8+ OA unit configs Robert Bragg
2017-04-05 16:23 ` [PATCH v3 4/7] drm/i915/perf: Add OA unit support for Gen 8+ Robert Bragg
2017-04-06 16:56 ` Lionel Landwerlin
2017-04-12 11:33 ` Matthew Auld
2017-04-12 14:57 ` Robert Bragg
2017-04-05 16:23 ` [PATCH v3 5/7] drm/i915/perf: Add more OA configs for BDW, CHV, SKL + BXT Robert Bragg
2017-04-05 16:23 ` [PATCH v3 6/7] drm/i915/perf: per-gen timebase for checking sample freq Robert Bragg
2017-04-05 16:49 ` Lionel Landwerlin
2017-04-05 17:06 ` Ville Syrjälä
2017-04-05 17:17 ` Lionel Landwerlin
2017-04-05 17:26 ` Ville Syrjälä
2017-04-05 17:59 ` Robert Bragg
2017-04-05 19:05 ` [PATCH v2] " Robert Bragg
2017-04-12 12:34 ` Matthew Auld
2017-04-12 15:07 ` Robert Bragg
2017-04-05 16:23 ` Robert Bragg [this message]
2017-04-12 11:36 ` [PATCH v3 7/7] drm/i915/perf: remove perf.hook_lock Matthew Auld
2017-04-05 16:42 ` ✓ Fi.CI.BAT: success for Enable OA unit for Gen 8 and 9 in i915 perf (rev4) Patchwork
2017-04-05 19:21 ` ✓ Fi.CI.BAT: success for Enable OA unit for Gen 8 and 9 in i915 perf (rev5) Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170405162320.30094-8-robert@sixbynine.org \
--to=robert@sixbynine.org \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).