[Intel-gfx] [PATCH 30/37] drm/i915: Exercise filling and removing random ranges from the live GTT
Joonas Lahtinen
joonas.lahtinen at linux.intel.com
Fri Jan 13 08:59:52 UTC 2017
On ke, 2017-01-11 at 21:09 +0000, Chris Wilson wrote:
> Test the low-level i915_address_space interfaces to sanity check the
> live insertion/removal of address ranges.
>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
<SNIP>
> +static u64 scale(u64 offset, unsigned int shift)
> +{
> + return offset << shift;
> +}
BIT_ULL is your friend.
> +static int random_hole(struct drm_i915_private *i915,
fill_random_hole?
> + struct i915_address_space *vm,
> + u64 hole_start, u64 hole_end)
> +{
> + I915_RND_STATE(prng);
Just to remind that this prng should be seeded from the user seed to
maintain repeatability. I kinda assume it's so.
> + unsigned int size;
> +
> + for (size = 12; (hole_end - hole_start) >> (size + 2); size++) {
This criteria is not obvious to me. Maybe write a comment above.
You could add a variable BIT_ULL(1, size) here too.
<SNIP>
Put a one line comment what each test achieves, again you have some of
it in the commit messages already.
> +static int igt_ppgtt_drunk(void *arg)
Regards, Joonas
--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
More information about the Intel-gfx
mailing list