[igt-dev] [PATCH i-g-t] tests/i915/gem_create: Remove page nonaligned buffer tests
Chris Wilson
chris at chris-wilson.co.uk
Mon Jan 27 09:56:16 UTC 2020
Quoting Ramalingam C (2020-01-27 09:46:46)
> On 2020-01-27 at 08:56:07 +0000, Chris Wilson wrote:
> > Quoting Ramalingam C (2020-01-27 08:46:10)
> > > Considering that kernel returns the real memory size(page aligned)
> > > allocated, nonaligned buffer tests are not valid anymore. Hence removing
> > > them.
> >
> > >
> > > Signed-off-by: Ramalingam C <ramalingam.c at intel.com>
> > > cc: Chris Wilson <chris at chris-wilson.co.uk>
> > > ---
> > > tests/i915/gem_create.c | 46 -----------------------------------------
> > > 1 file changed, 46 deletions(-)
> > >
> > > diff --git a/tests/i915/gem_create.c b/tests/i915/gem_create.c
> > > index 8fc128dae6e2..d80479c757e8 100644
> > > --- a/tests/i915/gem_create.c
> > > +++ b/tests/i915/gem_create.c
> > > @@ -119,46 +119,6 @@ static void invalid_size_test(int fd)
> > > igt_assert_eq(create_ioctl(fd, &create), -EINVAL);
> > > }
> > >
> > > -/*
> > > - * Creating an object with non-aligned size and trying to access it with an
> > > - * offset, which is greater than the requested size but smaller than the
> > > - * object's last page boundary. pwrite here must be successful.
> > > - */
> > > -static void valid_nonaligned_size(int fd)
> > > -{
> > > - struct drm_i915_gem_create create = {
> > > - .size = PAGE_SIZE / 2,
> > > - };
> > > - char buf[PAGE_SIZE];
> > > -
> > > - igt_assert_eq(create_ioctl(fd, &create), 0);
> > > -
> > > - gem_write(fd, create.handle, PAGE_SIZE / 2, buf, PAGE_SIZE / 2);
> > > -
> > > - gem_close(fd, create.handle);
> >
> > This is reasonable, just add a igt_assert(create.size >= PAGE_SIZE) as
> you mean igt_assert(create.size == PAGE_SIZE) right... ?
No, we already do return aligned to mr->min_page_size, so we want some
generality. The minimum we expect is aligned to PAGE_SIZE, so that is
the minimum we need to enforce to ensure consistency with system-page
aligned uAPI (e.g. mmap).
-Chris
More information about the igt-dev
mailing list