diff options
author | Kenneth Feng <kenneth.feng@amd.com> | 2024-03-11 14:11:39 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2024-05-02 16:18:15 -0400 |
commit | dd8707295d55bfe044b5c145f7060cc1a91b7157 (patch) | |
tree | a2d93c640f05e19c03071c5b7c1a12159f43377f /drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | |
parent | b9f5d0f9788968739fad3404dc0dad45716d67f7 (diff) |
drm/amd/amdgpu: enable gfxoff on gc 12.0.1
Enable gfxoff on gc 12.0.1
Signed-off-by: Kenneth Feng <kenneth.feng@amd.com>
Reviewed-by: Jack Gui <Jack.Gui@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c | 14 |
1 files changed, 13 insertions, 1 deletions
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; } |