Commit 95c3d275 authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Matthew Auld

drm/i915: Remove resv from i915_vma

It's just an alias to vma->obj->base.resv, no need to duplicate it.
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: default avatarNiranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Signed-off-by: default avatarMatthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211117142024.1043017-5-matthew.auld@intel.com
parent e6e1a304
...@@ -990,7 +990,7 @@ static int eb_validate_vmas(struct i915_execbuffer *eb) ...@@ -990,7 +990,7 @@ static int eb_validate_vmas(struct i915_execbuffer *eb)
} }
if (!(ev->flags & EXEC_OBJECT_WRITE)) { if (!(ev->flags & EXEC_OBJECT_WRITE)) {
err = dma_resv_reserve_shared(vma->resv, 1); err = dma_resv_reserve_shared(vma->obj->base.resv, 1);
if (err) if (err)
return err; return err;
} }
...@@ -2164,7 +2164,7 @@ static int eb_parse(struct i915_execbuffer *eb) ...@@ -2164,7 +2164,7 @@ static int eb_parse(struct i915_execbuffer *eb)
goto err_trampoline; goto err_trampoline;
} }
err = dma_resv_reserve_shared(shadow->resv, 1); err = dma_resv_reserve_shared(shadow->obj->base.resv, 1);
if (err) if (err)
goto err_trampoline; goto err_trampoline;
......
...@@ -116,7 +116,6 @@ vma_create(struct drm_i915_gem_object *obj, ...@@ -116,7 +116,6 @@ vma_create(struct drm_i915_gem_object *obj,
vma->vm = i915_vm_get(vm); vma->vm = i915_vm_get(vm);
vma->ops = &vm->vma_ops; vma->ops = &vm->vma_ops;
vma->obj = obj; vma->obj = obj;
vma->resv = obj->base.resv;
vma->size = obj->base.size; vma->size = obj->base.size;
vma->display_alignment = I915_GTT_MIN_ALIGNMENT; vma->display_alignment = I915_GTT_MIN_ALIGNMENT;
...@@ -1032,7 +1031,7 @@ int i915_ggtt_pin(struct i915_vma *vma, struct i915_gem_ww_ctx *ww, ...@@ -1032,7 +1031,7 @@ int i915_ggtt_pin(struct i915_vma *vma, struct i915_gem_ww_ctx *ww,
GEM_BUG_ON(!i915_vma_is_ggtt(vma)); GEM_BUG_ON(!i915_vma_is_ggtt(vma));
#ifdef CONFIG_LOCKDEP #ifdef CONFIG_LOCKDEP
WARN_ON(!ww && dma_resv_held(vma->resv)); WARN_ON(!ww && dma_resv_held(vma->obj->base.resv));
#endif #endif
do { do {
...@@ -1251,19 +1250,19 @@ int _i915_vma_move_to_active(struct i915_vma *vma, ...@@ -1251,19 +1250,19 @@ int _i915_vma_move_to_active(struct i915_vma *vma,
} }
if (fence) { if (fence) {
dma_resv_add_excl_fence(vma->resv, fence); dma_resv_add_excl_fence(vma->obj->base.resv, fence);
obj->write_domain = I915_GEM_DOMAIN_RENDER; obj->write_domain = I915_GEM_DOMAIN_RENDER;
obj->read_domains = 0; obj->read_domains = 0;
} }
} else { } else {
if (!(flags & __EXEC_OBJECT_NO_RESERVE)) { if (!(flags & __EXEC_OBJECT_NO_RESERVE)) {
err = dma_resv_reserve_shared(vma->resv, 1); err = dma_resv_reserve_shared(vma->obj->base.resv, 1);
if (unlikely(err)) if (unlikely(err))
return err; return err;
} }
if (fence) { if (fence) {
dma_resv_add_shared_fence(vma->resv, fence); dma_resv_add_shared_fence(vma->obj->base.resv, fence);
obj->write_domain = 0; obj->write_domain = 0;
} }
} }
......
...@@ -234,16 +234,16 @@ static inline void __i915_vma_put(struct i915_vma *vma) ...@@ -234,16 +234,16 @@ static inline void __i915_vma_put(struct i915_vma *vma)
kref_put(&vma->ref, i915_vma_release); kref_put(&vma->ref, i915_vma_release);
} }
#define assert_vma_held(vma) dma_resv_assert_held((vma)->resv) #define assert_vma_held(vma) dma_resv_assert_held((vma)->obj->base.resv)
static inline void i915_vma_lock(struct i915_vma *vma) static inline void i915_vma_lock(struct i915_vma *vma)
{ {
dma_resv_lock(vma->resv, NULL); dma_resv_lock(vma->obj->base.resv, NULL);
} }
static inline void i915_vma_unlock(struct i915_vma *vma) static inline void i915_vma_unlock(struct i915_vma *vma)
{ {
dma_resv_unlock(vma->resv); dma_resv_unlock(vma->obj->base.resv);
} }
int __must_check int __must_check
......
...@@ -178,7 +178,6 @@ struct i915_vma { ...@@ -178,7 +178,6 @@ struct i915_vma {
const struct i915_vma_ops *ops; const struct i915_vma_ops *ops;
struct drm_i915_gem_object *obj; struct drm_i915_gem_object *obj;
struct dma_resv *resv; /** Alias of obj->resv */
struct sg_table *pages; struct sg_table *pages;
void __iomem *iomap; void __iomem *iomap;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment