Skip to content

Commit 3526b60

Browse files
Thomas Hellströmtursulin
authored andcommitted
drm/i915/ttm: Return some errors instead of trying memcpy move
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: 2b0a750 ("drm/i915/ttm: Failsafe migration blits") Cc: Matthew Auld <[email protected]> Signed-off-by: Thomas Hellström <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 29b9702) Signed-off-by: Tvrtko Ursulin <[email protected]>
1 parent ee59792 commit 3526b60

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -427,11 +427,17 @@ __i915_ttm_move(struct ttm_buffer_object *bo,
427427

428428
if (!IS_ERR(fence))
429429
goto out;
430-
} else if (move_deps) {
431-
int err = i915_deps_sync(move_deps, ctx);
430+
} else {
431+
int err = PTR_ERR(fence);
432+
433+
if (err == -EINTR || err == -ERESTARTSYS || err == -EAGAIN)
434+
return fence;
432435

433-
if (err)
434-
return ERR_PTR(err);
436+
if (move_deps) {
437+
err = i915_deps_sync(move_deps, ctx);
438+
if (err)
439+
return ERR_PTR(err);
440+
}
435441
}
436442

437443
/* Error intercept failed or no accelerated migration to start with */

0 commit comments

Comments
 (0)