All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Subject: [Intel-gfx] [PATCH 11/19] drm/i915: Remove resv from i915_vma
Date: Mon, 30 Aug 2021 14:09:58 +0200	[thread overview]
Message-ID: <20210830121006.2978297-12-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20210830121006.2978297-1-maarten.lankhorst@linux.intel.com>

It's just an alias to vma->obj->base.resv, no need to duplicate it.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c | 4 ++--
 drivers/gpu/drm/i915/i915_vma.c                | 9 ++++-----
 drivers/gpu/drm/i915/i915_vma.h                | 6 +++---
 drivers/gpu/drm/i915/i915_vma_types.h          | 1 -
 4 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
index 4f10a81befd1..6832b255294e 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
@@ -975,7 +975,7 @@ static int eb_validate_vmas(struct i915_execbuffer *eb)
 		}
 
 		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)
 				return err;
 		}
@@ -2121,7 +2121,7 @@ static int eb_parse(struct i915_execbuffer *eb)
 		goto err_trampoline;
 	}
 
-	err = dma_resv_reserve_shared(shadow->resv, 1);
+	err = dma_resv_reserve_shared(shadow->obj->base.resv, 1);
 	if (err)
 		goto err_trampoline;
 
diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index ad5d52b33eb6..36db641e863e 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -116,7 +116,6 @@ vma_create(struct drm_i915_gem_object *obj,
 	vma->vm = i915_vm_get(vm);
 	vma->ops = &vm->vma_ops;
 	vma->obj = obj;
-	vma->resv = obj->base.resv;
 	vma->size = obj->base.size;
 	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,
 	GEM_BUG_ON(!i915_vma_is_ggtt(vma));
 
 #ifdef CONFIG_LOCKDEP
-	WARN_ON(!ww && dma_resv_held(vma->resv));
+	WARN_ON(!ww && dma_resv_held(vma->obj->base.resv));
 #endif
 
 	do {
@@ -1249,17 +1248,17 @@ int i915_vma_move_to_active(struct i915_vma *vma,
 			intel_frontbuffer_put(front);
 		}
 
-		dma_resv_add_excl_fence(vma->resv, &rq->fence);
+		dma_resv_add_excl_fence(vma->obj->base.resv, &rq->fence);
 		obj->write_domain = I915_GEM_DOMAIN_RENDER;
 		obj->read_domains = 0;
 	} else {
 		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))
 				return err;
 		}
 
-		dma_resv_add_shared_fence(vma->resv, &rq->fence);
+		dma_resv_add_shared_fence(vma->obj->base.resv, &rq->fence);
 		obj->write_domain = 0;
 	}
 
diff --git a/drivers/gpu/drm/i915/i915_vma.h b/drivers/gpu/drm/i915/i915_vma.h
index 1ba82bf863a5..0b11c188f749 100644
--- a/drivers/gpu/drm/i915/i915_vma.h
+++ b/drivers/gpu/drm/i915/i915_vma.h
@@ -225,16 +225,16 @@ static inline void __i915_vma_put(struct i915_vma *vma)
 	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)
 {
-	dma_resv_lock(vma->resv, NULL);
+	dma_resv_lock(vma->obj->base.resv, NULL);
 }
 
 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
diff --git a/drivers/gpu/drm/i915/i915_vma_types.h b/drivers/gpu/drm/i915/i915_vma_types.h
index 995b502d7e5d..47573ed2d11f 100644
--- a/drivers/gpu/drm/i915/i915_vma_types.h
+++ b/drivers/gpu/drm/i915/i915_vma_types.h
@@ -177,7 +177,6 @@ struct i915_vma {
 	const struct i915_vma_ops *ops;
 
 	struct drm_i915_gem_object *obj;
-	struct dma_resv *resv; /** Alias of obj->resv */
 
 	struct sg_table *pages;
 	void __iomem *iomap;
-- 
2.32.0


  parent reply	other threads:[~2021-08-30 12:10 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-30 12:09 [Intel-gfx] [PATCH 00/19] drm/i915: Short-term pinning and async eviction Maarten Lankhorst
2021-08-30 12:09 ` [Intel-gfx] [PATCH 01/19] drm/i915: Move __i915_gem_free_object to ttm_bo_destroy Maarten Lankhorst
2021-09-16  9:43   ` Thomas Hellström (Intel)
2021-09-16 13:35     ` Maarten Lankhorst
2021-08-30 12:09 ` [Intel-gfx] [PATCH 02/19] drm/i915: Remove unused bits of i915_vma/active api Maarten Lankhorst
2021-09-08  1:37   ` Niranjana Vishwanathapura
2021-08-30 12:09 ` [Intel-gfx] [PATCH 03/19] drm/i915: Slightly rework EXEC_OBJECT_CAPTURE handling Maarten Lankhorst
2021-09-08  1:49   ` Niranjana Vishwanathapura
2021-08-30 12:09 ` [Intel-gfx] [PATCH 04/19] drm/i915: Remove gen6_ppgtt_unpin_all Maarten Lankhorst
2021-09-29  8:07   ` Matthew Auld
2021-08-30 12:09 ` [Intel-gfx] [PATCH 05/19] drm/i915: Create a dummy object for gen6 ppgtt Maarten Lankhorst
2021-08-30 12:09 ` [Intel-gfx] [PATCH 06/19] drm/i915: Create a full object for mock_ring Maarten Lankhorst
2021-08-30 12:09 ` [Intel-gfx] [PATCH 07/19] drm/i915: vma is always backed by an object Maarten Lankhorst
2021-08-31  9:18   ` Tvrtko Ursulin
2021-08-31  9:34     ` Maarten Lankhorst
2021-08-31 10:29       ` Tvrtko Ursulin
2021-09-03  9:31         ` Maarten Lankhorst
2021-09-03 10:48           ` Tvrtko Ursulin
2021-09-16 13:41             ` Maarten Lankhorst
2021-09-16 14:30               ` Tvrtko Ursulin
2021-09-16 15:05                 ` Tvrtko Ursulin
2021-08-30 12:09 ` [Intel-gfx] [PATCH 08/19] drm/i915: Fix runtime pm handling in i915_gem_shrink Maarten Lankhorst
2021-08-30 12:09   ` Maarten Lankhorst
2021-09-08  1:12   ` [Intel-gfx] " Niranjana Vishwanathapura
2021-09-29  8:37   ` Matthew Auld
2021-09-29  8:40     ` Matthew Auld
2021-09-29  8:53     ` Maarten Lankhorst
2021-08-30 12:09 ` [Intel-gfx] [PATCH 09/19] drm/i915: Change shrink ordering to use locking around unbinding Maarten Lankhorst
2021-09-08  1:04   ` Niranjana Vishwanathapura
2021-08-30 12:09 ` [Intel-gfx] [PATCH 10/19] Move CONTEXT_VALID_BIT check Maarten Lankhorst
2021-09-08 19:45   ` Niranjana Vishwanathapura
2021-08-30 12:09 ` Maarten Lankhorst [this message]
2021-09-08  1:10   ` [Intel-gfx] [PATCH 11/19] drm/i915: Remove resv from i915_vma Niranjana Vishwanathapura
2021-08-30 12:09 ` [Intel-gfx] [PATCH 12/19] drm/i915: Remove pages_mutex and intel_gtt->vma_ops.set/clear_pages members Maarten Lankhorst
2021-08-30 12:10 ` [Intel-gfx] [PATCH 13/19] drm/i915: Take object lock in i915_ggtt_pin if ww is not set Maarten Lankhorst
2021-09-08  3:11   ` Niranjana Vishwanathapura
2021-09-16 13:54     ` Maarten Lankhorst
2021-08-30 12:10 ` [Intel-gfx] [PATCH 14/19] drm/i915: Add i915_vma_unbind_unlocked, and take obj lock for i915_vma_unbind Maarten Lankhorst
2021-09-03  9:33   ` Maarten Lankhorst
2021-08-30 12:10 ` [Intel-gfx] [PATCH 15/19] drm/i915: Remove support for unlocked i915_vma unbind Maarten Lankhorst
2021-09-08  3:35   ` Niranjana Vishwanathapura
2021-08-30 12:10 ` [Intel-gfx] [PATCH 16/19] drm/i915: Remove short-term pins from execbuf Maarten Lankhorst
2021-08-30 12:10 ` [Intel-gfx] [PATCH 17/19] drm/i915: Add functions to set/get moving fence Maarten Lankhorst
2021-09-08  4:08   ` Niranjana Vishwanathapura
2021-09-16 13:49     ` Maarten Lankhorst
2021-09-16  9:48   ` Thomas Hellström
2021-08-30 12:10 ` [Intel-gfx] [PATCH 18/19] drm/i915: Add support for asynchronous moving fence waiting Maarten Lankhorst
2021-09-16 10:01   ` Thomas Hellström (Intel)
2021-08-30 12:10 ` [Intel-gfx] [PATCH 19/19] drm/i915: Add accelerated migration to ttm Maarten Lankhorst
2021-09-16 11:19   ` Thomas Hellström (Intel)
2021-08-30 13:03 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Short-term pinning and async eviction Patchwork
2021-08-30 13:05 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-08-30 13:32 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2021-09-16  9:40 ` [Intel-gfx] [PATCH 00/19] " Thomas Hellström (Intel)
2021-09-16 11:24   ` Maarten Lankhorst

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210830121006.2978297-12-maarten.lankhorst@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.