From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Widawsky Subject: [PATCH 3/8] drm/i915/context: whitespace cleanup, and warning cleanup Date: Wed, 2 Feb 2011 15:00:15 -0800 Message-ID: <1296687620-27019-4-git-send-email-bwidawsk@gmail.com> References: <1296687620-27019-1-git-send-email-bwidawsk@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-yx0-f177.google.com (mail-yx0-f177.google.com [209.85.213.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 7A5689E7B4 for ; Wed, 2 Feb 2011 15:00:45 -0800 (PST) Received: by mail-yx0-f177.google.com with SMTP id 30so242900yxd.36 for ; Wed, 02 Feb 2011 15:00:45 -0800 (PST) In-Reply-To: <1296687620-27019-1-git-send-email-bwidawsk@gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --- 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