]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/amd/powerplay: add control gfxoff enabling in late init
authorHuang Rui <ray.huang@amd.com>
Tue, 13 Mar 2018 10:32:39 +0000 (18:32 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 15 May 2018 18:43:41 +0000 (13:43 -0500)
Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/amd_powerplay.c

index 246f8e9e94512012e69ca2a8e335aac2013acce3..b493369e6d0f9daac4bf28777b6461917937eac9 100644 (file)
@@ -180,6 +180,7 @@ static int pp_late_init(void *handle)
 {
        struct amdgpu_device *adev = handle;
        struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;
+       int ret;
 
        if (hwmgr && hwmgr->pm_en) {
                mutex_lock(&hwmgr->smu_lock);
@@ -189,6 +190,14 @@ static int pp_late_init(void *handle)
        }
        if (adev->pm.smu_prv_buffer_size != 0)
                pp_reserve_vram_for_smu(adev);
+
+       if (hwmgr->hwmgr_func->gfx_off_control &&
+           (hwmgr->feature_mask & PP_GFXOFF_MASK)) {
+               ret = hwmgr->hwmgr_func->gfx_off_control(hwmgr, true);
+               if (ret)
+                       pr_err("gfx off enabling failed!\n");
+       }
+
        return 0;
 }