Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: b9467983b774 ("drm/amdgpu: add dynamic workload profile switching for gfx10")
Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4262
Reviewed-by: Kenneth Feng <kenneth.feng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org # 6.15.x

+31
+8
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
··· 2228 2228 enum PP_SMC_POWER_PROFILE profile; 2229 2229 int r; 2230 2230 2231 + if (amdgpu_dpm_is_overdrive_enabled(adev)) 2232 + return; 2233 + 2231 2234 if (adev->gfx.num_gfx_rings) 2232 2235 profile = PP_SMC_POWER_PROFILE_FULLSCREEN3D; 2233 2236 else ··· 2261 2258 2262 2259 void amdgpu_gfx_profile_ring_end_use(struct amdgpu_ring *ring) 2263 2260 { 2261 + struct amdgpu_device *adev = ring->adev; 2262 + 2263 + if (amdgpu_dpm_is_overdrive_enabled(adev)) 2264 + return; 2265 + 2264 2266 atomic_dec(&ring->adev->gfx.total_submission_cnt); 2265 2267 2266 2268 schedule_delayed_work(&ring->adev->gfx.idle_work, GFX_PROFILE_IDLE_TIMEOUT);
+22
drivers/gpu/drm/amd/pm/amdgpu_dpm.c
··· 1697 1697 } 1698 1698 } 1699 1699 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 + 1700 1722 int amdgpu_dpm_set_pp_table(struct amdgpu_device *adev, 1701 1723 const char *buf, 1702 1724 size_t size)
+1
drivers/gpu/drm/amd/pm/inc/amdgpu_dpm.h
··· 563 563 void **addr, 564 564 size_t *size); 565 565 int amdgpu_dpm_is_overdrive_supported(struct amdgpu_device *adev); 566 + int amdgpu_dpm_is_overdrive_enabled(struct amdgpu_device *adev); 566 567 int amdgpu_dpm_set_pp_table(struct amdgpu_device *adev, 567 568 const char *buf, 568 569 size_t size);