[Intel-gfx] [PATCH v2 37/38] drm/i915: Add mock exercise for i915_gem_gtt_insert

Joonas Lahtinen joonas.lahtinen at linux.intel.com
Wed Jan 25 13:31:44 UTC 2017


On to, 2017-01-19 at 11:41 +0000, Chris Wilson wrote:
> i915_gem_gtt_insert should allocate from the available free space in the
> GTT, evicting as necessary to create space.
> 
> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

<SNIP>

> +		list_add(&obj->batch_pool_link, &objects);

Still dislike the obscurity. The least you could do is make a comment
on abusing the variable.

> +
> +	/* And then force evictions */
> +	for (total = 0;
> +	     total + 2*I915_GTT_PAGE_SIZE <= i915->ggtt.base.total;
> +	     total += 2*I915_GTT_PAGE_SIZE) {
> +		struct i915_vma *vma;

<SNIP>

> +		err = i915_gem_gtt_insert(&i915->ggtt.base, &vma->node,
> +					   obj->base.size, 0, obj->cache_level,
> +					   0, i915->ggtt.base.total,
> +					   0);
> +		if (err) {
> +			pr_err("i915_gem_gtt_insert (pass 1) failed at %llu/%llu with err=%d\n",

pass 3?

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

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


More information about the Intel-gfx mailing list