Re: [PATCH v2 30/38] drm/i915: Test creation of VMA

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

 



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

<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.lahtinen@xxxxxxxxxxxxxxx>

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