Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6028929rwb; Tue, 17 Jan 2023 23:36:13 -0800 (PST) X-Google-Smtp-Source: AMrXdXvU1/WML6T08T7notw3ti/t1L8fk4H04U6YkkSUrXdUyusA7W8Rm7pMoOo+4hDKJCno7tQs X-Received: by 2002:a17:90a:300b:b0:227:db2:25fe with SMTP id g11-20020a17090a300b00b002270db225femr6334868pjb.35.1674027373071; Tue, 17 Jan 2023 23:36:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674027373; cv=none; d=google.com; s=arc-20160816; b=0lvuGvEILBbzoNXZAfHCoWn594wFg6tUKLozqNU2VqOfZDMvH+GpaxAeb+6Adqjq5T vcJESyFGBk1WqAQzR/zYtVzS7zE3Lwmaa77LRG3ToX3Qq0eZAuUhTpVhN+atlJsrK+y7 Ucyl52Pd13kUSuA2yo67t0axLORKcIeImuPRK5oqT/p2CaowZmApVTnKN1W8eBaMbKA1 X6zrLFNnqsTky/HECVrhVu2qbCcHSlZmA0eLGYzO1ENvsC9Mmcq4ERjPG6x0aNC9n2Gi VD55nzbojIQghVfP/XN6BB7aCSuBKctOyB39459k3P3f13KY4z0BAy8KMcfoZgEqulvY ldDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=VHl/4diKtyJnEE11WWdgE7GtYAgDLsei1RwmYtZIKRg=; b=dCUUxViU/Rz0m4chiyq/NChva0ICcomwsRYYbBFF3FkuNfdy26zxXBgBOhH5bwcyew u/wQt0gWg2+GSFYEbYp5nT5+6RDVeQr7gCbPH09xEU6ORDqk1oV7JQZQQZTDmHM5qEVH DxScAIyKj2ds4EuVJSZBsFO6Ovig0f+VSxMMtVhD2R+WaqU2uGhiAsIzyYj4THe203zM UU7+B2RLjAtApVXwPXRk8Z2pwn4pu8VJYw2yFKebz1o8Jojy+gIynb6t8+h3+7KfGvDK t0yP748eUeBTHUwFitZKFgWfVcL7CTlG4Bl2MKIYwY6J1ZDI8OXVpKvvkl2R7P8IsKuZ d7GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WQ0V9+KW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v31-20020a63151f000000b0049ca23d4915si33198456pgl.104.2023.01.17.23.36.07; Tue, 17 Jan 2023 23:36:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WQ0V9+KW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230094AbjARGke (ORCPT + 48 others); Wed, 18 Jan 2023 01:40:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229599AbjARG0e (ORCPT ); Wed, 18 Jan 2023 01:26:34 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 737D7552A2 for ; Tue, 17 Jan 2023 22:14:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674022465; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VHl/4diKtyJnEE11WWdgE7GtYAgDLsei1RwmYtZIKRg=; b=WQ0V9+KW6VMn0ifr33bQKJq0glGdLjCYvkPabaE/d7GNcdXQ5nT1+NKBwDABRTO7v1Ev7J bmVNrtwFkj9BkXTcy77wUZk7N80I66VbWGLi5OOznpVCV9PDIAPg0fFezzVIIHwjYxuryf wksqYH568um1VSSvhkXW/UEmZSrKpdU= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-496-mT75pktpPX-JWLRokZSLBA-1; Wed, 18 Jan 2023 01:14:24 -0500 X-MC-Unique: mT75pktpPX-JWLRokZSLBA-1 Received: by mail-ej1-f71.google.com with SMTP id dr5-20020a170907720500b00808d17c4f27so22931229ejc.6 for ; Tue, 17 Jan 2023 22:14:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VHl/4diKtyJnEE11WWdgE7GtYAgDLsei1RwmYtZIKRg=; b=vo9GHiHIB/qyOvfzQXqvG+nHtOnjQKbQITdcGBrc/JRaPkf7gwlBHQSZXyG4/cwoKu BwiezMwv0tdfo9JnJnfWTVJwHj0j/FWwrJuYOQMM5I5ercCV8UkyXtCqDXWlbQc9u4V2 FT0fYtwRhtCiH6yTpm6hSIGRyPEuew+3p41C7PcE4NJoLjijamRHdqi+KLoO9yL6AELD L86GfY4z6vSqBOmu/A7mUyzyPWpV4XE6Eu9LQcZGlGEBPjK9otbP+W/+qvIK9brr+1P/ uMYE5+KUojoPk7tf1usJ3GjWggg48I7Q3s5h1OcGZarSx3e940RMergYuZXxDPP6ZuLU royQ== X-Gm-Message-State: AFqh2kq3B6by6RvjMCfXplZsPGioQFLZ6jOVxF1ghZfoi9EpuEKWs2rA pJrjia/COwJf+kHtxySmb1gKAVb4rzRQv+THsKjSlZ5CJeSxp133uIAQS6K4nSIp7bpPXAFfnf+ IlWb/iyG3xX//mzBVDdzOB/M2 X-Received: by 2002:aa7:c1ce:0:b0:49e:89e:3b36 with SMTP id d14-20020aa7c1ce000000b0049e089e3b36mr5877842edp.30.1674022462952; Tue, 17 Jan 2023 22:14:22 -0800 (PST) X-Received: by 2002:aa7:c1ce:0:b0:49e:89e:3b36 with SMTP id d14-20020aa7c1ce000000b0049e089e3b36mr5877825edp.30.1674022462771; Tue, 17 Jan 2023 22:14:22 -0800 (PST) Received: from cassiopeiae.. ([2a02:810d:4b3f:de78:642:1aff:fe31:a19f]) by smtp.gmail.com with ESMTPSA id u2-20020a1709061da200b0083f91a32131sm14105071ejh.0.2023.01.17.22.14.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jan 2023 22:14:22 -0800 (PST) From: Danilo Krummrich To: daniel@ffwll.ch, airlied@redhat.com, christian.koenig@amd.com, bskeggs@redhat.com, jason@jlekstrand.net, tzimmermann@suse.de, mripard@kernel.org, corbet@lwn.net Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Danilo Krummrich Subject: [PATCH drm-next 14/14] drm/nouveau: debugfs: implement DRM GPU VA debugfs Date: Wed, 18 Jan 2023 07:12:56 +0100 Message-Id: <20230118061256.2689-15-dakr@redhat.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230118061256.2689-1-dakr@redhat.com> References: <20230118061256.2689-1-dakr@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Provide the driver indirection iterating over all DRM GPU VA spaces to enable the common 'gpuvas' debugfs file for dumping DRM GPU VA spaces. Signed-off-by: Danilo Krummrich --- drivers/gpu/drm/nouveau/nouveau_debugfs.c | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c index 2a36d1ca8fda..7f6ccc5d1d86 100644 --- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c +++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c @@ -202,6 +202,29 @@ nouveau_debugfs_pstate_open(struct inode *inode, struct file *file) return single_open(file, nouveau_debugfs_pstate_get, inode->i_private); } +static int +nouveau_debugfs_gpuva(struct seq_file *m, void *data) +{ + struct drm_info_node *node = (struct drm_info_node *) m->private; + struct nouveau_drm *drm = nouveau_drm(node->minor->dev); + struct nouveau_cli *cli; + + mutex_lock(&drm->clients_lock); + list_for_each_entry(cli, &drm->clients, head) { + struct nouveau_uvmm *uvmm = nouveau_cli_uvmm(cli); + + if (!uvmm) + continue; + + nouveau_uvmm_lock(uvmm); + drm_debugfs_gpuva_info(m, &uvmm->umgr); + nouveau_uvmm_unlock(uvmm); + } + mutex_unlock(&drm->clients_lock); + + return 0; +} + static const struct file_operations nouveau_pstate_fops = { .owner = THIS_MODULE, .open = nouveau_debugfs_pstate_open, @@ -213,6 +236,7 @@ static const struct file_operations nouveau_pstate_fops = { static struct drm_info_list nouveau_debugfs_list[] = { { "vbios.rom", nouveau_debugfs_vbios_image, 0, NULL }, { "strap_peek", nouveau_debugfs_strap_peek, 0, NULL }, + DRM_DEBUGFS_GPUVA_INFO(nouveau_debugfs_gpuva, NULL), }; #define NOUVEAU_DEBUGFS_ENTRIES ARRAY_SIZE(nouveau_debugfs_list) -- 2.39.0