diff mbox

[3/8] drm/i915/context: whitespace cleanup, and warning cleanup

Message ID 1296687620-27019-4-git-send-email-bwidawsk@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ben Widawsky Feb. 2, 2011, 11 p.m. UTC
None
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_context.c b/drivers/gpu/drm/i915/i915_context.c
index 6284080..dec3b02 100644
--- a/drivers/gpu/drm/i915/i915_context.c
+++ b/drivers/gpu/drm/i915/i915_context.c
@@ -115,6 +115,7 @@  err_unref:
 	mutex_unlock(&dev->struct_mutex);
 	return NULL;
 }
+
 /**
  * i915_context_hw_init - Create a valid context for the given object
  * on the specified ring. This may need to be hardware dependent in the future,
@@ -315,12 +316,14 @@  void i915_context_init(struct drm_device *dev)
 	}
 }
 
+static int warn_idr_cleanup = 0;
+
 static
 int i915_context_idr_cleanup(int id, void *p, void *data)
 {
 	struct drm_device *dev = (struct drm_device *)data;
 	struct drm_i915_gem_context *ctx = (struct drm_i915_gem_context *)p;
-	DRM_DEBUG_DRIVER("Destroying abandoned context %d\n", ctx->ctx_id);
+	WARN_ON_ONCE(warn_idr_cleanup);
 	do_context_destroy(dev, ctx);
 	return 0;
 }
@@ -333,8 +336,10 @@  void i915_context_fini(struct drm_device *dev)
 
 	i915_destroy_hw_context(dev, dev_priv->default_context);
 	spin_lock(&dev_priv->i915_ctx_lock);
+	warn_idr_cleanup=1;
 	idr_for_each(&dev_priv->i915_ctx_idr, i915_context_idr_cleanup, dev);
 	idr_remove_all(&dev_priv->i915_ctx_idr);
 	idr_destroy(&dev_priv->i915_ctx_idr);
+	warn_idr_cleanup=0;
 	spin_unlock(&dev_priv->i915_ctx_lock);
 }