From: "Dixit, Ashutosh" <ashutosh.dixit@intel.com>
To: "Zbigniew Kempczyński" <zbigniew.kempczynski@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] tests/gem_sync: Use softpin path for no-reloc gens
Date: Tue, 26 Oct 2021 13:30:19 -0700 [thread overview]
Message-ID: <8735onmsv8.wl-ashutosh.dixit@intel.com> (raw)
In-Reply-To: <20211026082919.14135-1-zbigniew.kempczynski@intel.com>
On Tue, 26 Oct 2021 01:29:19 -0700, Zbigniew Kempczyński wrote:
>
> Test uses pre-warming batch which establishes offsets in the kernel
> so adding pinned flag + zeroing relocation is enough to run with
> softpinning on no-reloc gens.
LGTM, but don't we need something similar in switch_ring() too or it needs
something different?
Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com>
> ---
> tests/i915/gem_sync.c | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/tests/i915/gem_sync.c b/tests/i915/gem_sync.c
> index 6cb00c406..2e9ed9ed8 100644
> --- a/tests/i915/gem_sync.c
> +++ b/tests/i915/gem_sync.c
> @@ -501,6 +501,7 @@ store_ring(int fd, const intel_ctx_t *ctx, unsigned ring,
> {
> const unsigned int gen = intel_gen(intel_get_drm_devid(fd));
> struct intel_engine_data ied;
> + bool has_relocs = gem_has_relocations(fd);
>
> ied = list_store_engines(fd, ctx, ring);
> igt_require(ied.nengines);
> @@ -532,10 +533,11 @@ store_ring(int fd, const intel_ctx_t *ctx, unsigned ring,
> gem_execbuf(fd, &execbuf);
>
> object[0].flags |= EXEC_OBJECT_WRITE;
> + object[0].flags |= has_relocs ? 0 : EXEC_OBJECT_PINNED;
> object[1].handle = gem_create(fd, 20*1024);
>
> object[1].relocs_ptr = to_user_pointer(reloc);
> - object[1].relocation_count = 1024;
> + object[1].relocation_count = has_relocs ? 1024 : 0;
>
> batch = gem_mmap__cpu(fd, object[1].handle, 0, 20*1024,
> PROT_WRITE | PROT_READ);
> @@ -789,6 +791,7 @@ __store_many(int fd, const intel_ctx_t *ctx, unsigned ring,
> int order[64];
> uint32_t *batch, *b;
> int done;
> + bool has_relocs = gem_has_relocations(fd);
>
> memset(&execbuf, 0, sizeof(execbuf));
> execbuf.buffers_ptr = to_user_pointer(object);
> @@ -805,9 +808,10 @@ __store_many(int fd, const intel_ctx_t *ctx, unsigned ring,
> execbuf.buffer_count = 1;
> gem_execbuf(fd, &execbuf);
> object[0].flags |= EXEC_OBJECT_WRITE;
> + object[0].flags |= has_relocs ? 0 : EXEC_OBJECT_PINNED;
>
> object[1].relocs_ptr = to_user_pointer(reloc);
> - object[1].relocation_count = 1024;
> + object[1].relocation_count = has_relocs ? 1024 : 0;
> execbuf.buffer_count = 2;
>
> memset(reloc, 0, sizeof(reloc));
> @@ -990,6 +994,7 @@ store_all(int fd, const intel_ctx_t *ctx, int num_children, int timeout)
> {
> const unsigned int gen = intel_gen(intel_get_drm_devid(fd));
> struct intel_engine_data ied;
> + bool has_relocs = gem_has_relocations(fd);
>
> ied = list_store_engines(fd, ctx, ALL_ENGINES);
> igt_require(ied.nengines);
> @@ -1019,10 +1024,11 @@ store_all(int fd, const intel_ctx_t *ctx, int num_children, int timeout)
> gem_execbuf(fd, &execbuf);
>
> object[0].flags |= EXEC_OBJECT_WRITE;
> + object[0].flags |= has_relocs ? 0 : EXEC_OBJECT_PINNED;
> object[1].handle = gem_create(fd, 1024*16 + 4096);
>
> object[1].relocs_ptr = to_user_pointer(reloc);
> - object[1].relocation_count = 1024;
> + object[1].relocation_count = has_relocs ? 1024 : 0;
>
> batch = gem_mmap__cpu(fd, object[1].handle, 0, 16*1024 + 4096,
> PROT_WRITE | PROT_READ);
> --
> 2.26.0
>
next prev parent reply other threads:[~2021-10-26 20:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-26 8:29 [igt-dev] [PATCH i-g-t] tests/gem_sync: Use softpin path for no-reloc gens Zbigniew Kempczyński
2021-10-26 9:20 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2021-10-26 10:35 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2021-10-26 20:30 ` Dixit, Ashutosh [this message]
2021-10-27 12:43 ` [igt-dev] [PATCH i-g-t] " 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=8735onmsv8.wl-ashutosh.dixit@intel.com \
--to=ashutosh.dixit@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=zbigniew.kempczynski@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 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.