[PATCH 08/34] drm: kselftest for drm_mm_reserve_node()

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Wed Dec 14 09:55:37 UTC 2016


On ma, 2016-12-12 at 11:53 +0000, Chris Wilson wrote:
> Exercise drm_mm_reserve_node(), check that we can't reserve an already
> occupied range and that the lists are correct after reserving/removing.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

<SNIP>


> @@ -105,6 +108,135 @@ static int igt_debug(void *ignored)
>  	return 0;
>  }
>  
> +static int __igt_reserve(int count, u64 size)
> +{

<SNIP>

> +	if (!drm_mm_clean(&mm)) {
> +		pr_err("mm not empty on creation\n");
> +		goto out;
> +	}

Usual nag about repeating the drm_mm_clean test.

<SNIP>

> +	/* Repeated use should then fail */
> +	drm_random_reorder(order, count, &lcg_state);
> +	for (n = 0; n < count; n++) {
> +		struct drm_mm_node tmp = {
> +			.start = order[n] * size,
> +			.size = 1
> +		};
> +
> +		if (!drm_mm_reserve_node(&mm, &tmp)) {

Good chance to check that the returne error code is -ENOSPC.

And could make max_count/max_iterations a variable (ditto for
max_prime) to be shared among tests.

Other than that,

Reviewed-by: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation


More information about the dri-devel mailing list