diff options
author | Evan Quan <evan.quan@amd.com> | 2020-05-08 17:55:42 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2020-05-14 16:42:44 -0400 |
commit | cd598d6cfd217f18e53f6c26b2397692666eb3a4 (patch) | |
tree | 6b00f4a3160e1b4ece0d63f11f31a11cd13a39da /drivers/gpu | |
parent | e528ccf9320c3634395e39d467bb6daed3bec4e8 (diff) |
drm/amd/powerplay: report correct AC/DC event based on ctxid V2
'ctxid' is used to distinguish different events raised from SMC.
0x3 and 0x4 are for AC and DC power mode.
V2: update the way to retrieve the ctxid and change the log level
to debug
Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c index 3979973680ec..3391d1c4bbbe 100644 --- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c +++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c @@ -1556,6 +1556,11 @@ static int smu_v11_0_irq_process(struct amdgpu_device *adev, { uint32_t client_id = entry->client_id; uint32_t src_id = entry->src_id; + /* + * ctxid is used to distinguish different + * events for SMCToHost interrupt. + */ + uint32_t ctxid = entry->src_data[0]; if (client_id == SOC15_IH_CLIENTID_THM) { switch (src_id) { @@ -1596,8 +1601,18 @@ static int smu_v11_0_irq_process(struct amdgpu_device *adev, dev_emerg(adev->dev, "System is going to shutdown due to HW CTF!\n"); orderly_poweroff(true); } else if (client_id == SOC15_IH_CLIENTID_MP1) { - if (src_id == 0xfe) - smu_v11_0_ack_ac_dc_interrupt(&adev->smu); + if (src_id == 0xfe) { + switch (ctxid) { + case 0x3: + dev_dbg(adev->dev, "Switched to AC mode!\n"); + smu_v11_0_ack_ac_dc_interrupt(&adev->smu); + break; + case 0x4: + dev_dbg(adev->dev, "Switched to DC mode!\n"); + smu_v11_0_ack_ac_dc_interrupt(&adev->smu); + break; + } + } } return 0; |