From patchwork Tue Feb 1 18:16:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 523611 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p11IKnle001773 for ; Tue, 1 Feb 2011 18:21:12 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D2D739E92B for ; Tue, 1 Feb 2011 10:20:48 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-gx0-f177.google.com (mail-gx0-f177.google.com [209.85.161.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 015399E808 for ; Tue, 1 Feb 2011 10:17:58 -0800 (PST) Received: by mail-gx0-f177.google.com with SMTP id 21so2709953gxk.36 for ; Tue, 01 Feb 2011 10:17:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=95JIWGnCOKebJEL73xja2FPT+MwW7nWisWfUYcQr8H8=; b=xDF2qQaATZeqJAGi59w8GoZzF8ftC8MYkycB82epQTJ0cWUGGex39dCBWjs2Q1PMzr 5Zl3mhjYhtyX5zj6Hxc4FNJCyCJFUN1QH4QLiDJ1atEoFeJvqB1uMsdRz4JAtj17w0XV 1eqw/9PlJl+Z3NXwrLlJc/Hnej119JnsMX1ss= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=c+CU6pFh6aLXAxl88BiCCDHVyUKbRHl6QGAZu6jNkD+YMO7vctqrikM3gz3/jloGuu xM6l+JSYM1UWlaCJXAm9eYH/yNDXcHoKG1sJyWsS2rwkXBVxtW2Jk78MrazZ6im47Q8s 3t6sfWa6CsZBZNSYNFEsSsIa81jHKPyKEi4GA= Received: by 10.90.88.19 with SMTP id l19mr11113919agb.42.1296584278752; Tue, 01 Feb 2011 10:17:58 -0800 (PST) Received: from localhost.localdomain ([67.208.96.87]) by mx.google.com with ESMTPS id f10sm27543608anh.5.2011.02.01.10.17.56 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 01 Feb 2011 10:17:57 -0800 (PST) From: Ben Widawsky To: intel-gfx@lists.freedesktop.org Date: Tue, 1 Feb 2011 10:16:21 -0800 Message-Id: <1296584186-20446-5-git-send-email-bwidawsk@gmail.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1296584186-20446-1-git-send-email-bwidawsk@gmail.com> References: <1296584186-20446-1-git-send-email-bwidawsk@gmail.com> Subject: [Intel-gfx] [PATCH 4/9] drm/i915/context: whitespace cleanup, and warning cleanup X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Tue, 01 Feb 2011 18:21:12 +0000 (UTC) diff --git a/drivers/gpu/drm/i915/i915_context.c b/drivers/gpu/drm/i915/i915_context.c index 4e19636..90b7bf3 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_deinit(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); }