Skip to contentSkip to conversation

drm/amd/amdgpu: Add APU flag to gca_config debugfs data (v2)

PATCH In review Tom St Denis 2 participants 3 messages Feb 15, 2022 – Feb 17, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/amdgpu: Add APU flag to gca_config debugfs data (v2)

Needed by umr to detect if ip discovered ASIC is an APU or not.

(v2): Remove asic type from packet it's not strictly needed

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +4 -1
index 4b950de9bf66..8f0ca71862b1 100644
@@ -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,9 @@ 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 & AMD_IS_APU ? 1 : 0;
+
 	while (size && (*pos < no_regs * 4)) {
 		uint32_t value;
 
Signature · 1 line
2.32.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 24 lines · Tom St Denis

Needed by umr to detect if ip discovered ASIC is an APU or not.

(v2): Remove asic type from packet it's not strictly needed

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +1 -1
index 4b950de9bf66..8f0ca71862b1 100644
@@ -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;

drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c static ssize_t amdgpu_debugfs_gca_config_read(struct file *f, char __user *buf, · line 771

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +1 -0
@@ -768,6 +768,9 @@ 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 */

Fix the comment here. Also, we already expose the APU flag as AMDGPU_IDS_FLAGS_FUSION via the AMDGPU_INFO_DEV_INFO query to the INFO ioctl. If you already use that, you should already have this. If not, with the comment fixed:

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +2 -1
+       config[no_regs++] = adev->flags & AMD_IS_APU ? 1 : 0;
+
        while (size && (*pos < no_regs * 4)) {
                uint32_t value;
 
--

2.32.0

author Reviewed-by Alex Deucher
#2 lore raw

[AMD Official Use Only]

umr uses the config debugfs during init anyways so adding apu status here instead of fetching it out of DRM makes sense (for umr).

I'll send a v3.

Tom

________________________________________
From: Alex Deucher <[email protected]>
Sent: Wednesday, February 16, 2022 09:36
To: StDenis, Tom
Cc: amd-gfx list
Subject: Re: [PATCH] drm/amd/amdgpu: Add APU flag to gca_config debugfs data (v2)

Quoted 24 lines · Tom St Denis

Needed by umr to detect if ip discovered ASIC is an APU or not.

(v2): Remove asic type from packet it's not strictly needed

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +1 -1
index 4b950de9bf66..8f0ca71862b1 100644
@@ -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;

drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c static ssize_t amdgpu_debugfs_gca_config_read(struct file *f, char __user *buf, · line 771

Quoted 4 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +1 -0
@@ -768,6 +768,9 @@ 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 */

Fix the comment here. Also, we already expose the APU flag as AMDGPU_IDS_FLAGS_FUSION via the AMDGPU_INFO_DEV_INFO query to the INFO ioctl. If you already use that, you should already have this. If not, with the comment fixed:

Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +2 -1
+       config[no_regs++] = adev->flags & AMD_IS_APU ? 1 : 0;
+
        while (size && (*pos < no_regs * 4)) {
                uint32_t value;
 
--

2.32.0