From: Matthew Auld <matthew.auld@intel.com>
To: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>,
igt-dev@lists.freedesktop.org
Cc: tvrtko.ursulin@intel.com, thomas.hellstrom@intel.com,
daniel.vetter@intel.com, petri.latvala@intel.com
Subject: Re: [igt-dev] [PATCH i-g-t v9 19/19] tests/i915/vm_bind: Add userptr invalidation test
Date: Fri, 13 Jan 2023 14:27:39 +0000 [thread overview]
Message-ID: <a0689b87-9d95-6520-ff86-3f47e744a7ce@intel.com> (raw)
In-Reply-To: <20221212231254.2303-20-niranjana.vishwanathapura@intel.com>
On 12/12/2022 23:12, Niranjana Vishwanathapura wrote:
> Add vma-merge-execbuf3 subtest to gem_userptr_blits to
> validate userptr invalidations with VM_BIND+execbuf3.
>
> NOTE:
> The test is derived from vma-merge subtest. There is a known
> fence timeout issue with vma-merge subtest which the
> vma-merge-execbuf3 inherits, but the test still passes none
> the less validates userptr invalidation of persistent mappings
> and rebinding the same in the subsequent submission.
>
> Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
> ---
> tests/i915/gem_userptr_blits.c | 71 ++++++++++++++++++++++++++++++++++
> 1 file changed, 71 insertions(+)
>
> diff --git a/tests/i915/gem_userptr_blits.c b/tests/i915/gem_userptr_blits.c
> index 698508669..0ec54bd21 100644
> --- a/tests/i915/gem_userptr_blits.c
> +++ b/tests/i915/gem_userptr_blits.c
> @@ -60,7 +60,10 @@
>
> #include "i915/gem.h"
> #include "i915/gem_create.h"
> +#include "i915/gem_vm.h"
> +#include "i915/i915_vm_bind.h"
> #include "igt.h"
> +#include "igt_syncobj.h"
> #include "igt_sysfs.h"
> #include "igt_types.h"
> #include "sw_sync.h"
> @@ -740,6 +743,69 @@ static void test_vma_merge(int i915)
> put_ahnd(ahnd);
> }
>
> +static void test_vma_merge_execbuf3(int i915)
> +{
> + struct drm_i915_gem_context_param param = {
> + .param = I915_CONTEXT_PARAM_RECOVERABLE,
> + .value = 0,
> + };
> + const size_t sz = 2 * hugepagesize();
> + uint32_t handle, vm_id;
> + const intel_ctx_t *ctx;
> + igt_spin_t *spin;
> + uint64_t ahnd;
> + void *addr;
> +
> + vm_id = gem_vm_create_in_vm_bind_mode(i915);
> + ctx = intel_ctx_create_all_physical(i915);
> + param.ctx_id = ctx->id;
> + gem_context_set_param(i915, ¶m);
> + gem_context_set_vm(i915, ctx->id, vm_id);
> + (void)gem_context_get_vm(i915, ctx->id);
> +
> + ahnd = get_simple_ahnd(i915, ctx->id);
> + igt_require(ahnd);
> + addr = mmap(NULL, sz, PROT_READ | PROT_WRITE,
> + MAP_SHARED | MAP_ANONYMOUS, -1, 0);
> +
> + gem_userptr(i915, addr + sz / 2, 4096, 0, userptr_flags, &handle);
> +
> + spin = igt_spin_new(i915, .ctx = ctx, .vm_id = vm_id,
> + .ahnd = ahnd, .dependency = handle,
> + .flags = IGT_SPIN_EXECBUF3);
> +
> + for (size_t x = 0; x < sz; x += 4096) {
> + if (x == sz / 2)
> + continue;
> +
> + igt_assert(mmap(addr + x, 4096, PROT_READ | PROT_WRITE,
> + MAP_FIXED | MAP_SHARED | MAP_ANON, -1, 0) !=
> + MAP_FAILED);
> + }
> +
> + igt_spin_end(spin);
> + igt_spin_reset(spin);
> + igt_assert(syncobj_timeline_wait(i915, spin->out_syncobj, NULL, spin->nengines,
> + gettime_ns() + (2 * NSEC_PER_SEC),
> + DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT, NULL));
> +
> + /* Another submission will cause rebind of invalidated mappings */
> + gem_execbuf3(i915, &spin->execbuf3);
> + igt_spin_end(spin);
> + igt_assert(syncobj_timeline_wait(i915, &spin->out_syncobj[spin->nengines - 1],
> + NULL, 1, gettime_ns() + (2 * NSEC_PER_SEC),
> + DRM_SYNCOBJ_WAIT_FLAGS_WAIT_FOR_SUBMIT, NULL));
> + gem_close(i915, handle);
> +
> + munmap(addr, sz);
> +
> + igt_spin_free(i915, spin);
> + put_ahnd(ahnd);
> +
> + intel_ctx_destroy(i915, ctx);
> + gem_vm_destroy(i915, vm_id);
> +}
> +
> static void test_huge_split(int i915)
> {
> const size_t sz = 2 * hugepagesize();
> @@ -2628,6 +2694,11 @@ igt_main_args("c:", NULL, help_str, opt_handler, NULL)
> igt_subtest("vma-merge")
> test_vma_merge(fd);
>
> + igt_subtest("vma-merge-execbuf3") {
I guess needs test description somewhere, since this is new subtest.
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
> + igt_require(i915_vm_bind_version(fd) == 1);
> + test_vma_merge_execbuf3(fd);
> + }
> +
> igt_subtest("huge-split")
> test_huge_split(fd);
> }
next prev parent reply other threads:[~2023-01-13 14:27 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-12 23:12 [igt-dev] [PATCH i-g-t v9 00/19] vm_bind: Add VM_BIND validation support Niranjana Vishwanathapura
2022-12-12 23:12 ` [igt-dev] [PATCH i-g-t v9 01/19] lib/i915: memory region gtt_alignment support Niranjana Vishwanathapura
2022-12-12 23:12 ` [igt-dev] [PATCH i-g-t v9 02/19] lib/i915: Move common syncobj functions to library Niranjana Vishwanathapura
2023-01-13 10:02 ` Matthew Auld
2022-12-12 23:12 ` [igt-dev] [PATCH i-g-t v9 03/19] lib/vm_bind: import uapi definitions Niranjana Vishwanathapura
2022-12-12 23:12 ` [igt-dev] [PATCH i-g-t v9 04/19] lib/vm_bind: Add vm_bind/unbind and execbuf3 ioctls Niranjana Vishwanathapura
2022-12-12 23:12 ` [igt-dev] [PATCH i-g-t v9 05/19] lib/vm_bind: Add vm_bind mode support for VM Niranjana Vishwanathapura
2022-12-12 23:12 ` [igt-dev] [PATCH i-g-t v9 06/19] lib/vm_bind: Add vm_bind specific library functions Niranjana Vishwanathapura
2022-12-12 23:12 ` [igt-dev] [PATCH i-g-t v9 07/19] lib/vm_bind: Add __prime_handle_to_fd() Niranjana Vishwanathapura
2022-12-12 23:12 ` [igt-dev] [PATCH i-g-t v9 08/19] tests/i915/vm_bind: Add vm_bind sanity test Niranjana Vishwanathapura
2022-12-12 23:12 ` [igt-dev] [PATCH i-g-t v9 09/19] tests/i915/vm_bind: Add basic VM_BIND test support Niranjana Vishwanathapura
2022-12-12 23:12 ` [igt-dev] [PATCH i-g-t v9 10/19] tests/i915/vm_bind: Add userptr subtest Niranjana Vishwanathapura
2022-12-12 23:12 ` [igt-dev] [PATCH i-g-t v9 11/19] tests/i915/vm_bind: Add gem_exec3_basic test Niranjana Vishwanathapura
2022-12-12 23:12 ` [igt-dev] [PATCH i-g-t v9 12/19] tests/i915/vm_bind: Add gem_exec3_balancer test Niranjana Vishwanathapura
2022-12-12 23:12 ` [igt-dev] [PATCH i-g-t v9 13/19] tests/i915/vm_bind: Add gem_lmem_swapping@vm_bind sub test Niranjana Vishwanathapura
2022-12-12 23:12 ` [igt-dev] [PATCH i-g-t v9 14/19] tests/i915/vm_bind: Add gem_shrink@vm_bind* subtests Niranjana Vishwanathapura
2022-12-12 23:12 ` [igt-dev] [PATCH i-g-t v9 15/19] tests/i915/vm_bind: Add i915_capture library routines Niranjana Vishwanathapura
2022-12-13 13:14 ` Matthew Auld
2022-12-13 16:11 ` Niranjana Vishwanathapura
2023-01-13 10:06 ` Matthew Auld
2023-01-18 6:26 ` Niranjana Vishwanathapura
2023-01-18 7:12 ` Niranjana Vishwanathapura
2022-12-12 23:12 ` [igt-dev] [PATCH i-g-t v9 16/19] tests/i915/vm_bind: Test capture of persistent mappings Niranjana Vishwanathapura
2022-12-12 23:12 ` [igt-dev] [PATCH i-g-t v9 17/19] lib/vm_bind: Add execbuf3 support to igt_spin_factory Niranjana Vishwanathapura
2023-01-13 11:38 ` Matthew Auld
2023-01-18 6:34 ` Niranjana Vishwanathapura
2022-12-12 23:12 ` [igt-dev] [PATCH i-g-t v9 18/19] tests/i915/vm_bind: Use execbuf3 spinner Niranjana Vishwanathapura
2023-01-13 11:39 ` Matthew Auld
2022-12-12 23:12 ` [igt-dev] [PATCH i-g-t v9 19/19] tests/i915/vm_bind: Add userptr invalidation test Niranjana Vishwanathapura
2023-01-13 14:27 ` Matthew Auld [this message]
2023-01-18 6:34 ` Niranjana Vishwanathapura
2022-12-12 23:50 ` [igt-dev] ✓ Fi.CI.BAT: success for vm_bind: Add VM_BIND validation support (rev13) Patchwork
2022-12-13 17:48 ` [igt-dev] ✓ Fi.CI.IGT: " 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=a0689b87-9d95-6520-ff86-3f47e744a7ce@intel.com \
--to=matthew.auld@intel.com \
--cc=daniel.vetter@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=niranjana.vishwanathapura@intel.com \
--cc=petri.latvala@intel.com \
--cc=thomas.hellstrom@intel.com \
--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