Skip to contentSkip to conversation

drm/amdgpu/pm: Don't show pp_power_profile_mode for YC and later APUs

PATCH In review Mario Limonciello 3 participants 7 messages Oct 29, 2021 – Nov 1, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu/pm: Don't show pp_power_profile_mode for YC and later APUs

This command corresponding to this attribute was deprecated in the PMFW for YC so don't show a non-functional attribute.

Since future APUs may be brought up using IP version checking also disable it for future APU's. If any do support the command then they can be treated as exceptions.

---
 drivers/gpu/drm/amd/pm/amdgpu_pm.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/pm/amdgpu_pm.c +3 -0
index 49fe4155c374..c7326f0ec517 100644
@@ -2094,6 +2094,9 @@ static int default_attr_update(struct amdgpu_device *adev, struct amdgpu_device_
 	} else if (DEVICE_ATTR_IS(pp_dpm_dclk)) {
 		if (!(asic_type == CHIP_VANGOGH || asic_type == CHIP_SIENNA_CICHLID))
 			*states = ATTR_STATE_UNSUPPORTED;
+	} else if (DEVICE_ATTR_IS(pp_power_profile_mode)) {
+		if ((adev->flags & AMD_IS_APU) && asic_type >= CHIP_YELLOW_CARP)
+			*states = ATTR_STATE_UNSUPPORTED;
 	}
 
 	switch (asic_type) {
Signature · 1 line
2.25.1
#1 lore raw

[Public]

Instead of ASIC check better to do the check based on ppt_func->get_power_profile_mode. If function is NULL/not implemented, drop the attribute.

Thanks,
Lijo

#2 lore raw
Quoted 6 lines · Lijo

[Public]

Instead of ASIC check better to do the check based on ppt_func->get_power_profile_mode. If function is NULL/not implemented, drop the attribute.

The pointer is always there at the subsystem level. E.g., smu_get_power_profile_mode()

Alex

Quoted 2 lines

Thanks,
Lijo

#3 lore raw

[Public]

For swsmu, we could add a helper macro like smu_is_supported(x) that checks if ppt func is not NULL.

Thanks,
Lijo

#4 lore raw

[Public]

smu_get_power_profile_mode actually calls smu->ppt_funcs->get_power_profile_mode

So shouldn't it be sufficient to do this?

        } else if (DEVICE_ATTR_IS(pp_power_profile_mode)) {
                if (!adev->smu.ppt_funcs->get_power_profile_mode)
                        *states = ATTR_STATE_UNSUPPORTED;
        }

From: Lazar, Lijo <[email protected]>
Sent: Saturday, October 30, 2021 10:06
To: Alex Deucher <[email protected]>
Cc: Limonciello, Mario <[email protected]>; [email protected]; Deucher, Alexander <[email protected]>
Subject: Re: [PATCH] drm/amdgpu/pm: Don't show pp_power_profile_mode for YC and later APUs

[Public]

For swsmu, we could add a helper macro like smu_is_supported(x) that checks if ppt func is not NULL.

Thanks,
Lijo

#5 lore raw

There are two subsystems - powerplay and swsmu. The subsystem implementation details are hidden from amdgpu_pm funcs. I thought Alex is talking about that.

Thanks,
Lijo
________________________________
From: Limonciello, Mario <[email protected]>
Sent: Monday, November 1, 2021 8:16:27 AM
To: Lazar, Lijo <[email protected]>; Alex Deucher <[email protected]>
Cc: [email protected] <[email protected]>; Deucher, Alexander <[email protected]>
Subject: RE: [PATCH] drm/amdgpu/pm: Don't show pp_power_profile_mode for YC and later APUs

[Public]

smu_get_power_profile_mode actually calls smu->ppt_funcs->get_power_profile_mode

So shouldn’t it be sufficient to do this?

        } else if (DEVICE_ATTR_IS(pp_power_profile_mode)) {

                if (!adev->smu.ppt_funcs->get_power_profile_mode)

                        *states = ATTR_STATE_UNSUPPORTED;

        }

From: Lazar, Lijo <[email protected]>
Sent: Saturday, October 30, 2021 10:06
To: Alex Deucher <[email protected]>
Cc: Limonciello, Mario <[email protected]>; [email protected]; Deucher, Alexander <[email protected]>
Subject: Re: [PATCH] drm/amdgpu/pm: Don't show pp_power_profile_mode for YC and later APUs

[Public]

For swsmu, we could add a helper macro like smu_is_supported(x) that checks if ppt func is not NULL.

Thanks,
Lijo

#6 lore raw

Right.

Alex

Quoted 55 lines · Lijo

There are two subsystems - powerplay and swsmu. The subsystem implementation details are hidden from amdgpu_pm funcs. I thought Alex is talking about that.

Thanks,
Lijo
________________________________
From: Limonciello, Mario <[email protected]>
Sent: Monday, November 1, 2021 8:16:27 AM
To: Lazar, Lijo <[email protected]>; Alex Deucher <[email protected]>
Cc: [email protected] <[email protected]>; Deucher, Alexander <[email protected]>
Subject: RE: [PATCH] drm/amdgpu/pm: Don't show pp_power_profile_mode for YC and later APUs

[Public]

smu_get_power_profile_mode actually calls smu->ppt_funcs->get_power_profile_mode

So shouldn’t it be sufficient to do this?

        } else if (DEVICE_ATTR_IS(pp_power_profile_mode)) {

                if (!adev->smu.ppt_funcs->get_power_profile_mode)

                        *states = ATTR_STATE_UNSUPPORTED;

        }

From: Lazar, Lijo <[email protected]>
Sent: Saturday, October 30, 2021 10:06
To: Alex Deucher <[email protected]>
Cc: Limonciello, Mario <[email protected]>; [email protected]; Deucher, Alexander <[email protected]>
Subject: Re: [PATCH] drm/amdgpu/pm: Don't show pp_power_profile_mode for YC and later APUs

[Public]

For swsmu, we could add a helper macro like smu_is_supported(x) that checks if ppt func is not NULL.

Thanks,
Lijo