path: root/drivers/gpu/drm/i915/selftests/i915_gem_object.c
diff options
authorChris Wilson <>2018-07-06 11:39:44 +0100
committerChris Wilson <>2018-07-06 18:22:37 +0100
commita523697857cdfb6a548f6caf38f42f4fe0f7d757 (patch)
tree298d0fdefdd1db85c061a611d2752505015982bb /drivers/gpu/drm/i915/selftests/i915_gem_object.c
parent6dd7526f6f6c73961eecec8a4b9b717d414010f8 (diff)
drm/i915: Start returning an error from i915_vma_move_to_active()
Handling such a late error in request construction is tricky, but to accommodate future patches which may allocate here, we potentially could err. To handle the error after already adjusting global state to track the new request, we must finish and submit the request. But we don't want to use the request as not everything is being tracked by it, so we opt to cancel the commands inside the request. Signed-off-by: Chris Wilson <> Reviewed-by: Tvrtko Ursulin <> Link:
Diffstat (limited to 'drivers/gpu/drm/i915/selftests/i915_gem_object.c')
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_object.c b/drivers/gpu/drm/i915/selftests/i915_gem_object.c
index b2ccbc5e2bbe..25c2b2d433bd 100644
--- a/drivers/gpu/drm/i915/selftests/i915_gem_object.c
+++ b/drivers/gpu/drm/i915/selftests/i915_gem_object.c
@@ -464,13 +464,14 @@ static int make_obj_busy(struct drm_i915_gem_object *obj)
return PTR_ERR(rq);
- i915_vma_move_to_active(vma, rq, EXEC_OBJECT_WRITE);
+ err = i915_vma_move_to_active(vma, rq, EXEC_OBJECT_WRITE);
- i915_gem_object_set_active_reference(obj);
+ __i915_gem_object_release_unless_active(obj);
- return 0;
+ return err;
static bool assert_mmap_offset(struct drm_i915_private *i915,