dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Liam R. Howlett" <Liam.Howlett@Oracle.com>
To: Danilo Krummrich <dakr@redhat.com>
Cc: matthew.brost@intel.com, willy@infradead.org,
	dri-devel@lists.freedesktop.org, corbet@lwn.net,
	nouveau@lists.freedesktop.org, ogabbay@kernel.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	mripard@kernel.org, linux-mm@kvack.org,
	boris.brezillon@collabora.com, bskeggs@redhat.com,
	tzimmermann@suse.de, bagasdotme@gmail.com,
	christian.koenig@amd.com, jason@jlekstrand.net
Subject: Re: [PATCH drm-next v4 14/14] drm/nouveau: debugfs: implement DRM GPU VA debugfs
Date: Tue, 13 Jun 2023 21:20:57 -0400	[thread overview]
Message-ID: <20230614012057.jhyzdliloui5k7yx@revolver> (raw)
In-Reply-To: <20230606223130.6132-15-dakr@redhat.com>

* Danilo Krummrich <dakr@redhat.com> [230606 18:32]:
> 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 <dakr@redhat.com>
> ---
>  drivers/gpu/drm/nouveau/nouveau_debugfs.c | 39 +++++++++++++++++++++++
>  1 file changed, 39 insertions(+)
> 
> diff --git a/drivers/gpu/drm/nouveau/nouveau_debugfs.c b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
> index 99d022a91afc..053f703f2f68 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_debugfs.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_debugfs.c
> @@ -203,6 +203,44 @@ nouveau_debugfs_pstate_open(struct inode *inode, struct file *file)
>  	return single_open(file, nouveau_debugfs_pstate_get, inode->i_private);
>  }
>  
> +static void
> +nouveau_debugfs_gpuva_regions(struct seq_file *m, struct nouveau_uvmm *uvmm)
> +{
> +	MA_STATE(mas, &uvmm->region_mt, 0, 0);
> +	struct nouveau_uvma_region *reg;
> +
> +	seq_puts  (m, " VA regions  | start              | range              | end                \n");
> +	seq_puts  (m, "----------------------------------------------------------------------------\n");

rcu_read_lock();

> +	mas_for_each(&mas, reg, ULONG_MAX)
> +		seq_printf(m, "             | 0x%016llx | 0x%016llx | 0x%016llx\n",
> +			   reg->va.addr, reg->va.range, reg->va.addr + reg->va.range);

rcu_read_unlock();

> +}
> +
> +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);
> +		seq_puts(m, "\n");
> +		nouveau_debugfs_gpuva_regions(m, uvmm);
> +		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,
> @@ -214,6 +252,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.40.1
> 

  reply	other threads:[~2023-06-14  1:21 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-06 22:31 [PATCH drm-next v4 00/14] [RFC] DRM GPUVA Manager & Nouveau VM_BIND UAPI Danilo Krummrich
2023-06-06 22:31 ` [PATCH drm-next v4 01/14] drm: execution context for GEM buffers v4 Danilo Krummrich
2023-06-06 22:31 ` [PATCH drm-next v4 02/14] maple_tree: split up MA_STATE() macro Danilo Krummrich
2023-06-13 17:25   ` Liam R. Howlett
2023-06-06 22:31 ` [PATCH drm-next v4 03/14] drm: manager to keep track of GPUs VA mappings Danilo Krummrich
2023-06-07  4:36   ` kernel test robot
2023-06-14  0:29   ` Liam R. Howlett
2023-06-15 14:27     ` Danilo Krummrich
2023-06-06 22:31 ` [PATCH drm-next v4 04/14] drm: debugfs: provide infrastructure to dump a DRM GPU VA space Danilo Krummrich
2023-06-06 23:55   ` kernel test robot
2023-06-07 20:19   ` kernel test robot
2023-06-06 22:31 ` [PATCH drm-next v4 05/14] drm/nouveau: new VM_BIND uapi interfaces Danilo Krummrich
2023-06-06 22:31 ` [PATCH drm-next v4 06/14] drm/nouveau: get vmm via nouveau_cli_vmm() Danilo Krummrich
2023-06-06 22:31 ` [PATCH drm-next v4 07/14] drm/nouveau: bo: initialize GEM GPU VA interface Danilo Krummrich
2023-06-06 22:31 ` [PATCH drm-next v4 08/14] drm/nouveau: move usercopy helpers to nouveau_drv.h Danilo Krummrich
2023-06-06 22:31 ` [PATCH drm-next v4 09/14] drm/nouveau: fence: separate fence alloc and emit Danilo Krummrich
2023-06-07 15:42   ` kernel test robot
2023-06-06 22:31 ` [PATCH drm-next v4 10/14] drm/nouveau: fence: fail to emit when fence context is killed Danilo Krummrich
2023-06-06 22:31 ` [PATCH drm-next v4 11/14] drm/nouveau: chan: provide nouveau_channel_kill() Danilo Krummrich
2023-06-06 22:31 ` [PATCH drm-next v4 12/14] drm/nouveau: nvkm/vmm: implement raw ops to manage uvmm Danilo Krummrich
2023-06-07 15:52   ` kernel test robot
2023-06-06 22:31 ` [PATCH drm-next v4 13/14] drm/nouveau: implement new VM_BIND uAPI Danilo Krummrich
2023-06-08 12:53   ` kernel test robot
2023-06-06 22:31 ` [PATCH drm-next v4 14/14] drm/nouveau: debugfs: implement DRM GPU VA debugfs Danilo Krummrich
2023-06-14  1:20   ` Liam R. Howlett [this message]
2023-06-09 11:56 ` [PATCH drm-next v4 00/14] [RFC] DRM GPUVA Manager & Nouveau VM_BIND UAPI Donald Robson
2023-06-13 14:20   ` Danilo Krummrich
2023-06-14  7:58     ` Donald Robson
2023-06-15 16:31       ` Danilo Krummrich
2023-06-15 16:39 ` Danilo Krummrich

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=20230614012057.jhyzdliloui5k7yx@revolver \
    --to=liam.howlett@oracle.com \
    --cc=bagasdotme@gmail.com \
    --cc=boris.brezillon@collabora.com \
    --cc=bskeggs@redhat.com \
    --cc=christian.koenig@amd.com \
    --cc=corbet@lwn.net \
    --cc=dakr@redhat.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jason@jlekstrand.net \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=matthew.brost@intel.com \
    --cc=mripard@kernel.org \
    --cc=nouveau@lists.freedesktop.org \
    --cc=ogabbay@kernel.org \
    --cc=tzimmermann@suse.de \
    --cc=willy@infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).