[Intel-gfx] [PATCH]gem: fix a regression

Ian Romanick idr at freedesktop.org
Tue Apr 7 19:57:42 CEST 2009


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Shaohua Li wrote:
> regression caused by commit 5e118f4139feafe97e913df67b1f7c1e5083e535
> i915_gem_object_move_to_inactive() should be called in task context, as
> it calls fput()
> 
> Signed-off-by: Shaohua Li<shaohua.li at intel.com>
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 1449b45..54a258c 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -1494,8 +1494,17 @@ i915_gem_retire_request(struct drm_device *dev,
>  
>  		if (obj->write_domain != 0)
>  			i915_gem_object_move_to_flushing(obj);
> -		else
> +		else {
> +			/*
> +			 * the object might be freed, take reference first so
> +			 * it will not be freed in atomic environment
> +			 **/
> +			drm_gem_object_reference(obj);
>  			i915_gem_object_move_to_inactive(obj);
> +			spin_unlock(&dev_priv->mm.active_list_lock);
> +			drm_gem_object_unreference(obj);
> +			spin_lock(&dev_priv->mm.active_list_lock);
> +		}
>  	}

I don't see the relationship between this code change and the commit
message.  I assume that calling drm_gem_object_reference doesn't change
up to task context.  Am I missing something?

>  out:
>  	spin_unlock(&dev_priv->mm.active_list_lock);

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknblBYACgkQX1gOwKyEAw8fRgCggQ5JLkPMpQGr8gnW6iuz3/Hc
SAkAnAxEvoLiJ6uTG41GidANudddYzao
=MT2w
-----END PGP SIGNATURE-----



More information about the Intel-gfx mailing list