All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zack Rusin <zack@kde.org>
To: dri-devel@lists.freedesktop.org
Cc: David Airlie <airlied@linux.ie>,
	krastevm@vmware.com, Huang Rui <ray.huang@amd.com>,
	Christian Koenig <christian.koenig@amd.com>,
	mombasawalam@vmware.com
Subject: [PATCH 2/5] drm/vmwgfx: Add debugfs entries for various ttm resource managers
Date: Wed,  6 Apr 2022 22:56:48 -0400	[thread overview]
Message-ID: <20220407025652.146426-3-zack@kde.org> (raw)
In-Reply-To: <20220407025652.146426-1-zack@kde.org>

From: Zack Rusin <zackr@vmware.com>

Use the newly added TTM's ability to automatically create debugfs entries
for specified placements. This creates entries in /sys/kernel/debug/ttm/
that can be read to get information about various TTM resource
managers which are used by vmwgfx.

Signed-off-by: Zack Rusin <zackr@vmware.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
index decd54b8333d..59d0d1cd564b 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c
@@ -1630,6 +1630,13 @@ static int vmw_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	struct vmw_private *vmw;
 	int ret;
+	const char * const ttm_placement_names[] = {
+		[TTM_PL_SYSTEM] = "system_ttm",
+		[TTM_PL_VRAM] = "vram_ttm",
+		[VMW_PL_GMR] = "gmr_ttm",
+		[VMW_PL_MOB] = "mob_ttm",
+		[VMW_PL_SYSTEM] = "system_mob_ttm"
+	};
 
 	ret = drm_aperture_remove_conflicting_pci_framebuffers(pdev, &driver);
 	if (ret)
@@ -1657,6 +1664,9 @@ static int vmw_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		goto out_unload;
 
 	vmw_debugfs_gem_init(vmw);
+	ttm_resource_manager_debugfs_init(&vmw->bdev,
+					  ttm_placement_names,
+					  ARRAY_SIZE(ttm_placement_names));
 
 	return 0;
 out_unload:
-- 
2.32.0


  parent reply	other threads:[~2022-04-07  2:57 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-07  2:56 [PATCH 0/5] drm/ttm: Introduce TTM res manager debugfs helpers Zack Rusin
2022-04-07  2:56 ` [PATCH 1/5] drm/ttm: Add common debugfs code for resource managers Zack Rusin
2022-04-07  6:01   ` Christian König
2022-04-07 14:15     ` Zack Rusin
2022-04-08  7:56       ` Daniel Vetter
2022-04-08  8:34         ` Christian König
2022-04-07  2:56 ` Zack Rusin [this message]
2022-04-07  2:56 ` [PATCH 3/5] drm/amdgpu: Use TTM builtin resource manager debugfs code Zack Rusin
2022-04-07  2:56   ` Zack Rusin
2022-04-07  2:56 ` [PATCH 4/5] drm/qxl: " Zack Rusin
2022-04-07  2:56 ` [PATCH 5/5] drm/radeon: " Zack Rusin
2022-04-07  2:56   ` Zack Rusin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220407025652.146426-3-zack@kde.org \
    --to=zack@kde.org \
    --cc=airlied@linux.ie \
    --cc=christian.koenig@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=krastevm@vmware.com \
    --cc=mombasawalam@vmware.com \
    --cc=ray.huang@amd.com \
    --cc=zackr@vmware.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.