From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 06/10] drm/i915/gt: Move intel_breadcrumbs_arm_irq earlier
Date: Wed, 22 Jul 2020 13:55:38 +0100 [thread overview]
Message-ID: <670bb129-cfec-1697-3285-ef0132a56d47@linux.intel.com> (raw)
In-Reply-To: <20200720092312.16975-6-chris@chris-wilson.co.uk>
On 20/07/2020 10:23, Chris Wilson wrote:
> Move the __intel_breadcrumbs_arm_irq earlier, next to the disarm_irq, so
> that we can make use of it in the following patch.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/gt/intel_breadcrumbs.c | 88 ++++++++++-----------
> 1 file changed, 44 insertions(+), 44 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c b/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c
> index 621cf9d1d7ad..d6008034869f 100644
> --- a/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c
> +++ b/drivers/gpu/drm/i915/gt/intel_breadcrumbs.c
> @@ -54,6 +54,37 @@ static void irq_disable(struct intel_engine_cs *engine)
> spin_unlock(&engine->gt->irq_lock);
> }
>
> +static void __intel_breadcrumbs_arm_irq(struct intel_breadcrumbs *b)
> +{
> + lockdep_assert_held(&b->irq_lock);
> +
> + if (b->irq_armed)
> + return;
> +
> + GEM_BUG_ON(!b->irq_engine);
> + if (!intel_gt_pm_get_if_awake(b->irq_engine->gt))
> + return;
> +
> + /*
> + * The breadcrumb irq will be disarmed on the interrupt after the
> + * waiters are signaled. This gives us a single interrupt window in
> + * which we can add a new waiter and avoid the cost of re-enabling
> + * the irq.
> + */
> + WRITE_ONCE(b->irq_armed, true);
> +
> + /*
> + * Since we are waiting on a request, the GPU should be busy
> + * and should have its own rpm reference. This is tracked
> + * by i915->gt.awake, we can forgo holding our own wakref
> + * for the interrupt as before i915->gt.awake is released (when
> + * the driver is idle) we disarm the breadcrumbs.
> + */
> +
> + if (!b->irq_enabled++)
> + irq_enable(b->irq_engine);
> +}
> +
> static void __intel_breadcrumbs_disarm_irq(struct intel_breadcrumbs *b)
> {
> lockdep_assert_held(&b->irq_lock);
> @@ -69,19 +100,6 @@ static void __intel_breadcrumbs_disarm_irq(struct intel_breadcrumbs *b)
> intel_gt_pm_put_async(b->irq_engine->gt);
> }
>
> -void intel_breadcrumbs_park(struct intel_breadcrumbs *b)
> -{
> - unsigned long flags;
> -
> - if (!READ_ONCE(b->irq_armed))
> - return;
> -
> - spin_lock_irqsave(&b->irq_lock, flags);
> - if (b->irq_armed)
> - __intel_breadcrumbs_disarm_irq(b);
> - spin_unlock_irqrestore(&b->irq_lock, flags);
> -}
> -
> static inline bool __request_completed(const struct i915_request *rq)
> {
> return i915_seqno_passed(__hwsp_seqno(rq), rq->fence.seqno);
> @@ -215,37 +233,6 @@ static void signal_irq_work(struct irq_work *work)
> }
> }
>
> -static void __intel_breadcrumbs_arm_irq(struct intel_breadcrumbs *b)
> -{
> - lockdep_assert_held(&b->irq_lock);
> -
> - if (b->irq_armed)
> - return;
> -
> - GEM_BUG_ON(!b->irq_engine);
> - if (!intel_gt_pm_get_if_awake(b->irq_engine->gt))
> - return;
> -
> - /*
> - * The breadcrumb irq will be disarmed on the interrupt after the
> - * waiters are signaled. This gives us a single interrupt window in
> - * which we can add a new waiter and avoid the cost of re-enabling
> - * the irq.
> - */
> - WRITE_ONCE(b->irq_armed, true);
> -
> - /*
> - * Since we are waiting on a request, the GPU should be busy
> - * and should have its own rpm reference. This is tracked
> - * by i915->gt.awake, we can forgo holding our own wakref
> - * for the interrupt as before i915->gt.awake is released (when
> - * the driver is idle) we disarm the breadcrumbs.
> - */
> -
> - if (!b->irq_enabled++)
> - irq_enable(b->irq_engine);
> -}
> -
> struct intel_breadcrumbs *
> intel_breadcrumbs_create(struct intel_engine_cs *irq_engine)
> {
> @@ -285,6 +272,19 @@ void intel_breadcrumbs_reset(struct intel_breadcrumbs *b)
> spin_unlock_irqrestore(&b->irq_lock, flags);
> }
>
> +void intel_breadcrumbs_park(struct intel_breadcrumbs *b)
> +{
> + unsigned long flags;
> +
> + if (!READ_ONCE(b->irq_armed))
> + return;
> +
> + spin_lock_irqsave(&b->irq_lock, flags);
> + if (b->irq_armed)
> + __intel_breadcrumbs_disarm_irq(b);
> + spin_unlock_irqrestore(&b->irq_lock, flags);
> +}
> +
> void intel_breadcrumbs_free(struct intel_breadcrumbs *b)
> {
> kfree(b);
>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2020-07-22 12:55 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-20 9:23 [Intel-gfx] [PATCH 01/10] drm/i915/gem: Remove disordered per-file request list for throttling Chris Wilson
2020-07-20 9:23 ` [Intel-gfx] [PATCH 02/10] drm/i915: Remove requirement for holding i915_request.lock for breadcrumbs Chris Wilson
2020-07-20 9:23 ` [Intel-gfx] [PATCH 03/10] drm/i915/gt: Replace intel_engine_transfer_stale_breadcrumbs Chris Wilson
2020-07-20 9:32 ` Tvrtko Ursulin
2020-07-20 9:23 ` [Intel-gfx] [PATCH 04/10] drm/i915/gt: Only transfer the virtual context to the new engine if active Chris Wilson
2020-07-20 9:23 ` [Intel-gfx] [PATCH 05/10] drm/i915/gt: Distinguish the virtual breadcrumbs from the irq breadcrumbs Chris Wilson
2020-07-20 11:23 ` Tvrtko Ursulin
2020-07-20 15:02 ` Chris Wilson
2020-07-22 8:12 ` Tvrtko Ursulin
2020-07-22 8:30 ` Chris Wilson
2020-07-21 7:59 ` kernel test robot
2020-07-20 9:23 ` [Intel-gfx] [PATCH 06/10] drm/i915/gt: Move intel_breadcrumbs_arm_irq earlier Chris Wilson
2020-07-22 12:55 ` Tvrtko Ursulin [this message]
2020-07-20 9:23 ` [Intel-gfx] [PATCH 07/10] drm/i915/gt: Hold context/request reference while breadcrumbs are active Chris Wilson
2020-07-22 13:05 ` Tvrtko Ursulin
2020-07-22 13:11 ` Chris Wilson
2020-07-20 9:23 ` [Intel-gfx] [PATCH 08/10] drm/i915/gt: Track signaled breadcrumbs outside of the breadcrumb spinlock Chris Wilson
2020-07-22 13:26 ` Tvrtko Ursulin
2020-07-22 13:42 ` Chris Wilson
2020-07-20 9:23 ` [Intel-gfx] [PATCH 09/10] drm/i915/gt: Split the breadcrumb spinlock between global and contexts Chris Wilson
2020-07-20 9:23 ` [Intel-gfx] [PATCH 10/10] drm/i915: Drop i915_request.lock serialisation around await_start Chris Wilson
2020-07-20 10:33 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [01/10] drm/i915/gem: Remove disordered per-file request list for throttling Patchwork
2020-07-20 10:34 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2020-07-20 10:55 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-07-20 13:44 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " 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=670bb129-cfec-1697-3285-ef0132a56d47@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--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