On ma, 2016-07-25 at 08:44 +0100, Chris Wilson wrote:
> Upon release of the file (i.e. the user calls close(fd)), we decouple
> all objects from the client list so that we don't chase the dangling
> file_priv. As we always inspect file_priv first, we only need to nullify
> that pointer and can safely ignore the list_head.
> 
> Signed-off-by: Chris Wilson <[email protected]>

Reviewed-by: Joonas Lahtinen <[email protected]>

> ---
>  drivers/gpu/drm/i915/i915_gem.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index c8436639b3ed..3730aecc1eae 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -4745,21 +4745,15 @@ int i915_gem_freeze_late(struct drm_i915_private 
> *dev_priv)
>  void i915_gem_release(struct drm_device *dev, struct drm_file *file)
>  {
>       struct drm_i915_file_private *file_priv = file->driver_priv;
> +     struct drm_i915_gem_request *request;
>  
>       /* Clean up our request list when the client is going away, so that
>        * later retire_requests won't dereference our soon-to-be-gone
>        * file_priv.
>        */
>       spin_lock(&file_priv->mm.lock);
> -     while (!list_empty(&file_priv->mm.request_list)) {
> -             struct drm_i915_gem_request *request;
> -
> -             request = list_first_entry(&file_priv->mm.request_list,
> -                                        struct drm_i915_gem_request,
> -                                        client_list);
> -             list_del(&request->client_list);
> +     list_for_each_entry(request, &file_priv->mm.request_list, client_list)
>               request->file_priv = NULL;
> -     }
>       spin_unlock(&file_priv->mm.lock);
>  
>       if (!list_empty(&file_priv->rps.link)) {
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to