* [PATCH] drm/amd/amdgpu: Add APU flag and asic_type to gca_config debugfs data
@ 2022-02-15 15:28 Tom St Denis
2022-02-15 22:34 ` Alex Deucher
0 siblings, 1 reply; 2+ messages in thread
From: Tom St Denis @ 2022-02-15 15:28 UTC (permalink / raw)
To: amd-gfx; +Cc: Tom St Denis
Needed by umr to detect if ip discovered ASIC is an APU or not.
Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
index 4b950de9bf66..3b2341610c16 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
@@ -728,7 +728,7 @@ static ssize_t amdgpu_debugfs_gca_config_read(struct file *f, char __user *buf,
return -ENOMEM;
/* version, increment each time something is added */
- config[no_regs++] = 3;
+ config[no_regs++] = 4;
config[no_regs++] = adev->gfx.config.max_shader_engines;
config[no_regs++] = adev->gfx.config.max_tile_pipes;
config[no_regs++] = adev->gfx.config.max_cu_per_sh;
@@ -768,6 +768,11 @@ static ssize_t amdgpu_debugfs_gca_config_read(struct file *f, char __user *buf,
config[no_regs++] = adev->pdev->subsystem_device;
config[no_regs++] = adev->pdev->subsystem_vendor;
+ /* rev==4 asic_type and APU flag */
+ config[no_regs++] = adev->flags & 0xFF;
+ config[no_regs++] = (adev->flags >> 8) & 0xFF;
+ config[no_regs++] = adev->flags & AMD_IS_APU ? 1 : 0;
+
while (size && (*pos < no_regs * 4)) {
uint32_t value;
--
2.32.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/amd/amdgpu: Add APU flag and asic_type to gca_config debugfs data
2022-02-15 15:28 [PATCH] drm/amd/amdgpu: Add APU flag and asic_type to gca_config debugfs data Tom St Denis
@ 2022-02-15 22:34 ` Alex Deucher
0 siblings, 0 replies; 2+ messages in thread
From: Alex Deucher @ 2022-02-15 22:34 UTC (permalink / raw)
To: Tom St Denis; +Cc: amd-gfx list
On Tue, Feb 15, 2022 at 10:29 AM Tom St Denis <tom.stdenis@amd.com> wrote:
>
> Needed by umr to detect if ip discovered ASIC is an APU or not.
>
> Signed-off-by: Tom St Denis <tom.stdenis@amd.com>
I'm not sure we want to expose the asic_type outside of the driver as
we may theoretically change the ordering in the kernel and then
userspace would need to be aware of this. We already expose the
asic_family and external revision id which encodes basically the same
information.
Alex
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> index 4b950de9bf66..3b2341610c16 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> @@ -728,7 +728,7 @@ static ssize_t amdgpu_debugfs_gca_config_read(struct file *f, char __user *buf,
> return -ENOMEM;
>
> /* version, increment each time something is added */
> - config[no_regs++] = 3;
> + config[no_regs++] = 4;
> config[no_regs++] = adev->gfx.config.max_shader_engines;
> config[no_regs++] = adev->gfx.config.max_tile_pipes;
> config[no_regs++] = adev->gfx.config.max_cu_per_sh;
> @@ -768,6 +768,11 @@ static ssize_t amdgpu_debugfs_gca_config_read(struct file *f, char __user *buf,
> config[no_regs++] = adev->pdev->subsystem_device;
> config[no_regs++] = adev->pdev->subsystem_vendor;
>
> + /* rev==4 asic_type and APU flag */
> + config[no_regs++] = adev->flags & 0xFF;
> + config[no_regs++] = (adev->flags >> 8) & 0xFF;
> + config[no_regs++] = adev->flags & AMD_IS_APU ? 1 : 0;
> +
> while (size && (*pos < no_regs * 4)) {
> uint32_t value;
>
> --
> 2.32.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-15 22:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-15 15:28 [PATCH] drm/amd/amdgpu: Add APU flag and asic_type to gca_config debugfs data Tom St Denis
2022-02-15 22:34 ` Alex Deucher
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.