diff options
author | Kevin Wang | 2018-12-19 09:23:23 +0100 |
---|---|---|
committer | Alex Deucher | 2019-03-19 21:03:56 +0100 |
commit | 5c45103f48d77287b0a641d40c96d284abac8d23 (patch) | |
tree | 614e213fe68e8c451e790d0ceaa3cc0b6d0bce82 /drivers/gpu/drm/amd/powerplay/smu_v11_0.c | |
parent | drm/amd/powerplay: implement smu vega20_message_map for vega20 (diff) | |
download | kernel-qcow2-linux-5c45103f48d77287b0a641d40c96d284abac8d23.tar.gz kernel-qcow2-linux-5c45103f48d77287b0a641d40c96d284abac8d23.tar.xz kernel-qcow2-linux-5c45103f48d77287b0a641d40c96d284abac8d23.zip |
drm/amd/powerplay: use virtual msg index to replace asic-related msg index
Using virtual msg index is able to support all ASIC specific message values on
one smu upper layer.
Signed-off-by: Kevin Wang <Kevin1.Wang@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/smu_v11_0.c')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c index c0ff55f31954..ff1120af04a3 100644 --- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c +++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c @@ -81,13 +81,17 @@ static int smu_v11_0_wait_for_response(struct smu_context *smu) static int smu_v11_0_send_msg(struct smu_context *smu, uint16_t msg) { struct amdgpu_device *adev = smu->adev; - int ret = 0; + int ret = 0, index = 0; + + index = smu_msg_get_index(smu, msg); + if (index < 0) + return index; smu_v11_0_wait_for_response(smu); WREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_90, 0); - smu_v11_0_send_msg_without_waiting(smu, msg); + smu_v11_0_send_msg_without_waiting(smu, (uint16_t)index); ret = smu_v11_0_wait_for_response(smu); @@ -105,7 +109,11 @@ smu_v11_0_send_msg_with_param(struct smu_context *smu, uint16_t msg, { struct amdgpu_device *adev = smu->adev; - int ret = 0; + int ret = 0, index = 0; + + index = smu_msg_get_index(smu, msg); + if (index < 0) + return index; ret = smu_v11_0_wait_for_response(smu); if (ret) @@ -116,7 +124,7 @@ smu_v11_0_send_msg_with_param(struct smu_context *smu, uint16_t msg, WREG32_SOC15(MP1, 0, mmMP1_SMN_C2PMSG_82, param); - smu_v11_0_send_msg_without_waiting(smu, msg); + smu_v11_0_send_msg_without_waiting(smu, (uint16_t)index); ret = smu_v11_0_wait_for_response(smu); if (ret) |