[Intel-gfx] [PATCH 11/37] drm/i915: Only update LRU position of fence on success.

Eric Anholt eric at anholt.net
Wed Mar 17 22:31:20 CET 2010


On Wed, 10 Mar 2010 22:44:58 +0000, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> If we fail to set the domain when preparing to mmap a fenced object,
> don't bother to more it to the front of the LRU fence list.

I don't think this patch can do anything, since ret == -EINVAL implies
obj_priv->gtt_space == NULL which implies obj_priv->fence_reg ==
I915_FENCE_REG_NONE.  If the first implication were ever untrue, this
code would be broken either before or after.

> Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/i915_gem.c |   15 +++++++--------
>  1 files changed, 7 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index b93f7e1..892be92 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -1046,20 +1046,19 @@ i915_gem_set_domain_ioctl(struct drm_device *dev, void *data,
>  	if (read_domains & I915_GEM_DOMAIN_GTT) {
>  		ret = i915_gem_object_set_to_gtt_domain(obj, write_domain != 0);
>  
> -		/* Update the LRU on the fence for the CPU access that's
> -		 * about to occur.
> -		 */
> -		if (obj_priv->fence_reg != I915_FENCE_REG_NONE) {
> -			list_move_tail(&obj_priv->fence_list,
> -				       &dev_priv->mm.fence_list);
> -		}
> -
>  		/* Silently promote "you're not bound, there was nothing to do"
>  		 * to success, since the client was just asking us to
>  		 * make sure everything was done.
>  		 */
>  		if (ret == -EINVAL)
>  			ret = 0;
                        > +
> +		/* Update the LRU on the fence for the CPU access that's
> +		 * about to occur.
> +		 */
> +		if (ret == 0 && obj_priv->fence_reg != I915_FENCE_REG_NONE)
> +			list_move_tail(&obj_priv->fence_list,
> +				       &dev_priv->mm.fence_list);
>  	} else {
>  		ret = i915_gem_object_set_to_cpu_domain(obj, write_domain != 0);
>  	}
> -- 
> 1.7.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20100317/4861d9f2/attachment.sig>


More information about the Intel-gfx mailing list