Re: [PATCH 1/2] drm/i915: Only mark as map-and-fenceable when bound into the GGTT

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

 



On Fri, Oct 31, 2014 at 01:53:52PM +0000, Chris Wilson wrote:
> @@ -4091,6 +4078,7 @@ i915_gem_object_pin(struct drm_i915_gem_object *obj,
>  		}
>  	}
>  
> +	bound = vma ? vma->bound : 0;
>  	if (vma == NULL || !drm_mm_node_allocated(&vma->node)) {
>  		vma = i915_gem_object_bind_to_vm(obj, vm, alignment, flags);
>  		if (IS_ERR(vma))
> @@ -4100,6 +4088,29 @@ i915_gem_object_pin(struct drm_i915_gem_object *obj,
>  	if (flags & PIN_GLOBAL && !(vma->bound & GLOBAL_BIND))
>  		vma->bind_vma(vma, obj->cache_level, GLOBAL_BIND);
>  
> +	if ((bound ^ vma->bound) & GLOBAL_BIND) {

Shouldn't we have a && i915_is_ggtt(vma->vm) check here too?

Then we could just look at the vma's drm_mm node instead of jumping
through the helpers here. Which gets us one inch closer to tracking
mappable in the ggtt vma, without increasing the diff ;-)
-Daniel

> +		bool mappable, fenceable;
> +		u32 fence_size, fence_alignment;
> +
> +		fence_size = i915_gem_get_gtt_size(obj->base.dev,
> +						   obj->base.size,
> +						   obj->tiling_mode);
> +		fence_alignment = i915_gem_get_gtt_alignment(obj->base.dev,
> +							     obj->base.size,
> +							     obj->tiling_mode,
> +							     true);
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
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