AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Timur Kristóf" <timur.kristof@gmail.com>
To: amd-gfx@lists.freedesktop.org,
	Alex Deucher <alexander.deucher@amd.com>,
	christian.koenig@amd.com, Natalie Vock <natalie.vock@gmx.de>,
	Jeremy Klarenbeek <jeremy.klarenbeek99@gmail.com>
Cc: "Timur Kristóf" <timur.kristof@gmail.com>
Subject: [PATCH 2/5] drm/amd/pm: Rename enable_bapm() to notify_ac_dc()
Date: Tue, 19 May 2026 10:41:55 +0200	[thread overview]
Message-ID: <20260519084158.72960-3-timur.kristof@gmail.com> (raw)
In-Reply-To: <20260519084158.72960-1-timur.kristof@gmail.com>

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.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
---
 drivers/gpu/drm/amd/include/kgd_pp_interface.h | 2 +-
 drivers/gpu/drm/amd/pm/amdgpu_dpm.c            | 8 ++++----
 drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c     | 6 +++---
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/gpu/drm/amd/include/kgd_pp_interface.h b/drivers/gpu/drm/amd/include/kgd_pp_interface.h
index 1bbf531de5ed..27e0874d3ade 100644
--- a/drivers/gpu/drm/amd/include/kgd_pp_interface.h
+++ b/drivers/gpu/drm/amd/include/kgd_pp_interface.h
@@ -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,
diff --git a/drivers/gpu/drm/amd/pm/amdgpu_dpm.c b/drivers/gpu/drm/amd/pm/amdgpu_dpm.c
index feadf604b474..f76ba6753551 100644
--- a/drivers/gpu/drm/amd/pm/amdgpu_dpm.c
+++ b/drivers/gpu/drm/amd/pm/amdgpu_dpm.c
@@ -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);
diff --git a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
index 33eb85dd68e9..49b95752de25 100644
--- a/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
+++ b/drivers/gpu/drm/amd/pm/legacy-dpm/kv_dpm.c
@@ -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");
 	}
@@ -3342,7 +3342,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,
-- 
2.54.0


  parent reply	other threads:[~2026-05-19  8:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-19  8:41 [PATCH 0/5] drm/amd/pm: Fix laptop issues on SMU6-7 Timur Kristóf
2026-05-19  8:41 ` [PATCH 1/5] drm/amd/pm/si: Disregard vblank time when no displays are connected Timur Kristóf
2026-05-19 15:09   ` Alex Deucher
2026-05-19  8:41 ` Timur Kristóf [this message]
2026-05-19  8:41 ` [PATCH 3/5] drm/amd/pm/smu7: Notify SMU7 of DC->AC switch Timur Kristóf
2026-05-19  8:41 ` [PATCH 4/5] drm/amd/pm/si: Fix updating clock limits from power states Timur Kristóf
2026-05-19  8:41 ` [PATCH 5/5] drm/amd/pm/si: Notify the SMC when switching to AC Timur Kristóf
2026-05-21  0:52 ` [PATCH 0/5] drm/amd/pm: Fix laptop issues on SMU6-7 Jeremy Klarenbeek
2026-05-24  6:38 ` Jeremy Klarenbeek
2026-05-24 11:32   ` Timur Kristóf
2026-05-29 20:33     ` Deucher, Alexander
2026-05-30 10:07       ` Jeremy Klarenbeek
2026-05-30 10:32         ` Timur Kristóf
2026-05-30 12:51           ` Jeremy Klarenbeek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260519084158.72960-3-timur.kristof@gmail.com \
    --to=timur.kristof@gmail.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=jeremy.klarenbeek99@gmail.com \
    --cc=natalie.vock@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox