Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1d335d1b authored by Mika Kuoppala's avatar Mika Kuoppala Committed by Daniel Vetter
Browse files

drm/i915: Move vm page allocation in proper place



Move to i915_vma_bind as it is part of the binding.

Suggested-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Cc: Michel Thierry <michel.thierry@intel.com>
Signed-off-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 3b7a5119
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -3556,17 +3556,6 @@ i915_gem_object_bind_to_vm(struct drm_i915_gem_object *obj,
	if (ret)
		goto err_remove_node;

	/*  allocate before insert / bind */
	if (vma->vm->allocate_va_range) {
		trace_i915_va_alloc(vma->vm, vma->node.start, vma->node.size,
				VM_TO_TRACE_NAME(vma->vm));
		ret = vma->vm->allocate_va_range(vma->vm,
						vma->node.start,
						vma->node.size);
		if (ret)
			goto err_remove_node;
	}

	trace_i915_vma_bind(vma, flags);
	ret = i915_vma_bind(vma, obj->cache_level,
			    flags & PIN_GLOBAL ? GLOBAL_BIND : 0);
+15 −1
Original line number Diff line number Diff line
@@ -2927,8 +2927,22 @@ i915_get_ggtt_vma_pages(struct i915_vma *vma)
int i915_vma_bind(struct i915_vma *vma, enum i915_cache_level cache_level,
		  u32 flags)
{
	int ret;

	if (vma->vm->allocate_va_range) {
		trace_i915_va_alloc(vma->vm, vma->node.start,
				    vma->node.size,
				    VM_TO_TRACE_NAME(vma->vm));

		ret = vma->vm->allocate_va_range(vma->vm,
						 vma->node.start,
						 vma->node.size);
		if (ret)
			return ret;
	}

	if (i915_is_ggtt(vma->vm)) {
		int ret = i915_get_ggtt_vma_pages(vma);
		ret = i915_get_ggtt_vma_pages(vma);

		if (ret)
			return ret;