From patchwork Thu Apr 7 02:56:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zack Rusin X-Patchwork-Id: 12804364 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 61BE3C433EF for ; Thu, 7 Apr 2022 02:57:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1F1A810E6BF; Thu, 7 Apr 2022 02:57:06 +0000 (UTC) Received: from letterbox.kde.org (letterbox.kde.org [46.43.1.242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3A39710E6B5 for ; Thu, 7 Apr 2022 02:57:03 +0000 (UTC) Received: from vertex.vmware.com (pool-108-36-85-85.phlapa.fios.verizon.net [108.36.85.85]) (Authenticated sender: zack) by letterbox.kde.org (Postfix) with ESMTPSA id 4964E28A5AB; Thu, 7 Apr 2022 03:57:01 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kde.org; s=users; t=1649300222; bh=ab3eTJUaYGfc8Eoce+oTc8nInro20BzElLFNR62PoXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SCcskNOQnHxUFbQYVBkcM1+S/RmyT73YXWmG5qU9j4j6h9lPIiKmtNqtz9Bo3f2WA ot+6+8rkF/izq1YVGdN87rpbchHkpOmqqttWz0zejPiqVQjDkn8xoOHTniuJacQiat 9xTHFS7I8a+jZuFm1/EvviqCrpm8gTUttj7XfPhz7nI+gL0A8pApw2hDyDjgw4VMux +HDB3D5IjIgzh46J975LNn92KSy0GOICdH9H3KK4uuKMj1CaWEdhnQxO3AKBxB2HCe AZQeRtZ1OO9FcUFQxcmZlvscwVWnqACaWhXStPu44A+TXVHiO8zZNPKRs4xVscKa5s 45sphnoYIv39g== From: Zack Rusin To: dri-devel@lists.freedesktop.org Subject: [PATCH 2/5] drm/vmwgfx: Add debugfs entries for various ttm resource managers Date: Wed, 6 Apr 2022 22:56:48 -0400 Message-Id: <20220407025652.146426-3-zack@kde.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220407025652.146426-1-zack@kde.org> References: <20220407025652.146426-1-zack@kde.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Zack Rusin Cc: David Airlie , krastevm@vmware.com, Huang Rui , Christian Koenig , mombasawalam@vmware.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Zack Rusin 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 --- 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: