aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMika Kuoppala <mika.kuoppala@linux.intel.com>2014-08-05 10:16:26 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-08-07 08:04:07 -0400
commitf260fe7b2f8c32e2fb02a36d3b76ef64b61dbdc5 (patch)
tree3b8787a5114d5278165eb776ecbba229df7f0909
parent02c9f7e3cfe76a7f54ef03438c36aade86cc1c8b (diff)
drm/i915: Don't accumulate hangcheck score on forward progress
If the actual head has progressed forward inside a batch (request), don't accumulate hangcheck score. As the hangcheck score in increased only by acthd jumping backwards, the result is that we only declare an active batch as stuck if it is trapped inside a loop. Or that the looping will dominate the batch progression so that it overcomes the bonus that forward progress gives. v2: Improved commit message (Chris Wilson) Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> [danvet: s/active_loop/active (loop)/ as requested by Chris.] Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/i915_gpu_error.c2
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c15
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.h2
3 files changed, 16 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c b/drivers/gpu/drm/i915/i915_gpu_error.c
index 0c945e91d542..7c478e6cedae 100644
--- a/drivers/gpu/drm/i915/i915_gpu_error.c
+++ b/drivers/gpu/drm/i915/i915_gpu_error.c
@@ -229,6 +229,8 @@ static const char *hangcheck_action_to_str(enum intel_ring_hangcheck_action a)
229 return "wait"; 229 return "wait";
230 case HANGCHECK_ACTIVE: 230 case HANGCHECK_ACTIVE:
231 return "active"; 231 return "active";
232 case HANGCHECK_ACTIVE_LOOP:
233 return "active (loop)";
232 case HANGCHECK_KICK: 234 case HANGCHECK_KICK:
233 return "kick"; 235 return "kick";
234 case HANGCHECK_HUNG: 236 case HANGCHECK_HUNG:
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index 6ef9d6fabf80..390ccc2a3096 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -3189,8 +3189,14 @@ ring_stuck(struct intel_engine_cs *ring, u64 acthd)
3189 struct drm_i915_private *dev_priv = dev->dev_private; 3189 struct drm_i915_private *dev_priv = dev->dev_private;
3190 u32 tmp; 3190 u32 tmp;
3191 3191
3192 if (ring->hangcheck.acthd != acthd) 3192 if (acthd != ring->hangcheck.acthd) {
3193 return HANGCHECK_ACTIVE; 3193 if (acthd > ring->hangcheck.max_acthd) {
3194 ring->hangcheck.max_acthd = acthd;
3195 return HANGCHECK_ACTIVE;
3196 }
3197
3198 return HANGCHECK_ACTIVE_LOOP;
3199 }
3194 3200
3195 if (IS_GEN2(dev)) 3201 if (IS_GEN2(dev))
3196 return HANGCHECK_HUNG; 3202 return HANGCHECK_HUNG;
@@ -3301,8 +3307,9 @@ static void i915_hangcheck_elapsed(unsigned long data)
3301 switch (ring->hangcheck.action) { 3307 switch (ring->hangcheck.action) {
3302 case HANGCHECK_IDLE: 3308 case HANGCHECK_IDLE:
3303 case HANGCHECK_WAIT: 3309 case HANGCHECK_WAIT:
3304 break;
3305 case HANGCHECK_ACTIVE: 3310 case HANGCHECK_ACTIVE:
3311 break;
3312 case HANGCHECK_ACTIVE_LOOP:
3306 ring->hangcheck.score += BUSY; 3313 ring->hangcheck.score += BUSY;
3307 break; 3314 break;
3308 case HANGCHECK_KICK: 3315 case HANGCHECK_KICK:
@@ -3322,6 +3329,8 @@ static void i915_hangcheck_elapsed(unsigned long data)
3322 */ 3329 */
3323 if (ring->hangcheck.score > 0) 3330 if (ring->hangcheck.score > 0)
3324 ring->hangcheck.score--; 3331 ring->hangcheck.score--;
3332
3333 ring->hangcheck.acthd = ring->hangcheck.max_acthd = 0;
3325 } 3334 }
3326 3335
3327 ring->hangcheck.seqno = seqno; 3336 ring->hangcheck.seqno = seqno;
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h
index ed5941078f92..70525d0c2c74 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.h
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.h
@@ -70,6 +70,7 @@ enum intel_ring_hangcheck_action {
70 HANGCHECK_IDLE = 0, 70 HANGCHECK_IDLE = 0,
71 HANGCHECK_WAIT, 71 HANGCHECK_WAIT,
72 HANGCHECK_ACTIVE, 72 HANGCHECK_ACTIVE,
73 HANGCHECK_ACTIVE_LOOP,
73 HANGCHECK_KICK, 74 HANGCHECK_KICK,
74 HANGCHECK_HUNG, 75 HANGCHECK_HUNG,
75}; 76};
@@ -78,6 +79,7 @@ enum intel_ring_hangcheck_action {
78 79
79struct intel_ring_hangcheck { 80struct intel_ring_hangcheck {
80 u64 acthd; 81 u64 acthd;
82 u64 max_acthd;
81 u32 seqno; 83 u32 seqno;
82 int score; 84 int score;
83 enum intel_ring_hangcheck_action action; 85 enum intel_ring_hangcheck_action action;