Commit 676fa572 authored by Chris Wilson's avatar Chris Wilson Committed by Daniel Vetter

drm/i915: Move the ban period onto the context

This will allow us to set per-file, or even per-context, periods in the
future.
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: default avatarMika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 90254523
...@@ -678,6 +678,11 @@ struct i915_ctx_hang_stats { ...@@ -678,6 +678,11 @@ struct i915_ctx_hang_stats {
/* Time when this context was last blamed for a GPU reset */ /* Time when this context was last blamed for a GPU reset */
unsigned long guilty_ts; unsigned long guilty_ts;
/* If the contexts causes a second GPU hang within this time,
* it is permanently banned from submitting any more work.
*/
unsigned long ban_period_seconds;
/* This context is banned to submit more work */ /* This context is banned to submit more work */
bool banned; bool banned;
}; };
......
...@@ -2535,7 +2535,8 @@ static bool i915_context_is_banned(struct drm_i915_private *dev_priv, ...@@ -2535,7 +2535,8 @@ static bool i915_context_is_banned(struct drm_i915_private *dev_priv,
if (ctx->hang_stats.banned) if (ctx->hang_stats.banned)
return true; return true;
if (elapsed <= DRM_I915_CTX_BAN_PERIOD) { if (ctx->hang_stats.ban_period_seconds &&
elapsed <= ctx->hang_stats.ban_period_seconds) {
if (!i915_gem_context_is_default(ctx)) { if (!i915_gem_context_is_default(ctx)) {
DRM_DEBUG("context hanging too fast, banning!\n"); DRM_DEBUG("context hanging too fast, banning!\n");
return true; return true;
......
...@@ -222,6 +222,8 @@ __create_hw_context(struct drm_device *dev, ...@@ -222,6 +222,8 @@ __create_hw_context(struct drm_device *dev,
* is no remap info, it will be a NOP. */ * is no remap info, it will be a NOP. */
ctx->remap_slice = (1 << NUM_L3_SLICES(dev)) - 1; ctx->remap_slice = (1 << NUM_L3_SLICES(dev)) - 1;
ctx->hang_stats.ban_period_seconds = DRM_I915_CTX_BAN_PERIOD;
return ctx; return ctx;
err_out: err_out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment