[Intel-gfx] [PATCH v3 03/16] drm/i915: reference count for i915_hw_contexts

Chris Wilson chris at chris-wilson.co.uk
Wed Apr 10 00:18:23 CEST 2013


On Thu, Apr 04, 2013 at 06:32:35PM +0300, Mika Kuoppala wrote:
> In preparation to do analysis of which context was
> guilty of gpu hung, store kreffed context pointer
> into request struct.
> 
> This allows us to inspect contexts when gpu is reset
> even if those contexts would already be released
> by userspace.
> 
> v2: track i915_hw_context pointers instead of using ctx_ids
>     (from Chris Wilson)
> 
> v3 (Ben): Get rid of do_release() and handle refcounting more compactly.
>     (recommended by Chis)
> 
> v4: kref_* put inside static inlines (Daniel Vetter)
>     remove code duplication on freeing context (Chris Wilson)
> 
> Signed-off-by: Mika Kuoppala <mika.kuoppala at intel.com> (v2)
> Signed-off-by: Ben Widawsky <ben at bwidawsk.net> (v3)
> Signed-off-by: Mika Kuoppala <mika.kuoppala at intel.com> (v4)
> ---
> @@ -511,7 +520,7 @@ int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data,
>  		return -ENOENT;
>  	}
>  
> -	do_destroy(ctx);
> +	i915_gem_context_unreference(ctx);

This needs to remove the ctx from the idr as well as dropping the
reference associated with the id.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list