drm/amd/amdgpu: power up sdma engine when S3 resume back
authorPrike Liang <Prike.Liang@amd.com>
Wed, 11 Sep 2019 05:15:17 +0000 (13:15 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 17 Sep 2019 19:37:58 +0000 (14:37 -0500)
The sdma_v4 should be ungated when the IP resume back,
otherwise it will hang up and resume time out error.

Signed-off-by: Prike Liang <Prike.Liang@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.c
drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c

index 61bd10310604c5296741f359906c74c94e114d1c..5803fcbae22f72ffc7be0479b900cf7894d90816 100644 (file)
@@ -948,6 +948,7 @@ int amdgpu_dpm_set_powergating_by_smu(struct amdgpu_device *adev, uint32_t block
        case AMD_IP_BLOCK_TYPE_UVD:
        case AMD_IP_BLOCK_TYPE_VCN:
        case AMD_IP_BLOCK_TYPE_VCE:
+       case AMD_IP_BLOCK_TYPE_SDMA:
                if (swsmu)
                        ret = smu_dpm_set_power_gate(&adev->smu, block_type, gate);
                else
@@ -956,7 +957,6 @@ int amdgpu_dpm_set_powergating_by_smu(struct amdgpu_device *adev, uint32_t block
                break;
        case AMD_IP_BLOCK_TYPE_GMC:
        case AMD_IP_BLOCK_TYPE_ACP:
-       case AMD_IP_BLOCK_TYPE_SDMA:
                ret = ((adev)->powerplay.pp_funcs->set_powergating_by_smu(
                                (adev)->powerplay.pp_handle, block_type, gate));
                break;
index ff18b3a57892c648ea54d56fb25809653af972da..78452cf0115df0dc5ad41d93a167c3c83b40db8c 100644 (file)
@@ -1889,8 +1889,9 @@ static int sdma_v4_0_hw_init(void *handle)
        int r;
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
 
-       if (adev->asic_type == CHIP_RAVEN && adev->powerplay.pp_funcs &&
-                       adev->powerplay.pp_funcs->set_powergating_by_smu)
+       if ((adev->asic_type == CHIP_RAVEN && adev->powerplay.pp_funcs &&
+                       adev->powerplay.pp_funcs->set_powergating_by_smu) ||
+                       adev->asic_type == CHIP_RENOIR)
                amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_SDMA, false);
 
        if (!amdgpu_sriov_vf(adev))
@@ -1917,8 +1918,9 @@ static int sdma_v4_0_hw_fini(void *handle)
        sdma_v4_0_ctx_switch_enable(adev, false);
        sdma_v4_0_enable(adev, false);
 
-       if (adev->asic_type == CHIP_RAVEN && adev->powerplay.pp_funcs
-                       && adev->powerplay.pp_funcs->set_powergating_by_smu)
+       if ((adev->asic_type == CHIP_RAVEN && adev->powerplay.pp_funcs
+                       && adev->powerplay.pp_funcs->set_powergating_by_smu) ||
+                       adev->asic_type == CHIP_RENOIR)
                amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_SDMA, true);
 
        return 0;
index 22f3c60d380f3b76bf224239f75704d94cacbf62..33960fb38a5d7324f2637ff435adfa37d48c2bc0 100644 (file)
@@ -354,6 +354,9 @@ int smu_dpm_set_power_gate(struct smu_context *smu, uint32_t block_type,
        case AMD_IP_BLOCK_TYPE_GFX:
                ret = smu_gfx_off_control(smu, gate);
                break;
+       case AMD_IP_BLOCK_TYPE_SDMA:
+               ret = smu_powergate_sdma(smu, gate);
+               break;
        default:
                break;
        }