All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Widawsky <bwidawsk@gmail.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 3/8] drm/i915/context: whitespace cleanup, and warning cleanup
Date: Wed,  2 Feb 2011 15:00:15 -0800	[thread overview]
Message-ID: <1296687620-27019-4-git-send-email-bwidawsk@gmail.com> (raw)
In-Reply-To: <1296687620-27019-1-git-send-email-bwidawsk@gmail.com>

---
 drivers/gpu/drm/i915/i915_context.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

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);
 }
-- 
1.7.3.4

  parent reply	other threads:[~2011-02-02 23:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-02 23:00 [PATCH 0/8] drm/i915/context Ben Widawsky
2011-02-02 23:00 ` [PATCH 1/8] drm/i915/context: basic implementation context ioctls Ben Widawsky
2011-02-02 23:00 ` [PATCH 2/8] drm/i915/context: context initialization/destruction Ben Widawsky
2011-02-02 23:00 ` Ben Widawsky [this message]
2011-02-02 23:00 ` [PATCH 4/8] drm/i915/context: minimal support for contexts in execbuffer2 Ben Widawsky
2011-02-02 23:00 ` [PATCH 5/8] drm/i915/context: context validation for execbuffer2 Ben Widawsky
2011-02-14 20:21   ` Daniel Vetter
2011-02-14 23:10     ` Ben Widawsky
2011-02-02 23:00 ` [PATCH 6/8] drm/i915/context: enable calling context_switch Ben Widawsky
2011-02-02 23:00 ` [PATCH 7/8] drm/i915/context: Insert MI_SET_CONTEXT in ringbuffer context switch Ben Widawsky
2011-02-02 23:00 ` [PATCH 8/8] drm/i915/context: context switch, and PPGTT params Ben Widawsky
2011-02-02 23:29 ` [PATCH 0/8] drm/i915/context Chris Wilson
2011-02-02 23:55   ` Ben Widawsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1296687620-27019-4-git-send-email-bwidawsk@gmail.com \
    --to=bwidawsk@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.