All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Matthew Auld <matthew.william.auld@gmail.com>
Cc: igt-dev@lists.freedesktop.org,
	Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Subject: Re: [Intel-gfx] [igt-dev] [PATCH i-g-t 2/2] i915/gem_softpin: Check full placement control under full-ppgtt
Date: Wed, 16 Dec 2020 09:36:14 +0000	[thread overview]
Message-ID: <160811137407.1420.12667858510374604278@build.alporthouse.com> (raw)
In-Reply-To: <CAM0jSHOhCKfoFNqZUnHqbsNC-hWXzKQjK8jzH4FB+B4hnSinHA@mail.gmail.com>

Quoting Matthew Auld (2020-12-16 09:31:41)
> On Tue, 15 Dec 2020 at 21:07, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> >
> > With full-ppgtt, userspacew has complete control over their GTT. Verify
> > that we can place an object at the very beginning and the very end of
> > our GTT.
> >
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > ---
> >  tests/i915/gem_softpin.c | 45 ++++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 45 insertions(+)
> >
> > diff --git a/tests/i915/gem_softpin.c b/tests/i915/gem_softpin.c
> > index fcaf8ef30..a530e89d3 100644
> > --- a/tests/i915/gem_softpin.c
> > +++ b/tests/i915/gem_softpin.c
> > @@ -97,6 +97,47 @@ static void test_invalid(int fd)
> >         }
> >  }
> >
> > +static uint32_t batch_create(int i915, uint64_t *sz)
> > +{
> > +       const uint32_t bbe = MI_BATCH_BUFFER_END;
> > +       struct drm_i915_gem_create create = {
> > +               .size = sizeof(bbe),
> > +       };
> > +
> > +       if (igt_ioctl(i915, DRM_IOCTL_I915_GEM_CREATE, &create)) {
> > +               igt_assert_eq(errno, 0);
> > +               return 0;
> > +       }
> > +
> > +       gem_write(i915, create.handle, 0, &bbe, sizeof(bbe));
> > +
> > +       *sz = create.size;
> > +       return create.handle;
> > +}
> > +
> > +static void test_zero(int i915)
> > +{
> > +       uint64_t sz;
> > +       struct drm_i915_gem_exec_object2 object = {
> > +               .handle = batch_create(i915, &sz),
> > +               .flags = EXEC_OBJECT_PINNED | EXEC_OBJECT_SUPPORTS_48B_ADDRESS,
> > +       };
> > +       struct drm_i915_gem_execbuffer2 execbuf = {
> > +               .buffers_ptr = to_user_pointer(&object),
> > +               .buffer_count = 1,
> > +       };
> > +
> > +       /* Under full-ppgtt, we have complete control of the GTT */
> > +
> > +       object.offset = 0;
> > +       gem_execbuf(i915, &execbuf);
> > +
> > +       object.offset = gem_aperture_size(i915) - sz;
> > +       gem_close(i915, object.handle);
> > +
> > +       gem_close(i915, object.handle);
> > +}
> > +
> >  static void test_softpin(int fd)
> >  {
> >         const uint32_t size = 1024 * 1024;
> > @@ -559,6 +600,10 @@ igt_main
> >
> >         igt_subtest("invalid")
> >                 test_invalid(fd);
> > +       igt_subtest("zero") {
> > +               igt_require(gem_uses_full_ppgtt(fd));
> > +               test_zero(fd);
> > +       }
> 
> Worth adding igt_subtest("full") somewhere, which tries to occupy the
> entire 48b ppGTT? Maybe using pad_to_size?

No. I'll let you work out why :)
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-12-16  9:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-15 21:06 [Intel-gfx] [PATCH i-g-t 1/2] i915/gem_exec_params: Assert a 4G object does _not_ fit without 48b Chris Wilson
2020-12-15 21:06 ` [Intel-gfx] [PATCH i-g-t 2/2] i915/gem_softpin: Check full placement control under full-ppgtt Chris Wilson
2020-12-15 21:06   ` [igt-dev] " Chris Wilson
2020-12-15 21:53   ` [Intel-gfx] [PATCH i-g-t v2] " Chris Wilson
2020-12-16  9:31   ` [Intel-gfx] [igt-dev] [PATCH i-g-t 2/2] " Matthew Auld
2020-12-16  9:36     ` Chris Wilson [this message]
2020-12-15 21:47 ` [Intel-gfx] [PATCH i-g-t 1/2] i915/gem_exec_params: Assert a 4G object does _not_ fit without 48b Tang, CQ
2020-12-16  3:11 ` [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/2] " Patchwork
2020-12-16  4:52 ` [igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/2] i915/gem_exec_params: Assert a 4G object does _not_ fit without 48b (rev2) 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=160811137407.1420.12667858510374604278@build.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.william.auld@gmail.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.