aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 2068b7fe7523..82bc329919fe 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1925,6 +1925,19 @@ static void amdgpu_device_ip_late_init_func_handler(struct work_struct *work)
1925 DRM_ERROR("ib ring test failed (%d).\n", r); 1925 DRM_ERROR("ib ring test failed (%d).\n", r);
1926} 1926}
1927 1927
1928static void amdgpu_device_delay_enable_gfx_off(struct work_struct *work)
1929{
1930 struct amdgpu_device *adev =
1931 container_of(work, struct amdgpu_device, gfx.gfx_off_delay_work.work);
1932
1933 mutex_lock(&adev->gfx.gfx_off_mutex);
1934 if (!adev->gfx.gfx_off_state && !adev->gfx.gfx_off_req_count) {
1935 if (!amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_GFX, true))
1936 adev->gfx.gfx_off_state = true;
1937 }
1938 mutex_unlock(&adev->gfx.gfx_off_mutex);
1939}
1940
1928/** 1941/**
1929 * amdgpu_device_ip_suspend_phase1 - run suspend for hardware IPs (phase 1) 1942 * amdgpu_device_ip_suspend_phase1 - run suspend for hardware IPs (phase 1)
1930 * 1943 *
@@ -2394,6 +2407,8 @@ int amdgpu_device_init(struct amdgpu_device *adev,
2394 2407
2395 INIT_DELAYED_WORK(&adev->late_init_work, 2408 INIT_DELAYED_WORK(&adev->late_init_work,
2396 amdgpu_device_ip_late_init_func_handler); 2409 amdgpu_device_ip_late_init_func_handler);
2410 INIT_DELAYED_WORK(&adev->gfx.gfx_off_delay_work,
2411 amdgpu_device_delay_enable_gfx_off);
2397 2412
2398 adev->gfx.gfx_off_req_count = 1; 2413 adev->gfx.gfx_off_req_count = 1;
2399 adev->pm.ac_power = power_supply_is_system_supplied() > 0 ? true : false; 2414 adev->pm.ac_power = power_supply_is_system_supplied() > 0 ? true : false;