From patchwork Wed Feb 2 23:00:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 527991 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 p12N3X6b006374 for ; Wed, 2 Feb 2011 23:03:53 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CDA019E9D2 for ; Wed, 2 Feb 2011 15:03:32 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org 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) 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=kPmtyFO1XCk2/X9yAS6xUs5P47VxzfI0eTWR5l0tvk0=; b=sETzRJhPCMhC6t//FOSotsPGEKe3fhiN7eclJcdjOGaCWlDug3DEe2KZHNlRX9eneZ ZmSzgARajxx/glyjjLlRgnFL+yMSiIH8bhwcWjEmGoWZCOg/Lf6t3wxpQnU2PHi0Jhko MGTsd6VSQfUSMeDdemsaEnpVREPuKYu0cWLKM= 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=XTeVW8LbctRO+EQ0UAEajJo+aRlFNQfnqMDBo7okn0nNHBoDUzy3ZnjsgJWWe6VU1m gWUfj5mlZpSSnBIDDjbbetKS6y7gCcAbCa55CjDE7D9huBYB8p27drsKI3fa5iUhAFl0 zaDnjNFsQ8QKoaViKnGlUBL4WYBge2VbLGIt0= Received: by 10.151.103.15 with SMTP id f15mr12299191ybm.251.1296687645362; Wed, 02 Feb 2011 15:00:45 -0800 (PST) Received: from localhost.localdomain ([134.134.139.76]) by mx.google.com with ESMTPS id i10sm79654yhd.10.2011.02.02.15.00.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 02 Feb 2011 15:00:43 -0800 (PST) From: Ben Widawsky To: intel-gfx@lists.freedesktop.org Date: Wed, 2 Feb 2011 15:00:15 -0800 Message-Id: <1296687620-27019-4-git-send-email-bwidawsk@gmail.com> X-Mailer: git-send-email 1.7.3.4 In-Reply-To: <1296687620-27019-1-git-send-email-bwidawsk@gmail.com> References: <1296687620-27019-1-git-send-email-bwidawsk@gmail.com> Subject: [Intel-gfx] [PATCH 3/8] 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]); Wed, 02 Feb 2011 23:04:11 +0000 (UTC) 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); }