Skip to contentSkip to conversation

gem_ctx_create:Adjusted test to use __for_each_physical_engine to utilize all available engines

PATCH Superseded Arjun Melkaveri 3 participants 5 messages Feb 5, 2020 – Feb 7, 2020

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 gem_ctx_create:Adjusted test to use __for_each_physical_engine to utilize all available engines

Changes :-
1) Added __for_each_physical_engine for subtest engines.
2) Moved test cases from static to dynamic.
3) used gem_context_clone_with_engines for creating contexts.
4) Passing NULL in active test to run test for all engines.

Cc Chris Wilson <[email protected]>
Cc Ursulin Tvrtko <[email protected]>

--
V1 -> V2
Modified files, active , maximum. with below change.

Added gem_reopen_driver and gem_context_copy_engines to transfer the engine map from parent fd default context.

---
 tests/i915/gem_ctx_create.c | 102 ++++++++++++++++++++++++++----------
 1 file changed, 75 insertions(+), 27 deletions(-)
tests/i915/gem_ctx_create.c +75 -27
index d9a820e2..2c44a3e3 100644
@@ -100,11 +100,18 @@ static void files(int core, int timeout, const int ncpus)
 	igt_fork(child, ncpus) {
 		struct timespec start, end;
 		unsigned count = 0;
+		int fd;
 
 		clock_gettime(CLOCK_MONOTONIC, &start);
 		do {
 			do {
-				int fd = drm_open_driver(DRIVER_INTEL);
+				fd = gem_reopen_driver(core);
+				/*
+				 * Ensure the gpu is idle by launching
+				 * a nop execbuf  and stalling for it.
+				 */
+				gem_quiescent_gpu(fd);
+				gem_context_copy_engines(core, 0, fd, 0);
 				obj.handle = gem_open(fd, name);
 				execbuf.flags &= ~ENGINE_FLAGS;
 				execbuf.flags |= ppgtt_engines[count % ppgtt_nengine];
@@ -124,22 +131,22 @@ static void files(int core, int timeout, const int ncpus)
 	gem_close(core, batch);
 }
 
-static void active(int fd, unsigned engine, int timeout, int ncpus)
+static void active(int fd, const struct intel_execution_engine2 *e,
+		   int timeout, int ncpus)
 {
 	const uint32_t bbe = MI_BATCH_BUFFER_END;
 	struct drm_i915_gem_execbuffer2 execbuf;
 	struct drm_i915_gem_exec_object2 obj;
 	unsigned int nengine, engines[16];
 	unsigned *shared;
-
-	if (engine == ALL_ENGINES) {
+	/* When e is NULL, test would run for all engines */
+	if (!e) {
 		igt_require(all_nengine);
 		nengine = all_nengine;
 		memcpy(engines, all_engines, sizeof(engines[0])*nengine);
 	} else {
-		gem_require_ring(fd, engine);
 		nengine = 1;
-		engines[0] = engine;
+		engines[0] = e->flags;
 	}
 
 	shared = mmap(NULL, 4096, PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0);
@@ -156,8 +163,17 @@ static void active(int fd, unsigned engine, int timeout, int ncpus)
 	if (ncpus < 0) {
 		igt_fork(child, ppgtt_nengine) {
 			unsigned long count = 0;
+			int i915;
+
+			i915 = gem_reopen_driver(fd);
+			/*
+			 * Ensure the gpu is idle by launching
+			 * a nop execbuf and stalling for it
+			 */
+			gem_quiescent_gpu(i915);
+			gem_context_copy_engines(fd, 0, i915, 0);
 
-			if (ppgtt_engines[child] == engine)
+			if (ppgtt_engines[child] == e->flags)
 				continue;
 
 			execbuf.flags = ppgtt_engines[child];
@@ -179,11 +195,22 @@ static void active(int fd, unsigned engine, int timeout, int ncpus)
 	igt_fork(child, ncpus) {
 		struct timespec start, end;
 		unsigned count = 0;
+		int i915;
+		uint32_t ctx;
+
+		i915 = gem_reopen_driver(fd);
+		/*
+		 * Ensure the gpu is idle by launching
+		 * a nop execbuf and stalling for it.
+		 */
+		gem_quiescent_gpu(i915);
+		ctx = gem_context_create(i915);
+		gem_context_copy_engines(fd, 0, i915, ctx);
 
 		clock_gettime(CLOCK_MONOTONIC, &start);
 		do {
 			do {
-				execbuf.rsvd1 = gem_context_create(fd);
+				execbuf.rsvd1 = ctx;
 				for (unsigned n = 0; n < nengine; n++) {
 					execbuf.flags = engines[n];
 					gem_execbuf(fd, &execbuf);
@@ -276,7 +303,9 @@ static void maximum(int fd, int ncpus, unsigned mode)
 
 		err = -ENOMEM;
 		if (avail_mem > (count + 1) * ctx_size)
-			err = __gem_context_create(fd, &ctx_id);
+			err =  __gem_context_clone(fd, 0,
+						   I915_CONTEXT_CLONE_ENGINES,
+						   0, &ctx_id);
 		if (err) {
 			igt_info("Created %lu contexts, before failing with '%s' [%d]\n",
 				 count, strerror(-err), -err);
@@ -297,9 +326,18 @@ static void maximum(int fd, int ncpus, unsigned mode)
 
 	igt_fork(child, ncpus) {
 		struct timespec start, end;
+		int i915;
+
+		i915 = gem_reopen_driver(fd);
+		/*
+		 * Ensure the gpu is idle by launching
+		 * a nop execbuf and stalling for it.
+		 */
+		gem_quiescent_gpu(i915);
+		gem_context_copy_engines(fd, 0, i915, 0);
 
 		hars_petruska_f54_1_random_perturb(child);
-		obj[0].handle = gem_create(fd, 4096);
+		obj[0].handle = gem_create(i915, 4096);
 
 		clock_gettime(CLOCK_MONOTONIC, &start);
 		for (int repeat = 0; repeat < 3; repeat++) {
@@ -310,13 +348,13 @@ static void maximum(int fd, int ncpus, unsigned mode)
 				execbuf.rsvd1 = contexts[i];
 				for (unsigned long j = 0; j < all_nengine; j++) {
 					execbuf.flags = all_engines[j];
-					gem_execbuf(fd, &execbuf);
+					gem_execbuf(i915, &execbuf);
 				}
 			}
 		}
-		gem_sync(fd, obj[0].handle);
+		gem_sync(i915, obj[0].handle);
 		clock_gettime(CLOCK_MONOTONIC, &end);
-		gem_close(fd, obj[0].handle);
+		gem_close(i915, obj[0].handle);
 
 		igt_info("[%d] Context execution: %.3f us\n", child,
 			 elapsed(&start, &end) / (3 * count * all_nengine) * 1e6);
@@ -370,6 +408,7 @@ static void basic_ext_param(int i915)
 
 		gem_context_destroy(i915, create.ctx_id);
 
+
 		/* Having demonstrated a valid setup, check a few invalids */
 		ext.param.ctx_id = 1;
 		igt_assert_eq(create_ext_ioctl(i915, &create), -EINVAL);
@@ -524,6 +563,7 @@ igt_main
 {
 	const int ncpus = sysconf(_SC_NPROCESSORS_ONLN);
 	struct drm_i915_gem_context_create create;
+	const struct intel_execution_engine2 *e;
 	int fd = -1;
 
 	igt_fixture {
@@ -531,8 +571,8 @@ igt_main
 		igt_require_gem(fd);
 		gem_require_contexts(fd);
 
-		for_each_physical_engine(e, fd)
-			all_engines[all_nengine++] = eb_ring(e);
+		__for_each_physical_engine(fd, e)
+			all_engines[all_nengine++] = e->flags;
 		igt_require(all_nengine);
 
 		if (gem_uses_full_ppgtt(fd)) {
@@ -572,20 +612,28 @@ igt_main
 	igt_subtest("forked-files")
 		files(fd, 20, ncpus);
 
+	/* NULL value means all engines */
 	igt_subtest("active-all")
-		active(fd, ALL_ENGINES, 20, 1);
+		active(fd, NULL, 20, 1);
 	igt_subtest("forked-active-all")
-		active(fd, ALL_ENGINES, 20, ncpus);
-
-	for (const struct intel_execution_engine *e = intel_execution_engines;
-	     e->name; e++) {
-		igt_subtest_f("active-%s", e->name)
-			active(fd, eb_ring(e), 20, 1);
-		igt_subtest_f("forked-active-%s", e->name)
-			active(fd, eb_ring(e), 20, ncpus);
-		if (e->exec_id) {
-			igt_subtest_f("hog-%s", e->name)
-				active(fd, eb_ring(e), 20, -1);
+		active(fd, NULL, 20, ncpus);
+
+	igt_subtest_with_dynamic("active") {
+		__for_each_physical_engine(fd, e) {
+			igt_dynamic_f("%s", e->name)
+				active(fd, e, 20, 1);
+		}
+	}
+	igt_subtest_with_dynamic("forked-active") {
+		__for_each_physical_engine(fd, e) {
+			igt_dynamic_f("%s", e->name)
+				active(fd, e, 20, ncpus);
+		}
+	}
+	igt_subtest_with_dynamic("hog") {
+		__for_each_physical_engine(fd, e) {
+			igt_dynamic_f("%s", e->name)
+				active(fd, e, 20, -1);
 		}
 	}
 
Signature · 6 lines
2.24.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
#1 lore raw

[igt-dev] ✗ GitLab.Pipeline: failure for gem_ctx_create:Adjusted test to use __for_each_physical_engine to utilize all available engines (rev2)

== Series Details ==

== Series Details ==

Series: gem_ctx_create:Adjusted test to use __for_each_physical_engine to utilize all available engines (rev2)
URL : https://patchwork.freedesktop.org/series/72889/
State : failure

== Summary ==

ERROR! This series introduces new undocumented tests:

gem_ctx_create@active
gem_ctx_create@forked-active
gem_ctx_create@hog

Can you document them as per the requirement in the [CONTRIBUTING.md]?

[Documentation] has more details on how to do this.

Here are few examples:
https://gitlab.freedesktop.org/drm/igt-gpu-tools/commit/0316695d03aa46108296b27f3982ec93200c7a6e
https://gitlab.freedesktop.org/drm/igt-gpu-tools/commit/443cc658e1e6b492ee17bf4f4d891029eb7a205d

Thanks in advance!

[CONTRIBUTING.md]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/blob/master/CONTRIBUTING.md#L19
[Documentation]: https://drm.pages.freedesktop.org/igt-gpu-tools/igt-gpu-tools-Core.html#igt-describe

Other than that, pipeline status: SUCCESS.

see https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/105018 for the overview.

== Logs ==

For more details see: https://gitlab.freedesktop.org/gfx-ci/igt-ci-tags/pipelines/105018
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#2 lore raw

[igt-dev] ✓ Fi.CI.BAT: success for gem_ctx_create:Adjusted test to use __for_each_physical_engine to utilize all available engines (rev2)

In reply to Arjun Melkaveri
== Series Details ==

== Series Details ==

Series: gem_ctx_create:Adjusted test to use __for_each_physical_engine to utilize all available engines (rev2)
URL : https://patchwork.freedesktop.org/series/72889/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_7869 -> IGTPW_4100
====================================================

Summary
-------

**SUCCESS**

No regressions found.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/index.html

Known issues
------------

Here are the changes found in IGTPW_4100 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_close_race@basic-threads:
- fi-byt-j1900: [PASS][1] -> [INCOMPLETE][2] ([i915#45])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-byt-j1900/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/fi-byt-j1900/igt@[email protected]

* igt@i915_selftest@live_blt:
- fi-hsw-4770r: [PASS][3] -> [DMESG-FAIL][4] ([i915#725])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-hsw-4770r/igt@i915_selftest@live_blt.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/fi-hsw-4770r/igt@i915_selftest@live_blt.html

* igt@i915_selftest@live_gem_contexts:
- fi-hsw-peppy: [PASS][5] -> [DMESG-FAIL][6] ([i915#761])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-hsw-peppy/igt@i915_selftest@live_gem_contexts.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/fi-hsw-peppy/igt@i915_selftest@live_gem_contexts.html

* igt@kms_chamelium@dp-crc-fast:
- fi-kbl-7500u: [PASS][7] -> [FAIL][8] ([fdo#109635] / [i915#262])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-kbl-7500u/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/fi-kbl-7500u/igt@[email protected]

#### Possible fixes ####

* igt@gem_exec_parallel@fds:
- fi-icl-u3: [INCOMPLETE][9] -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-icl-u3/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/fi-icl-u3/igt@[email protected]

* igt@i915_module_load@reload:
- fi-skl-6770hq: [DMESG-WARN][11] ([i915#92]) -> [PASS][12] +2 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-skl-6770hq/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/fi-skl-6770hq/igt@[email protected]

* igt@i915_selftest@live_blt:
- fi-bsw-nick: [INCOMPLETE][13] ([i915#392]) -> [PASS][14]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-bsw-nick/igt@i915_selftest@live_blt.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/fi-bsw-nick/igt@i915_selftest@live_blt.html
- fi-ivb-3770: [DMESG-FAIL][15] ([i915#725]) -> [PASS][16]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-ivb-3770/igt@i915_selftest@live_blt.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/fi-ivb-3770/igt@i915_selftest@live_blt.html

* igt@kms_chamelium@hdmi-crc-fast:
- fi-kbl-7500u: [FAIL][17] ([fdo#109635] / [i915#217]) -> [PASS][18]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-kbl-7500u/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/fi-kbl-7500u/igt@[email protected]

* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: [FAIL][19] ([fdo#111096] / [i915#323]) -> [PASS][20]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-kbl-7500u/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/fi-kbl-7500u/igt@[email protected]

* igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence:
- fi-skl-6770hq: [SKIP][21] ([fdo#109271]) -> [PASS][22] +4 similar issues
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-skl-6770hq/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/fi-skl-6770hq/igt@[email protected]

* igt@kms_pipe_crc_basic@read-crc-pipe-c:
- fi-skl-6770hq: [DMESG-WARN][23] ([i915#106] / [i915#188]) -> [PASS][24]
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-skl-6770hq/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/fi-skl-6770hq/igt@[email protected]

#### Warnings ####

* igt@i915_selftest@live_blt:
- fi-hsw-4770: [DMESG-FAIL][25] ([i915#553]) -> [DMESG-FAIL][26] ([i915#725])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/fi-hsw-4770/igt@i915_selftest@live_blt.html
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/fi-hsw-4770/igt@i915_selftest@live_blt.html

[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109635]: https://bugs.freedesktop.org/show_bug.cgi?id=109635
[fdo#111096]: https://bugs.freedesktop.org/show_bug.cgi?id=111096
[i915#106]: https://gitlab.freedesktop.org/drm/intel/issues/106
[i915#188]: https://gitlab.freedesktop.org/drm/intel/issues/188
[i915#217]: https://gitlab.freedesktop.org/drm/intel/issues/217
[i915#262]: https://gitlab.freedesktop.org/drm/intel/issues/262
[i915#323]: https://gitlab.freedesktop.org/drm/intel/issues/323
[i915#392]: https://gitlab.freedesktop.org/drm/intel/issues/392
[i915#45]: https://gitlab.freedesktop.org/drm/intel/issues/45
[i915#553]: https://gitlab.freedesktop.org/drm/intel/issues/553
[i915#725]: https://gitlab.freedesktop.org/drm/intel/issues/725
[i915#761]: https://gitlab.freedesktop.org/drm/intel/issues/761
[i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92

Participating hosts (49 -> 44)
------------------------------

Additional (2): fi-gdg-551 fi-snb-2520m
Missing (7): fi-kbl-soraka fi-hsw-4200u fi-bsw-cyan fi-ctg-p8600 fi-tgl-y fi-byt-clapper fi-bdw-samus

Build changes
-------------

* CI: CI-20190529 -> None
* IGT: IGT_5419 -> IGTPW_4100

CI-20190529: 20190529
CI_DRM_7869: db0579be255412f38a450c3c577f8d10f1195034 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_4100: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/index.html
IGT_5419: 44913a91e77434b03001bb9ea53216cd03c476e6 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Testlist changes ==

+igt@gem_ctx_create@active
+igt@gem_ctx_create@forked-active
+igt@gem_ctx_create@hog
-igt@gem_ctx_create@active-blt
-igt@gem_ctx_create@active-bsd
-igt@gem_ctx_create@active-bsd1
-igt@gem_ctx_create@active-bsd2
-igt@gem_ctx_create@active-default
-igt@gem_ctx_create@active-render
-igt@gem_ctx_create@active-vebox
-igt@gem_ctx_create@forked-active-blt
-igt@gem_ctx_create@forked-active-bsd
-igt@gem_ctx_create@forked-active-bsd1
-igt@gem_ctx_create@forked-active-bsd2
-igt@gem_ctx_create@forked-active-default
-igt@gem_ctx_create@forked-active-render
-igt@gem_ctx_create@forked-active-vebox
-igt@gem_ctx_create@hog-blt
-igt@gem_ctx_create@hog-bsd
-igt@gem_ctx_create@hog-bsd1
-igt@gem_ctx_create@hog-bsd2
-igt@gem_ctx_create@hog-render
-igt@gem_ctx_create@hog-vebox

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/index.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#3 lore raw
In reply to Arjun Melkaveri
Quoted 5 lines · Arjun Melkaveri

Changes :-
1) Added __for_each_physical_engine for subtest engines.
2) Moved test cases from static to dynamic.
3) used gem_context_clone_with_engines for creating contexts.
4) Passing NULL in active test to run test for all engines.

Please refactor commit msg to focus on 'why' not 'what' - you can look at changes in gem_exec_parallel test (git blame).

Quoted 5 lines
Cc Chris Wilson <[email protected]>
Cc Ursulin Tvrtko <[email protected]>
Quoted 7 lines

--
V1 -> V2
Modified files, active , maximum. with below change.

Added gem_reopen_driver and gem_context_copy_engines to transfer the engine map from parent fd default context.

If this is a part of change it needs to be up toghether with commit msg.

The rest looks ok. After changing commit msg I will give final r-b. Kasia

Quoted 222 lines
---
 tests/i915/gem_ctx_create.c | 102 ++++++++++++++++++++++++++----------
 1 file changed, 75 insertions(+), 27 deletions(-)
tests/i915/gem_ctx_create.c +75 -27
index d9a820e2..2c44a3e3 100644
@@ -100,11 +100,18 @@ static void files(int core, int timeout, const int ncpus)
 	igt_fork(child, ncpus) {
 		struct timespec start, end;
 		unsigned count = 0;
+		int fd;
 
 		clock_gettime(CLOCK_MONOTONIC, &start);
 		do {
 			do {
-				int fd = drm_open_driver(DRIVER_INTEL);
+				fd = gem_reopen_driver(core);
+				/*
+				 * Ensure the gpu is idle by launching
+				 * a nop execbuf  and stalling for it.
+				 */
+				gem_quiescent_gpu(fd);
+				gem_context_copy_engines(core, 0, fd, 0);
 				obj.handle = gem_open(fd, name);
 				execbuf.flags &= ~ENGINE_FLAGS;
 				execbuf.flags |= ppgtt_engines[count % ppgtt_nengine];
@@ -124,22 +131,22 @@ static void files(int core, int timeout, const int ncpus)
 	gem_close(core, batch);
 }
 
-static void active(int fd, unsigned engine, int timeout, int ncpus)
+static void active(int fd, const struct intel_execution_engine2 *e,
+		   int timeout, int ncpus)
 {
 	const uint32_t bbe = MI_BATCH_BUFFER_END;
 	struct drm_i915_gem_execbuffer2 execbuf;
 	struct drm_i915_gem_exec_object2 obj;
 	unsigned int nengine, engines[16];
 	unsigned *shared;
-
-	if (engine == ALL_ENGINES) {
+	/* When e is NULL, test would run for all engines */
+	if (!e) {
 		igt_require(all_nengine);
 		nengine = all_nengine;
 		memcpy(engines, all_engines, sizeof(engines[0])*nengine);
 	} else {
-		gem_require_ring(fd, engine);
 		nengine = 1;
-		engines[0] = engine;
+		engines[0] = e->flags;
 	}
 
 	shared = mmap(NULL, 4096, PROT_WRITE, MAP_SHARED | MAP_ANON, -1, 0);
@@ -156,8 +163,17 @@ static void active(int fd, unsigned engine, int timeout, int ncpus)
 	if (ncpus < 0) {
 		igt_fork(child, ppgtt_nengine) {
 			unsigned long count = 0;
+			int i915;
+
+			i915 = gem_reopen_driver(fd);
+			/*
+			 * Ensure the gpu is idle by launching
+			 * a nop execbuf and stalling for it
+			 */
+			gem_quiescent_gpu(i915);
+			gem_context_copy_engines(fd, 0, i915, 0);
 
-			if (ppgtt_engines[child] == engine)
+			if (ppgtt_engines[child] == e->flags)
 				continue;
 
 			execbuf.flags = ppgtt_engines[child];
@@ -179,11 +195,22 @@ static void active(int fd, unsigned engine, int timeout, int ncpus)
 	igt_fork(child, ncpus) {
 		struct timespec start, end;
 		unsigned count = 0;
+		int i915;
+		uint32_t ctx;
+
+		i915 = gem_reopen_driver(fd);
+		/*
+		 * Ensure the gpu is idle by launching
+		 * a nop execbuf and stalling for it.
+		 */
+		gem_quiescent_gpu(i915);
+		ctx = gem_context_create(i915);
+		gem_context_copy_engines(fd, 0, i915, ctx);
 
 		clock_gettime(CLOCK_MONOTONIC, &start);
 		do {
 			do {
-				execbuf.rsvd1 = gem_context_create(fd);
+				execbuf.rsvd1 = ctx;
 				for (unsigned n = 0; n < nengine; n++) {
 					execbuf.flags = engines[n];
 					gem_execbuf(fd, &execbuf);
@@ -276,7 +303,9 @@ static void maximum(int fd, int ncpus, unsigned mode)
 
 		err = -ENOMEM;
 		if (avail_mem > (count + 1) * ctx_size)
-			err = __gem_context_create(fd, &ctx_id);
+			err =  __gem_context_clone(fd, 0,
+						   I915_CONTEXT_CLONE_ENGINES,
+						   0, &ctx_id);
 		if (err) {
 			igt_info("Created %lu contexts, before failing with '%s' [%d]\n",
 				 count, strerror(-err), -err);
@@ -297,9 +326,18 @@ static void maximum(int fd, int ncpus, unsigned mode)
 
 	igt_fork(child, ncpus) {
 		struct timespec start, end;
+		int i915;
+
+		i915 = gem_reopen_driver(fd);
+		/*
+		 * Ensure the gpu is idle by launching
+		 * a nop execbuf and stalling for it.
+		 */
+		gem_quiescent_gpu(i915);
+		gem_context_copy_engines(fd, 0, i915, 0);
 
 		hars_petruska_f54_1_random_perturb(child);
-		obj[0].handle = gem_create(fd, 4096);
+		obj[0].handle = gem_create(i915, 4096);
 
 		clock_gettime(CLOCK_MONOTONIC, &start);
 		for (int repeat = 0; repeat < 3; repeat++) {
@@ -310,13 +348,13 @@ static void maximum(int fd, int ncpus, unsigned mode)
 				execbuf.rsvd1 = contexts[i];
 				for (unsigned long j = 0; j < all_nengine; j++) {
 					execbuf.flags = all_engines[j];
-					gem_execbuf(fd, &execbuf);
+					gem_execbuf(i915, &execbuf);
 				}
 			}
 		}
-		gem_sync(fd, obj[0].handle);
+		gem_sync(i915, obj[0].handle);
 		clock_gettime(CLOCK_MONOTONIC, &end);
-		gem_close(fd, obj[0].handle);
+		gem_close(i915, obj[0].handle);
 
 		igt_info("[%d] Context execution: %.3f us\n", child,
 			 elapsed(&start, &end) / (3 * count * all_nengine) * 1e6);
@@ -370,6 +408,7 @@ static void basic_ext_param(int i915)
 
 		gem_context_destroy(i915, create.ctx_id);
 
+
 		/* Having demonstrated a valid setup, check a few invalids */
 		ext.param.ctx_id = 1;
 		igt_assert_eq(create_ext_ioctl(i915, &create), -EINVAL);
@@ -524,6 +563,7 @@ igt_main
 {
 	const int ncpus = sysconf(_SC_NPROCESSORS_ONLN);
 	struct drm_i915_gem_context_create create;
+	const struct intel_execution_engine2 *e;
 	int fd = -1;
 
 	igt_fixture {
@@ -531,8 +571,8 @@ igt_main
 		igt_require_gem(fd);
 		gem_require_contexts(fd);
 
-		for_each_physical_engine(e, fd)
-			all_engines[all_nengine++] = eb_ring(e);
+		__for_each_physical_engine(fd, e)
+			all_engines[all_nengine++] = e->flags;
 		igt_require(all_nengine);
 
 		if (gem_uses_full_ppgtt(fd)) {
@@ -572,20 +612,28 @@ igt_main
 	igt_subtest("forked-files")
 		files(fd, 20, ncpus);
 
+	/* NULL value means all engines */
 	igt_subtest("active-all")
-		active(fd, ALL_ENGINES, 20, 1);
+		active(fd, NULL, 20, 1);
 	igt_subtest("forked-active-all")
-		active(fd, ALL_ENGINES, 20, ncpus);
-
-	for (const struct intel_execution_engine *e = intel_execution_engines;
-	     e->name; e++) {
-		igt_subtest_f("active-%s", e->name)
-			active(fd, eb_ring(e), 20, 1);
-		igt_subtest_f("forked-active-%s", e->name)
-			active(fd, eb_ring(e), 20, ncpus);
-		if (e->exec_id) {
-			igt_subtest_f("hog-%s", e->name)
-				active(fd, eb_ring(e), 20, -1);
+		active(fd, NULL, 20, ncpus);
+
+	igt_subtest_with_dynamic("active") {
+		__for_each_physical_engine(fd, e) {
+			igt_dynamic_f("%s", e->name)
+				active(fd, e, 20, 1);
+		}
+	}
+	igt_subtest_with_dynamic("forked-active") {
+		__for_each_physical_engine(fd, e) {
+			igt_dynamic_f("%s", e->name)
+				active(fd, e, 20, ncpus);
+		}
+	}
+	igt_subtest_with_dynamic("hog") {
+		__for_each_physical_engine(fd, e) {
+			igt_dynamic_f("%s", e->name)
+				active(fd, e, 20, -1);
 		}
 	}
 
Signature · 6 lines
2.24.0

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#4 lore raw

[igt-dev] ✗ Fi.CI.IGT: failure for gem_ctx_create:Adjusted test to use __for_each_physical_engine to utilize all available engines (rev2)

In reply to Arjun Melkaveri
== Series Details ==

== Series Details ==

Series: gem_ctx_create:Adjusted test to use __for_each_physical_engine to utilize all available engines (rev2)
URL : https://patchwork.freedesktop.org/series/72889/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_7869_full -> IGTPW_4100_full
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with IGTPW_4100_full absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in IGTPW_4100_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/index.html

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in IGTPW_4100_full:

### IGT changes ###

#### Possible regressions ####

* igt@kms_cursor_crc@pipe-b-cursor-suspend:
- shard-iclb: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-iclb4/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-iclb1/igt@[email protected]

Known issues
------------

Here are the changes found in IGTPW_4100_full that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_busy@extended-parallel-vcs1:
- shard-iclb: [PASS][3] -> [SKIP][4] ([fdo#112080]) +8 similar issues
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-iclb1/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-iclb5/igt@[email protected]

* igt@gem_caching@read-writes:
- shard-hsw: [PASS][5] -> [FAIL][6] ([i915#694])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-hsw2/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-hsw4/igt@[email protected]

* igt@gem_eio@in-flight-suspend:
- shard-kbl: [PASS][7] -> [INCOMPLETE][8] ([fdo#103665])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-kbl6/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-kbl6/igt@[email protected]

* igt@gem_exec_schedule@deep-bsd:
- shard-iclb: [PASS][9] -> [SKIP][10] ([fdo#112146]) +2 similar issues
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-iclb5/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-iclb4/igt@[email protected]

* igt@gem_exec_schedule@fifo-bsd1:
- shard-iclb: [PASS][11] -> [SKIP][12] ([fdo#109276]) +11 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-iclb2/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-iclb8/igt@[email protected]

* igt@gem_ppgtt@flink-and-close-vma-leak:
- shard-apl: [PASS][13] -> [FAIL][14] ([i915#644])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-apl2/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-apl4/igt@[email protected]

* igt@gem_workarounds@suspend-resume-fd:
- shard-kbl: [PASS][15] -> [DMESG-WARN][16] ([i915#180]) +4 similar issues
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-kbl7/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-kbl3/igt@[email protected]

* igt@gen9_exec_parse@allowed-all:
- shard-glk: [PASS][17] -> [INCOMPLETE][18] ([i915#58] / [k.org#198133])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-glk2/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-glk3/igt@[email protected]

* igt@i915_selftest@live_blt:
- shard-hsw: [PASS][19] -> [DMESG-FAIL][20] ([i915#553] / [i915#725])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-hsw2/igt@i915_selftest@live_blt.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-hsw4/igt@i915_selftest@live_blt.html

* igt@kms_big_fb@y-tiled-64bpp-rotate-0:
- shard-iclb: [PASS][21] -> [SKIP][22] ([i915#1140])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-iclb7/igt@[email protected]
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-iclb7/igt@[email protected]

* igt@kms_cursor_crc@pipe-c-cursor-suspend:
- shard-apl: [PASS][23] -> [DMESG-WARN][24] ([i915#180]) +2 similar issues
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-apl2/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-apl6/igt@[email protected]

* igt@kms_flip@flip-vs-expired-vblank:
- shard-glk: [PASS][25] -> [FAIL][26] ([i915#79])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-glk4/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-glk7/igt@[email protected]

* igt@kms_plane_lowres@pipe-a-tiling-x:
- shard-glk: [PASS][27] -> [FAIL][28] ([i915#899])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-glk9/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-glk5/igt@[email protected]

* igt@kms_psr@psr2_cursor_render:
- shard-iclb: [PASS][29] -> [SKIP][30] ([fdo#109441]) +2 similar issues
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-iclb2/igt@kms_psr@psr2_cursor_render.html
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-iclb6/igt@kms_psr@psr2_cursor_render.html

#### Possible fixes ####

* igt@gem_ctx_exec@basic-nohangcheck:
- shard-iclb: [INCOMPLETE][31] -> [PASS][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-iclb2/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-iclb2/igt@[email protected]

* igt@gem_exec_parallel@vcs1-fds:
- shard-iclb: [SKIP][33] ([fdo#112080]) -> [PASS][34] +9 similar issues
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-iclb3/igt@[email protected]
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-iclb1/igt@[email protected]

* igt@gem_exec_schedule@pi-userfault-bsd:
- shard-iclb: [SKIP][35] ([i915#677]) -> [PASS][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-iclb2/igt@[email protected]
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-iclb5/igt@[email protected]

* igt@gem_exec_schedule@reorder-wide-bsd:
- shard-iclb: [SKIP][37] ([fdo#112146]) -> [PASS][38] +7 similar issues
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-iclb1/igt@[email protected]
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-iclb8/igt@[email protected]

* igt@gem_partial_pwrite_pread@write:
- shard-hsw: [FAIL][39] ([i915#694]) -> [PASS][40] +1 similar issue
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-hsw7/igt@[email protected]
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-hsw6/igt@[email protected]

* igt@i915_pm_rps@reset:
- shard-apl: [FAIL][41] ([i915#39]) -> [PASS][42]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-apl1/igt@[email protected]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-apl4/igt@[email protected]

* igt@kms_cursor_crc@pipe-c-cursor-suspend:
- shard-kbl: [DMESG-WARN][43] ([i915#180]) -> [PASS][44] +4 similar issues
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-kbl7/igt@[email protected]
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-kbl3/igt@[email protected]

* igt@kms_flip@flip-vs-expired-vblank-interruptible:
- shard-glk: [FAIL][45] ([i915#79]) -> [PASS][46]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-glk1/igt@[email protected]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-glk2/igt@[email protected]

* igt@kms_flip@flip-vs-suspend-interruptible:
- shard-apl: [DMESG-WARN][47] ([i915#180]) -> [PASS][48]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-apl8/igt@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-apl6/igt@[email protected]

* igt@kms_psr2_su@frontbuffer:
- shard-iclb: [SKIP][49] ([fdo#109642] / [fdo#111068]) -> [PASS][50]
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-iclb7/igt@[email protected]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-iclb2/igt@[email protected]

* igt@kms_psr@psr2_cursor_blt:
- shard-iclb: [SKIP][51] ([fdo#109441]) -> [PASS][52] +1 similar issue
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-iclb6/igt@kms_psr@psr2_cursor_blt.html
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-iclb2/igt@kms_psr@psr2_cursor_blt.html

* igt@prime_vgem@fence-wait-bsd2:
- shard-iclb: [SKIP][53] ([fdo#109276]) -> [PASS][54] +14 similar issues
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-iclb5/igt@[email protected]
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-iclb2/igt@[email protected]

#### Warnings ####

* igt@gem_ctx_isolation@vcs1-nonpriv:
- shard-iclb: [SKIP][55] ([fdo#112080]) -> [FAIL][56] ([IGT#28])
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-iclb3/igt@[email protected]
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-iclb4/igt@[email protected]

* igt@gem_ctx_isolation@vcs1-nonpriv-switch:
- shard-iclb: [FAIL][57] ([IGT#28]) -> [SKIP][58] ([fdo#112080])
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-iclb1/igt@[email protected]
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-iclb7/igt@[email protected]

* igt@gem_tiled_blits@interruptible:
- shard-hsw: [FAIL][59] ([i915#818]) -> [FAIL][60] ([i915#694])
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-hsw8/igt@[email protected]
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-hsw8/igt@[email protected]

* igt@gem_tiled_blits@normal:
- shard-hsw: [FAIL][61] ([i915#694]) -> [FAIL][62] ([i915#818])
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-hsw1/igt@[email protected]
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-hsw8/igt@[email protected]

* igt@kms_dp_dsc@basic-dsc-enable-edp:
- shard-iclb: [SKIP][63] ([fdo#109349]) -> [DMESG-WARN][64] ([fdo#107724])
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7869/shard-iclb7/igt@[email protected]
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/shard-iclb2/igt@[email protected]

[IGT#28]: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/28
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
[fdo#109349]: https://bugs.freedesktop.org/show_bug.cgi?id=109349
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
[fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
[fdo#112080]: https://bugs.freedesktop.org/show_bug.cgi?id=112080
[fdo#112146]: https://bugs.freedesktop.org/show_bug.cgi?id=112146
[i915#1140]: https://gitlab.freedesktop.org/drm/intel/issues/1140
[i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
[i915#39]: https://gitlab.freedesktop.org/drm/intel/issues/39
[i915#553]: https://gitlab.freedesktop.org/drm/intel/issues/553
[i915#58]: https://gitlab.freedesktop.org/drm/intel/issues/58
[i915#644]: https://gitlab.freedesktop.org/drm/intel/issues/644
[i915#677]: https://gitlab.freedesktop.org/drm/intel/issues/677
[i915#694]: https://gitlab.freedesktop.org/drm/intel/issues/694
[i915#725]: https://gitlab.freedesktop.org/drm/intel/issues/725
[i915#79]: https://gitlab.freedesktop.org/drm/intel/issues/79
[i915#818]: https://gitlab.freedesktop.org/drm/intel/issues/818
[i915#899]: https://gitlab.freedesktop.org/drm/intel/issues/899
[k.org#198133]: https://bugzilla.kernel.org/show_bug.cgi?id=198133

Participating hosts (10 -> 8)
------------------------------

Missing (2): pig-skl-6260u pig-glk-j5005

Build changes
-------------

* CI: CI-20190529 -> None
* IGT: IGT_5419 -> IGTPW_4100
* Piglit: piglit_4509 -> None

CI-20190529: 20190529
CI_DRM_7869: db0579be255412f38a450c3c577f8d10f1195034 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_4100: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/index.html
IGT_5419: 44913a91e77434b03001bb9ea53216cd03c476e6 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_4100/index.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev