All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915/selftests: Don't try to queue a request with zero delay
@ 2017-10-24 22:08 Chris Wilson
  2017-10-24 22:08 ` [PATCH 2/2] drm/i915: Use same test for eviction and submitting kernel context Chris Wilson
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Chris Wilson @ 2017-10-24 22:08 UTC (permalink / raw)
  To: intel-gfx

Instead of trying to create a timer with zero delay (i.e. with expires
set to the current jiffies and not the future, an already expired
timer), execute that request immediately.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/selftests/mock_engine.c | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/selftests/mock_engine.c b/drivers/gpu/drm/i915/selftests/mock_engine.c
index 331c2b09869e..24ea1ef7efec 100644
--- a/drivers/gpu/drm/i915/selftests/mock_engine.c
+++ b/drivers/gpu/drm/i915/selftests/mock_engine.c
@@ -39,15 +39,16 @@ static void hw_delay_complete(struct timer_list *t)
 
 	spin_lock(&engine->hw_lock);
 
-	request = first_request(engine);
-	if (request) {
+	while ((request = first_request(engine))) {
 		list_del_init(&request->link);
 		mock_seqno_advance(&engine->base, request->base.global_seqno);
+		if (request->delay)
+			break;
 	}
-
-	request = first_request(engine);
-	if (request)
+	if (request) {
+		GEM_BUG_ON(!request->delay);
 		mod_timer(&engine->hw_delay, jiffies + request->delay);
+	}
 
 	spin_unlock(&engine->hw_lock);
 }
@@ -98,8 +99,15 @@ static void mock_submit_request(struct drm_i915_gem_request *request)
 
 	spin_lock_irq(&engine->hw_lock);
 	list_add_tail(&mock->link, &engine->hw_queue);
-	if (mock->link.prev == &engine->hw_queue)
-		mod_timer(&engine->hw_delay, jiffies + mock->delay);
+	if (mock->link.prev == &engine->hw_queue) {
+		if (mock->delay) {
+			mod_timer(&engine->hw_delay, jiffies + mock->delay);
+		} else {
+			list_del_init(&mock->link);
+			mock_seqno_advance(&engine->base,
+					   mock->base.global_seqno);
+		}
+	}
 	spin_unlock_irq(&engine->hw_lock);
 }
 
-- 
2.15.0.rc2

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

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2017-10-25 15:35 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-24 22:08 [PATCH 1/2] drm/i915/selftests: Don't try to queue a request with zero delay Chris Wilson
2017-10-24 22:08 ` [PATCH 2/2] drm/i915: Use same test for eviction and submitting kernel context Chris Wilson
2017-10-25 11:07   ` Joonas Lahtinen
2017-10-25 15:35     ` Chris Wilson
2017-10-24 23:31 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915/selftests: Don't try to queue a request with zero delay Patchwork
2017-10-25 10:06 ` [PATCH v2] " Chris Wilson
2017-10-25 10:11   ` Chris Wilson
2017-10-25 10:17 ` [PATCH v3] " Chris Wilson
2017-10-25 10:22   ` Joonas Lahtinen
2017-10-25 10:33 ` ✗ Fi.CI.BAT: warning for series starting with [v2] drm/i915/selftests: Don't try to queue a request with zero delay (rev2) Patchwork
2017-10-25 10:51 ` ✗ Fi.CI.BAT: warning for series starting with [v3] drm/i915/selftests: Don't try to queue a request with zero delay (rev3) Patchwork

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.