From patchwork Thu Feb 14 14:57:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Auld X-Patchwork-Id: 10812981 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 03B6613BF for ; Thu, 14 Feb 2019 14:58:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E502728E9A for ; Thu, 14 Feb 2019 14:58:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D757428E0D; Thu, 14 Feb 2019 14:58:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 776502D89F for ; Thu, 14 Feb 2019 14:58:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C0C4E6E946; Thu, 14 Feb 2019 14:58:49 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id C80136E938 for ; Thu, 14 Feb 2019 14:58:28 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Feb 2019 06:58:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,369,1544515200"; d="scan'208";a="114920583" Received: from jhbrinke-mobl3.amr.corp.intel.com (HELO mwahaha.ger.corp.intel.com) ([10.252.11.151]) by orsmga007.jf.intel.com with ESMTP; 14 Feb 2019 06:58:27 -0800 From: Matthew Auld To: intel-gfx@lists.freedesktop.org Date: Thu, 14 Feb 2019 14:57:34 +0000 Message-Id: <20190214145740.14521-37-matthew.auld@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190214145740.14521-1-matthew.auld@intel.com> References: <20190214145740.14521-1-matthew.auld@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [RFC PATCH 36/42] drm/i915/lmem: include debugfs metrics X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Useful for debugging. Signed-off-by: Matthew Auld Cc: Joonas Lahtinen Cc: Abdiel Janulgue --- drivers/gpu/drm/i915/i915_debugfs.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index fed46fe19c03..2178c13213ef 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -435,6 +435,8 @@ static int i915_gem_object_info(struct seq_file *m, void *data) struct i915_ggtt *ggtt = &dev_priv->ggtt; u32 count, mapped_count, purgeable_count, dpy_count, huge_count; u64 size, mapped_size, purgeable_size, dpy_size, huge_size; + u32 lmem_count, lmem_dpy_count; + u64 lmem_size, lmem_dpy_size; struct drm_i915_gem_object *obj; unsigned int page_sizes = 0; char buf[80]; @@ -448,6 +450,7 @@ static int i915_gem_object_info(struct seq_file *m, void *data) mapped_size = mapped_count = 0; purgeable_size = purgeable_count = 0; huge_size = huge_count = 0; + lmem_size = lmem_count = lmem_dpy_size = lmem_dpy_count = 0; spin_lock(&dev_priv->mm.obj_lock); list_for_each_entry(obj, &dev_priv->mm.unbound_list, mm.link) { @@ -469,6 +472,15 @@ static int i915_gem_object_info(struct seq_file *m, void *data) huge_size += obj->base.size; page_sizes |= obj->mm.page_sizes.sg; } + + if (i915_gem_object_is_lmem(obj)) { + if (obj->pin_global) { + lmem_dpy_count++; + lmem_dpy_size += obj->base.size; + } + lmem_count++; + lmem_size += obj->base.size; + } } seq_printf(m, "%u unbound objects, %llu bytes\n", count, size); @@ -497,6 +509,15 @@ static int i915_gem_object_info(struct seq_file *m, void *data) huge_size += obj->base.size; page_sizes |= obj->mm.page_sizes.sg; } + + if (i915_gem_object_is_lmem(obj)) { + if (obj->pin_global) { + lmem_dpy_count++; + lmem_dpy_size += obj->base.size; + } + lmem_count++; + lmem_size += obj->base.size; + } } spin_unlock(&dev_priv->mm.obj_lock); @@ -513,6 +534,12 @@ static int i915_gem_object_info(struct seq_file *m, void *data) seq_printf(m, "%u display objects (globally pinned), %llu bytes\n", dpy_count, dpy_size); + if (HAS_LMEM(dev_priv)) { + seq_printf(m, "%u LMEM objects, %llu bytes\n", lmem_count, lmem_size); + seq_printf(m, "%u LMEM display objects (globally pinned), %llu bytes\n", + lmem_dpy_count, lmem_dpy_size); + } + seq_printf(m, "%llu [%pa] gtt total\n", ggtt->vm.total, &ggtt->mappable_end); seq_printf(m, "Supported page sizes: %s\n",