From: Kenneth Feng Date: Mon, 11 Mar 2024 06:11:39 +0000 (+0800) Subject: drm/amd/amdgpu: enable gfxoff on gc 12.0.1 X-Git-Tag: io_uring-6.11-20240722~49^2~25^2~384 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=dd8707295d55bfe044b5c145f7060cc1a91b7157;p=linux-2.6-block.git drm/amd/amdgpu: enable gfxoff on gc 12.0.1 Enable gfxoff on gc 12.0.1 Signed-off-by: Kenneth Feng Reviewed-by: Jack Gui Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c index 3c555f78d4da..b53ca25012e6 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c @@ -3606,7 +3606,19 @@ static void gfx_v12_cntl_pg(struct amdgpu_device *adev, bool enable) static int gfx_v12_0_set_powergating_state(void *handle, enum amd_powergating_state state) { - /* TODO */ + struct amdgpu_device *adev = (struct amdgpu_device *)handle; + bool enable = (state == AMD_PG_STATE_GATE); + + if (amdgpu_sriov_vf(adev)) + return 0; + + switch (amdgpu_ip_version(adev, GC_HWIP, 0)) { + case IP_VERSION(12, 0, 1): + amdgpu_gfx_off_ctrl(adev, enable); + break; + default: + break; + } return 0; } diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c index 68b9bf822e8d..fe6834f1648b 100644 --- a/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c +++ b/drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c @@ -758,6 +758,7 @@ int smu_v14_0_gfx_off_control(struct smu_context *smu, bool enable) case IP_VERSION(14, 0, 0): case IP_VERSION(14, 0, 1): case IP_VERSION(14, 0, 2): + case IP_VERSION(14, 0, 3): if (!(adev->pm.pp_feature & PP_GFXOFF_MASK)) return 0; if (enable)