[Intel-gfx] [PATCH v2 7/7] drm/i915/selftests: add sanity selftest for huge-GTT-pages

Chris Wilson chris at chris-wilson.co.uk
Mon Oct 21 20:28:07 UTC 2019


Quoting Matthew Auld (2019-10-21 20:27:47)
> Now that for all the relevant backends we do randomised testing, we need
> to make sure we still sanity check the obvious cases that might blow up,
> such that introducing a temporary regression is less likely.  Also
> rather than do this for every backend, just limit to our two memory
> types: system and local.
> 
> Suggested-by: Chris Wilson <chris at chris-wilson.co.uk>
> Signed-off-by: Matthew Auld <matthew.auld at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> ---
>  .../gpu/drm/i915/gem/selftests/huge_pages.c   | 103 ++++++++++++++++++
>  1 file changed, 103 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
> index 1d7c2a50d636..fee8a6c338b8 100644
> --- a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
> +++ b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
> @@ -1505,6 +1505,108 @@ static int igt_ppgtt_lmem_huge(void *arg)
>         return err;
>  }
>  
> +static struct drm_i915_gem_object *
> +igt_create_local(struct drm_i915_private *i915, u32 size)
> +{
> +       return i915_gem_object_create_lmem(i915, size, I915_ALLOC_CONTIGUOUS);
> +}
> +
> +static struct drm_i915_gem_object *
> +igt_create_system(struct drm_i915_private *i915, u32 size)
> +{
> +       return huge_pages_object(i915, size, size);

Some might say that these [internal, mocks] should also be part of the
factory service ;)

> +typedef struct drm_i915_gem_object *
> +(*igt_create_fn)(struct drm_i915_private *i915, u32 size);
> +
> +static int igt_ppgtt_sanity_check(void *arg)
> +{
> +       struct i915_gem_context *ctx = arg;
> +       struct drm_i915_private *i915 = ctx->i915;
> +       unsigned int supported = INTEL_INFO(i915)->page_sizes;
> +       struct {
> +               u32 size;
> +               u32 pages;
> +       } combos[] = {
> +               { SZ_64K,         SZ_64K,          },
> +               { SZ_2M,          SZ_2M,           },
> +               { SZ_2M,          SZ_64K,          },
> +               { SZ_2M + SZ_4K,  SZ_64K | SZ_4K,  },
> +               { SZ_2M + SZ_4K,  SZ_2M  | SZ_4K,  },
> +               { SZ_2M + SZ_64K, SZ_2M  | SZ_64K, },

Won't SZ_2M - PAGE_SIZE also be as interesting?

If I am not barking up the wrong tree with my understanding here,
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the Intel-gfx mailing list