diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-12-24 11:13:39 -0500 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-01-07 08:20:20 -0500 |
commit | 676fa5721c2eece4b27ac9be0cdb11c37de0a034 (patch) | |
tree | defc052c9ff5c7d7a4ae3f573ba11bf1c7ffa130 /drivers/gpu | |
parent | 9025452366e9a86f2e11292865d98430341005d1 (diff) |
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: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_context.c | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index da52f9cdc5df..ee841349407e 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -678,6 +678,11 @@ struct i915_ctx_hang_stats { | |||
678 | /* Time when this context was last blamed for a GPU reset */ | 678 | /* Time when this context was last blamed for a GPU reset */ |
679 | unsigned long guilty_ts; | 679 | unsigned long guilty_ts; |
680 | 680 | ||
681 | /* If the contexts causes a second GPU hang within this time, | ||
682 | * it is permanently banned from submitting any more work. | ||
683 | */ | ||
684 | unsigned long ban_period_seconds; | ||
685 | |||
681 | /* This context is banned to submit more work */ | 686 | /* This context is banned to submit more work */ |
682 | bool banned; | 687 | bool banned; |
683 | }; | 688 | }; |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 9cd457ae4427..3f6ca46a1dfe 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -2535,7 +2535,8 @@ static bool i915_context_is_banned(struct drm_i915_private *dev_priv, | |||
2535 | if (ctx->hang_stats.banned) | 2535 | if (ctx->hang_stats.banned) |
2536 | return true; | 2536 | return true; |
2537 | 2537 | ||
2538 | if (elapsed <= DRM_I915_CTX_BAN_PERIOD) { | 2538 | if (ctx->hang_stats.ban_period_seconds && |
2539 | elapsed <= ctx->hang_stats.ban_period_seconds) { | ||
2539 | if (!i915_gem_context_is_default(ctx)) { | 2540 | if (!i915_gem_context_is_default(ctx)) { |
2540 | DRM_DEBUG("context hanging too fast, banning!\n"); | 2541 | DRM_DEBUG("context hanging too fast, banning!\n"); |
2541 | return true; | 2542 | return true; |
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index b9deade53f2e..1d10c21f979b 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c | |||
@@ -222,6 +222,8 @@ __create_hw_context(struct drm_device *dev, | |||
222 | * is no remap info, it will be a NOP. */ | 222 | * is no remap info, it will be a NOP. */ |
223 | ctx->remap_slice = (1 << NUM_L3_SLICES(dev)) - 1; | 223 | ctx->remap_slice = (1 << NUM_L3_SLICES(dev)) - 1; |
224 | 224 | ||
225 | ctx->hang_stats.ban_period_seconds = DRM_I915_CTX_BAN_PERIOD; | ||
226 | |||
225 | return ctx; | 227 | return ctx; |
226 | 228 | ||
227 | err_out: | 229 | err_out: |