All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH igt] igt/gem_fenced_exec_thrash: Use fixed durations
@ 2018-02-19 16:10 ` Chris Wilson
  0 siblings, 0 replies; 9+ messages in thread
From: Chris Wilson @ 2018-02-19 16:10 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

Convert from using constant loops of indeterminate loads over to using a
duration based with precise dummyloads, we are able to do more cycles in
less time by limiting the amount of BUSY_LOAD required to exercise the
test.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/gem_fenced_exec_thrash.c | 109 ++++++++++-------------------------------
 1 file changed, 27 insertions(+), 82 deletions(-)

diff --git a/tests/gem_fenced_exec_thrash.c b/tests/gem_fenced_exec_thrash.c
index 9a43c845..5a28a4ce 100644
--- a/tests/gem_fenced_exec_thrash.c
+++ b/tests/gem_fenced_exec_thrash.c
@@ -25,17 +25,12 @@
  *
  */
 
-#include "igt.h"
 #include <stdlib.h>
-#include <sys/ioctl.h>
-#include <stdio.h>
 #include <string.h>
-#include <fcntl.h>
 #include <inttypes.h>
 #include <errno.h>
 
-#include <drm.h>
-
+#include "igt.h"
 
 IGT_TEST_DESCRIPTION("Test execbuf fence accounting.");
 
@@ -59,53 +54,6 @@ IGT_TEST_DESCRIPTION("Test execbuf fence accounting.");
  * each command.
  */
 
-static drm_intel_bufmgr *bufmgr;
-struct intel_batchbuffer *batch;
-uint32_t devid;
-
-static void emit_dummy_load(void)
-{
-	int i;
-	uint32_t tile_flags = 0;
-	uint32_t tiling_mode = I915_TILING_X;
-	unsigned long pitch;
-	drm_intel_bo *dummy_bo;
-
-	dummy_bo = drm_intel_bo_alloc_tiled(bufmgr, "tiled dummy_bo", 2048, 2048,
-				      4, &tiling_mode, &pitch, 0);
-
-	if (IS_965(devid)) {
-		pitch /= 4;
-		tile_flags = XY_SRC_COPY_BLT_SRC_TILED |
-			XY_SRC_COPY_BLT_DST_TILED;
-	}
-
-	for (i = 0; i < 5; i++) {
-		BLIT_COPY_BATCH_START(tile_flags);
-		OUT_BATCH((3 << 24) | /* 32 bits */
-			  (0xcc << 16) | /* copy ROP */
-			  pitch);
-		OUT_BATCH(0 << 16 | 1024);
-		OUT_BATCH((2048) << 16 | (2048));
-		OUT_RELOC_FENCED(dummy_bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0);
-		OUT_BATCH(0 << 16 | 0);
-		OUT_BATCH(pitch);
-		OUT_RELOC_FENCED(dummy_bo, I915_GEM_DOMAIN_RENDER, 0, 0);
-		ADVANCE_BATCH();
-
-		if (batch->gen >= 6) {
-			BEGIN_BATCH(3, 0);
-			OUT_BATCH(XY_SETUP_CLIP_BLT_CMD);
-			OUT_BATCH(0);
-			OUT_BATCH(0);
-			ADVANCE_BATCH();
-		}
-	}
-	intel_batchbuffer_flush(batch);
-
-	drm_intel_bo_unreference(dummy_bo);
-}
-
 static uint32_t
 tiled_bo_create (int fd)
 {
@@ -149,19 +97,10 @@ static void run_test(int fd, int num_fences, int expected_errno,
 	struct drm_i915_gem_exec_object2 exec[2][2*MAX_FENCES+3];
 	struct drm_i915_gem_relocation_entry reloc[2*MAX_FENCES+2];
 
+	unsigned long count;
 	int i, n;
-	int loop = 1000;
-
-	if (flags & BUSY_LOAD) {
-		bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
-		batch = intel_batchbuffer_alloc(bufmgr, devid);
 
-		/* Takes forever otherwise. */
-		loop = 50;
-	}
-
-	if (flags & INTERRUPTIBLE)
-		igt_fork_signal_helper();
+	igt_assert(2*num_fences+1 < ARRAY_SIZE(exec[0]));
 
 	memset(execbuf, 0, sizeof(execbuf));
 	memset(exec, 0, sizeof(exec));
@@ -186,16 +125,25 @@ static void run_test(int fd, int num_fences, int expected_errno,
 		execbuf[i].batch_len = 2*sizeof(uint32_t);
 	}
 
-	do {
-		if (flags & BUSY_LOAD)
-			emit_dummy_load();
+	count = 0;
+	igt_until_timeout(2) {
+		for (i = 0; i < 2; i++) {
+			igt_spin_t *spin = NULL;
+
+			if (flags & BUSY_LOAD)
+				spin = __igt_spin_batch_new(fd, 0, 0, 0);
 
-		igt_assert_eq(__gem_execbuf(fd, &execbuf[0]), -expected_errno);
-		igt_assert_eq(__gem_execbuf(fd, &execbuf[1]), -expected_errno);
-	} while (--loop);
+			igt_while_interruptible(flags & INTERRUPTIBLE) {
+				igt_assert_eq(__gem_execbuf(fd, &execbuf[i]),
+					      -expected_errno);
+			}
 
-	if (flags & INTERRUPTIBLE)
-		igt_stop_signal_helper();
+			igt_spin_batch_free(fd, spin);
+			gem_quiescent_gpu(fd);
+		}
+		count++;
+	}
+	igt_info("Completed %lu cycles\n", count);
 
 	/* Cleanup */
 	for (n = 0; n < 2*num_fences; n++)
@@ -203,28 +151,25 @@ static void run_test(int fd, int num_fences, int expected_errno,
 
 	for (i = 0; i < 2; i++)
 		gem_close(fd, exec[i][2*num_fences].handle);
-
-	if (flags & BUSY_LOAD) {
-		intel_batchbuffer_free(batch);
-		drm_intel_bufmgr_destroy(bufmgr);
-	}
 }
 
-int fd;
-int num_fences;
-
 igt_main
 {
+	uint32_t devid = 0;
+	unsigned int num_fences = 0;
+	int fd = -1;
+
 	igt_skip_on_simulation();
 
 	igt_fixture {
 		fd = drm_open_driver(DRIVER_INTEL);
 		igt_require_gem(fd);
+
 		num_fences = gem_available_fences(fd);
 		igt_assert(num_fences > 4);
-		devid = intel_get_drm_devid(fd);
-
 		igt_assert(num_fences <= MAX_FENCES);
+
+		devid = intel_get_drm_devid(fd);
 	}
 
 	igt_subtest("2-spare-fences")
-- 
2.16.1

_______________________________________________
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

* [igt-dev] [PATCH igt] igt/gem_fenced_exec_thrash: Use fixed durations
@ 2018-02-19 16:10 ` Chris Wilson
  0 siblings, 0 replies; 9+ messages in thread
From: Chris Wilson @ 2018-02-19 16:10 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

Convert from using constant loops of indeterminate loads over to using a
duration based with precise dummyloads, we are able to do more cycles in
less time by limiting the amount of BUSY_LOAD required to exercise the
test.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/gem_fenced_exec_thrash.c | 109 ++++++++++-------------------------------
 1 file changed, 27 insertions(+), 82 deletions(-)

diff --git a/tests/gem_fenced_exec_thrash.c b/tests/gem_fenced_exec_thrash.c
index 9a43c845..5a28a4ce 100644
--- a/tests/gem_fenced_exec_thrash.c
+++ b/tests/gem_fenced_exec_thrash.c
@@ -25,17 +25,12 @@
  *
  */
 
-#include "igt.h"
 #include <stdlib.h>
-#include <sys/ioctl.h>
-#include <stdio.h>
 #include <string.h>
-#include <fcntl.h>
 #include <inttypes.h>
 #include <errno.h>
 
-#include <drm.h>
-
+#include "igt.h"
 
 IGT_TEST_DESCRIPTION("Test execbuf fence accounting.");
 
@@ -59,53 +54,6 @@ IGT_TEST_DESCRIPTION("Test execbuf fence accounting.");
  * each command.
  */
 
-static drm_intel_bufmgr *bufmgr;
-struct intel_batchbuffer *batch;
-uint32_t devid;
-
-static void emit_dummy_load(void)
-{
-	int i;
-	uint32_t tile_flags = 0;
-	uint32_t tiling_mode = I915_TILING_X;
-	unsigned long pitch;
-	drm_intel_bo *dummy_bo;
-
-	dummy_bo = drm_intel_bo_alloc_tiled(bufmgr, "tiled dummy_bo", 2048, 2048,
-				      4, &tiling_mode, &pitch, 0);
-
-	if (IS_965(devid)) {
-		pitch /= 4;
-		tile_flags = XY_SRC_COPY_BLT_SRC_TILED |
-			XY_SRC_COPY_BLT_DST_TILED;
-	}
-
-	for (i = 0; i < 5; i++) {
-		BLIT_COPY_BATCH_START(tile_flags);
-		OUT_BATCH((3 << 24) | /* 32 bits */
-			  (0xcc << 16) | /* copy ROP */
-			  pitch);
-		OUT_BATCH(0 << 16 | 1024);
-		OUT_BATCH((2048) << 16 | (2048));
-		OUT_RELOC_FENCED(dummy_bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0);
-		OUT_BATCH(0 << 16 | 0);
-		OUT_BATCH(pitch);
-		OUT_RELOC_FENCED(dummy_bo, I915_GEM_DOMAIN_RENDER, 0, 0);
-		ADVANCE_BATCH();
-
-		if (batch->gen >= 6) {
-			BEGIN_BATCH(3, 0);
-			OUT_BATCH(XY_SETUP_CLIP_BLT_CMD);
-			OUT_BATCH(0);
-			OUT_BATCH(0);
-			ADVANCE_BATCH();
-		}
-	}
-	intel_batchbuffer_flush(batch);
-
-	drm_intel_bo_unreference(dummy_bo);
-}
-
 static uint32_t
 tiled_bo_create (int fd)
 {
@@ -149,19 +97,10 @@ static void run_test(int fd, int num_fences, int expected_errno,
 	struct drm_i915_gem_exec_object2 exec[2][2*MAX_FENCES+3];
 	struct drm_i915_gem_relocation_entry reloc[2*MAX_FENCES+2];
 
+	unsigned long count;
 	int i, n;
-	int loop = 1000;
-
-	if (flags & BUSY_LOAD) {
-		bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
-		batch = intel_batchbuffer_alloc(bufmgr, devid);
 
-		/* Takes forever otherwise. */
-		loop = 50;
-	}
-
-	if (flags & INTERRUPTIBLE)
-		igt_fork_signal_helper();
+	igt_assert(2*num_fences+1 < ARRAY_SIZE(exec[0]));
 
 	memset(execbuf, 0, sizeof(execbuf));
 	memset(exec, 0, sizeof(exec));
@@ -186,16 +125,25 @@ static void run_test(int fd, int num_fences, int expected_errno,
 		execbuf[i].batch_len = 2*sizeof(uint32_t);
 	}
 
-	do {
-		if (flags & BUSY_LOAD)
-			emit_dummy_load();
+	count = 0;
+	igt_until_timeout(2) {
+		for (i = 0; i < 2; i++) {
+			igt_spin_t *spin = NULL;
+
+			if (flags & BUSY_LOAD)
+				spin = __igt_spin_batch_new(fd, 0, 0, 0);
 
-		igt_assert_eq(__gem_execbuf(fd, &execbuf[0]), -expected_errno);
-		igt_assert_eq(__gem_execbuf(fd, &execbuf[1]), -expected_errno);
-	} while (--loop);
+			igt_while_interruptible(flags & INTERRUPTIBLE) {
+				igt_assert_eq(__gem_execbuf(fd, &execbuf[i]),
+					      -expected_errno);
+			}
 
-	if (flags & INTERRUPTIBLE)
-		igt_stop_signal_helper();
+			igt_spin_batch_free(fd, spin);
+			gem_quiescent_gpu(fd);
+		}
+		count++;
+	}
+	igt_info("Completed %lu cycles\n", count);
 
 	/* Cleanup */
 	for (n = 0; n < 2*num_fences; n++)
@@ -203,28 +151,25 @@ static void run_test(int fd, int num_fences, int expected_errno,
 
 	for (i = 0; i < 2; i++)
 		gem_close(fd, exec[i][2*num_fences].handle);
-
-	if (flags & BUSY_LOAD) {
-		intel_batchbuffer_free(batch);
-		drm_intel_bufmgr_destroy(bufmgr);
-	}
 }
 
-int fd;
-int num_fences;
-
 igt_main
 {
+	uint32_t devid = 0;
+	unsigned int num_fences = 0;
+	int fd = -1;
+
 	igt_skip_on_simulation();
 
 	igt_fixture {
 		fd = drm_open_driver(DRIVER_INTEL);
 		igt_require_gem(fd);
+
 		num_fences = gem_available_fences(fd);
 		igt_assert(num_fences > 4);
-		devid = intel_get_drm_devid(fd);
-
 		igt_assert(num_fences <= MAX_FENCES);
+
+		devid = intel_get_drm_devid(fd);
 	}
 
 	igt_subtest("2-spare-fences")
-- 
2.16.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.BAT: success for igt/gem_fenced_exec_thrash: Use fixed durations
  2018-02-19 16:10 ` [igt-dev] " Chris Wilson
  (?)
@ 2018-02-19 17:05 ` Patchwork
  -1 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2018-02-19 17:05 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

== Series Details ==

Series: igt/gem_fenced_exec_thrash: Use fixed durations
URL   : https://patchwork.freedesktop.org/series/38536/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
a68b3060dec0c59d3c6403f551fecf3bc4a1fd64 igt/perf_pmu: Retain original GTT offset when resubmitting the spinner

with latest DRM-Tip kernel build CI_DRM_3800
92b39eb6f562 drm-tip: 2018y-02m-19d-15h-50m-23s UTC integration manifest

No testlist changes.

Test debugfs_test:
        Subgroup read_all_entries:
                pass       -> INCOMPLETE (fi-snb-2520m) fdo#103713
Test gem_mmap_gtt:
        Subgroup basic-small-bo-tiledx:
                fail       -> PASS       (fi-gdg-551) fdo#102575
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-c:
                pass       -> INCOMPLETE (fi-bxt-dsi) fdo#103927

fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:423s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:428s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:376s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:495s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:288s
fi-bxt-dsi       total:246  pass:219  dwarn:0   dfail:0   fail:0   skip:26 
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:488s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:474s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:464s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:573s
fi-cnl-y3        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:579s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:414s
fi-gdg-551       total:288  pass:180  dwarn:0   dfail:0   fail:0   skip:108 time:282s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:511s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:396s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:416s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:459s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:414s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:457s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:499s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:453s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:503s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:594s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:431s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:510s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:527s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:499s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:473s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:415s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:434s
fi-snb-2520m     total:3    pass:2    dwarn:0   dfail:0   fail:0   skip:0  
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:398s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_953/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✗ Fi.CI.IGT: failure for igt/gem_fenced_exec_thrash: Use fixed durations
  2018-02-19 16:10 ` [igt-dev] " Chris Wilson
  (?)
  (?)
@ 2018-02-19 21:35 ` Patchwork
  -1 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2018-02-19 21:35 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

== Series Details ==

Series: igt/gem_fenced_exec_thrash: Use fixed durations
URL   : https://patchwork.freedesktop.org/series/38536/
State : failure

== Summary ==

Test kms_flip:
        Subgroup flip-vs-blocking-wf-vblank:
                pass       -> FAIL       (shard-hsw) fdo#100368
Test kms_rotation_crc:
        Subgroup sprite-rotation-180:
                fail       -> PASS       (shard-snb) fdo#103925
Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-primscrn-pri-indfb-draw-render:
                fail       -> PASS       (shard-snb) fdo#101623
        Subgroup fbc-1p-primscrn-shrfb-plflip-blt:
                pass       -> DMESG-FAIL (shard-apl) fdo#103167
Test perf:
        Subgroup oa-exponents:
                fail       -> PASS       (shard-apl) fdo#102254
Test pm_rc6_residency:
        Subgroup rc6-accuracy:
                pass       -> SKIP       (shard-snb)
Test kms_sysfs_edid_timing:
                pass       -> WARN       (shard-apl) fdo#100047
Test gem_fenced_exec_thrash:
        Subgroup too-many-fences:
                pass       -> FAIL       (shard-hsw)

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#102254 https://bugs.freedesktop.org/show_bug.cgi?id=102254
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047

shard-apl        total:3350 pass:1747 dwarn:1   dfail:1   fail:11  skip:1588 time:12226s
shard-hsw        total:3434 pass:1760 dwarn:1   dfail:0   fail:4   skip:1668 time:11875s
shard-snb        total:3434 pass:1352 dwarn:1   dfail:0   fail:2   skip:2079 time:6685s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_953/shards.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH igt] igt/gem_fenced_exec_thrash: Use fixed durations
  2018-02-19 16:10 ` [igt-dev] " Chris Wilson
@ 2018-02-20 10:11   ` Joonas Lahtinen
  -1 siblings, 0 replies; 9+ messages in thread
From: Joonas Lahtinen @ 2018-02-20 10:11 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev

Quoting Chris Wilson (2018-02-19 18:10:03)
> Convert from using constant loops of indeterminate loads over to using a
> duration based with precise dummyloads, we are able to do more cycles in
> less time by limiting the amount of BUSY_LOAD required to exercise the
> test.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

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

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

* Re: [igt-dev] [PATCH igt] igt/gem_fenced_exec_thrash: Use fixed durations
@ 2018-02-20 10:11   ` Joonas Lahtinen
  0 siblings, 0 replies; 9+ messages in thread
From: Joonas Lahtinen @ 2018-02-20 10:11 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev

Quoting Chris Wilson (2018-02-19 18:10:03)
> Convert from using constant loops of indeterminate loads over to using a
> duration based with precise dummyloads, we are able to do more cycles in
> less time by limiting the amount of BUSY_LOAD required to exercise the
> test.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>

Regards, Joonas
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] [PATCH igt v2] igt/gem_fenced_exec_thrash: Use fixed durations
  2018-02-19 16:10 ` [igt-dev] " Chris Wilson
                   ` (3 preceding siblings ...)
  (?)
@ 2018-02-20 10:44 ` Chris Wilson
  -1 siblings, 0 replies; 9+ messages in thread
From: Chris Wilson @ 2018-02-20 10:44 UTC (permalink / raw)
  To: igt-dev

Convert from using constant loops of indeterminate loads over to using a
duration based with precise dummyloads, we are able to do more cycles in
less time by limiting the amount of BUSY_LOAD required to exercise the
test.

v2: Bump limits and make the checks tighter.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
---
 tests/gem_fenced_exec_thrash.c | 116 +++++++++++------------------------------
 1 file changed, 31 insertions(+), 85 deletions(-)

diff --git a/tests/gem_fenced_exec_thrash.c b/tests/gem_fenced_exec_thrash.c
index 9a43c845..385790ad 100644
--- a/tests/gem_fenced_exec_thrash.c
+++ b/tests/gem_fenced_exec_thrash.c
@@ -25,17 +25,12 @@
  *
  */
 
-#include "igt.h"
 #include <stdlib.h>
-#include <sys/ioctl.h>
-#include <stdio.h>
 #include <string.h>
-#include <fcntl.h>
 #include <inttypes.h>
 #include <errno.h>
 
-#include <drm.h>
-
+#include "igt.h"
 
 IGT_TEST_DESCRIPTION("Test execbuf fence accounting.");
 
@@ -45,7 +40,7 @@ IGT_TEST_DESCRIPTION("Test execbuf fence accounting.");
 
 #define BATCH_SIZE 4096
 
-#define MAX_FENCES 32
+#define MAX_FENCES 64
 
 /*
  * Testcase: execbuf fence accounting
@@ -59,53 +54,6 @@ IGT_TEST_DESCRIPTION("Test execbuf fence accounting.");
  * each command.
  */
 
-static drm_intel_bufmgr *bufmgr;
-struct intel_batchbuffer *batch;
-uint32_t devid;
-
-static void emit_dummy_load(void)
-{
-	int i;
-	uint32_t tile_flags = 0;
-	uint32_t tiling_mode = I915_TILING_X;
-	unsigned long pitch;
-	drm_intel_bo *dummy_bo;
-
-	dummy_bo = drm_intel_bo_alloc_tiled(bufmgr, "tiled dummy_bo", 2048, 2048,
-				      4, &tiling_mode, &pitch, 0);
-
-	if (IS_965(devid)) {
-		pitch /= 4;
-		tile_flags = XY_SRC_COPY_BLT_SRC_TILED |
-			XY_SRC_COPY_BLT_DST_TILED;
-	}
-
-	for (i = 0; i < 5; i++) {
-		BLIT_COPY_BATCH_START(tile_flags);
-		OUT_BATCH((3 << 24) | /* 32 bits */
-			  (0xcc << 16) | /* copy ROP */
-			  pitch);
-		OUT_BATCH(0 << 16 | 1024);
-		OUT_BATCH((2048) << 16 | (2048));
-		OUT_RELOC_FENCED(dummy_bo, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, 0);
-		OUT_BATCH(0 << 16 | 0);
-		OUT_BATCH(pitch);
-		OUT_RELOC_FENCED(dummy_bo, I915_GEM_DOMAIN_RENDER, 0, 0);
-		ADVANCE_BATCH();
-
-		if (batch->gen >= 6) {
-			BEGIN_BATCH(3, 0);
-			OUT_BATCH(XY_SETUP_CLIP_BLT_CMD);
-			OUT_BATCH(0);
-			OUT_BATCH(0);
-			ADVANCE_BATCH();
-		}
-	}
-	intel_batchbuffer_flush(batch);
-
-	drm_intel_bo_unreference(dummy_bo);
-}
-
 static uint32_t
 tiled_bo_create (int fd)
 {
@@ -146,22 +94,14 @@ static void run_test(int fd, int num_fences, int expected_errno,
 		     unsigned flags)
 {
 	struct drm_i915_gem_execbuffer2 execbuf[2];
-	struct drm_i915_gem_exec_object2 exec[2][2*MAX_FENCES+3];
-	struct drm_i915_gem_relocation_entry reloc[2*MAX_FENCES+2];
+	struct drm_i915_gem_exec_object2 exec[2][2*MAX_FENCES+1];
+	struct drm_i915_gem_relocation_entry reloc[2*MAX_FENCES];
 
+	unsigned long count;
 	int i, n;
-	int loop = 1000;
-
-	if (flags & BUSY_LOAD) {
-		bufmgr = drm_intel_bufmgr_gem_init(fd, 4096);
-		batch = intel_batchbuffer_alloc(bufmgr, devid);
 
-		/* Takes forever otherwise. */
-		loop = 50;
-	}
-
-	if (flags & INTERRUPTIBLE)
-		igt_fork_signal_helper();
+	igt_assert(2*num_fences+1 <= ARRAY_SIZE(exec[0]));
+	igt_assert(2*num_fences <= ARRAY_SIZE(reloc));
 
 	memset(execbuf, 0, sizeof(execbuf));
 	memset(exec, 0, sizeof(exec));
@@ -186,16 +126,25 @@ static void run_test(int fd, int num_fences, int expected_errno,
 		execbuf[i].batch_len = 2*sizeof(uint32_t);
 	}
 
-	do {
-		if (flags & BUSY_LOAD)
-			emit_dummy_load();
+	count = 0;
+	igt_until_timeout(2) {
+		for (i = 0; i < 2; i++) {
+			igt_spin_t *spin = NULL;
+
+			if (flags & BUSY_LOAD)
+				spin = __igt_spin_batch_new(fd, 0, 0, 0);
 
-		igt_assert_eq(__gem_execbuf(fd, &execbuf[0]), -expected_errno);
-		igt_assert_eq(__gem_execbuf(fd, &execbuf[1]), -expected_errno);
-	} while (--loop);
+			igt_while_interruptible(flags & INTERRUPTIBLE) {
+				igt_assert_eq(__gem_execbuf(fd, &execbuf[i]),
+					      -expected_errno);
+			}
 
-	if (flags & INTERRUPTIBLE)
-		igt_stop_signal_helper();
+			igt_spin_batch_free(fd, spin);
+			gem_quiescent_gpu(fd);
+		}
+		count++;
+	}
+	igt_info("Completed %lu cycles\n", count);
 
 	/* Cleanup */
 	for (n = 0; n < 2*num_fences; n++)
@@ -203,28 +152,25 @@ static void run_test(int fd, int num_fences, int expected_errno,
 
 	for (i = 0; i < 2; i++)
 		gem_close(fd, exec[i][2*num_fences].handle);
-
-	if (flags & BUSY_LOAD) {
-		intel_batchbuffer_free(batch);
-		drm_intel_bufmgr_destroy(bufmgr);
-	}
 }
 
-int fd;
-int num_fences;
-
 igt_main
 {
+	uint32_t devid = 0;
+	unsigned int num_fences = 0;
+	int fd = -1;
+
 	igt_skip_on_simulation();
 
 	igt_fixture {
 		fd = drm_open_driver(DRIVER_INTEL);
 		igt_require_gem(fd);
+
 		num_fences = gem_available_fences(fd);
 		igt_assert(num_fences > 4);
-		devid = intel_get_drm_devid(fd);
-
 		igt_assert(num_fences <= MAX_FENCES);
+
+		devid = intel_get_drm_devid(fd);
 	}
 
 	igt_subtest("2-spare-fences")
-- 
2.16.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.BAT: success for igt/gem_fenced_exec_thrash: Use fixed durations (rev2)
  2018-02-19 16:10 ` [igt-dev] " Chris Wilson
                   ` (4 preceding siblings ...)
  (?)
@ 2018-02-20 12:39 ` Patchwork
  -1 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2018-02-20 12:39 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

== Series Details ==

Series: igt/gem_fenced_exec_thrash: Use fixed durations (rev2)
URL   : https://patchwork.freedesktop.org/series/38536/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
dd61508a38b677dfffc66d5591257ee1e21a4597 lib: Remove overzealous assertion on gem_set_caching()

with latest DRM-Tip kernel build CI_DRM_3805
2c22e35947db drm-tip: 2018y-02m-20d-11h-11m-23s UTC integration manifest

No testlist changes.

Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                incomplete -> PASS       (fi-snb-2520m) fdo#103713

fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:422s
fi-bdw-gvtdvm    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:423s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:375s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:481s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:285s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:482s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:480s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:469s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:462s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:565s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:416s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:285s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:508s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:392s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:411s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:456s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:415s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:455s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:491s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:448s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:496s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:589s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:427s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:495s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:520s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:491s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:470s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:406s
fi-skl-gvtdvm    total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:434s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:523s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:399s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_960/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✓ Fi.CI.IGT: success for igt/gem_fenced_exec_thrash: Use fixed durations (rev2)
  2018-02-19 16:10 ` [igt-dev] " Chris Wilson
                   ` (5 preceding siblings ...)
  (?)
@ 2018-02-20 15:24 ` Patchwork
  -1 siblings, 0 replies; 9+ messages in thread
From: Patchwork @ 2018-02-20 15:24 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

== Series Details ==

Series: igt/gem_fenced_exec_thrash: Use fixed durations (rev2)
URL   : https://patchwork.freedesktop.org/series/38536/
State : success

== Summary ==

Test kms_flip:
        Subgroup 2x-plain-flip-ts-check:
                fail       -> PASS       (shard-hsw) fdo#100368
Test kms_atomic_transition:
        Subgroup 1x-modeset-transitions-fencing:
                fail       -> PASS       (shard-apl) fdo#103207
Test kms_rotation_crc:
        Subgroup primary-rotation-180:
                pass       -> FAIL       (shard-snb) fdo#103925 +1
Test gem_eio:
        Subgroup in-flight-contexts:
                dmesg-warn -> PASS       (shard-snb) fdo#104058
        Subgroup in-flight-external:
                pass       -> FAIL       (shard-hsw) fdo#104676
Test perf:
        Subgroup oa-exponents:
                pass       -> FAIL       (shard-apl) fdo#102254
Test kms_cursor_legacy:
        Subgroup 2x-long-flip-vs-cursor-legacy:
                fail       -> PASS       (shard-hsw) fdo#104873

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103207 https://bugs.freedesktop.org/show_bug.cgi?id=103207
fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
fdo#104058 https://bugs.freedesktop.org/show_bug.cgi?id=104058
fdo#104676 https://bugs.freedesktop.org/show_bug.cgi?id=104676
fdo#102254 https://bugs.freedesktop.org/show_bug.cgi?id=102254
fdo#104873 https://bugs.freedesktop.org/show_bug.cgi?id=104873

shard-apl        total:3381 pass:1768 dwarn:1   dfail:0   fail:9   skip:1602 time:12066s
shard-hsw        total:3429 pass:1760 dwarn:1   dfail:0   fail:2   skip:1665 time:11851s
shard-snb        total:3429 pass:1350 dwarn:1   dfail:0   fail:2   skip:2076 time:6613s
Blacklisted hosts:
shard-kbl        total:3429 pass:1854 dwarn:71  dfail:3   fail:9   skip:1492 time:9761s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_960/shards.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

end of thread, other threads:[~2018-02-20 15:24 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-19 16:10 [PATCH igt] igt/gem_fenced_exec_thrash: Use fixed durations Chris Wilson
2018-02-19 16:10 ` [igt-dev] " Chris Wilson
2018-02-19 17:05 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2018-02-19 21:35 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2018-02-20 10:11 ` [igt-dev] [PATCH igt] " Joonas Lahtinen
2018-02-20 10:11   ` Joonas Lahtinen
2018-02-20 10:44 ` [igt-dev] [PATCH igt v2] " Chris Wilson
2018-02-20 12:39 ` [igt-dev] ✓ Fi.CI.BAT: success for igt/gem_fenced_exec_thrash: Use fixed durations (rev2) Patchwork
2018-02-20 15:24 ` [igt-dev] ✓ Fi.CI.IGT: " 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.