On 6/24/2020 3:05 PM, Alex Deucher wrote:
[CAUTION: External Email] Add a switch statement to simplify asic checks. Note that BACO is not supported on APUs, so there is no need to check them.
why not base this on smu_context to really query the SMU_FEATURE_BACO_BIT and then base the below flow on that instead of nested logic vs case? I am not sure if there was any issue with smu_context earlier?
Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx> --- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 34 ++++++++++++++++--------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index 4ec544783a45..0fec39eed164 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c @@ -167,19 +167,29 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags) } if (amdgpu_device_supports_boco(dev) && - (amdgpu_runtime_pm != 0)) /* enable runpm by default for boco */ - adev->runpm = true; - else if (amdgpu_device_supports_baco(dev) && - (amdgpu_runtime_pm != 0) && - (adev->asic_type >= CHIP_TOPAZ) && - (adev->asic_type != CHIP_VEGA10) && - (adev->asic_type != CHIP_VEGA20) && - (adev->asic_type != CHIP_SIENNA_CICHLID) && - (adev->asic_type != CHIP_ARCTURUS)) /* enable runpm on VI+ */ - adev->runpm = true; - else if (amdgpu_device_supports_baco(dev) && - (amdgpu_runtime_pm > 0)) /* enable runpm if runpm=1 on CI */ + (amdgpu_runtime_pm != 0)) { /* enable runpm by default for boco */ adev->runpm = true; + } else if (amdgpu_device_supports_baco(dev) && + (amdgpu_runtime_pm != 0)) { + switch (adev->asic_type) { +#ifdef CONFIG_DRM_AMDGPU_CIK + case CHIP_BONAIRE: + case CHIP_HAWAII: +#endif + case CHIP_VEGA10: + case CHIP_VEGA20: + case CHIP_ARCTURUS: + case CHIP_SIENNA_CICHLID: + /* enable runpm if runpm=1 */ + if (amdgpu_runtime_pm > 0) + adev->runpm = true; + break; + default: + /* enable runpm on VI+ */ + adev->runpm = true; + break; + } + } /* Call ACPI methods: require modeset init * but failure is not fatal -- 2.25.4 _______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Crajneesh.bhardwaj%40amd.com%7Cd5d794bda2c44e0c902008d818719558%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637286223410087832&sdata=yErSk5DyDDXPX8Y1cXp14QxX9pgwRlIj6%2FuIhNKYN%2Bk%3D&reserved=0
_______________________________________________ amd-gfx mailing list amd-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/amd-gfx