[PATCH] amdgpu/pm: Don't show `smartshift_*_power` files for APUs

Mario Limonciello mario.limonciello at amd.com
Wed Mar 9 22:05:48 UTC 2022


`smartshift_*_power` files are showing up on some OEM programs on
the APU instead of the dGPU.

Adjust the logic to the function `ss_power_attr_update`
to detect whether or not the attributes should be exported.

The existing checks that are dropped are already included in
`amdgpu_device_support_smart_shift`, so this can be simplified.
This causes attributes to not be shown on APUs.

Signed-off-by: Mario Limonciello <mario.limonciello at amd.com>
---
 drivers/gpu/drm/amd/pm/amdgpu_pm.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
index cbbbd4079249..ccd0648c6789 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c
@@ -1884,10 +1884,7 @@ static int ss_power_attr_update(struct amdgpu_device *adev, struct amdgpu_device
 {
 	uint32_t ss_power, size;
 
-	if (!amdgpu_acpi_is_power_shift_control_supported())
-		*states = ATTR_STATE_UNSUPPORTED;
-	else if ((adev->flags & AMD_IS_PX) &&
-		 !amdgpu_device_supports_smart_shift(adev_to_drm(adev)))
+	if (!amdgpu_device_supports_smart_shift(adev_to_drm(adev)))
 		*states = ATTR_STATE_UNSUPPORTED;
 	else if (amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_SS_APU_SHARE,
 		 (void *)&ss_power, &size))
-- 
2.34.1



More information about the amd-gfx mailing list