[8/8] Add debugging output to reset logic
diff mbox

Message ID 1249763687-5252-9-git-send-email-bgamari.foss@gmail.com
State Superseded
Headers show

Commit Message

Ben Gamari Aug. 8, 2009, 8:34 p.m. UTC
---
 drivers/gpu/drm/i915/i915_drv.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

Patch
diff mbox

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 576cb7e..07bc6d8 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -38,6 +38,8 @@ 
 #include "drm_crtc_helper.h"
 
 
+#include <linux/debug_locks.h>
+
 static unsigned int i915_modeset = -1;
 module_param_named(modeset, i915_modeset, int, 0400);
 
@@ -153,6 +155,7 @@  void i965_reset(struct drm_device *dev, u8 flags)
 		udelay(100);
 	} while (mutex_is_locked(&dev->struct_mutex) && time_after(timeout, jiffies));
 
+	printk("i915: checking lock\n");
 	if (mutex_is_locked(&dev->struct_mutex)) {
 #if 1
 		DRM_ERROR("i915 struct_mutex lock is still held by %s. Giving on up reset.\n", dev->struct_mutex.owner->task->comm);
@@ -169,13 +172,16 @@  void i965_reset(struct drm_device *dev, u8 flags)
 #endif
 
 	debug_show_all_locks();
+	printk("i915: Acquiring mutex\n");
 	mutex_lock(&dev->struct_mutex);
 
 	/*
 	 * Clear request list
 	 */
+	printk("i915: Retiring requests\n");
 	i915_gem_retire_requests(dev);
 
+	printk("i915: Saving display config\n");
 	if (need_display)
 		i915_save_display(dev);
 
@@ -191,6 +197,7 @@  void i965_reset(struct drm_device *dev, u8 flags)
 		udelay(50);
 		pci_write_config_byte(dev->pdev, GDRST, gdrst & 0xfeffffff);
 
+		printk("i915: Waiting for hardware to recover\n");
 		/* ...we don't want to loop forever though, 500ms should be plenty */
 	       timeout = jiffies + msecs_to_jiffies(500);
 		do {
@@ -229,11 +236,13 @@  void i965_reset(struct drm_device *dev, u8 flags)
 		struct drm_i915_gem_object *obj_priv = obj->driver_private;
 		dev_priv->mm.suspended = 0;
 
+		printk("i915: Stop ring\n");
 		/* Stop the ring if it's running. */
 		I915_WRITE(PRB0_CTL, 0);
 		I915_WRITE(PRB0_TAIL, 0);
 		I915_WRITE(PRB0_HEAD, 0);
 
+		printk("i915: Init ring\n");
 		/* Initialize the ring. */
 		I915_WRITE(PRB0_START, obj_priv->gtt_offset);
 		I915_WRITE(PRB0_CTL,
@@ -251,7 +260,9 @@  void i965_reset(struct drm_device *dev, u8 flags)
 		}
 
 		mutex_unlock(&dev->struct_mutex);
+		printk("i915: irq_uninstall\n");
 		drm_irq_uninstall(dev);
+		printk("i915: irq_install\n");
 		drm_irq_install(dev);
 		mutex_lock(&dev->struct_mutex);
 	}
@@ -259,6 +270,7 @@  void i965_reset(struct drm_device *dev, u8 flags)
 	/*
 	 * Display needs restore too...
 	 */
+	printk("i915: Restore display\n");
 	if (need_display)
 		i915_restore_display(dev);