Skip to contentSkip to conversation

drm/amdgpu: handle default profile on GC 9.4.1

PATCH In review Alex Deucher 4 participants 5 messages Oct 18, 2024 – Oct 22, 2024

Subsystems (3)
lore
Share & tools
lore

Alex Deucher

author maintainer
#0 lore raw

PATCH 1/1 drm/amdgpu: handle default profile on GC 9.4.1

It does not support fullscreen 3D.

Fixes 336568de918e ("drm/amdgpu/swsmu: default to fullscreen 3D profile for dGPUs")
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2 -1
index accc96a03bd9..4b816c7e94fe 100644
@@ -1267,7 +1267,8 @@ static int smu_sw_init(struct amdgpu_ip_block *ip_block)
 	smu->workload_prority[PP_SMC_POWER_PROFILE_COMPUTE] = 5;
 	smu->workload_prority[PP_SMC_POWER_PROFILE_CUSTOM] = 6;
 
-	if (smu->is_apu)
+	if (smu->is_apu ||
+	    (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 1)))
 		smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT];
 	else
 		smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_FULLSCREEN3D];
Signature · 1 line
2.46.2
author maintainer
#1 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

Ping?
________________________________
From: Deucher, Alexander <[email protected]>
Sent: Friday, October 18, 2024 3:20 PM
To: [email protected] <[email protected]>
Cc: Deucher, Alexander <[email protected]>
Subject: [PATCH] drm/amdgpu: handle default profile on GC 9.4.1

It does not support fullscreen 3D.

Fixes 336568de918e ("drm/amdgpu/swsmu: default to fullscreen 3D profile for dGPUs")
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2 -1
index accc96a03bd9..4b816c7e94fe 100644
@@ -1267,7 +1267,8 @@ static int smu_sw_init(struct amdgpu_ip_block *ip_block)
         smu->workload_prority[PP_SMC_POWER_PROFILE_COMPUTE] = 5;
         smu->workload_prority[PP_SMC_POWER_PROFILE_CUSTOM] = 6;
 
-       if (smu->is_apu)
+       if (smu->is_apu ||
+           (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 1)))
                 smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT];
         else
                 smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_FULLSCREEN3D];

--
2.46.2

maintainer Reviewed-by Kenneth Feng [email protected]
#2 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

Hi Alex,
I have found another problem with the current code based on the default workload setting to 3D fullscreen. For example, the default workload is set to 3D fullscreen first, but in boot, it's not applied yet. Then a vcn ring test comes in, sets the workload mask to vcn workload + 3D fullscreen. After the setting, Actually the workload mask is updated to vcn workload only. Then after the vcn ring test, the workload doesn't go to 3D fullscreen workload. It goes to bootup workload(PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT).
Let me try to fix it by today and get back to you.
For this patch itself, it's ok.

From: amd-gfx <[email protected]> On Behalf Of Deucher, Alexander
Sent: Tuesday, October 22, 2024 4:35 AM
To: [email protected]
Subject: Re: [PATCH] drm/amdgpu: handle default profile on GC 9.4.1

[AMD Official Use Only - AMD Internal Distribution Only]

Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.

[AMD Official Use Only - AMD Internal Distribution Only]

Ping?
________________________________
From: Deucher, Alexander <[email protected]<mailto:[email protected]>>
Sent: Friday, October 18, 2024 3:20 PM
To: [email protected]<mailto:[email protected]> <[email protected]<mailto:[email protected]>>
Cc: Deucher, Alexander <[email protected]<mailto:[email protected]>>
Subject: [PATCH] drm/amdgpu: handle default profile on GC 9.4.1

It does not support fullscreen 3D.

Fixes 336568de918e ("drm/amdgpu/swsmu: default to fullscreen 3D profile for dGPUs")
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2 -1
index accc96a03bd9..4b816c7e94fe 100644
@@ -1267,7 +1267,8 @@ static int smu_sw_init(struct amdgpu_ip_block *ip_block)
         smu->workload_prority[PP_SMC_POWER_PROFILE_COMPUTE] = 5;
         smu->workload_prority[PP_SMC_POWER_PROFILE_CUSTOM] = 6;
 
-       if (smu->is_apu)
+       if (smu->is_apu ||
+           (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 1)))
                 smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT];
         else
                 smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_FULLSCREEN3D];

--
2.46.2

#3 lore raw

Please double check the COMPUTE profile set by KFD as well.

Thanks,

Alex

Quoted 93 lines · Kenneth

[AMD Official Use Only - AMD Internal Distribution Only]

Hi Alex,

I have found another problem with the current code based on the default workload setting to 3D fullscreen.

For example, the default workload is set to 3D fullscreen first, but in boot, it’s not applied yet.

Then a vcn ring test comes in, sets the workload mask to vcn workload + 3D fullscreen. After the setting,

Actually the workload mask is updated to vcn workload only. Then after the vcn ring test, the workload doesn’t go

to 3D fullscreen workload. It goes to bootup
workload(PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT).

Let me try to fix it by today and get back to you.

For this patch itself, it’s ok.

*From:* amd-gfx <[email protected]> *On Behalf Of *Deucher, Alexander
*Sent:* Tuesday, October 22, 2024 4:35 AM
*To:* [email protected]
*Subject:* Re: [PATCH] drm/amdgpu: handle default profile on GC 9.4.1

[AMD Official Use Only - AMD Internal Distribution Only]

*Caution:* This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.

[AMD Official Use Only - AMD Internal Distribution Only]

Ping?
------------------------------

*From:* Deucher, Alexander <[email protected]> *Sent:* Friday, October 18, 2024 3:20 PM
*To:* [email protected] <[email protected]> *Cc:* Deucher, Alexander <[email protected]> *Subject:* [PATCH] drm/amdgpu: handle default profile on GC 9.4.1

It does not support fullscreen 3D.

Fixes 336568de918e ("drm/amdgpu/swsmu: default to fullscreen 3D profile

for dGPUs")

---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2 -1
index accc96a03bd9..4b816c7e94fe 100644
@@ -1267,7 +1267,8 @@ static int smu_sw_init(struct amdgpu_ip_block
 *ip_block)
         smu->workload_prority[PP_SMC_POWER_PROFILE_COMPUTE] = 5;
         smu->workload_prority[PP_SMC_POWER_PROFILE_CUSTOM] = 6;
 
-       if (smu->is_apu)
+       if (smu->is_apu ||
+           (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 1)))
                 smu->workload_mask = 1 <<
 smu->workload_prority[PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT];
         else
                 smu->workload_mask = 1 <<

smu->workload_prority[PP_SMC_POWER_PROFILE_FULLSCREEN3D]; --
2.46.2

#4 lore raw
In reply to Alex Deucher
Quoted 13 lines · Alex Deucher

It does not support fullscreen 3D.

Fixes 336568de918e ("drm/amdgpu/swsmu: default to fullscreen 3D profile for dGPUs")
---
 drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +0 -0
index accc96a03bd9..4b816c7e94fe 100644

drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c static int smu_sw_init(struct amdgpu_ip_block *ip_block) · line 1272

Quoted 7 lines
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +2 -1
@@ -1267,7 +1267,8 @@ static int smu_sw_init(struct amdgpu_ip_block *ip_block)
 	smu->workload_prority[PP_SMC_POWER_PROFILE_COMPUTE] = 5;
 	smu->workload_prority[PP_SMC_POWER_PROFILE_CUSTOM] = 6;
 
-	if (smu->is_apu)
+	if (smu->is_apu ||
+	    (amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(9, 4, 1)))
 		smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT];

It's better to make this check generic and check against availability of 3D workload profile.

is_workload_profile_available(profile_index)
return smu->workload_map && smu->workload_map[index].valid_mapping .

Thanks,
Lijo

Quoted 2 lines
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +0 -0
 	else
 		smu->workload_mask = 1 << smu->workload_prority[PP_SMC_POWER_PROFILE_FULLSCREEN3D];