]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
drm/i915: Move the ban period onto the context
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 24 Dec 2014 16:13:39 +0000 (08:13 -0800)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 7 Jan 2015 13:20:20 +0000 (14:20 +0100)
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>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_gem_context.c

index da52f9cdc5df9fac5d6617422f94acfa5fde9bf8..ee841349407eac7d04194cd556249b2d64014109 100644 (file)
@@ -678,6 +678,11 @@ struct i915_ctx_hang_stats {
        /* Time when this context was last blamed for a GPU reset */
        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 */
        bool banned;
 };
index 9cd457ae442752762e7c792d4c857e4465d0a6cb..3f6ca46a1dfec4e6f7d9b8905059f0fc25fd37cf 100644 (file)
@@ -2535,7 +2535,8 @@ static bool i915_context_is_banned(struct drm_i915_private *dev_priv,
        if (ctx->hang_stats.banned)
                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)) {
                        DRM_DEBUG("context hanging too fast, banning!\n");
                        return true;
index b9deade53f2e27174008dde2441b7cabaa83d786..1d10c21f979b3208d5e2afd6d5122c7229c9e546 100644 (file)
@@ -222,6 +222,8 @@ __create_hw_context(struct drm_device *dev,
         * is no remap info, it will be a NOP. */
        ctx->remap_slice = (1 << NUM_L3_SLICES(dev)) - 1;
 
+       ctx->hang_stats.ban_period_seconds = DRM_I915_CTX_BAN_PERIOD;
+
        return ctx;
 
 err_out: