Re: [PATCH 30/37] drm/i915: Exercise filling and removing random ranges from the live GTT

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxx>

<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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux