From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Cc: igt-dev@lists.freedesktop.org, "Lahtinen,
Joonas" <joonas.lahtinen@intel.com>,
"Graunke, Kenneth W" <kenneth.w.graunke@intel.com>,
"Kondapally, Kalyan" <kalyan.kondapally@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t v3] prime_vgem: Check that we wrap the vgem mmap with userptr
Date: Fri, 9 Oct 2020 10:38:04 +0100 [thread overview]
Message-ID: <478fbc5e-0d54-8fd9-bf76-a8a431a54148@linux.intel.com> (raw)
In-Reply-To: <20201008230303.1560301-1-chris@chris-wilson.co.uk>
On 09/10/2020 00:03, Chris Wilson wrote:
> This came up in a discussion about importing virtio dma-buf, which are
> themselves plain shmemfs objects and so not only backed by struct pages,
> but wrappable by userptr. vgem share the same properties and so should
> serve as a useful proxy for testing.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: "Graunke, Kenneth W" <kenneth.w.graunke@intel.com>,
> Cc: "Lahtinen, Joonas" <joonas.lahtinen@intel.com>
> Cc: "Kondapally, Kalyan" <kalyan.kondapally@intel.com>
> ---
> tests/intel-ci/fast-feedback.testlist | 1 +
> tests/prime_vgem.c | 31 +++++++++++++++++++++++++++
> 2 files changed, 32 insertions(+)
>
> diff --git a/tests/intel-ci/fast-feedback.testlist b/tests/intel-ci/fast-feedback.testlist
> index aa2eb3295..982d25834 100644
> --- a/tests/intel-ci/fast-feedback.testlist
> +++ b/tests/intel-ci/fast-feedback.testlist
> @@ -143,6 +143,7 @@ igt@prime_vgem@basic-fence-read
> igt@prime_vgem@basic-gtt
> igt@prime_vgem@basic-read
> igt@prime_vgem@basic-write
> +igt@prime_vgem@basic-userptr
> igt@vgem_basic@setversion
> igt@vgem_basic@create
> igt@vgem_basic@debugfs
> diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c
> index 38e2026aa..bc74d6844 100644
> --- a/tests/prime_vgem.c
> +++ b/tests/prime_vgem.c
> @@ -287,6 +287,34 @@ static void test_write(int vgem, int i915)
> munmap(ptr, scratch.size);
> }
>
> +static void test_userptr(int vgem, int i915)
> +{
> + struct vgem_bo scratch;
> + struct drm_i915_gem_exec_object2 obj = {};
> + struct drm_i915_gem_execbuffer2 execbuf = {
> + .buffers_ptr = to_user_pointer(&obj),
> + .buffer_count = 1,
> + };
> + uint32_t *ptr;
> +
> + scratch.width = 1024;
> + scratch.height = 1024;
> + scratch.bpp = 32;
> + vgem_create(vgem, &scratch);
> +
> + ptr = vgem_mmap(vgem, &scratch, PROT_WRITE);
> + gem_close(vgem, scratch.handle);
> + *ptr = MI_BATCH_BUFFER_END;
> +
> + gem_userptr(i915, ptr, scratch.size, 0, 0, &obj.handle);
> + gem_set_caching(i915, obj.handle, I915_CACHING_NONE); /* for exec */
> +
> + gem_execbuf(i915, &execbuf);
> + gem_close(i915, obj.handle);
> +
> + munmap(ptr, scratch.size);
> +}
> +
> static void test_gtt(int vgem, int i915)
> {
> struct vgem_bo scratch;
> @@ -1038,6 +1066,9 @@ igt_main
> igt_subtest("basic-write")
> test_write(vgem, i915);
>
> + igt_subtest("basic-userptr")
> + test_userptr(vgem, i915);
> +
> igt_subtest("basic-gtt") {
> gem_require_mappable_ggtt(i915);
> test_gtt(vgem, i915);
>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Regards,
Tvrtko
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2020-10-09 9:38 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-08 22:13 [Intel-gfx] [PATCH i-g-t] prime_vgem: Check that we wrap the vgem mmap with userptr Chris Wilson
2020-10-08 22:22 ` [Intel-gfx] [PATCH i-g-t v2] " Chris Wilson
2020-10-08 22:58 ` [igt-dev] ✓ Fi.CI.BAT: success for prime_vgem: Check that we wrap the vgem mmap with userptr (rev2) Patchwork
2020-10-08 23:03 ` [igt-dev] [PATCH i-g-t v3] prime_vgem: Check that we wrap the vgem mmap with userptr Chris Wilson
2020-10-09 9:38 ` Tvrtko Ursulin [this message]
2020-10-08 23:40 ` [igt-dev] ✓ Fi.CI.BAT: success for prime_vgem: Check that we wrap the vgem mmap with userptr (rev3) Patchwork
2020-10-09 2:19 ` [igt-dev] ✗ Fi.CI.IGT: failure for prime_vgem: Check that we wrap the vgem mmap with userptr (rev2) Patchwork
2020-10-09 3:09 ` [igt-dev] ✗ Fi.CI.IGT: failure for prime_vgem: Check that we wrap the vgem mmap with userptr (rev3) 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=478fbc5e-0d54-8fd9-bf76-a8a431a54148@linux.intel.com \
--to=tvrtko.ursulin@linux.intel.com \
--cc=chris@chris-wilson.co.uk \
--cc=igt-dev@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=joonas.lahtinen@intel.com \
--cc=kalyan.kondapally@intel.com \
--cc=kenneth.w.graunke@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