]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amdgpu: enable hibernate support on Navi1X
authorEvan Quan <evan.quan@amd.com>
Thu, 7 May 2020 10:17:55 +0000 (18:17 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 8 May 2020 18:32:16 +0000 (14:32 -0400)
BACO is needed to support hibernate on Navi1X.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c

index c42b3dccfcb646f889cc285a89c395b7ac6bb3fa..4a03a24348f4346093815def6c6af1dcd51af702 100644 (file)
@@ -958,6 +958,7 @@ struct amdgpu_device {
 
        /* s3/s4 mask */
        bool                            in_suspend;
+       bool                            in_hibernate;
 
        bool                            in_gpu_reset;
        enum pp_mp1_state               mp1_state;
index 719a963c31a2594dd723e69196924bd7f2059eb2..959abd0e38d590c43ababaf8ed68446fae394d3d 100644 (file)
@@ -1191,7 +1191,9 @@ static int amdgpu_pmops_freeze(struct device *dev)
        struct amdgpu_device *adev = drm_dev->dev_private;
        int r;
 
+       adev->in_hibernate = true;
        r = amdgpu_device_suspend(drm_dev, true);
+       adev->in_hibernate = false;
        if (r)
                return r;
        return amdgpu_asic_reset(adev);
index 607ff0270aeea0b1952618cc7b4ea09efa0bb927..de14542de77596ef2b85f5a057690ebabc98822b 100644 (file)
@@ -1498,7 +1498,7 @@ static int smu_disable_dpm(struct smu_context *smu)
        bool use_baco = !smu->is_apu &&
                ((adev->in_gpu_reset &&
                  (amdgpu_asic_reset_method(adev) == AMD_RESET_METHOD_BACO)) ||
-                (adev->in_runpm && amdgpu_asic_supports_baco(adev)));
+                ((adev->in_runpm || adev->in_hibernate) && amdgpu_asic_supports_baco(adev)));
 
        ret = smu_get_smc_version(smu, NULL, &smu_version);
        if (ret) {