[2/2] drm/amdgpu: Remove duplicate fdinfo fields

Message ID 20230525155227.560094-2-robdclark@gmail.com
State New
Headers
Series [1/2] drm/amdgpu: Fix no-procfs build |

Commit Message

Rob Clark May 25, 2023, 3:52 p.m. UTC
  From: Rob Clark <robdclark@chromium.org>

Some of the fields that are handled by drm_show_fdinfo() crept back in
when rebasing the patch.  Remove them again.

Fixes: 376c25f8ca47 ("drm/amdgpu: Switch to fdinfo helper")
Signed-off-by: Rob Clark <robdclark@chromium.org>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c | 3 ---
 1 file changed, 3 deletions(-)
  

Comments

Alex Deucher May 25, 2023, 8:28 p.m. UTC | #1
On Thu, May 25, 2023 at 11:52 AM Rob Clark <robdclark@gmail.com> wrote:
>
> From: Rob Clark <robdclark@chromium.org>
>
> Some of the fields that are handled by drm_show_fdinfo() crept back in
> when rebasing the patch.  Remove them again.
>
> Fixes: 376c25f8ca47 ("drm/amdgpu: Switch to fdinfo helper")
> Signed-off-by: Rob Clark <robdclark@chromium.org>

Series is:
Reviewed-by: <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
> index 13d7413d4ca3..a93e5627901a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
> @@ -80,23 +80,20 @@ void amdgpu_show_fdinfo(struct drm_printer *p, struct drm_file *file)
>
>         amdgpu_ctx_mgr_usage(&fpriv->ctx_mgr, usage);
>
>         /*
>          * ******************************************************************
>          * For text output format description please see drm-usage-stats.rst!
>          * ******************************************************************
>          */
>
>         drm_printf(p, "pasid:\t%u\n", fpriv->vm.pasid);
> -       drm_printf(p, "drm-driver:\t%s\n", file->minor->dev->driver->name);
> -       drm_printf(p, "drm-pdev:\t%04x:%02x:%02x.%d\n", domain, bus, dev, fn);
> -       drm_printf(p, "drm-client-id:\t%Lu\n", vm->immediate.fence_context);
>         drm_printf(p, "drm-memory-vram:\t%llu KiB\n", stats.vram/1024UL);
>         drm_printf(p, "drm-memory-gtt: \t%llu KiB\n", stats.gtt/1024UL);
>         drm_printf(p, "drm-memory-cpu: \t%llu KiB\n", stats.cpu/1024UL);
>         drm_printf(p, "amd-memory-visible-vram:\t%llu KiB\n",
>                    stats.visible_vram/1024UL);
>         drm_printf(p, "amd-evicted-vram:\t%llu KiB\n",
>                    stats.evicted_vram/1024UL);
>         drm_printf(p, "amd-evicted-visible-vram:\t%llu KiB\n",
>                    stats.evicted_visible_vram/1024UL);
>         drm_printf(p, "amd-requested-vram:\t%llu KiB\n",
> --
> 2.40.1
>
  
Neil Armstrong May 26, 2023, 7:17 a.m. UTC | #2
Hi Rob,

On 25/05/2023 17:52, Rob Clark wrote:
> From: Rob Clark <robdclark@chromium.org>
> 
> Some of the fields that are handled by drm_show_fdinfo() crept back in
> when rebasing the patch.  Remove them again.
> 
> Fixes: 376c25f8ca47 ("drm/amdgpu: Switch to fdinfo helper")
> Signed-off-by: Rob Clark <robdclark@chromium.org>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c | 3 ---
>   1 file changed, 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
> index 13d7413d4ca3..a93e5627901a 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
> @@ -80,23 +80,20 @@ void amdgpu_show_fdinfo(struct drm_printer *p, struct drm_file *file)
>   
>   	amdgpu_ctx_mgr_usage(&fpriv->ctx_mgr, usage);
>   
>   	/*
>   	 * ******************************************************************
>   	 * For text output format description please see drm-usage-stats.rst!
>   	 * ******************************************************************
>   	 */
>   
>   	drm_printf(p, "pasid:\t%u\n", fpriv->vm.pasid);
> -	drm_printf(p, "drm-driver:\t%s\n", file->minor->dev->driver->name);
> -	drm_printf(p, "drm-pdev:\t%04x:%02x:%02x.%d\n", domain, bus, dev, fn);
> -	drm_printf(p, "drm-client-id:\t%Lu\n", vm->immediate.fence_context);
>   	drm_printf(p, "drm-memory-vram:\t%llu KiB\n", stats.vram/1024UL);
>   	drm_printf(p, "drm-memory-gtt: \t%llu KiB\n", stats.gtt/1024UL);
>   	drm_printf(p, "drm-memory-cpu: \t%llu KiB\n", stats.cpu/1024UL);
>   	drm_printf(p, "amd-memory-visible-vram:\t%llu KiB\n",
>   		   stats.visible_vram/1024UL);
>   	drm_printf(p, "amd-evicted-vram:\t%llu KiB\n",
>   		   stats.evicted_vram/1024UL);
>   	drm_printf(p, "amd-evicted-visible-vram:\t%llu KiB\n",
>   		   stats.evicted_visible_vram/1024UL);
>   	drm_printf(p, "amd-requested-vram:\t%llu KiB\n",

I got:
drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c: In function ‘amdgpu_show_fdinfo’:
drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c:64:32: error: variable ‘domain’ set but not used [-Werror=unused-but-set-variable]
    64 |         uint32_t bus, dev, fn, domain;
       |                                ^~~~~~
drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c:64:28: error: variable ‘fn’ set but not used [-Werror=unused-but-set-variable]
    64 |         uint32_t bus, dev, fn, domain;
       |                            ^~
drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c:64:23: error: variable ‘dev’ set but not used [-Werror=unused-but-set-variable]
    64 |         uint32_t bus, dev, fn, domain;
       |                       ^~~
drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c:64:18: error: variable ‘bus’ set but not used [-Werror=unused-but-set-variable]
    64 |         uint32_t bus, dev, fn, domain;

after applying patch 2, can you fix it ? Seems you can keep the drm-pdev print line

I applied patch 1

Thanks,
Neil
  

Patch

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
index 13d7413d4ca3..a93e5627901a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c
@@ -80,23 +80,20 @@  void amdgpu_show_fdinfo(struct drm_printer *p, struct drm_file *file)
 
 	amdgpu_ctx_mgr_usage(&fpriv->ctx_mgr, usage);
 
 	/*
 	 * ******************************************************************
 	 * For text output format description please see drm-usage-stats.rst!
 	 * ******************************************************************
 	 */
 
 	drm_printf(p, "pasid:\t%u\n", fpriv->vm.pasid);
-	drm_printf(p, "drm-driver:\t%s\n", file->minor->dev->driver->name);
-	drm_printf(p, "drm-pdev:\t%04x:%02x:%02x.%d\n", domain, bus, dev, fn);
-	drm_printf(p, "drm-client-id:\t%Lu\n", vm->immediate.fence_context);
 	drm_printf(p, "drm-memory-vram:\t%llu KiB\n", stats.vram/1024UL);
 	drm_printf(p, "drm-memory-gtt: \t%llu KiB\n", stats.gtt/1024UL);
 	drm_printf(p, "drm-memory-cpu: \t%llu KiB\n", stats.cpu/1024UL);
 	drm_printf(p, "amd-memory-visible-vram:\t%llu KiB\n",
 		   stats.visible_vram/1024UL);
 	drm_printf(p, "amd-evicted-vram:\t%llu KiB\n",
 		   stats.evicted_vram/1024UL);
 	drm_printf(p, "amd-evicted-visible-vram:\t%llu KiB\n",
 		   stats.evicted_visible_vram/1024UL);
 	drm_printf(p, "amd-requested-vram:\t%llu KiB\n",