From patchwork Thu Feb 12 20:05:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: rafael.barbalho@intel.com X-Patchwork-Id: 5821931 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 59A339F336 for ; Thu, 12 Feb 2015 20:05:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 797F920256 for ; Thu, 12 Feb 2015 20:05:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 52CBC20225 for ; Thu, 12 Feb 2015 20:05:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 868296E43C; Thu, 12 Feb 2015 12:05:49 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 0B8F9720C5 for ; Thu, 12 Feb 2015 12:05:48 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP; 12 Feb 2015 12:01:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,566,1418112000"; d="scan'208";a="526756160" Received: from rbarbalh-linux.isw.intel.com ([10.102.226.86]) by orsmga003.jf.intel.com with ESMTP; 12 Feb 2015 11:57:03 -0800 From: rafael.barbalho@intel.com To: intel-gfx@lists.freedesktop.org Date: Thu, 12 Feb 2015 20:05:01 +0000 Message-Id: <1423771502-9766-2-git-send-email-rafael.barbalho@intel.com> X-Mailer: git-send-email 2.3.0 In-Reply-To: <1423771502-9766-1-git-send-email-rafael.barbalho@intel.com> References: <1423771502-9766-1-git-send-email-rafael.barbalho@intel.com> Subject: [Intel-gfx] [RFC 1/2] drm/i915: Export active PPGTTs in debugfs X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Rafael Barbalho It's possible to gather up basic information on all active VMs. Signed-off-by: Rafael Barbalho Cc: Daniel Vetter Cc: Jon Bloomfield --- drivers/gpu/drm/i915/i915_debugfs.c | 41 +++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 1467cc1..0bf10c0 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -125,7 +125,7 @@ describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj) struct i915_vma *vma; int pin_count = 0; - seq_printf(m, "%pK: %s%s%s %8zdKiB %02x %02x %u %u %u%s%s%s", + seq_printf(m, "%p: %s%s%s %8zdKiB %02x %02x %u %u %u%s%s%s", &obj->base, get_pin_flag(obj), get_tiling_flag(obj), @@ -2013,22 +2013,37 @@ static void gen8_ppgtt_info(struct seq_file *m, struct drm_device *dev) struct drm_i915_private *dev_priv = dev->dev_private; struct intel_engine_cs *ring; struct i915_hw_ppgtt *ppgtt = dev_priv->mm.aliasing_ppgtt; + struct i915_address_space *vm; int unused, i; - if (!ppgtt) - return; - seq_printf(m, "Page directories: %d\n", ppgtt->num_pd_pages); - seq_printf(m, "Page tables: %d\n", ppgtt->num_pd_entries); - for_each_ring(ring, dev_priv, unused) { - seq_printf(m, "%s\n", ring->name); - for (i = 0; i < 4; i++) { - u32 offset = 0x270 + i * 8; - u64 pdp = I915_READ(ring->mmio_base + offset + 4); - pdp <<= 32; - pdp |= I915_READ(ring->mmio_base + offset); - seq_printf(m, "\tPDP%d 0x%016llx\n", i, pdp); + if (ppgtt) { + seq_printf(m, "Page directories: %d\n", ppgtt->num_pd_pages); + seq_printf(m, "Page tables: %d\n", ppgtt->num_pd_entries); + for_each_ring(ring, dev_priv, unused) { + seq_printf(m, "%s\n", ring->name); + for (i = 0; i < 4; i++) { + u32 offset = 0x270 + i * 8; + u64 pdp = I915_READ(ring->mmio_base + offset + 4); + pdp <<= 32; + pdp |= I915_READ(ring->mmio_base + offset); + seq_printf(m, "\tPDP%d 0x%016llx\n", i, pdp); + } + } + } else { + i = 0; + list_for_each_entry(vm, &dev_priv->vm_list, global_link) { + if (i915_is_ggtt(vm)) + continue; + i++; + ppgtt = i915_vm_to_ppgtt(vm); + seq_printf(m, "PPGTT %p - references\n", ppgtt); + seq_printf(m, "Page directories: %d\n", + ppgtt->num_pd_pages); + seq_printf(m, "Page tables: %d\n", + ppgtt->num_pd_entries); } + seq_printf(m, "Number of PPGTTs active: %d\n", i); } }