[Intel-gfx] [PATCH 11/12] drm/i915: Convert object coloring to VMA

Daniel Vetter daniel at ffwll.ch
Tue Jul 23 19:07:57 CEST 2013


On Sun, Jul 21, 2013 at 07:08:18PM -0700, Ben Widawsky wrote:
> Signed-off-by: Ben Widawsky <ben at bwidawsk.net>

Oh, here's the patch I've been looking for in patch 1 ;-)

I think if you split up patch 1 into different pieces _without_ changing
anything in the aggregate diff (see my little howto on our internal wiki)
then I guess I can be appeased to merge stuff as-is, or suggest to squash
in individual fixups like this one here.
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_drv.h |  3 ---
>  drivers/gpu/drm/i915/i915_gem.c | 18 +-----------------
>  2 files changed, 1 insertion(+), 20 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index fe41a3d..2b4f30c 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1864,9 +1864,6 @@ bool i915_gem_obj_bound(struct drm_i915_gem_object *o,
>  			struct i915_address_space *vm);
>  unsigned long i915_gem_obj_size(struct drm_i915_gem_object *o,
>  				struct i915_address_space *vm);
> -void i915_gem_obj_set_color(struct drm_i915_gem_object *o,
> -			    struct i915_address_space *vm,
> -			    enum i915_cache_level color);
>  struct i915_vma *i915_gem_obj_to_vma(struct drm_i915_gem_object *obj,
>  				     struct i915_address_space *vm);
>  struct i915_vma *
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index 397a4b4..e038709 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -3394,7 +3394,7 @@ int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,
>  		}
>  
>  		vm->map_vma(vma, cache_level, 0);
> -		i915_gem_obj_set_color(obj, vm, cache_level);
> +		vma->node.color = cache_level;
>  	}
>  
>  	if (cache_level == I915_CACHE_NONE) {
> @@ -4800,22 +4800,6 @@ unsigned long i915_gem_obj_size(struct drm_i915_gem_object *o,
>  	return 0;
>  }
>  
> -void i915_gem_obj_set_color(struct drm_i915_gem_object *o,
> -			    struct i915_address_space *vm,
> -			    enum i915_cache_level color)
> -{
> -	struct i915_vma *vma;
> -	BUG_ON(list_empty(&o->vma_list));
> -	list_for_each_entry(vma, &o->vma_list, vma_link) {
> -		if (vma->vm == vm) {
> -			vma->node.color = color;
> -			return;
> -		}
> -	}
> -
> -	WARN(1, "Couldn't set color for VM %p\n", vm);
> -}
> -
>  struct i915_vma *i915_gem_obj_to_vma(struct drm_i915_gem_object *obj,
>  				     struct i915_address_space *vm)
>  {
> -- 
> 1.8.3.3
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch



More information about the Intel-gfx mailing list