From: Matthew Brost <matthew.brost@intel.com>
To: Christoph Manszewski <christoph.manszewski@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH 1/1] tests/intel/xe_vm: Add 'partial-unbinds' subtest
Date: Tue, 31 Oct 2023 17:57:34 +0000 [thread overview]
Message-ID: <ZUFADj+X06TqH1AF@DUT025-TGLU.fm.intel.com> (raw)
In-Reply-To: <20231031150140.374123-2-christoph.manszewski@intel.com>
On Tue, Oct 31, 2023 at 04:01:40PM +0100, Christoph Manszewski wrote:
> Xe supports partial unbind operations in asynchronous mode. Add basic
> coverage for this feature.
>
> Signed-off-by: Christoph Manszewski <christoph.manszewski@intel.com>
This exposes a bug in the Xe KMD, let's get this in.
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
> ---
> tests/intel/xe_vm.c | 43 +++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 43 insertions(+)
>
> diff --git a/tests/intel/xe_vm.c b/tests/intel/xe_vm.c
> index dd3302337..eeb49122a 100644
> --- a/tests/intel/xe_vm.c
> +++ b/tests/intel/xe_vm.c
> @@ -256,6 +256,46 @@ test_bind_one_bo_many_times_many_vm(int fd)
> __test_bind_one_bo(fd, 0, addrs_size, addrs);
> }
>
> +/**
> + * SUBTEST: partial-unbinds
> + * Description: Test partial unbinds
> + * Functionality: unbind
> + * Test category: functionality test
> + */
> +
> +static void test_partial_unbinds(int fd)
> +{
> + uint32_t vm = xe_vm_create(fd, DRM_XE_VM_CREATE_ASYNC_DEFAULT, 0);
> + size_t bo_size = 3 * xe_get_default_alignment(fd);
> + uint32_t bo = xe_bo_create(fd, 0, vm, bo_size);
> + uint64_t unbind_size = bo_size / 3;
> + uint64_t addr = 0x1a0000;
> +
> + struct drm_xe_sync sync = {
> + .flags = DRM_XE_SYNC_SYNCOBJ | DRM_XE_SYNC_SIGNAL,
> + .handle = syncobj_create(fd, 0),
> + };
> +
> + xe_vm_bind_async(fd, vm, 0, bo, 0, addr, bo_size, &sync, 1);
> + igt_assert(syncobj_wait(fd, &sync.handle, 1, INT64_MAX, 0, NULL));
> +
> + syncobj_reset(fd, &sync.handle, 1);
> + xe_vm_unbind_async(fd, vm, 0, 0, addr + unbind_size, unbind_size, &sync, 1);
> + igt_assert(syncobj_wait(fd, &sync.handle, 1, INT64_MAX, 0, NULL));
> +
> + syncobj_reset(fd, &sync.handle, 1);
> + xe_vm_unbind_async(fd, vm, 0, 0, addr, unbind_size, &sync, 1);
> + igt_assert(syncobj_wait(fd, &sync.handle, 1, INT64_MAX, 0, NULL));
> +
> + syncobj_reset(fd, &sync.handle, 1);
> + xe_vm_unbind_async(fd, vm, 0, 0, addr + 2 * unbind_size, unbind_size, &sync, 1);
> + igt_assert(syncobj_wait(fd, &sync.handle, 1, INT64_MAX, 0, NULL));
> +
> + syncobj_destroy(fd, sync.handle);
> + gem_close(fd, bo);
> + xe_vm_destroy(fd, vm);
> +}
> +
> /**
> * SUBTEST: unbind-all-%d-vmas
> * Description: Test unbind all with %arg[1] VMAs
> @@ -1827,6 +1867,9 @@ igt_main
> igt_subtest("scratch")
> test_scratch(fd);
>
> + igt_subtest("partial-unbinds")
> + test_partial_unbinds(fd);
> +
> igt_subtest("unbind-all-2-vmas")
> unbind_all(fd, 2);
>
> --
> 2.40.1
>
next prev parent reply other threads:[~2023-10-31 17:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-31 15:01 [igt-dev] [PATCH 0/1] tests/intel/xe_vm: Add 'partial-unbinds' subtest Christoph Manszewski
2023-10-31 15:01 ` [igt-dev] [PATCH 1/1] " Christoph Manszewski
2023-10-31 17:57 ` Matthew Brost [this message]
2023-10-31 18:59 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2023-10-31 20:19 ` [igt-dev] ✓ CI.xeBAT: success " 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=ZUFADj+X06TqH1AF@DUT025-TGLU.fm.intel.com \
--to=matthew.brost@intel.com \
--cc=christoph.manszewski@intel.com \
--cc=igt-dev@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: 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