All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: intel-gfx@lists.freedesktop.org
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Subject: [Intel-gfx] [PATCH 1/2] drm/i915: Add a few asserts around handling of i915_request_is_active()
Date: Fri, 29 May 2020 09:58:08 +0100	[thread overview]
Message-ID: <20200529085809.23691-1-chris@chris-wilson.co.uk> (raw)

Let's assert that we only call the execute callbacks on making the
request active, and that we do not execute the request without calling
the callbacks.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_request.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c
index 0d810a62ff46..e5aba6824e26 100644
--- a/drivers/gpu/drm/i915/i915_request.c
+++ b/drivers/gpu/drm/i915/i915_request.c
@@ -192,6 +192,7 @@ static void __notify_execute_cb(struct i915_request *rq)
 
 	lockdep_assert_held(&rq->lock);
 
+	GEM_BUG_ON(!i915_request_is_active(rq));
 	if (llist_empty(&rq->execute_cb))
 		return;
 
@@ -518,15 +519,15 @@ bool __i915_request_submit(struct i915_request *request)
 	if (!test_and_set_bit(I915_FENCE_FLAG_ACTIVE, &request->fence.flags)) {
 		list_move_tail(&request->sched.link, &engine->active.requests);
 		clear_bit(I915_FENCE_FLAG_PQUEUE, &request->fence.flags);
+		__notify_execute_cb(request);
 	}
+	GEM_BUG_ON(!llist_empty(&request->execute_cb));
 
 	if (test_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT, &request->fence.flags) &&
 	    !test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &request->fence.flags) &&
 	    !i915_request_enable_breadcrumb(request))
 		intel_engine_signal_breadcrumbs(engine);
 
-	__notify_execute_cb(request);
-
 	spin_unlock(&request->lock);
 
 	return result;
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

             reply	other threads:[~2020-05-29  8:58 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-29  8:58 Chris Wilson [this message]
2020-05-29  8:58 ` [Intel-gfx] [PATCH 2/2] drm/i915: Once executed, always executed Chris Wilson
2020-05-29 10:09   ` [Intel-gfx] [PATCH v2] drm/i915: Check for awaits on still currently executing requests Chris Wilson
2020-05-29 10:17   ` [Intel-gfx] [PATCH v3] " Chris Wilson
2020-05-29 12:28   ` [Intel-gfx] [PATCH v4] " Chris Wilson
2020-05-29 14:03     ` Chris Wilson
2020-05-29 14:39     ` [Intel-gfx] [PATCH v2] " Chris Wilson
2020-05-29 16:01       ` Tvrtko Ursulin
2020-05-29  9:28 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Add a few asserts around handling of i915_request_is_active() Patchwork
2020-05-29 10:31 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2020-05-29 10:44 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915: Add a few asserts around handling of i915_request_is_active() (rev2) Patchwork
2020-05-29 11:33 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Add a few asserts around handling of i915_request_is_active() (rev3) Patchwork
2020-05-29 12:54 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2020-05-29 13:18 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Add a few asserts around handling of i915_request_is_active() (rev4) Patchwork
2020-05-29 13:57 ` [Intel-gfx] [PATCH 1/2] drm/i915: Add a few asserts around handling of i915_request_is_active() Tvrtko Ursulin
2020-05-29 14:44 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for series starting with [1/2] drm/i915: Add a few asserts around handling of i915_request_is_active() (rev4) Patchwork
2020-05-29 15:24 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Add a few asserts around handling of i915_request_is_active() (rev5) Patchwork
2020-05-29 17:42 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2020-05-29 17:46 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Add a few asserts around handling of i915_request_is_active() (rev6) Patchwork
2020-05-29 20:07 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=20200529085809.23691-1-chris@chris-wilson.co.uk \
    --to=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 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.