[igt-dev] [PATCH i-g-t] tests/i915/gem_mmap_offset: Add new API test for gem_mmap_offset

Chris Wilson chris at chris-wilson.co.uk
Thu Nov 28 12:59:41 UTC 2019


Quoting Chris Wilson (2019-11-28 12:55:02)
> +static void isolation(int i915)
> +{
> +       for_each_mmap_offset_type(t) {
> +               struct drm_i915_gem_mmap_offset mmap_arg = {
> +                       .flags = t->type
> +               };
> +               int A = gem_reopen_driver(i915);
> +               int B = gem_reopen_driver(i915);
> +               uint64_t offset_a, offset_b;
> +               uint32_t a, b;
> +               void *ptr;
> +
> +               a = gem_create(A, 4096);
> +               b = gem_open(B, gem_flink(A, a));
> +
> +               mmap_arg.handle = a;
> +               igt_assert_eq(mmap_offset_ioctl(i915, &mmap_arg), 0);

First ioctl should skip if type is not supported.

> +               offset_a = mmap_arg.offset;
> +
> +               mmap_arg.handle = b;
> +               igt_assert_eq(mmap_offset_ioctl(i915, &mmap_arg), 0);

Then second must succeed.
-Chris


More information about the igt-dev mailing list