drm/i915: hangcheck disable parameter
authorBen Widawsky <ben@bwidawsk.net>
Wed, 29 Jun 2011 17:26:42 +0000 (10:26 -0700)
committerKeith Packard <keithp@keithp.com>
Wed, 29 Jun 2011 17:32:08 +0000 (10:32 -0700)
Provide a parameter to disable hanghcheck. This is useful mostly for
developers trying to debug known problems, and probably should not be
touched by normal users.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Keith Packard <keithp@keithp.com>
drivers/gpu/drm/i915/i915_drv.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/i915_irq.c

index 609358faaa9061749ccf9cb2c2022568600eef17..b54f7d9b173a0a514c1518f80c775feeeaa303a8 100644 (file)
@@ -70,6 +70,9 @@ module_param_named(vbt_sdvo_panel_type, i915_vbt_sdvo_panel_type, int, 0600);
 static bool i915_try_reset = true;
 module_param_named(reset, i915_try_reset, bool, 0600);
 
+bool i915_enable_hangcheck = true;
+module_param_named(enable_hangcheck, i915_enable_hangcheck, bool, 0644);
+
 static struct drm_driver driver;
 extern int intel_agp_enabled;
 
index 01affb63be297d210f76261380b8694c5d6b82ce..e0f9ca3e5ff8fa0eebb36ab5bd4111d92dd84389 100644 (file)
@@ -994,6 +994,7 @@ extern unsigned int i915_panel_use_ssc;
 extern int i915_vbt_sdvo_panel_type;
 extern unsigned int i915_enable_rc6;
 extern unsigned int i915_enable_fbc;
+extern bool i915_enable_hangcheck;
 
 extern int i915_suspend(struct drm_device *dev, pm_message_t state);
 extern int i915_resume(struct drm_device *dev);
index 71cc8a353a789e89f378ec899c3ad6be39fb08be..8b670e7ee4046b6668b755bffab62a1f42cbcf04 100644 (file)
@@ -1779,8 +1779,11 @@ i915_add_request(struct intel_ring_buffer *ring,
        ring->outstanding_lazy_request = false;
 
        if (!dev_priv->mm.suspended) {
-               mod_timer(&dev_priv->hangcheck_timer,
-                         jiffies + msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD));
+               if (i915_enable_hangcheck) {
+                       mod_timer(&dev_priv->hangcheck_timer,
+                                 jiffies +
+                                 msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD));
+               }
                if (was_empty)
                        queue_delayed_work(dev_priv->wq,
                                           &dev_priv->mm.retire_work, HZ);
index ae2b49969b995c0b1c7f7f76f65d2426ea003522..0b0de5239ad5fbe5d7355a577e54effafbb94f65 100644 (file)
@@ -361,10 +361,12 @@ static void notify_ring(struct drm_device *dev,
 
        ring->irq_seqno = seqno;
        wake_up_all(&ring->irq_queue);
-
-       dev_priv->hangcheck_count = 0;
-       mod_timer(&dev_priv->hangcheck_timer,
-                 jiffies + msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD));
+       if (i915_enable_hangcheck) {
+               dev_priv->hangcheck_count = 0;
+               mod_timer(&dev_priv->hangcheck_timer,
+                         jiffies +
+                         msecs_to_jiffies(DRM_I915_HANGCHECK_PERIOD));
+       }
 }
 
 static void gen6_pm_rps_work(struct work_struct *work)
@@ -1664,6 +1666,9 @@ void i915_hangcheck_elapsed(unsigned long data)
        uint32_t acthd, instdone, instdone1;
        bool err = false;
 
+       if (!i915_enable_hangcheck)
+               return;
+
        /* If all work is done then ACTHD clearly hasn't advanced. */
        if (i915_hangcheck_ring_idle(&dev_priv->ring[RCS], &err) &&
            i915_hangcheck_ring_idle(&dev_priv->ring[VCS], &err) &&