Re: [PATCH] drm/i915: Fix context/engine cleanup order

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

 



On Mon, Dec 14, 2015 at 04:30:04PM +0000, Nick Hoath wrote:
> diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
> index 900ffd0..7df3c7a 100644
> --- a/drivers/gpu/drm/i915/i915_gem_context.c
> +++ b/drivers/gpu/drm/i915/i915_gem_context.c
> @@ -431,17 +431,22 @@ void i915_gem_context_fini(struct drm_device *dev)
>  		i915_gem_object_ggtt_unpin(dctx->legacy_hw_ctx.rcs_state);
>  	}
>  
> -	for (i = 0; i < I915_NUM_RINGS; i++) {
> +	for (i = I915_NUM_RINGS; --i >= 0;) {
>  		struct intel_engine_cs *ring = &dev_priv->ring[i];
>  
>  		if (ring->last_context)
>  			i915_gem_context_unreference(ring->last_context);
>  
> -		ring->default_context = NULL;
>  		ring->last_context = NULL;
>  	}
>  
>  	i915_gem_context_unreference(dctx);
> +
> +	for (i = I915_NUM_RINGS; --i >= 0;) {
> +		struct intel_engine_cs *ring = &dev_priv->ring[i];
> +
> +		ring->default_context = NULL;
> +	}
>  }

Why?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://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