[PATCH 15/15] drm/i915: Do not use i915_vma active for waiting.

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Fri Jul 30 09:00:45 UTC 2021


We're going to remove it, so just remove the waiting first.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
---
 drivers/gpu/drm/i915/i915_vma.c | 8 +-------
 drivers/gpu/drm/i915/i915_vma.h | 9 +++++++--
 2 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index a2f254460127..ce0cc297ebef 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -1542,16 +1542,10 @@ __i915_request_await_bind(struct i915_request *rq, struct i915_vma *vma)
 
 static int __i915_vma_move_to_active(struct i915_vma *vma, struct i915_request *rq)
 {
-	int err;
-
 	GEM_BUG_ON(!i915_vma_is_pinned(vma));
 
 	/* Wait for the vma to be bound before we start! */
-	err = __i915_request_await_bind(rq, vma);
-	if (err)
-		return err;
-
-	return i915_active_add_request(&vma->active, rq);
+	return __i915_request_await_bind(rq, vma);
 }
 
 int i915_vma_move_to_active(struct i915_vma *vma,
diff --git a/drivers/gpu/drm/i915/i915_vma.h b/drivers/gpu/drm/i915/i915_vma.h
index 74357ea71a9f..8332741d0116 100644
--- a/drivers/gpu/drm/i915/i915_vma.h
+++ b/drivers/gpu/drm/i915/i915_vma.h
@@ -49,7 +49,7 @@ void i915_vma_unpin_and_release(struct i915_vma **p_vma, unsigned int flags);
 
 static inline bool i915_vma_is_active(const struct i915_vma *vma)
 {
-	return !i915_active_is_idle(&vma->active);
+	return i915_gem_object_wait(vma->obj, I915_WAIT_ALL, 0);
 }
 
 /* do not reserve memory to prevent deadlocks */
@@ -418,8 +418,13 @@ int i915_vma_wait_for_bind(struct i915_vma *vma);
 
 static inline int i915_vma_sync(struct i915_vma *vma)
 {
+	int ret;
 	/* Wait for the asynchronous bindings and pending GPU reads */
-	return i915_active_wait(&vma->active);
+	ret = i915_vma_wait_for_bind(vma);
+	if (ret)
+		return ret;
+
+	return i915_gem_object_wait(vma->obj, I915_WAIT_INTERRUPTIBLE | I915_WAIT_ALL, MAX_SCHEDULE_TIMEOUT);
 }
 
 void i915_vma_module_exit(void);
-- 
2.31.0



More information about the Intel-gfx-trybot mailing list