Skip to contentSkip to conversation

drm/amd/amdgpu: shorten the gfx idle worker timeout

PATCH In review Kenneth Feng 3 participants 5 messages Mar 11, 2025

Subsystems (3)
lore
Share & tools
lore

Kenneth Feng

author maintainer
#0 lore raw

PATCH 1/2 drm/amd/amdgpu: shorten the gfx idle worker timeout

Shorten the gfx idle worker timeout. This is to sync with DAL when there is no activity on the screen. Original 1 second can not sync with DAL, so DAL can not apply MALL when the workload type is not bootup default.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h +1 -1
index ddf4533614ba..b7b40edf4a31 100644
@@ -58,7 +58,7 @@ enum amdgpu_gfx_pipe_priority {
 #define AMDGPU_GFX_QUEUE_PRIORITY_MAXIMUM  15
 
 /* 1 second timeout */
-#define GFX_PROFILE_IDLE_TIMEOUT	msecs_to_jiffies(1000)
+#define GFX_PROFILE_IDLE_TIMEOUT	msecs_to_jiffies(10)
 
 enum amdgpu_gfx_partition {
 	AMDGPU_SPX_PARTITION_MODE = 0,
Signature · 1 line
2.34.1
author maintainer
#1 lore raw

PATCH 2/2 drm/amd/pm: prevent skipping the workload setting back to bootup default

This is a bug fix. The scenario is that the same client can add the certain workload type refcount multiple times. Then the same client can not remove this setting when it wants to get back to the default bootup workload.

---
 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 8cfb07549f54..592bf54015c6 100644
@@ -2273,7 +2273,8 @@ static int smu_bump_power_profile_mode(struct smu_context *smu,
 static void smu_power_profile_mode_get(struct smu_context *smu,
 				       enum PP_SMC_POWER_PROFILE profile_mode)
 {
-	smu->workload_refcount[profile_mode]++;
+	if (!smu->workload_refcount[profile_mode])
+		smu->workload_refcount[profile_mode]++;
 }
 
 static void smu_power_profile_mode_put(struct smu_context *smu,
Signature · 1 line
2.34.1
Reviewed-by on v1 2/2
#2 lore raw

RE: [PATCH 2/2] drm/amd/pm: prevent skipping the workload setting back to bootup default

[AMD Official Use Only - AMD Internal Distribution Only]

Please add following information into commit message.

Fixes bd3c9d1cde0c ("drm/amd/pm: fix and simplify workload handling”)

Series is

Best Regards,
Kevin
-----Original Message-----
From: Kenneth Feng <[email protected]>
Sent: Tuesday, March 11, 2025 16:55
To: [email protected]
Cc: Wang, Yang(Kevin) <[email protected]>; Deucher, Alexander <[email protected]>; Feng, Kenneth <[email protected]>
Subject: [PATCH 2/2] drm/amd/pm: prevent skipping the workload setting back to bootup default

This is a bug fix. The scenario is that the same client can add the certain workload type refcount multiple times. Then the same client can not remove this setting when it wants to get back to the default bootup workload.

---
 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 -2
index 8cfb07549f54..592bf54015c6 100644
@@ -2273,7 +2273,8 @@ static int smu_bump_power_profile_mode(struct smu_context *smu,  static void smu_power_profile_mode_get(struct smu_context *smu,
                                       enum PP_SMC_POWER_PROFILE profile_mode)  {
-       smu->workload_refcount[profile_mode]++;
+       if (!smu->workload_refcount[profile_mode])
+               smu->workload_refcount[profile_mode]++;
 }
 
 static void smu_power_profile_mode_put(struct smu_context *smu,
--

2.34.1

#3 lore raw

Re: [PATCH 2/2] drm/amd/pm: prevent skipping the workload setting back to bootup default

In reply to Kenneth Feng
Quoted 4 lines · Kenneth Feng

This is a bug fix. The scenario is that the same client can add the certain workload type refcount multiple times. Then the same client can not remove this setting when it wants to get back to the default bootup workload.

This will break the ref count handling.

Alex

Quoted 23 lines
---
 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 -2
index 8cfb07549f54..592bf54015c6 100644
@@ -2273,7 +2273,8 @@ static int smu_bump_power_profile_mode(struct smu_context *smu,
 static void smu_power_profile_mode_get(struct smu_context *smu,
                                       enum PP_SMC_POWER_PROFILE profile_mode)
 {
-       smu->workload_refcount[profile_mode]++;
+       if (!smu->workload_refcount[profile_mode])
+               smu->workload_refcount[profile_mode]++;
 }
 
 static void smu_power_profile_mode_put(struct smu_context *smu,
--

2.34.1

Reviewed-by on v1 1/2
#4 lore raw
In reply to Kenneth Feng

[AMD Official Use Only - AMD Internal Distribution Only]

Please correct the code comments before committing the patch.

/* 1 second timeout */ 10ms

With that fixed,

Best Regards,
Kevin

-----Original Message-----
From: Kenneth Feng <[email protected]>
Sent: Tuesday, March 11, 2025 16:55
To: [email protected]
Cc: Wang, Yang(Kevin) <[email protected]>; Deucher, Alexander <[email protected]>; Feng, Kenneth <[email protected]>
Subject: [PATCH 1/2] drm/amd/amdgpu: shorten the gfx idle worker timeout

Shorten the gfx idle worker timeout. This is to sync with DAL when there is no activity on the screen. Original 1 second can not sync with DAL, so DAL can not apply MALL when the workload type is not bootup default.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h +1 -2
index ddf4533614ba..b7b40edf4a31 100644
@@ -58,7 +58,7 @@ enum amdgpu_gfx_pipe_priority {  #define AMDGPU_GFX_QUEUE_PRIORITY_MAXIMUM  15
 
 /* 1 second timeout */
-#define GFX_PROFILE_IDLE_TIMEOUT       msecs_to_jiffies(1000)
+#define GFX_PROFILE_IDLE_TIMEOUT       msecs_to_jiffies(10)
 
 enum amdgpu_gfx_partition {
        AMDGPU_SPX_PARTITION_MODE = 0,
--

2.34.1