From patchwork Tue Apr 2 22:45:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 2381771 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 65821DF2A1 for ; Tue, 2 Apr 2013 22:43:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 33932E5EE9 for ; Tue, 2 Apr 2013 15:43:58 -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 89CF6E5D0C for ; Tue, 2 Apr 2013 15:43:49 -0700 (PDT) Received: by shiva.localdomain (Postfix, from userid 1005) id D86B488625; Tue, 2 Apr 2013 22:43:48 +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 (jfdmzpr01-ext.jf.intel.com [134.134.139.70]) by shiva.localdomain (Postfix) with ESMTPSA id 1F21C88625; Tue, 2 Apr 2013 22:43:46 +0000 (UTC) From: Ben Widawsky To: intel-gfx@lists.freedesktop.org Date: Tue, 2 Apr 2013 15:45:43 -0700 Message-Id: <1364942743-6041-2-git-send-email-ben@bwidawsk.net> X-Mailer: git-send-email 1.8.2 In-Reply-To: <1364942743-6041-1-git-send-email-ben@bwidawsk.net> References: <1363276337-12509-4-git-send-email-mika.kuoppala@intel.com> <1364942743-6041-1-git-send-email-ben@bwidawsk.net> In-Reply-To: <1363276337-12509-4-git-send-email-mika.kuoppala@intel.com> References: <1363276337-12509-4-git-send-email-mika.kuoppala@intel.com> Cc: Ben Widawsky Subject: [Intel-gfx] [PATCH 2/2] 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 7299ea4..70369e4 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -1479,11 +1479,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; @@ -1511,6 +1523,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;