Skip to content

Commit

Permalink
drm/i915: stop checking for NULL vma->obj
Browse files Browse the repository at this point in the history
This is no longer possible since e6e1a30 ("drm/i915: vma is always
backed by an object.").

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220304174252.1000238-1-matthew.auld@intel.com
  • Loading branch information
Matthew Auld committed Mar 7, 2022
1 parent 833124a commit e4b3ee7
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions drivers/gpu/drm/i915/i915_vma.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,21 +525,18 @@ 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);
vma->resource = NULL;
ret = i915_gem_object_wait_moving_fence(vma->obj, true);
if (ret) {
i915_vma_resource_free(vma->resource);
vma->resource = NULL;

return ret;
}
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);
set_bit(I915_BO_WAS_BOUND_BIT, &vma->obj->flags);

atomic_or(bind_flags, &vma->flags);
return 0;
Expand Down Expand Up @@ -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 */
Expand Down

0 comments on commit e4b3ee7

Please sign in to comment.