From patchwork Thu Apr 4 23:41:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 2395601 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id CE1F53FD1A for ; Thu, 4 Apr 2013 23:41:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 86CD7E6521 for ; Thu, 4 Apr 2013 16:41:29 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from shiva.localdomain (209-20-75-48.static.cloud-ips.com [209.20.75.48]) by gabe.freedesktop.org (Postfix) with ESMTP id 9D727E61AC for ; Thu, 4 Apr 2013 16:40:04 -0700 (PDT) Received: by shiva.localdomain (Postfix, from userid 1005) id 7784E88627; Thu, 4 Apr 2013 23:40:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on shiva.chad-versace.us X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable version=3.3.2 Received: from lundgren.nims.intel.com (jfdmzpr05-ext.jf.intel.com [134.134.139.74]) by shiva.localdomain (Postfix) with ESMTPSA id 0F8DB8862A; Thu, 4 Apr 2013 23:40:02 +0000 (UTC) From: Ben Widawsky To: intel-gfx@lists.freedesktop.org Date: Thu, 4 Apr 2013 16:41:51 -0700 Message-Id: <1365118914-15753-6-git-send-email-ben@bwidawsk.net> X-Mailer: git-send-email 1.8.2 In-Reply-To: <1365118914-15753-1-git-send-email-ben@bwidawsk.net> References: <1365118914-15753-1-git-send-email-ben@bwidawsk.net> Cc: Ben Widawsky Subject: [Intel-gfx] [PATCH 4/7] drm/i915: Better context messages X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 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 Signed-off-by: Ben Widawsky --- drivers/gpu/drm/i915/i915_gem_context.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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; }