]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/pm: Rename enable_bapm() to notify_ac_dc()
authorTimur Kristóf <timur.kristof@gmail.com>
Tue, 19 May 2026 08:41:55 +0000 (10:41 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 27 May 2026 14:48:11 +0000 (10:48 -0400)
No functional changes, just change the name of this
function pointer to be more generic.

BAPM refers to a specific feature on KV, but other kinds of
ASICs may also need the SMU to be notified on AC/DC changes.

Also remove the argument and use adev->pm.ac_power instead.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/include/kgd_pp_interface.h
drivers/gpu/drm/amd/pm/amdgpu_dpm.c
drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c

index ac05a12e71bdf164c93a5e7f4e15a75ab1633d34..6371f292f2d80a35f3087f3152ebf400f2404c7d 100644 (file)
@@ -417,7 +417,7 @@ struct amd_pm_funcs {
        void (*display_configuration_changed)(void *handle);
        void (*print_power_state)(void *handle, void *ps);
        bool (*vblank_too_short)(void *handle);
-       void (*enable_bapm)(void *handle, bool enable);
+       void (*notify_ac_dc)(void *handle);
        int (*check_state_equal)(void *handle,
                                void  *cps,
                                void  *rps,
index feadf604b47491fdebbe2f9e88dbcf0335602878..f76ba67535519cfe407d9e29755b367ad150695c 100644 (file)
@@ -33,8 +33,8 @@
 #include <linux/power_supply.h>
 #include "amdgpu_smu.h"
 
-#define amdgpu_dpm_enable_bapm(adev, e) \
-               ((adev)->powerplay.pp_funcs->enable_bapm((adev)->powerplay.pp_handle, (e)))
+#define amdgpu_dpm_notify_ac_dc(adev) \
+               ((adev)->powerplay.pp_funcs->notify_ac_dc((adev)->powerplay.pp_handle))
 
 #define amdgpu_dpm_is_legacy_dpm(adev) ((adev)->powerplay.pp_handle == (adev))
 
@@ -504,8 +504,8 @@ void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev)
                        adev->pm.ac_power = false;
 
                if (adev->powerplay.pp_funcs &&
-                   adev->powerplay.pp_funcs->enable_bapm)
-                       amdgpu_dpm_enable_bapm(adev, adev->pm.ac_power);
+                   adev->powerplay.pp_funcs->notify_ac_dc)
+                       amdgpu_dpm_notify_ac_dc(adev);
 
                if (is_support_sw_smu(adev))
                        smu_set_ac_dc(adev->powerplay.pp_handle);
index cdf3f8e6ec2fd3b4620baea05aaeef59228e913f..b763fdf43c603bc0ff3d2271a3cb3ce41a39a8a4 100644 (file)
@@ -1233,14 +1233,14 @@ static void kv_update_requested_ps(struct amdgpu_device *adev,
        adev->pm.dpm.requested_ps = &pi->requested_rps;
 }
 
-static void kv_dpm_enable_bapm(void *handle, bool enable)
+static void kv_dpm_enable_bapm(void *handle)
 {
        struct amdgpu_device *adev = (struct amdgpu_device *)handle;
        struct kv_power_info *pi = kv_get_pi(adev);
        int ret;
 
        if (pi->bapm_enable) {
-               ret = amdgpu_kv_smc_bapm_enable(adev, enable);
+               ret = amdgpu_kv_smc_bapm_enable(adev, adev->pm.ac_power);
                if (ret)
                        drm_err(adev_to_drm(adev), "amdgpu_kv_smc_bapm_enable failed\n");
        }
@@ -3341,7 +3341,7 @@ static const struct amd_pm_funcs kv_dpm_funcs = {
        .debugfs_print_current_performance_level = &kv_dpm_debugfs_print_current_performance_level,
        .force_performance_level = &kv_dpm_force_performance_level,
        .set_powergating_by_smu = kv_set_powergating_by_smu,
-       .enable_bapm = &kv_dpm_enable_bapm,
+       .notify_ac_dc = &kv_dpm_enable_bapm,
        .get_vce_clock_state = amdgpu_get_vce_clock_state,
        .check_state_equal = kv_check_state_equal,
        .read_sensor = &kv_dpm_read_sensor,