diff options
author | John Harrison <John.C.Harrison@Intel.com> | 2015-12-17 17:12:24 +0000 |
---|---|---|
committer | John Harrison <John.C.Harrison@Intel.com> | 2016-05-06 14:13:05 +0100 |
commit | 1547967b7af347222e33c4e95f2301e9b0582138 (patch) | |
tree | c47212c7d9e01c7e13140451a966b61ec65112e7 /drivers | |
parent | 5d10419b6b415cd1b1221bc938536c54f337bb07 (diff) |
drm/i915: Add support for retro-actively banning batch buffers
If a given context submits too many hanging batch buffers then it will
be banned and no further batch buffers will be accepted for it.
However, it is possible that a large number of buffers may already
have been accepted and are sat in the scheduler waiting to be
executed. This patch adds a late ban check to ensure that these will
also be discarded.
v4: New patch in series.
For: VIZ-1587
Signed-off-by: John Harrison <John.C.Harrison@Intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_execbuffer.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_lrc.c | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index a4d07ab56e48..54175d8c71c9 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c @@ -1296,6 +1296,12 @@ int i915_gem_ringbuffer_submission_final(struct i915_execbuffer_params *params) /* The mutex must be acquired before calling this function */ WARN_ON(!mutex_is_locked(¶ms->dev->struct_mutex)); + /* Check the context wasn't banned between submission and execution: */ + if (params->ctx->hang_stats.banned) { + DRM_DEBUG("Trying to execute for banned context!\n"); + return -ENOENT; + } + /* Make sure the request's seqno is the latest and greatest: */ if (req->reserved_seqno != dev_priv->last_seqno) { ret = i915_gem_get_seqno(engine->dev, &req->reserved_seqno); diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index b9258ee07480..02808f71ee82 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -1034,6 +1034,12 @@ int intel_execlists_submission_final(struct i915_execbuffer_params *params) /* The mutex must be acquired before calling this function */ WARN_ON(!mutex_is_locked(¶ms->dev->struct_mutex)); + /* Check the context wasn't banned between submission and execution: */ + if (params->ctx->hang_stats.banned) { + DRM_DEBUG("Trying to execute for banned context!\n"); + return -ENOENT; + } + /* Make sure the request's seqno is the latest and greatest: */ if (req->reserved_seqno != dev_priv->last_seqno) { ret = i915_gem_get_seqno(engine->dev, &req->reserved_seqno); |