Skip to content

Commit b38c696

Browse files
committed
drm/amdgpu: rework runtime pm enablement for BACO
Add a switch statement to simplify asic checks. Note that BACO is not supported on APUs, so there is no need to check them. Reviewed-by: Felix Kuehling <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 75e1658 commit b38c696

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -167,19 +167,29 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags)
167167
}
168168

169169
if (amdgpu_device_supports_boco(dev) &&
170-
(amdgpu_runtime_pm != 0)) /* enable runpm by default for boco */
171-
adev->runpm = true;
172-
else if (amdgpu_device_supports_baco(dev) &&
173-
(amdgpu_runtime_pm != 0) &&
174-
(adev->asic_type >= CHIP_TOPAZ) &&
175-
(adev->asic_type != CHIP_VEGA10) &&
176-
(adev->asic_type != CHIP_VEGA20) &&
177-
(adev->asic_type != CHIP_SIENNA_CICHLID) &&
178-
(adev->asic_type != CHIP_ARCTURUS)) /* enable runpm on VI+ */
179-
adev->runpm = true;
180-
else if (amdgpu_device_supports_baco(dev) &&
181-
(amdgpu_runtime_pm > 0)) /* enable runpm if runpm=1 on CI */
170+
(amdgpu_runtime_pm != 0)) { /* enable runpm by default for boco */
182171
adev->runpm = true;
172+
} else if (amdgpu_device_supports_baco(dev) &&
173+
(amdgpu_runtime_pm != 0)) {
174+
switch (adev->asic_type) {
175+
#ifdef CONFIG_DRM_AMDGPU_CIK
176+
case CHIP_BONAIRE:
177+
case CHIP_HAWAII:
178+
#endif
179+
case CHIP_VEGA10:
180+
case CHIP_VEGA20:
181+
case CHIP_ARCTURUS:
182+
case CHIP_SIENNA_CICHLID:
183+
/* enable runpm if runpm=1 */
184+
if (amdgpu_runtime_pm > 0)
185+
adev->runpm = true;
186+
break;
187+
default:
188+
/* enable runpm on VI+ */
189+
adev->runpm = true;
190+
break;
191+
}
192+
}
183193

184194
/* Call ACPI methods: require modeset init
185195
* but failure is not fatal

0 commit comments

Comments
 (0)