All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/execlists: Document runtime pm for intel_lrc_irq_handler()
Date: Wed, 12 Apr 2017 09:31:24 +0100	[thread overview]
Message-ID: <20170412083124.GF4250@nuc-i3427.alporthouse.com> (raw)
In-Reply-To: <08ddbaa6-9479-e98b-5583-a8b9e2cf305e@linux.intel.com>

On Wed, Apr 12, 2017 at 08:12:17AM +0100, Tvrtko Ursulin wrote:
> 
> On 11/04/2017 18:58, Chris Wilson wrote:
> >We indirectly hold the runtime-pm for the intel_lrc_irq_handler() by
> >virtue of dev_priv->gt.awake keeping a wakeref whilst the requests are
> >busy. As this is not obvious from the code, add a comment.
> >
> >Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> >Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> >---
> > drivers/gpu/drm/i915/intel_lrc.c | 9 +++++++++
> > 1 file changed, 9 insertions(+)
> >
> >diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> >index 0dc1cc4ad6e7..e16cc28dc783 100644
> >--- a/drivers/gpu/drm/i915/intel_lrc.c
> >+++ b/drivers/gpu/drm/i915/intel_lrc.c
> >@@ -515,6 +515,15 @@ static void intel_lrc_irq_handler(unsigned long data)
> > 	struct execlist_port *port = engine->execlist_port;
> > 	struct drm_i915_private *dev_priv = engine->i915;
> >
> >+	/* We can skip acquiring intel_runtime_pm_get() here as it was taken
> >+	 * on our behalf by the request (see i915_gem_mark_busy ()) and it will
> >+	 * not be relinquished until the device is idle (see
> >+	 * i915_gem_idle_work_handler()). As a precaution, we make sure
> >+	 * that all ELSP are drained i.e. we have processed the CSB,
> >+	 * before allowing ourselves to idle and calling intel_runtime_pm_put().
> >+	 */
> >+	GEM_BUG_ON(!dev_priv->gt.awake);
> >+
> > 	intel_uncore_forcewake_get(dev_priv, engine->fw_domains);
> >
> > 	/* Prefer doing test_and_clear_bit() as a two stage operation to avoid
> >
> 
> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> 
> It feels a big to c&p, but not sure if it worth putting a comment
> "see comment in intel_lrc_irq_handler on why we don't have to " to
> i915_guc_irq_handler or maybe dequeue?

For guc, the requirement for rpm is much less strict - the interface
with the guc is through ordinary memory not device memory, so we don't
need rpm_get (aiui). There is the mmio readback for !llc to ensure that
all GTT writes are flushed to system memory prior to dispatching the
workqueue -- that technically doesn't require rpm either.

I'm a bit more hesistant about adding such a comment to the guc atm, as
I think I will be more misleading then helpful.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-04-12  8:31 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-10 15:49 [PATCH] drm/i915/execlists: Document runtime pm for intel_lrc_irq_handler() Chris Wilson
2017-04-10 16:07 ` ✗ Fi.CI.BAT: warning for " Patchwork
2017-04-11 17:58 ` [PATCH] " Chris Wilson
2017-04-12  7:12   ` Tvrtko Ursulin
2017-04-12  8:31     ` Chris Wilson [this message]
2017-04-12 10:22       ` Tvrtko Ursulin
2017-04-11 19:24 ` ✓ Fi.CI.BAT: success for drm/i915/execlists: Document runtime pm for intel_lrc_irq_handler() (rev2) 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=20170412083124.GF4250@nuc-i3427.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tvrtko.ursulin@linux.intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.