From: Chris Wilson <chris@chris-wilson.co.uk> To: intel-gfx@lists.freedesktop.org Cc: igt-dev@lists.freedesktop.org Subject: [Intel-gfx] [PATCH i-g-t 2/4] i915/gem_ctx_engine: Exercise for_each_context_engine() with custom engine[] Date: Fri, 14 Feb 2020 19:40:14 +0000 [thread overview] Message-ID: <20200214194016.4054376-2-chris@chris-wilson.co.uk> (raw) In-Reply-To: <20200214194016.4054376-1-chris@chris-wilson.co.uk> Set up a custom engine map with no engines, and check that the for_each_context_engine() correctly iterates over nothing. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> --- tests/i915/gem_ctx_engines.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/i915/gem_ctx_engines.c b/tests/i915/gem_ctx_engines.c index 063140e0f..6a2edd1e0 100644 --- a/tests/i915/gem_ctx_engines.c +++ b/tests/i915/gem_ctx_engines.c @@ -549,6 +549,31 @@ static void independent(int i915) gem_context_destroy(i915, param.ctx_id); } +static void libapi(int i915) +{ + struct i915_context_param_engines engines = {}; + struct drm_i915_gem_context_param p = { + .ctx_id = gem_context_create(i915), + .param = I915_CONTEXT_PARAM_ENGINES, + .value = to_user_pointer(&engines), + .size = sizeof(engines), + }; + const struct intel_execution_engine2 *e; + unsigned int count = 0; + + gem_context_set_param(i915, &p); + + for_each_context_engine(i915, p.ctx_id, e) + count++; + igt_assert_eq(count, 0); + + ____for_each_physical_engine(i915, p.ctx_id, e) + count++; + igt_assert_eq(count, 0); + + gem_context_destroy(i915, p.ctx_id); +} + igt_main { int i915 = -1; @@ -584,6 +609,9 @@ igt_main igt_subtest("independent") independent(i915); + igt_subtest("libapi") + libapi(i915); + igt_fixture igt_stop_hang_detector(); } -- 2.25.0 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
WARNING: multiple messages have this Message-ID (diff)
From: Chris Wilson <chris@chris-wilson.co.uk> To: intel-gfx@lists.freedesktop.org Cc: igt-dev@lists.freedesktop.org Subject: [igt-dev] [PATCH i-g-t 2/4] i915/gem_ctx_engine: Exercise for_each_context_engine() with custom engine[] Date: Fri, 14 Feb 2020 19:40:14 +0000 [thread overview] Message-ID: <20200214194016.4054376-2-chris@chris-wilson.co.uk> (raw) In-Reply-To: <20200214194016.4054376-1-chris@chris-wilson.co.uk> Set up a custom engine map with no engines, and check that the for_each_context_engine() correctly iterates over nothing. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> --- tests/i915/gem_ctx_engines.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/tests/i915/gem_ctx_engines.c b/tests/i915/gem_ctx_engines.c index 063140e0f..6a2edd1e0 100644 --- a/tests/i915/gem_ctx_engines.c +++ b/tests/i915/gem_ctx_engines.c @@ -549,6 +549,31 @@ static void independent(int i915) gem_context_destroy(i915, param.ctx_id); } +static void libapi(int i915) +{ + struct i915_context_param_engines engines = {}; + struct drm_i915_gem_context_param p = { + .ctx_id = gem_context_create(i915), + .param = I915_CONTEXT_PARAM_ENGINES, + .value = to_user_pointer(&engines), + .size = sizeof(engines), + }; + const struct intel_execution_engine2 *e; + unsigned int count = 0; + + gem_context_set_param(i915, &p); + + for_each_context_engine(i915, p.ctx_id, e) + count++; + igt_assert_eq(count, 0); + + ____for_each_physical_engine(i915, p.ctx_id, e) + count++; + igt_assert_eq(count, 0); + + gem_context_destroy(i915, p.ctx_id); +} + igt_main { int i915 = -1; @@ -584,6 +609,9 @@ igt_main igt_subtest("independent") independent(i915); + igt_subtest("libapi") + libapi(i915); + igt_fixture igt_stop_hang_detector(); } -- 2.25.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-02-14 19:40 UTC|newest] Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-02-14 19:40 [Intel-gfx] [PATCH i-g-t 1/4] i915/gem_ctx_engines: Exercise 0 engines[] Chris Wilson 2020-02-14 19:40 ` [igt-dev] " Chris Wilson 2020-02-14 19:40 ` Chris Wilson [this message] 2020-02-14 19:40 ` [igt-dev] [PATCH i-g-t 2/4] i915/gem_ctx_engine: Exercise for_each_context_engine() with custom engine[] Chris Wilson 2020-02-14 21:49 ` [Intel-gfx] " Antonio Argenziano 2020-02-14 21:49 ` Antonio Argenziano 2020-02-14 21:57 ` [Intel-gfx] " Chris Wilson 2020-02-14 21:57 ` Chris Wilson 2020-02-14 19:40 ` [Intel-gfx] [PATCH i-g-t 3/4] lib/i915: Don't confuse param.size Chris Wilson 2020-02-14 23:16 ` [Intel-gfx] [igt-dev] " Stimson, Dale B 2020-02-14 23:16 ` Stimson, Dale B 2020-02-14 19:40 ` [Intel-gfx] [PATCH i-g-t 4/4] lib/i915/gem_engine_topology.c - intel_get_current_engine invalid result Chris Wilson 2020-02-14 19:40 ` [igt-dev] " Chris Wilson 2020-02-14 20:13 ` [igt-dev] ✗ GitLab.Pipeline: failure for series starting with [i-g-t,1/4] i915/gem_ctx_engines: Exercise 0 engines[] Patchwork 2020-02-14 20:26 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork 2020-02-14 21:22 ` [Intel-gfx] [igt-dev] [PATCH i-g-t 1/4] " Antonio Argenziano 2020-02-14 21:22 ` Antonio Argenziano 2020-02-18 1:16 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/4] " Patchwork
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=20200214194016.4054376-2-chris@chris-wilson.co.uk \ --to=chris@chris-wilson.co.uk \ --cc=igt-dev@lists.freedesktop.org \ --cc=intel-gfx@lists.freedesktop.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.