diff options
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_execbuffer.c | 6 |
3 files changed, 8 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 1c3a1caf4f40..707bf0f742f7 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -2358,6 +2358,7 @@ static inline bool i915_gem_request_completed(struct drm_i915_gem_request *req) int i915_gem_request_add_to_client(struct drm_i915_gem_request *req, struct drm_file *file); +void i915_gem_request_remove_from_client(struct drm_i915_gem_request *request); static inline uint32_t i915_gem_request_get_seqno(struct drm_i915_gem_request *req) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 5f4bc4e41312..26891a8d237b 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -1399,8 +1399,7 @@ int i915_gem_request_add_to_client(struct drm_i915_gem_request *req, return 0; } -static inline void -i915_gem_request_remove_from_client(struct drm_i915_gem_request *request) +void i915_gem_request_remove_from_client(struct drm_i915_gem_request *request) { struct drm_i915_file_private *file_priv = request->file_priv; @@ -2735,7 +2734,7 @@ static void i915_gem_request_free(struct fence *req_fence) WARN_ON(!mutex_is_locked(&req->engine->dev->struct_mutex)); - if (req->file_priv) + if (WARN_ON(req->file_priv)) i915_gem_request_remove_from_client(req); if (ctx) { diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 6ee4f00f620c..7c4c0b69f3e4 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -1662,8 +1662,12 @@ err: * must be freed again. If it was submitted then it is being tracked * on the active request list and no clean up is required here. */ - if (ret && !IS_ERR_OR_NULL(req)) + if (ret && !IS_ERR_OR_NULL(req)) { + if (req->file_priv) + i915_gem_request_remove_from_client(req); + i915_gem_request_cancel(req); + } mutex_unlock(&dev->struct_mutex); |