@@ -2693,7 +2693,7 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev)
2693
2693
}
2694
2694
2695
2695
adev -> in_runpm = true;
2696
- if (amdgpu_device_supports_px ( drm_dev ) )
2696
+ if (adev -> pm . rpm_mode == AMDGPU_RUNPM_PX )
2697
2697
drm_dev -> switch_power_state = DRM_SWITCH_POWER_CHANGING ;
2698
2698
2699
2699
/*
@@ -2703,7 +2703,7 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev)
2703
2703
* platforms.
2704
2704
* TODO: this may be also needed for PX capable platform.
2705
2705
*/
2706
- if (amdgpu_device_supports_boco ( drm_dev ) )
2706
+ if (adev -> pm . rpm_mode == AMDGPU_RUNPM_BOCO )
2707
2707
adev -> mp1_state = PP_MP1_STATE_UNLOAD ;
2708
2708
2709
2709
ret = amdgpu_device_prepare (drm_dev );
@@ -2712,15 +2712,15 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev)
2712
2712
ret = amdgpu_device_suspend (drm_dev , false);
2713
2713
if (ret ) {
2714
2714
adev -> in_runpm = false;
2715
- if (amdgpu_device_supports_boco ( drm_dev ) )
2715
+ if (adev -> pm . rpm_mode == AMDGPU_RUNPM_BOCO )
2716
2716
adev -> mp1_state = PP_MP1_STATE_NONE ;
2717
2717
return ret ;
2718
2718
}
2719
2719
2720
- if (amdgpu_device_supports_boco ( drm_dev ) )
2720
+ if (adev -> pm . rpm_mode == AMDGPU_RUNPM_BOCO )
2721
2721
adev -> mp1_state = PP_MP1_STATE_NONE ;
2722
2722
2723
- if (amdgpu_device_supports_px ( drm_dev ) ) {
2723
+ if (adev -> pm . rpm_mode == AMDGPU_RUNPM_PX ) {
2724
2724
/* Only need to handle PCI state in the driver for ATPX
2725
2725
* PCI core handles it for _PR3.
2726
2726
*/
@@ -2729,9 +2729,9 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev)
2729
2729
pci_ignore_hotplug (pdev );
2730
2730
pci_set_power_state (pdev , PCI_D3cold );
2731
2731
drm_dev -> switch_power_state = DRM_SWITCH_POWER_DYNAMIC_OFF ;
2732
- } else if (amdgpu_device_supports_boco ( drm_dev ) ) {
2732
+ } else if (adev -> pm . rpm_mode == AMDGPU_RUNPM_BOCO ) {
2733
2733
/* nothing to do */
2734
- } else if (amdgpu_device_supports_baco ( drm_dev ) ) {
2734
+ } else if (adev -> pm . rpm_mode == AMDGPU_RUNPM_BACO ) {
2735
2735
amdgpu_device_baco_enter (drm_dev );
2736
2736
}
2737
2737
@@ -2754,7 +2754,7 @@ static int amdgpu_pmops_runtime_resume(struct device *dev)
2754
2754
if (!pci_device_is_present (adev -> pdev ))
2755
2755
adev -> no_hw_access = true;
2756
2756
2757
- if (amdgpu_device_supports_px ( drm_dev ) ) {
2757
+ if (adev -> pm . rpm_mode == AMDGPU_RUNPM_PX ) {
2758
2758
drm_dev -> switch_power_state = DRM_SWITCH_POWER_CHANGING ;
2759
2759
2760
2760
/* Only need to handle PCI state in the driver for ATPX
@@ -2766,22 +2766,22 @@ static int amdgpu_pmops_runtime_resume(struct device *dev)
2766
2766
if (ret )
2767
2767
return ret ;
2768
2768
pci_set_master (pdev );
2769
- } else if (amdgpu_device_supports_boco ( drm_dev ) ) {
2769
+ } else if (adev -> pm . rpm_mode == AMDGPU_RUNPM_BOCO ) {
2770
2770
/* Only need to handle PCI state in the driver for ATPX
2771
2771
* PCI core handles it for _PR3.
2772
2772
*/
2773
2773
pci_set_master (pdev );
2774
- } else if (amdgpu_device_supports_baco ( drm_dev ) ) {
2774
+ } else if (adev -> pm . rpm_mode == AMDGPU_RUNPM_BACO ) {
2775
2775
amdgpu_device_baco_exit (drm_dev );
2776
2776
}
2777
2777
ret = amdgpu_device_resume (drm_dev , false);
2778
2778
if (ret ) {
2779
- if (amdgpu_device_supports_px ( drm_dev ) )
2779
+ if (adev -> pm . rpm_mode == AMDGPU_RUNPM_PX )
2780
2780
pci_disable_device (pdev );
2781
2781
return ret ;
2782
2782
}
2783
2783
2784
- if (amdgpu_device_supports_px ( drm_dev ) )
2784
+ if (adev -> pm . rpm_mode == AMDGPU_RUNPM_PX )
2785
2785
drm_dev -> switch_power_state = DRM_SWITCH_POWER_ON ;
2786
2786
adev -> in_runpm = false;
2787
2787
return 0 ;
0 commit comments