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@xxxxxxxxxxxxxxxxxx> <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@xxxxxxxxxxxxxxx> Regards, Joonas -- Joonas Lahtinen Open Source Technology Center Intel Corporation _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel