drm/amdgpu: Fix no-procfs build
Subsystems (2)
PATCH 1/2 drm/amdgpu: Fix no-procfs build
From: Rob Clark <[email protected]>
Fixes undefined symbol when PROC_FS is not enabled.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2 -0
@@ -2795,21 +2795,23 @@ static const struct drm_driver amdgpu_kms_driver = { DRIVER_SYNCOBJ_TIMELINE, .open = amdgpu_driver_open_kms, .postclose = amdgpu_driver_postclose_kms, .lastclose = amdgpu_driver_lastclose_kms, .ioctls = amdgpu_ioctls_kms, .num_ioctls = ARRAY_SIZE(amdgpu_ioctls_kms), .dumb_create = amdgpu_mode_dumb_create, .dumb_map_offset = amdgpu_mode_dumb_mmap, .fops = &amdgpu_driver_kms_fops, .release = &amdgpu_driver_release_kms, +#ifdef CONFIG_PROC_FS .show_fdinfo = amdgpu_show_fdinfo, +#endif .prime_handle_to_fd = drm_gem_prime_handle_to_fd, .prime_fd_to_handle = drm_gem_prime_fd_to_handle, .gem_prime_import = amdgpu_gem_prime_import, .gem_prime_mmap = drm_gem_prime_mmap, .name = DRIVER_NAME, .desc = DRIVER_DESC, .date = DRIVER_DATE, .major = KMS_DRIVER_MAJOR,
Signature · 1 line
2.40.1
PATCH 2/2 drm/amdgpu: Remove duplicate fdinfo fields
From: Rob Clark <[email protected]>
Some of the fields that are handled by drm_show_fdinfo() crept back in when rebasing the patch. Remove them again.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c +0 -3
@@ -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",
Signature · 1 line
2.40.1
Re: [PATCH 2/2] drm/amdgpu: Remove duplicate fdinfo fields
Quoted 8 lines · Rob Clark
From: Rob Clark <[email protected]>
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 <[email protected]>
Series is:
Quoted 35 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c | 3 --- 1 file changed, 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c +0
-4@@ -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
Re: [PATCH 2/2] drm/amdgpu: Remove duplicate fdinfo fields
In reply to Rob ClarkHi Rob,
Quoted 29 lines · Rob Clark
From: Rob Clark <[email protected]>
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 <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c | 3 --- 1 file changed, 3 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c +0
-3@@ -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);
drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c void amdgpu_show_fdinfo(struct drm_printer *p, struct drm_file *file) · line 99
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fdinfo.c +0
-0drm_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
Neil Armstrong
AppliedHi,
Quoted 3 lines · Rob Clark
Fixes undefined symbol when
PROC_FSis not enabled.
Thanks, Applied to https://anongit.freedesktop.org/git/drm/drm-misc.git (drm-misc-next)
[1/2] drm/amdgpu: Fix no-procfs build
https://cgit.freedesktop.org/drm/drm-misc/commit/?id=1a56fcf08ae463a4564d111356091b2bdb6c7bce
[2/2] drm/amdgpu: Remove duplicate fdinfo fields
(no commit info)
Signature · 1 line
Neil