提交 9c913f38 编写于 作者: G Guchun Chen 提交者: Alex Deucher

drm/amdgpu: drop runpm from amdgpu_device structure

It's redundant, as now switching to rpm_mode to indicate
runtime power management mode.
Suggested-by: NLijo Lazar <lijo.lazar@amd.com>
Signed-off-by: NGuchun Chen <guchun.chen@amd.com>
Reviewed-by: NLijo Lazar <lijo.lazar@amd.com>
Reviewed-by: NEvan Quan <evan.quan@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 75a9ad8c
...@@ -1011,7 +1011,6 @@ struct amdgpu_device { ...@@ -1011,7 +1011,6 @@ struct amdgpu_device {
uint64_t df_perfmon_config_assign_mask[AMDGPU_MAX_DF_PERFMONS]; uint64_t df_perfmon_config_assign_mask[AMDGPU_MAX_DF_PERFMONS];
/* enable runtime pm on the device */ /* enable runtime pm on the device */
bool runpm;
bool in_runpm; bool in_runpm;
bool has_pr3; bool has_pr3;
......
...@@ -2121,7 +2121,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev, ...@@ -2121,7 +2121,7 @@ static int amdgpu_pci_probe(struct pci_dev *pdev,
if (ret) if (ret)
DRM_ERROR("Creating debugfs files failed (%d).\n", ret); DRM_ERROR("Creating debugfs files failed (%d).\n", ret);
if (adev->runpm) { if (adev->pm.rpm_mode != AMDGPU_RUNPM_NONE) {
/* only need to skip on ATPX */ /* only need to skip on ATPX */
if (amdgpu_device_supports_px(ddev)) if (amdgpu_device_supports_px(ddev))
dev_pm_set_driver_flags(ddev->dev, DPM_FLAG_NO_DIRECT_COMPLETE); dev_pm_set_driver_flags(ddev->dev, DPM_FLAG_NO_DIRECT_COMPLETE);
...@@ -2178,7 +2178,7 @@ amdgpu_pci_remove(struct pci_dev *pdev) ...@@ -2178,7 +2178,7 @@ amdgpu_pci_remove(struct pci_dev *pdev)
drm_dev_unplug(dev); drm_dev_unplug(dev);
if (adev->runpm) { if (adev->pm.rpm_mode != AMDGPU_RUNPM_NONE) {
pm_runtime_get_sync(dev->dev); pm_runtime_get_sync(dev->dev);
pm_runtime_forbid(dev->dev); pm_runtime_forbid(dev->dev);
} }
...@@ -2461,7 +2461,7 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev) ...@@ -2461,7 +2461,7 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev)
struct amdgpu_device *adev = drm_to_adev(drm_dev); struct amdgpu_device *adev = drm_to_adev(drm_dev);
int ret, i; int ret, i;
if (!adev->runpm) { if (adev->pm.rpm_mode == AMDGPU_RUNPM_NONE) {
pm_runtime_forbid(dev); pm_runtime_forbid(dev);
return -EBUSY; return -EBUSY;
} }
...@@ -2530,7 +2530,7 @@ static int amdgpu_pmops_runtime_resume(struct device *dev) ...@@ -2530,7 +2530,7 @@ static int amdgpu_pmops_runtime_resume(struct device *dev)
struct amdgpu_device *adev = drm_to_adev(drm_dev); struct amdgpu_device *adev = drm_to_adev(drm_dev);
int ret; int ret;
if (!adev->runpm) if (adev->pm.rpm_mode == AMDGPU_RUNPM_NONE)
return -EINVAL; return -EINVAL;
/* Avoids registers access if device is physically gone */ /* Avoids registers access if device is physically gone */
...@@ -2574,7 +2574,7 @@ static int amdgpu_pmops_runtime_idle(struct device *dev) ...@@ -2574,7 +2574,7 @@ static int amdgpu_pmops_runtime_idle(struct device *dev)
/* we don't want the main rpm_idle to call suspend - we want to autosuspend */ /* we don't want the main rpm_idle to call suspend - we want to autosuspend */
int ret = 1; int ret = 1;
if (!adev->runpm) { if (adev->pm.rpm_mode == AMDGPU_RUNPM_NONE) {
pm_runtime_forbid(dev); pm_runtime_forbid(dev);
return -EBUSY; return -EBUSY;
} }
......
...@@ -147,14 +147,13 @@ int amdgpu_driver_load_kms(struct amdgpu_device *adev, unsigned long flags) ...@@ -147,14 +147,13 @@ int amdgpu_driver_load_kms(struct amdgpu_device *adev, unsigned long flags)
goto out; goto out;
} }
adev->pm.rpm_mode = AMDGPU_RUNPM_NONE;
if (amdgpu_device_supports_px(dev) && if (amdgpu_device_supports_px(dev) &&
(amdgpu_runtime_pm != 0)) { /* enable runpm by default for atpx */ (amdgpu_runtime_pm != 0)) { /* enable PX as runtime mode */
adev->runpm = true;
adev->pm.rpm_mode = AMDGPU_RUNPM_PX; adev->pm.rpm_mode = AMDGPU_RUNPM_PX;
dev_info(adev->dev, "Using ATPX for runtime pm\n"); dev_info(adev->dev, "Using ATPX for runtime pm\n");
} else if (amdgpu_device_supports_boco(dev) && } else if (amdgpu_device_supports_boco(dev) &&
(amdgpu_runtime_pm != 0)) { /* enable runpm by default for boco */ (amdgpu_runtime_pm != 0)) { /* enable boco as runtime mode */
adev->runpm = true;
adev->pm.rpm_mode = AMDGPU_RUNPM_BOCO; adev->pm.rpm_mode = AMDGPU_RUNPM_BOCO;
dev_info(adev->dev, "Using BOCO for runtime pm\n"); dev_info(adev->dev, "Using BOCO for runtime pm\n");
} else if (amdgpu_device_supports_baco(dev) && } else if (amdgpu_device_supports_baco(dev) &&
...@@ -162,26 +161,24 @@ int amdgpu_driver_load_kms(struct amdgpu_device *adev, unsigned long flags) ...@@ -162,26 +161,24 @@ int amdgpu_driver_load_kms(struct amdgpu_device *adev, unsigned long flags)
switch (adev->asic_type) { switch (adev->asic_type) {
case CHIP_VEGA20: case CHIP_VEGA20:
case CHIP_ARCTURUS: case CHIP_ARCTURUS:
/* enable runpm if runpm=1 */ /* enable BACO as runpm mode if runpm=1 */
if (amdgpu_runtime_pm > 0) if (amdgpu_runtime_pm > 0)
adev->runpm = true; adev->pm.rpm_mode = AMDGPU_RUNPM_BACO;
break; break;
case CHIP_VEGA10: case CHIP_VEGA10:
/* turn runpm on if noretry=0 */ /* enable BACO as runpm mode if noretry=0 */
if (!adev->gmc.noretry) if (!adev->gmc.noretry)
adev->runpm = true; adev->pm.rpm_mode = AMDGPU_RUNPM_BACO;
break; break;
default: default:
/* enable runpm on CI+ */ /* enable BACO as runpm mode on CI+ */
adev->runpm = true; adev->pm.rpm_mode = AMDGPU_RUNPM_BACO;
break; break;
} }
if (adev->runpm) { if (adev->pm.rpm_mode == AMDGPU_RUNPM_BACO)
adev->pm.rpm_mode = AMDGPU_RUNPM_BACO;
dev_info(adev->dev, "Using BACO for runtime pm\n"); dev_info(adev->dev, "Using BACO for runtime pm\n");
} }
}
/* Call ACPI methods: require modeset init /* Call ACPI methods: require modeset init
* but failure is not fatal * but failure is not fatal
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册