Commit f0f7ddfc authored by Alex Deucher's avatar Alex Deucher

drm/amdgpu: add flag for runtime suspend

So we know whether we in are in runtime suspend or
system suspend.
Reviewed-by: default avatarEvan Quan <evan.quan@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 0a28eee9
...@@ -969,6 +969,7 @@ struct amdgpu_device { ...@@ -969,6 +969,7 @@ struct amdgpu_device {
int pstate; int pstate;
/* enable runtime pm on the device */ /* enable runtime pm on the device */
bool runpm; bool runpm;
bool in_runpm;
bool pm_sysfs_en; bool pm_sysfs_en;
bool ucode_sysfs_en; bool ucode_sysfs_en;
......
...@@ -1220,6 +1220,7 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev) ...@@ -1220,6 +1220,7 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev)
} }
} }
adev->in_runpm = true;
if (amdgpu_device_supports_boco(drm_dev)) if (amdgpu_device_supports_boco(drm_dev))
drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
drm_kms_helper_poll_disable(drm_dev); drm_kms_helper_poll_disable(drm_dev);
...@@ -1278,6 +1279,7 @@ static int amdgpu_pmops_runtime_resume(struct device *dev) ...@@ -1278,6 +1279,7 @@ static int amdgpu_pmops_runtime_resume(struct device *dev)
drm_kms_helper_poll_enable(drm_dev); drm_kms_helper_poll_enable(drm_dev);
if (amdgpu_device_supports_boco(drm_dev)) if (amdgpu_device_supports_boco(drm_dev))
drm_dev->switch_power_state = DRM_SWITCH_POWER_ON; drm_dev->switch_power_state = DRM_SWITCH_POWER_ON;
adev->in_runpm = false;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment