[PATCH 34/34] drm: kselftest for drm_mm and bottom-up allocation
Joonas Lahtinen
joonas.lahtinen at linux.intel.com
Wed Dec 14 09:10:55 UTC 2016
On ma, 2016-12-12 at 11:53 +0000, Chris Wilson wrote:
> Check that if we request bottom-up allocation from drm_mm_insert_node()
> we receive the next available hole from the bottom.
>
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
<SNIP>
> @@ -1304,6 +1304,95 @@ static int igt_topdown(void *ignored)
> > return ret;
> }
>
> +static int igt_bottomup(void *ignored)
> +{
<SNIP>
> + drm_mm_init(&mm, 0, size);
> + for (n = 0; n < size; n++) {
> + int err;
> +
> + err = drm_mm_insert_node_generic(&mm, &nodes[n], 1, 0, 0,
> + DRM_MM_INSERT_LOW);
> + if (err) {
> + pr_err("bottomup insert failed, step %d\n", n);
> + ret = err;
> + goto out;
> + }
> +
> + if (nodes[n].hole_size) {
Should really be if (nodes[n].hole_size != size - n) and
pr_err("incorrect hole...");
With that fixed;
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