drm/i915: Add is-completed assert to request retire entrypoint
authorChris Wilson <[email protected]>
Fri, 25 Nov 2016 13:17:15 +0000 (13:17 +0000)
committerChris Wilson <[email protected]>
Fri, 25 Nov 2016 13:49:23 +0000 (13:49 +0000)
While we will check that the request is completed prior to being
retired, by placing an assert that the request is complete at the
entrypoint of the function we can more clearly document the function's
preconditions.

Signed-off-by: Chris Wilson <[email protected]>
Reviewed-by: Joonas Lahtinen <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/i915/i915_gem_request.c

index 82904595eaae3c6276a002152917f1dedd6b518f..bd7b21f702830288dc572bb1e1411ed66a21a0a9 100644 (file)
@@ -281,6 +281,8 @@ void i915_gem_request_retire_upto(struct drm_i915_gem_request *req)
        struct drm_i915_gem_request *tmp;
 
        lockdep_assert_held(&req->i915->drm.struct_mutex);
+       GEM_BUG_ON(!i915_gem_request_completed(req));
+
        if (list_empty(&req->link))
                return;