dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/ttm: Return some errors instead of trying memcpy move
@ 2022-02-01  7:03 Thomas Hellström
  2022-02-01  9:55 ` Matthew Auld
  0 siblings, 1 reply; 2+ messages in thread
From: Thomas Hellström @ 2022-02-01  7:03 UTC (permalink / raw)
  To: intel-gfx, dri-devel; +Cc: Thomas Hellström, matthew.auld

The i915_ttm_accel_move() function may return error codes that should
be propagated further up the stack rather than consumed assuming that
the accel move failed and could be replaced with a memcpy move.

For -EINTR, -ERESTARTSYS and -EAGAIN, just propagate those codes, rather
than retrying with a memcpy move.

Fixes: 2b0a750caf33 ("drm/i915/ttm: Failsafe migration blits")
Cc: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c
index 1de306c03aaf..1ebe6e4086a1 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c
@@ -436,11 +436,17 @@ __i915_ttm_move(struct ttm_buffer_object *bo,
 
 		if (!IS_ERR(fence))
 			goto out;
-	} else if (move_deps) {
-		int err = i915_deps_sync(move_deps, ctx);
+	} else {
+		int err = PTR_ERR(fence);
+
+		if (err == -EINTR || err == -ERESTARTSYS || err == -EAGAIN)
+			return fence;
 
-		if (err)
-			return ERR_PTR(err);
+		if (move_deps) {
+			err = i915_deps_sync(move_deps, ctx);
+			if (err)
+				return ERR_PTR(err);
+		}
 	}
 
 	/* Error intercept failed or no accelerated migration to start with */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/i915/ttm: Return some errors instead of trying memcpy move
  2022-02-01  7:03 [PATCH] drm/i915/ttm: Return some errors instead of trying memcpy move Thomas Hellström
@ 2022-02-01  9:55 ` Matthew Auld
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Auld @ 2022-02-01  9:55 UTC (permalink / raw)
  To: Thomas Hellström, intel-gfx, dri-devel

On 01/02/2022 07:03, Thomas Hellström wrote:
> The i915_ttm_accel_move() function may return error codes that should
> be propagated further up the stack rather than consumed assuming that
> the accel move failed and could be replaced with a memcpy move.
> 
> For -EINTR, -ERESTARTSYS and -EAGAIN, just propagate those codes, rather
> than retrying with a memcpy move.
> 
> Fixes: 2b0a750caf33 ("drm/i915/ttm: Failsafe migration blits")
> Cc: Matthew Auld <matthew.auld@intel.com>
> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-02-01  9:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-01  7:03 [PATCH] drm/i915/ttm: Return some errors instead of trying memcpy move Thomas Hellström
2022-02-01  9:55 ` Matthew Auld

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox