From: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Bommu Krishnaiah <krishnaiah.bommu@intel.com>,
Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: [igt-dev] [PATCH i-g-t v4 1/1] tests/i915/gem_ctx_persistence: Set context with supported engines
Date: Tue, 28 Jan 2020 13:45:58 +0530 [thread overview]
Message-ID: <20200128081558.26688-2-krishnaiah.bommu@intel.com> (raw)
In-Reply-To: <20200128081558.26688-1-krishnaiah.bommu@intel.com>
Update the context with supported engines on the platform with set_property
I915_CONTEXT_PARAM_ENGINES to make sure the work load is submitted to
the available engines only.
v2: addressed the review comments.
v3: addressed v2 review comments.
V4: addressed v3 review comments.
Signed-off-by: Bommu Krishnaiah <krishnaiah.bommu@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
lib/i915/gem_engine_topology.c | 11 ++++++
lib/i915/gem_engine_topology.h | 2 +
tests/i915/gem_ctx_persistence.c | 65 ++++++++++++++++++++++++--------
3 files changed, 62 insertions(+), 16 deletions(-)
diff --git a/lib/i915/gem_engine_topology.c b/lib/i915/gem_engine_topology.c
index 43a99e0f..ed6737ef 100644
--- a/lib/i915/gem_engine_topology.c
+++ b/lib/i915/gem_engine_topology.c
@@ -274,6 +274,17 @@ int gem_context_lookup_engine(int fd, uint64_t engine, uint32_t ctx_id,
return 0;
}
+void gem_context_set_all_engines(int fd, uint32_t ctx)
+{
+ DEFINE_CONTEXT_ENGINES_PARAM(engines, param, ctx, GEM_MAX_ENGINES);
+ struct intel_engine_data engine_data = { };
+
+ if (!gem_topology_get_param(fd, ¶m) && !param.size) {
+ query_engine_list(fd, &engine_data);
+ ctx_map_engines(fd, &engine_data, ¶m);
+ }
+}
+
bool gem_has_engine_topology(int fd)
{
struct drm_i915_gem_context_param param = {
diff --git a/lib/i915/gem_engine_topology.h b/lib/i915/gem_engine_topology.h
index e40d7ec8..525741cc 100644
--- a/lib/i915/gem_engine_topology.h
+++ b/lib/i915/gem_engine_topology.h
@@ -51,6 +51,8 @@ void intel_next_engine(struct intel_engine_data *ed);
int gem_context_lookup_engine(int fd, uint64_t engine, uint32_t ctx_id,
struct intel_execution_engine2 *e);
+void gem_context_set_all_engines(int fd, uint32_t ctx);
+
bool gem_context_has_engine_map(int fd, uint32_t ctx);
bool gem_engine_is_equal(const struct intel_execution_engine2 *e1,
diff --git a/tests/i915/gem_ctx_persistence.c b/tests/i915/gem_ctx_persistence.c
index d68431ae..e0c6965a 100644
--- a/tests/i915/gem_ctx_persistence.c
+++ b/tests/i915/gem_ctx_persistence.c
@@ -156,7 +156,7 @@ static void test_persistence(int i915, unsigned int engine)
* request is retired -- no early termination.
*/
- ctx = gem_context_create(i915);
+ ctx = gem_context_clone_with_engines(i915, 0);
gem_context_set_persistence(i915, ctx, true);
spin = igt_spin_new(i915, ctx,
@@ -188,7 +188,7 @@ static void test_nonpersistent_cleanup(int i915, unsigned int engine)
* any inflight request is cancelled.
*/
- ctx = gem_context_create(i915);
+ ctx = gem_context_clone_with_engines(i915, 0);
gem_context_set_persistence(i915, ctx, false);
spin = igt_spin_new(i915, ctx,
@@ -217,7 +217,7 @@ static void test_nonpersistent_mixed(int i915, unsigned int engine)
igt_spin_t *spin;
uint32_t ctx;
- ctx = gem_context_create(i915);
+ ctx = gem_context_clone_with_engines(i915, 0);
gem_context_set_persistence(i915, ctx, i & 1);
spin = igt_spin_new(i915, ctx,
@@ -253,7 +253,7 @@ static void test_nonpersistent_hostile(int i915, unsigned int engine)
* the requests and cleanup the context.
*/
- ctx = gem_context_create(i915);
+ ctx = gem_context_clone_with_engines(i915, 0);
gem_context_set_persistence(i915, ctx, false);
spin = igt_spin_new(i915, ctx,
@@ -284,7 +284,7 @@ static void test_nonpersistent_hostile_preempt(int i915, unsigned int engine)
igt_require(gem_scheduler_has_preemption(i915));
- ctx = gem_context_create(i915);
+ ctx = gem_context_clone_with_engines(i915, 0);
gem_context_set_persistence(i915, ctx, true);
gem_context_set_priority(i915, ctx, 0);
spin[0] = igt_spin_new(i915, ctx,
@@ -295,7 +295,7 @@ static void test_nonpersistent_hostile_preempt(int i915, unsigned int engine)
igt_spin_busywait_until_started(spin[0]);
- ctx = gem_context_create(i915);
+ ctx = gem_context_clone_with_engines(i915, 0);
gem_context_set_persistence(i915, ctx, false);
gem_context_set_priority(i915, ctx, 1); /* higher priority than 0 */
spin[1] = igt_spin_new(i915, ctx,
@@ -385,7 +385,7 @@ static void test_nonpersistent_queued(int i915, unsigned int engine)
gem_quiescent_gpu(i915);
- ctx = gem_context_create(i915);
+ ctx = gem_context_clone_with_engines(i915, 0);
gem_context_set_persistence(i915, ctx, false);
spin = igt_spin_new(i915, ctx,
.engine = engine,
@@ -512,7 +512,8 @@ static void test_process_mixed(int i915, unsigned int engine)
igt_spin_t *spin;
uint32_t ctx;
- ctx = gem_context_create(i915);
+ ctx = gem_context_clone_with_engines(i915, 0);
+ gem_context_set_all_engines(i915, ctx);
gem_context_set_persistence(i915, ctx, persists);
spin = igt_spin_new(i915, ctx,
@@ -727,37 +728,69 @@ igt_main
igt_subtest("hangcheck")
test_nohangcheck_hostile(i915);
- __for_each_static_engine(e) {
+ for_each_engine(e, i915) {
igt_subtest_group {
igt_fixture {
gem_require_ring(i915, e->flags);
gem_require_contexts(i915);
}
- igt_subtest_f("%s-persistence", e->name)
+ igt_subtest_f("legacy-%s-persistence", e->name)
test_persistence(i915, e->flags);
- igt_subtest_f("%s-cleanup", e->name)
+ igt_subtest_f("legacy-%s-cleanup", e->name)
test_nonpersistent_cleanup(i915, e->flags);
- igt_subtest_f("%s-queued", e->name)
+ igt_subtest_f("legacy-%s-queued", e->name)
test_nonpersistent_queued(i915, e->flags);
- igt_subtest_f("%s-mixed", e->name)
+ igt_subtest_f("legacy-%s-mixed", e->name)
test_nonpersistent_mixed(i915, e->flags);
- igt_subtest_f("%s-mixed-process", e->name)
+ igt_subtest_f("legacy-%s-mixed-process", e->name)
test_process_mixed(i915, e->flags);
- igt_subtest_f("%s-hostile", e->name)
+ igt_subtest_f("legacy-%s-hostile", e->name)
test_nonpersistent_hostile(i915, e->flags);
- igt_subtest_f("%s-hostile-preempt", e->name)
+ igt_subtest_f("legacy-%s-hostile-preempt", e->name)
test_nonpersistent_hostile_preempt(i915,
e->flags);
}
}
+ __for_each_physical_engine(i915, e) {
+ igt_subtest_group {
+ igt_fixture {
+ gem_require_ring(i915, e->flags);
+ gem_require_contexts(i915);
+ }
+
+ igt_subtest_f("%s-persistence", e->name)
+ test_persistence(i915, e->flags);
+
+ igt_subtest_f("%s-cleanup", e->name)
+ test_nonpersistent_cleanup(i915, e->flags);
+
+ igt_subtest_f("%s-queued", e->name)
+ test_nonpersistent_queued(i915, e->flags);
+
+ igt_subtest_f("%s-mixed", e->name)
+ test_nonpersistent_mixed(i915, e->flags);
+
+ igt_subtest_f("%s-mixed-process", e->name)
+ test_process_mixed(i915, e->flags);
+
+ igt_subtest_f("%s-hostile", e->name)
+ test_nonpersistent_hostile(i915, e->flags);
+
+ igt_subtest_f("%s-hostile-preempt", e->name)
+ test_nonpersistent_hostile_preempt(i915,
+ e->flags);
+ }
+ }
+
+
igt_subtest("smoketest")
smoketest(i915);
--
2.24.0
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2020-01-28 8:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-28 8:15 [igt-dev] [PATCH i-g-t v4 0/1] tests/i915/gem_ctx_persistence: Set context with supported engines Bommu Krishnaiah
2020-01-28 8:15 ` Bommu Krishnaiah [this message]
2020-01-28 9:00 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/gem_ctx_persistence: Set context with supported engines (rev4) Patchwork
2020-01-29 8:41 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2020-01-28 9:12 [igt-dev] [PATCH i-g-t v4 0/1] tests/i915/gem_ctx_persistence: Set context with supported engines Bommu Krishnaiah
2020-01-28 9:12 ` [igt-dev] [PATCH i-g-t v4 1/1] " Bommu Krishnaiah
2020-01-28 9:41 ` Tvrtko Ursulin
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=20200128081558.26688-2-krishnaiah.bommu@intel.com \
--to=krishnaiah.bommu@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=tvrtko.ursulin@intel.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox