All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 1/2] lib: Spin fast, retire early
@ 2018-06-20 11:57 ` Chris Wilson
  0 siblings, 0 replies; 9+ messages in thread
From: Chris Wilson @ 2018-06-20 11:57 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

When using the pollable spinner, we often want to use it as a means of
ensuring the task is running on the GPU before switching to something
else. In which case we don't want to add extra delay inside the spinner,
but the current 1000 NOPs add on order of 5us, which is often larger
than the target latency.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
---
 lib/igt_dummyload.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index 3809b4e61..d73b4abd5 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -77,6 +77,7 @@ fill_reloc(struct drm_i915_gem_relocation_entry *reloc,
 
 #define OUT_FENCE	(1 << 0)
 #define POLL_RUN	(1 << 1)
+#define SPIN_FAST       (1 << 2)
 
 static int
 emit_recursive_batch(igt_spin_t *spin, int fd, uint32_t ctx, unsigned engine,
@@ -205,7 +206,8 @@ emit_recursive_batch(igt_spin_t *spin, int fd, uint32_t ctx, unsigned engine,
 	 * between function calls, that appears enough to keep SNB out of
 	 * trouble. See https://bugs.freedesktop.org/show_bug.cgi?id=102262
 	 */
-	batch += 1000;
+	if (!(flags & SPIN_FAST))
+		batch += 1000;
 
 	/* recurse */
 	r = &relocs[obj[BATCH].relocation_count++];
@@ -362,7 +364,7 @@ igt_spin_batch_new_fence(int fd, uint32_t ctx, unsigned engine)
 igt_spin_t *
 __igt_spin_batch_new_poll(int fd, uint32_t ctx, unsigned engine)
 {
-	return ___igt_spin_batch_new(fd, ctx, engine, 0, POLL_RUN);
+	return ___igt_spin_batch_new(fd, ctx, engine, 0, POLL_RUN | SPIN_FAST);
 }
 
 /**
-- 
2.18.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] 9+ messages in thread
* [PATCH i-g-t 1/2] lib: Spin fast, retire early
@ 2018-06-20 11:55 Chris Wilson
  2018-06-20 15:00 ` [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/2] " Patchwork
  0 siblings, 1 reply; 9+ messages in thread
From: Chris Wilson @ 2018-06-20 11:55 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

When using the pollable spinner, we often want to use it as a means of
ensuring the task is running on the GPU before switching to something
else. In which case we don't want to add extra delay inside the spinner,
but the current 1000 NOPs add on order of 5us, which is often larger
than the target latency.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
---
 lib/igt_dummyload.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index 3809b4e61..d73b4abd5 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -77,6 +77,7 @@ fill_reloc(struct drm_i915_gem_relocation_entry *reloc,
 
 #define OUT_FENCE	(1 << 0)
 #define POLL_RUN	(1 << 1)
+#define SPIN_FAST       (1 << 2)
 
 static int
 emit_recursive_batch(igt_spin_t *spin, int fd, uint32_t ctx, unsigned engine,
@@ -205,7 +206,8 @@ emit_recursive_batch(igt_spin_t *spin, int fd, uint32_t ctx, unsigned engine,
 	 * between function calls, that appears enough to keep SNB out of
 	 * trouble. See https://bugs.freedesktop.org/show_bug.cgi?id=102262
 	 */
-	batch += 1000;
+	if (!(flags & SPIN_FAST))
+		batch += 1000;
 
 	/* recurse */
 	r = &relocs[obj[BATCH].relocation_count++];
@@ -362,7 +364,7 @@ igt_spin_batch_new_fence(int fd, uint32_t ctx, unsigned engine)
 igt_spin_t *
 __igt_spin_batch_new_poll(int fd, uint32_t ctx, unsigned engine)
 {
-	return ___igt_spin_batch_new(fd, ctx, engine, 0, POLL_RUN);
+	return ___igt_spin_batch_new(fd, ctx, engine, 0, POLL_RUN | SPIN_FAST);
 }
 
 /**
-- 
2.18.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] 9+ messages in thread

end of thread, other threads:[~2018-06-20 21:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-20 11:57 [PATCH i-g-t 1/2] lib: Spin fast, retire early Chris Wilson
2018-06-20 11:57 ` [Intel-gfx] " Chris Wilson
2018-06-20 11:57 ` [PATCH i-g-t 2/2] igt/perf_pmu: Fast slow then meander Chris Wilson
2018-06-20 11:57   ` [igt-dev] " Chris Wilson
2018-06-20 12:11 ` [PATCH i-g-t 1/2] lib: Spin fast, retire early Joonas Lahtinen
2018-06-20 12:11   ` [igt-dev] [Intel-gfx] " Joonas Lahtinen
2018-06-20 16:19 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] " Patchwork
2018-06-20 21:44 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  -- strict thread matches above, loose matches on Subject: below --
2018-06-20 11:55 [PATCH i-g-t 1/2] " Chris Wilson
2018-06-20 15:00 ` [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/2] " 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.