diff options
author | Christian König <christian.koenig@amd.com> | 2022-05-10 18:29:35 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2022-05-26 14:56:34 -0400 |
commit | 9bdc1992c925a35c6f7200e8abe54e3f00ce7719 (patch) | |
tree | fcabbfa83ed72d1f29e241a8954c67cd9d7ad890 /drivers/gpu/drm | |
parent | af0b541670090e87996e0894bd0e457edf617541 (diff) | |
download | linux-9bdc1992c925a35c6f7200e8abe54e3f00ce7719.tar.bz2 |
drm/amdgpu: add drm-client-id to fdinfo v2
This is enough to get gputop working :)
v2: rebase and some addition cleanup
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Shashank Sharma <shashank.sharma@amd.com> (v1)
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c index 4d453845235c..99a7855ab1bc 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c @@ -58,11 +58,11 @@ void amdgpu_show_fdinfo(struct seq_file *m, struct file *f) 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; uint64_t vram_mem = 0, gtt_mem = 0, cpu_mem = 0; ktime_t usage[AMDGPU_HW_IP_NUM]; uint32_t bus, dev, fn, domain; - struct amdgpu_bo *root; unsigned int hw_ip; int ret; @@ -71,14 +71,12 @@ void amdgpu_show_fdinfo(struct seq_file *m, struct file *f) dev = PCI_SLOT(adev->pdev->devfn); fn = PCI_FUNC(adev->pdev->devfn); - root = fpriv->vm.root.bo; - ret = amdgpu_bo_reserve(root, false); - if (ret) { - DRM_ERROR("Fail to reserve bo\n"); + ret = amdgpu_bo_reserve(vm->root.bo, false); + if (ret) return; - } - amdgpu_vm_get_memory(&fpriv->vm, &vram_mem, >t_mem, &cpu_mem); - amdgpu_bo_unreserve(root); + + amdgpu_vm_get_memory(vm, &vram_mem, >t_mem, &cpu_mem); + amdgpu_bo_unreserve(vm->root.bo); amdgpu_ctx_mgr_usage(&fpriv->ctx_mgr, usage); @@ -91,6 +89,7 @@ void amdgpu_show_fdinfo(struct seq_file *m, struct file *f) seq_printf(m, "pasid:\t%u\n", fpriv->vm.pasid); seq_printf(m, "drm-driver:\t%s\n", file->minor->dev->driver->name); seq_printf(m, "drm-pdev:\t%04x:%02x:%02x.%d\n", domain, bus, dev, fn); + 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); |