Skip to content

Commit 5cccf10

Browse files
committed
drm/amdgpu: disable workload profile switching when OD is enabled
Users have reported that they have to reduce the level of undervolting to acheive stability when dynamic workload profiles are enabled on GC 10.3.x. Disable dynamic workload profiles if the user has enabled OD. Fixes: b946798 ("drm/amdgpu: add dynamic workload profile switching for gfx10") Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4262 Reviewed-by: Kenneth Feng <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected] # 6.15.x
1 parent d26625d commit 5cccf10

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2228,6 +2228,9 @@ void amdgpu_gfx_profile_ring_begin_use(struct amdgpu_ring *ring)
22282228
enum PP_SMC_POWER_PROFILE profile;
22292229
int r;
22302230

2231+
if (amdgpu_dpm_is_overdrive_enabled(adev))
2232+
return;
2233+
22312234
if (adev->gfx.num_gfx_rings)
22322235
profile = PP_SMC_POWER_PROFILE_FULLSCREEN3D;
22332236
else
@@ -2258,6 +2261,11 @@ void amdgpu_gfx_profile_ring_begin_use(struct amdgpu_ring *ring)
22582261

22592262
void amdgpu_gfx_profile_ring_end_use(struct amdgpu_ring *ring)
22602263
{
2264+
struct amdgpu_device *adev = ring->adev;
2265+
2266+
if (amdgpu_dpm_is_overdrive_enabled(adev))
2267+
return;
2268+
22612269
atomic_dec(&ring->adev->gfx.total_submission_cnt);
22622270

22632271
schedule_delayed_work(&ring->adev->gfx.idle_work, GFX_PROFILE_IDLE_TIMEOUT);

drivers/gpu/drm/amd/pm/amdgpu_dpm.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,6 +1697,28 @@ int amdgpu_dpm_is_overdrive_supported(struct amdgpu_device *adev)
16971697
}
16981698
}
16991699

1700+
int amdgpu_dpm_is_overdrive_enabled(struct amdgpu_device *adev)
1701+
{
1702+
if (is_support_sw_smu(adev)) {
1703+
struct smu_context *smu = adev->powerplay.pp_handle;
1704+
1705+
return smu->od_enabled;
1706+
} else {
1707+
struct pp_hwmgr *hwmgr;
1708+
1709+
/*
1710+
* dpm on some legacy asics don't carry od_enabled member
1711+
* as its pp_handle is casted directly from adev.
1712+
*/
1713+
if (amdgpu_dpm_is_legacy_dpm(adev))
1714+
return false;
1715+
1716+
hwmgr = (struct pp_hwmgr *)adev->powerplay.pp_handle;
1717+
1718+
return hwmgr->od_enabled;
1719+
}
1720+
}
1721+
17001722
int amdgpu_dpm_set_pp_table(struct amdgpu_device *adev,
17011723
const char *buf,
17021724
size_t size)

drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,7 @@ int amdgpu_dpm_get_smu_prv_buf_details(struct amdgpu_device *adev,
563563
void **addr,
564564
size_t *size);
565565
int amdgpu_dpm_is_overdrive_supported(struct amdgpu_device *adev);
566+
int amdgpu_dpm_is_overdrive_enabled(struct amdgpu_device *adev);
566567
int amdgpu_dpm_set_pp_table(struct amdgpu_device *adev,
567568
const char *buf,
568569
size_t size);

0 commit comments

Comments
 (0)