[Intel-gfx] [PATCH 2/2] drm/i915: prefer use of i915_gem_object_put

Chris Wilson chris at chris-wilson.co.uk
Wed Feb 22 16:12:15 UTC 2017


On Wed, Feb 22, 2017 at 04:01:06PM +0000, Matthew Auld wrote:
> Always use i915_gem_object_put over i915_gem_object_free if we can.
> 
> Signed-off-by: Matthew Auld <matthew.auld at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Joonas Lahtinen <joonas.lahtinen at linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_gem_stolen.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
> index f3abdc27c5dd..9ad8c7dddd04 100644
> --- a/drivers/gpu/drm/i915/i915_gem_stolen.c
> +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
> @@ -599,7 +599,7 @@ _i915_gem_object_create_stolen(struct drm_i915_private *dev_priv,
>  	return obj;
>  
>  cleanup:
> -	i915_gem_object_free(obj);
> +	i915_gem_object_put(obj);

Which you can't here. Put(stolen) assumes we have pinned the pages.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list