From patchwork Thu Apr 4 23:41:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 2395631 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id 8D28ADF25A for ; Thu, 4 Apr 2013 23:42:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 61096E6514 for ; Thu, 4 Apr 2013 16:42:42 -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 9AB2AE6412 for ; Thu, 4 Apr 2013 16:40:05 -0700 (PDT) Received: by shiva.localdomain (Postfix, from userid 1005) id 5B01E8862C; Thu, 4 Apr 2013 23:40:05 +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=ham 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 22DF58862B; Thu, 4 Apr 2013 23:40:04 +0000 (UTC) From: Ben Widawsky To: intel-gfx@lists.freedesktop.org Date: Thu, 4 Apr 2013 16:41:54 -0700 Message-Id: <1365118914-15753-9-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 7/7] drm/i915: Print all contexts in debugfs 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_debugfs.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 375c36a..eef2575 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -1471,11 +1471,23 @@ static int i915_gem_framebuffer_info(struct seq_file *m, void *data) return 0; } +static int context_show(int id, void *p, void *data) +{ + struct i915_hw_context *ctx = p; + struct seq_file *m = data; + + seq_printf(m, "context = %d\n", id); + describe_obj(m, ctx->obj); + seq_printf(m, "\n"); + return 0; +} + static int i915_context_status(struct seq_file *m, void *unused) { struct drm_info_node *node = (struct drm_info_node *) m->private; struct drm_device *dev = node->minor->dev; drm_i915_private_t *dev_priv = dev->dev_private; + struct drm_file *file; struct intel_ring_buffer *ring; int ret, i; @@ -1503,6 +1515,13 @@ static int i915_context_status(struct seq_file *m, void *unused) } } + list_for_each_entry(file, &dev->filelist, lhead) { + struct drm_i915_file_private *file_priv = file->driver_priv; + seq_printf(m, "File = %p ", file); + idr_for_each(&file_priv->context_idr, context_show, m); + seq_printf(m, "\n"); + } + mutex_unlock(&dev->mode_config.mutex); return 0;