From: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
To: sai.gowtham.ch@intel.com
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] tests/i915/gem_exec_capture: Adding Local memory support.
Date: Mon, 3 Jan 2022 09:09:19 +0100 [thread overview]
Message-ID: <YdKvL6vTA6DSKe6O@zkempczy-mobl2> (raw)
In-Reply-To: <20211231055526.7586-1-sai.gowtham.ch@intel.com>
On Fri, Dec 31, 2021 at 11:25:26AM +0530, sai.gowtham.ch@intel.com wrote:
> From: Ch Sai Gowtham <sai.gowtham.ch@intel.com>
>
> Adding local memory support to many-4K-zero subtest.
>
> Signed-off-by: Ch Sai Gowtham <sai.gowtham.ch@intel.com>
> Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> ---
> tests/i915/gem_exec_capture.c | 35 +++++++++++++++++++++--------------
> 1 file changed, 21 insertions(+), 14 deletions(-)
>
> diff --git a/tests/i915/gem_exec_capture.c b/tests/i915/gem_exec_capture.c
> index 9beb36fc..19cfa53d 100644
> --- a/tests/i915/gem_exec_capture.c
> +++ b/tests/i915/gem_exec_capture.c
> @@ -406,7 +406,7 @@ static struct offset *
> __captureN(int fd, int dir, uint64_t ahnd, const intel_ctx_t *ctx,
> const struct intel_execution_engine2 *e,
> unsigned int size, int count,
> - unsigned int flags, int *_fence_out)
> + unsigned int flags, int *_fence_out, uint32_t region)
> #define INCREMENTAL 0x1
> #define ASYNC 0x2
> {
> @@ -426,7 +426,7 @@ __captureN(int fd, int dir, uint64_t ahnd, const intel_ctx_t *ctx,
> obj = calloc(count + 2, sizeof(*obj));
> igt_assert(obj);
>
> - obj[0].handle = gem_create(fd, 4096);
> + obj[0].handle = gem_create_in_memory_regions(fd, 4096, region);
> obj[0].offset = get_offset(ahnd, obj[0].handle, 4096, 0);
> obj[0].flags = EXEC_OBJECT_WRITE | (ahnd ? EXEC_OBJECT_PINNED : 0);
>
> @@ -449,7 +449,7 @@ __captureN(int fd, int dir, uint64_t ahnd, const intel_ctx_t *ctx,
> }
> }
>
> - obj[count + 1].handle = gem_create(fd, 4096);
> + obj[count + 1].handle = gem_create_in_memory_regions(fd, 4096, region);
> obj[count + 1].relocs_ptr = (uintptr_t)reloc;
> obj[count + 1].relocation_count = !ahnd ? ARRAY_SIZE(reloc) : 0;
> obj[count + 1].offset = get_offset(ahnd, obj[count + 1].handle, 4096, 0);
> @@ -573,7 +573,7 @@ __captureN(int fd, int dir, uint64_t ahnd, const intel_ctx_t *ctx,
> configure_hangs(fd, e, ctx->id); \
> } while(0)
>
> -static void many(int fd, int dir, uint64_t size, unsigned int flags)
> +static void many(int fd, int dir, uint64_t size, unsigned int flags, uint32_t region)
> {
> const struct intel_execution_engine2 *e;
> const intel_ctx_t *ctx;
> @@ -594,7 +594,7 @@ static void many(int fd, int dir, uint64_t size, unsigned int flags)
> intel_require_memory(count, size, CHECK_RAM);
> ahnd = get_reloc_ahnd(fd, ctx->id);
>
> - offsets = __captureN(fd, dir, ahnd, ctx, e, size, count, flags, NULL);
> + offsets = __captureN(fd, dir, ahnd, ctx, e, size, count, flags, NULL, region);
>
> blobs = check_error_state(dir, offsets, count, size, !!(flags & INCREMENTAL));
> igt_info("Captured %lu %"PRId64"-blobs out of a total of %lu\n",
> @@ -605,7 +605,7 @@ static void many(int fd, int dir, uint64_t size, unsigned int flags)
> }
>
> static void prioinv(int fd, int dir, const intel_ctx_t *ctx,
> - const struct intel_execution_engine2 *e)
> + const struct intel_execution_engine2 *e, uint32_t system_region)
Change system_region -> region, caller is passing this so suggesting name
here is not good idea and can be confusing.
> {
> const uint32_t bbe = MI_BATCH_BUFFER_END;
> struct drm_i915_gem_exec_object2 obj = {
> @@ -659,7 +659,7 @@ static void prioinv(int fd, int dir, const intel_ctx_t *ctx,
> /* Reopen the allocator in the new process. */
> ahnd = get_reloc_ahnd(fd, ctx2->id);
>
> - free(__captureN(fd, dir, ahnd, ctx2, e, size, count, ASYNC, &fence_out));
> + free(__captureN(fd, dir, ahnd, ctx2, e, size, count, ASYNC, &fence_out, system_region));
Avoid long lines, here I would break before &fence_out.
With above fixed:
Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
--
Zbigniew
> put_ahnd(ahnd);
>
> write(link[1], &fd, sizeof(fd)); /* wake the parent up */
> @@ -744,6 +744,7 @@ igt_main
> struct igt_collection *regions, *set;
> char *sub_name;
> uint32_t region;
> + uint32_t system_region = INTEL_MEMORY_REGION_ID(I915_SYSTEM_MEMORY, 0);
>
> igt_fixture {
> int gen;
> @@ -780,29 +781,35 @@ igt_main
> }
> }
>
> - igt_subtest_f("many-4K-zero") {
> + igt_subtest_with_dynamic("many-4K-zero") {
> igt_require(gem_can_store_dword(fd, 0));
> - many(fd, dir, 1<<12, 0);
> + for_each_combination(regions, 1, set) {
> + sub_name = memregion_dynamic_subtest_name(regions);
> + region = igt_collection_get_value(regions, 0);
> + igt_dynamic_f("%s", sub_name)
> + many(fd, dir, 1<<12, 0, region);
> + free(sub_name);
> + }
> }
>
> igt_subtest_f("many-4K-incremental") {
> igt_require(gem_can_store_dword(fd, 0));
> - many(fd, dir, 1<<12, INCREMENTAL);
> + many(fd, dir, 1<<12, INCREMENTAL, system_region);
> }
>
> igt_subtest_f("many-2M-zero") {
> igt_require(gem_can_store_dword(fd, 0));
> - many(fd, dir, 2<<20, 0);
> + many(fd, dir, 2<<20, 0, system_region);
> }
>
> igt_subtest_f("many-2M-incremental") {
> igt_require(gem_can_store_dword(fd, 0));
> - many(fd, dir, 2<<20, INCREMENTAL);
> + many(fd, dir, 2<<20, INCREMENTAL, system_region);
> }
>
> igt_subtest_f("many-256M-incremental") {
> igt_require(gem_can_store_dword(fd, 0));
> - many(fd, dir, 256<<20, INCREMENTAL);
> + many(fd, dir, 256<<20, INCREMENTAL, system_region);
> }
>
> /* And check we can read from different types of objects */
> @@ -814,7 +821,7 @@ igt_main
>
> test_each_engine("pi", fd, ctx, e)
> igt_dynamic_f("%s", (e)->name)
> - prioinv(fd, dir, ctx, e);
> + prioinv(fd, dir, ctx, e, system_region);
>
> igt_fixture {
> close(dir);
> --
> 2.32.0
>
next prev parent reply other threads:[~2022-01-03 8:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-12-31 5:55 [igt-dev] [PATCH i-g-t] tests/i915/gem_exec_capture: Adding Local memory support sai.gowtham.ch
2021-12-31 11:33 ` [igt-dev] ✗ GitLab.Pipeline: warning for " Patchwork
2021-12-31 11:34 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2021-12-31 12:45 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-01-03 8:09 ` Zbigniew Kempczyński [this message]
2022-01-04 10:08 ` [igt-dev] ✗ GitLab.Pipeline: warning for tests/i915/gem_exec_capture: Adding Local memory support. (rev2) Patchwork
2022-01-04 10:13 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2022-01-04 11:26 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
-- strict thread matches above, loose matches on Subject: below --
2022-01-03 8:21 [igt-dev] [PATCH i-g-t] tests/i915/gem_exec_capture: Adding Local memory support sai.gowtham.ch
2022-01-03 8:54 sai.gowtham.ch
2022-01-03 9:40 ` Zbigniew Kempczyński
2022-02-24 5:20 sai.gowtham.ch
2022-03-11 8:44 ` Zbigniew Kempczyński
2022-03-22 4:54 sai.gowtham.ch
2022-03-23 13:39 ` Zbigniew Kempczyński
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=YdKvL6vTA6DSKe6O@zkempczy-mobl2 \
--to=zbigniew.kempczynski@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=sai.gowtham.ch@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