diff mbox

[4/7] drm/i915: Better context messages

Message ID 1365118914-15753-6-git-send-email-ben@bwidawsk.net (mailing list archive)
State New, archived
Headers show

Commit Message

Ben Widawsky April 4, 2013, 11:41 p.m. UTC
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_gem_context.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 8e218ad..8b2e73a 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -213,7 +213,7 @@  static int create_default_context(struct drm_i915_private *dev_priv)
 	if (ret)
 		goto err_unpin;
 
-	DRM_DEBUG_DRIVER("Default HW context loaded\n");
+	DRM_DEBUG_DRIVER("Default HW context loaded (%p)\n", ctx);
 	return 0;
 
 err_unpin:
@@ -275,6 +275,7 @@  static int context_idr_cleanup(int id, void *p, void *data)
 
 	BUG_ON(id == DEFAULT_CONTEXT_ID);
 
+	DRM_DEBUG_DRIVER("Context %d closed before destroy.\n", ctx->id);
 	do_destroy(ctx);
 
 	return 0;
@@ -453,8 +454,11 @@  int i915_switch_context(struct intel_ring_buffer *ring,
 		return -EINVAL;
 
 	to = i915_gem_context_get(ring, file->driver_priv, to_id);
-	if (to == NULL)
+	if (unlikely(!to)) {
+		BUG_ON(to_id == DEFAULT_CONTEXT_ID);
+		DRM_DEBUG_DRIVER("Couldn't find context %d\n", to_id);
 		return -ENOENT;
+	}
 
 	return do_switch(to);
 }
@@ -517,6 +521,6 @@  int i915_gem_context_destroy_ioctl(struct drm_device *dev, void *data,
 
 	mutex_unlock(&dev->struct_mutex);
 
-	DRM_DEBUG_DRIVER("HW context %d destroyed\n", args->ctx_id);
+	DRM_DEBUG_DRIVER("User destroyed context %d\n", args->ctx_id);
 	return 0;
 }