Commit e4b3ee71 authored by Matthew Auld's avatar Matthew Auld
Browse files

drm/i915: stop checking for NULL vma->obj



This is no longer possible since e6e1a304 ("drm/i915: vma is always
backed by an object.").

Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220304174252.1000238-1-matthew.auld@intel.com
parent 833124a0
Loading
Loading
Loading
Loading
+7 −10
Original line number Diff line number Diff line
@@ -525,7 +525,6 @@ int i915_vma_bind(struct i915_vma *vma,
		if (!work->vma_res->bi.pages_rsgt)
			work->pinned = i915_gem_object_get(vma->obj);
	} else {
		if (vma->obj) {
		ret = i915_gem_object_wait_moving_fence(vma->obj, true);
		if (ret) {
			i915_vma_resource_free(vma->resource);
@@ -533,12 +532,10 @@ int i915_vma_bind(struct i915_vma *vma,

			return ret;
		}
		}
		vma->ops->bind_vma(vma->vm, NULL, vma->resource, cache_level,
				   bind_flags);
	}

	if (vma->obj)
	set_bit(I915_BO_WAS_BOUND_BIT, &vma->obj->flags);

	atomic_or(bind_flags, &vma->flags);
@@ -1384,7 +1381,7 @@ int i915_vma_pin_ww(struct i915_vma *vma, struct i915_gem_ww_ctx *ww,

		work->vm = vma->vm;

		moving = vma->obj ? i915_gem_object_get_moving_fence(vma->obj) : NULL;
		moving = i915_gem_object_get_moving_fence(vma->obj);
		dma_fence_work_chain(&work->base, moving);

		/* Allocate enough page directories to used PTE */