On to, 2017-01-19 at 11:41 +0000, Chris Wilson wrote:
> Simple test to exercise creation and lookup of VMA within an object.
> 
> Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>

<SNIP>

> +static bool assert_vma(struct i915_vma *vma,
> +                    struct drm_i915_gem_object *obj,
> +                    struct i915_gem_context *ctx)
> +{
> +     if (vma->vm != &ctx->ppgtt->base) {
> +             pr_err("VMA created with wrong VM\n");
> +             return false;
> +     }

maybe "bool correct = true;" and list all the errors he VMA has? and
finally return correct;

> +     for_each_prime_number(num_obj, ULONG_MAX - 1) {
> +             for (; no < num_obj; no++) {
> +                     obj = i915_gem_object_create_internal(i915, PAGE_SIZE);
> +                     if (IS_ERR(obj))
> +                             goto err;
> +
> +                     list_add(&obj->batch_pool_link, &objects);

See below;

> +             }
> +
> +             nc = 0;
> +             for_each_prime_number(num_ctx, MAX_CONTEXT_HW_ID) {
> +                     for (; nc < num_ctx; nc++) {
> +                             ctx = mock_context(i915, "mock");
> +                             if (!ctx)
> +                                     goto err;
> +
> +                             list_move(&ctx->link, &contexts);

Why the difference?

> +                     }
> +
> +                     err = create_vmas(i915, &objects, &contexts);
> +                     if (err)
> +                             goto err;
> +
> +                     if (igt_timeout(end_time,
> +                                     "%s timed out: after %lu objects\n",
> +                                     __func__, no))

Maybe also context count, because it's available.

Reviewed-by: Joonas Lahtinen <joonas.lahti...@linux.intel.com>

Regards, Joonas
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to