[PATCH 2/2] drm/amdgpu: add drm-client-id to fdinfo
Tvrtko Ursulin
tvrtko.ursulin at linux.intel.com
Wed May 11 08:05:27 UTC 2022
On 10/05/2022 17:55, Christian König wrote:
> This is enough to get gputop working :)
Super cool! So I guess it's time for me to cleanup that code base a bit.
Regards,
Tvrtko
> Signed-off-by: Christian König <christian.koenig at amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
> index 38cb5eb105ad..4ef23224b617 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
> @@ -55,17 +55,15 @@ static const char *amdgpu_ip_name[AMDGPU_HW_IP_NUM] = {
>
> void amdgpu_show_fdinfo(struct seq_file *m, struct file *f)
> {
> - struct amdgpu_fpriv *fpriv;
> uint64_t vram_mem = 0, gtt_mem = 0, cpu_mem = 0;
> struct drm_file *file = f->private_data;
> struct amdgpu_device *adev = drm_to_adev(file->minor->dev);
> + struct amdgpu_fpriv *fpriv = file->driver_priv;
> + struct amdgpu_vm *vm = &fpriv->vm;
> uint32_t bus, dev, fn, domain, hw_ip;
> struct amdgpu_bo *root;
> int ret;
>
> - ret = amdgpu_file_to_fpriv(f, &fpriv);
> - if (ret)
> - return;
> bus = adev->pdev->bus->number;
> domain = pci_domain_nr(adev->pdev->bus);
> dev = PCI_SLOT(adev->pdev->devfn);
> @@ -93,6 +91,7 @@ void amdgpu_show_fdinfo(struct seq_file *m, struct file *f)
> seq_printf(m, "drm-driver:\t%s\n", file->minor->dev->driver->name);
> seq_printf(m, "drm-pdev:\t%04x:%02x:%02x.%d\npasid:\t%u\n", domain, bus,
> dev, fn, fpriv->vm.pasid);
> + seq_printf(m, "drm-client-id:\t%Lu\n", vm->immediate.fence_context);
> seq_printf(m, "drm-memory-vram:\t%llu KiB\n", vram_mem/1024UL);
> seq_printf(m, "drm-memory-gtt:\t%llu KiB\n", gtt_mem/1024UL);
> seq_printf(m, "drm-memory-cpu:\t%llu KiB\n", cpu_mem/1024UL);
More information about the amd-gfx
mailing list