[Intel-gfx] [PATCH] drm/i915: drop duplicate ggtt vma list add in setup_global_gtt

Chris Wilson chris at chris-wilson.co.uk
Wed Nov 13 00:58:08 CET 2013


On Tue, Nov 12, 2013 at 02:53:08PM -0800, Jesse Barnes wrote:
> Preallocated, stolen objects will already be added to this list when we
> first create them.

That had me scratching my head a bit trying to work out where and why
stolen objects were explicitly adding themselves to the obj->vma_list.

"Preallocated objects will already have been added to the vma_list when
creating their ggtt vma entry, and coincidentally also marked as holding
a ggtt mapping. Repeating the vma_list manipulation when setting up the
ggtt after preallocation is a recipe for an unhappy kernel."

> 
> Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>

> ---
>  drivers/gpu/drm/i915/i915_gem_gtt.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index f69bdc7..efb5dab 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -1124,7 +1124,6 @@ void i915_gem_setup_global_gtt(struct drm_device *dev,
>  		if (ret)
>  			DRM_DEBUG_KMS("Reservation failed\n");
>  		obj->has_global_gtt_mapping = 1;
 -		obj->has_global_gtt_mapping = 1;
> -		list_add(&vma->vma_link, &obj->vma_list);
>  	}
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list