platform/x86: hp-wmi: Enable cTGP in performance mode on OMEN 15-en1xxx
Subsystems (2)
PATCH 1/1 platform/x86: hp-wmi: Enable cTGP in performance mode on OMEN 15-en1xxx
On the OMEN 15-en1xxx (board 88D2) the GPU power limit stays at its 80 W default in every platform profile, including performance.
The firmware's SET_PERFORMANCE_MODE handler (GM1A in the DSDT) stores the mode byte in EC register 0x95 (HPCM) and enables NVIDIA cTGP through the NPCF device only when that byte is 0x01:
If ((HPCM == One)) { NPCF.CTGP = One ... }
Else { NPCF.CTGP = Zero ... }0x01 is the thermal policy v0 performance value. This board reports policy v1 (byte 3 of GET_SYSTEM_DESIGN_DATA is 1), so the driver sends 0x31 for performance and cTGP is never enabled. NPCF only reports the cTGP offset to nvidia-powerd (ACBT = 0xA0, i.e. +20 W) when CTGP is set.
For boards in a new omen_ctgp_boards[] list, set cTGP explicitly with SET_GPU_THERMAL_MODES after setting the profile: enabled in performance, disabled otherwise, with Dynamic Boost (PPAB) left enabled. The Victus S code already uses this command. platform_profile_omen_set_ec() is also called at probe time and when AC power returns, so cTGP follows the profile in those cases too.
A report for the Victus 16 board 8934 shows the same HPCM check in its GM1A method, so other v1 boards may be affected. Only 88D2 has been tested, hence the list.
Tested on an OMEN Laptop 15-en1xxx (board 88D2, BIOS F.20, RTX 3070 Laptop GPU) on AC: nvidia-smi reports a 100 W power limit in performance and 80 W in balanced and cool. Without this change it reports 80 W in every profile.
The firmware analysis and this patch were prepared with the help of an AI coding assistant (Claude Opus 5.5 in Claude Code). The result was reviewed and tested on the hardware by the submitter.
--- drivers/platform/x86/hp/hp-wmi.c | 34 ++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+)
drivers/platform/x86/hp/hp-wmi.c +34 -0
@@ -235,6 +235,14 @@ static const char * const omen_timed_thermal_profile_boards[] = { "8BAD", }; +/* DMI board names of Omen laptops whose firmware only enables NVIDIA cTGP +* from SET_PERFORMANCE_MODE for the v0 performance value. With v1 values cTGP +* stays disabled, so it has to be set with SET_GPU_THERMAL_MODES instead. +*/ +static const char *const omen_ctgp_boards[] = { +"88D2" , +}; +/* DMI Board names of Victus 16-d and 16-e laptops */ static const char *const victus_thermal_profile_boards[] = {"88EE" ,
@@ -2035,6 +2043,17 @@ static bool has_omen_thermal_profile_ec_timer(void) board_name) >= 0; } +static bool has_omen_ctgp_control (void ) +{ +const char *board_name =dmi_get_system_info (DMI_BOARD_NAME ); + +if (!board_name) +return false; + +return match_string (omen_ctgp_boards,ARRAY_SIZE (omen_ctgp_boards), + board_name) >=0 ; +} +inline int omen_thermal_profile_ec_flags_set (enum hp_thermal_profile_omen_flags flags) {return ec_write (HP_OMEN_EC_THERMAL_PROFILE_FLAGS_OFFSET , flags);
@@ -2045,6 +2064,10 @@ inline int omen_thermal_profile_ec_timer_set(u8 value)return ec_write (HP_OMEN_EC_THERMAL_PROFILE_TIMER_OFFSET , value); } +static int victus_s_gpu_thermal_profile_set (bool ctgp_enable, +bool ppab_enable, +u8 dstate); +static int platform_profile_omen_set_ec (enum platform_profile_option profile) {int err, tp, tp_version;
@@ -2096,6 +2119,17 @@ static int platform_profile_omen_set_ec(enum platform_profile_option profile)return err; } +/* +* Enable cTGP only in performance mode and keep Dynamic Boost enabled. +* dstate 1 means 100%, as on Victus S. +*/ +if (has_omen_ctgp_control ()) { + err =victus_s_gpu_thermal_profile_set (profile ==PLATFORM_PROFILE_PERFORMANCE , + true,1 ); +if (err) +pr_warn ("Failed to set GPU cTGP state: %d\n" , err); + } +return 0 ; }
base-commit: c339f4010dea8b0d754f84ace70cd1b089878ef8
Signature · 1 line
2.56.0
Hi David,
Thanks for sending the patch.
Quoted 7 lines · David William Richmond Davies-Jones
On the OMEN 15-en1xxx (board 88D2) the GPU power limit stays at its 80 W default in every platform profile, including performance.
The firmware's
SET_PERFORMANCE_MODEhandler (GM1A in the DSDT) stores the mode byte in EC register0x95(HPCM) and enables NVIDIA cTGP through the NPCF device only when that byte is0x01:
Quoted 7 lines
If ((HPCM == One)) { NPCF.CTGP = One ... } Else { NPCF.CTGP = Zero ... }
0x01is the thermal policy v0 performance value. This board reports policy v1 (byte 3 ofGET_SYSTEM_DESIGN_DATAis 1), so the driver sends0x31for performance and cTGP is never enabled. NPCF only reports the cTGP offset to nvidia-powerd (ACBT =0xA0, i.e. +20 W) when CTGP is set.
This is interesting because the patch does not make any changes to the HPWMI_SET_PERFORMANCE_MODE path. So, if I'm following correctly, the call tree would roughly look like this:platform_profile_omen_set()
platform_profile_omen_set_ec()
omen_get_thermal_policy_version() (you say this returns 1)
switch-case (performance) => tp = HP_OMEN_V1_THERMAL_PROFILE_PERFORMANCE omen_thermal_profile_set(0x31)
So perhaps policy v1 is not entirely wrong? The HPCM == 1 check in GM1A only tells us how this particular method handles the performance mode value. Have you checked the other consumers of HPCM, particularly GM22 and the NVIDIA-related SSDT methods? They may interpret the v1 value (0x31) differently. Given that the firmware reports thermal policy v1, I'd be hesitant to conclude that it is incorrect based solely on this check.
Quoted 6 lines
For boards in a new omen_ctgp_boards[] list, set cTGP explicitly with
SET_GPU_THERMAL_MODESafter setting the profile: enabled in performance, disabled otherwise, with Dynamic Boost (PPAB) left enabled. The Victus S code already uses this command.platform_profile_omen_set_ec()is also called at probe time and when AC power returns, so cTGP follows the profile in those cases too.
The diff follows Victus S code consistently. However, have you considered adding an entry to hp_wmi_feature_boards[] and using the corresponding omen_v1_legacy_thermal_params mapping instead? I'd prefer reusing the existing feature-board handling rather than introducing another board-specific list for functionality that already has an implementation.
If I'm not mistaken, board 88D2 should also support fan curves, right? By keeping the board ID in omen_thermal_profile_boards[], wouldn't you also be missing the manual PWM mode support?
Quoted 70 lines
A report for the Victus 16 board 8934 shows the same HPCM check in its GM1A method, so other v1 boards may be affected. Only 88D2 has been tested, hence the list.
Tested on an OMEN Laptop 15-en1xxx (board 88D2, BIOS F.20, RTX 3070 Laptop GPU) on AC: nvidia-smi reports a 100 W power limit in performance and 80 W in balanced and cool. Without this change it reports 80 W in every profile.
The firmware analysis and this patch were prepared with the help of an AI coding assistant (Claude Opus 5.5 in Claude Code). The result was reviewed and tested on the hardware by the submitter.
Link https://lore.kernel.org/platform-driver-x86/CA+LW3S2g4E971by7WhfFZGuyLT47141_Zn+eJ=wyqxB_+4G95A@mail.gmail.com/ open hereFixes 286e937efbc7 ("platform/x86: hp-wmi: support omen thermal profile policy v1")Signed-off-by David William Richmond Davies-Jones <[email protected]>---
drivers/platform/x86/hp/hp-wmi.c| 34 ++++++++++++++++++++++++++++++++1 file changed, 34 insertions(+)drivers/platform/x86/hp/hp-wmi.c +23
-0@@ -235,6 +235,14 @@ static const char * const omen_timed_thermal_profile_boards[] = { "8BAD", }; +/* DMI board names of Omen laptops whose firmware only enables NVIDIA cTGP +* from SET_PERFORMANCE_MODE for the v0 performance value. With v1 values cTGP +* stays disabled, so it has to be set with SET_GPU_THERMAL_MODES instead. +*/ +static const char *const omen_ctgp_boards[] = { +"88D2" , +}; +/* DMI Board names of Victus 16-d and 16-e laptops */ static const char *const victus_thermal_profile_boards[] = {"88EE" ,@@ -2035,6 +2043,17 @@ static bool has_omen_thermal_profile_ec_timer(void) board_name) >= 0; } +static bool has_omen_ctgp_control (void ) +{ +const char *board_name =dmi_get_system_info (DMI_BOARD_NAME ); + +if (!board_name) +return false; + +return match_string (omen_ctgp_boards,ARRAY_SIZE (omen_ctgp_boards), + board_name) >=0 ; +} +inline int omen_thermal_profile_ec_flags_set (enum hp_thermal_profile_omen_flags flags) {return ec_write (HP_OMEN_EC_THERMAL_PROFILE_FLAGS_OFFSET , flags);@@ -2045,6 +2064,10 @@ inline int omen_thermal_profile_ec_timer_set(u8 value)return ec_write (HP_OMEN_EC_THERMAL_PROFILE_TIMER_OFFSET , value); } +static int victus_s_gpu_thermal_profile_set (bool ctgp_enable, +bool ppab_enable, +u8 dstate); +static int platform_profile_omen_set_ec (enum platform_profile_option profile) {int err, tp, tp_version;
drivers/platform/x86/hp/hp-wmi.c static int platform_profile_omen_set_ec(enum platform_profile_option profile) · line 2128
Quoted 10 lines
drivers/platform/x86/hp/hp-wmi.c +7
-0@@ -2096,6 +2119,17 @@ static int platform_profile_omen_set_ec(enum platform_profile_option profile)return err; } +/* +* Enable cTGP only in performance mode and keep Dynamic Boost enabled. +* dstate 1 means 100%, as on Victus S. +*/ +if (has_omen_ctgp_control ()) { + err =victus_s_gpu_thermal_profile_set (profile ==PLATFORM_PROFILE_PERFORMANCE , + true,1 );
Why enable Dynamic Boost unconditionally when the firmware would almost certainly disable it in case of low-power/equivalent modes? Wouldn't it be better to make PPAB follow the selected platform profile instead?
Quoted 12 lines
drivers/platform/x86/hp/hp-wmi.c +4
-0+if (err) +pr_warn ("Failed to set GPU cTGP state: %d\n" , err); + } +return 0 ; }base-commit:
c339f4010dea8b0d754f84ace70cd1b089878ef8Signature · 1 line
2.56.0
Hi Krishna,
Thanks for the review. You were right on all points. I've sent v2 as a new thread, "[PATCH v2 0/2] platform/x86: hp-wmi: Fix cTGP and power limits on OMEN 15-en1xxx (88D2)".
Quoted 4 lines · Krishna Chomal
So perhaps policy v1 is not entirely wrong? The HPCM == 1 check in GM1A only tells us how this particular method handles the performance mode value. Have you checked the other consumers of HPCM, particularly GM22 and the NVIDIA-related SSDT methods?
Policy v1 is correct for this board. I went through the DSDT and all the SSDTs, and GM1A is the only consumer of HPCM. GM22 doesn't look at HPCM at all: it writes NPCF.CTGP and NPCF.DTGP directly from bytes 0 and 1 of its input, notifies NPCF, then applies the D-state (byte 2) and GPST (byte 3). GM21 reads them back. NPCF only reports the cTGP offset (ACBT) when CTGP == 1, and only reports Dynamic Boost when DTGP == 1. So on v1 this firmware expects cTGP to be set with SET_GPU_THERMAL_MODES, and the HPCM check in GM1A looks like the v0 route.
Quoted 3 lines
However, have you considered adding an entry to hp_wmi_feature_boards[] and using the corresponding
omen_v1_legacy_thermal_paramsmapping instead?
Done. v2 drops 88D2 from omen_thermal_profile_boards[] and adds it to hp_wmi_feature_boards[] with the omen_v1_legacy thermal parameters. GM1A stores the mode in EC 0x95, which matches HP_OMEN_EC_THERMAL_PROFILE_OFFSET. The new list is gone.
Quoted 1 line
If I'm not mistaken, board 88D2 should also support fan curves, right?
Yes. GM2D, GM2E and GM2F are implemented on this BIOS. GM2F returns a 2-fan, 15-entry table with a maximum of 5900 rpm. With v2, manual PWM goes from 1200 to 5900 rpm, and max and auto modes work.
Quoted 3 lines
Why enable Dynamic Boost unconditionally when the firmware would almost certainly disable it in case of low-power/equivalent modes? Wouldn't it be better to make PPAB follow the selected platform profile instead?
Agreed. On the Victus S path PPAB now follows the profile: enabled in performance and balanced, disabled in low-power. For what it's worth, GM1A on this firmware never touches DTGP, so it stays at its default of 1 unless GM22 clears it.
Moving the board to the Victus S path turned up one more problem, which is the new patch 1 in v2. When the power source changes in performance, victus_s_powersource_event() sends SET_POWER_LIMITS with PL1 = PL2 = 0. That was added for the 8C9C as "restore the defaults". On this AMD firmware GM29 multiplies both values by 1000 and passes them to ALIB as the SPPT and FPPT limits whenever the EC power level (OCPC) is 0. Under full CPU load on battery that held the CPU at 399 MHz and below 5 W. This firmware already sets these limits itself from the EC power-source event (_Q20): 25 W on battery and up to 54 W on AC. So v2 adds a per-board flag to skip the refresh and sets it for 88D2. With it the CPU holds about 25 W on battery and recovers to about 50 W on AC.
Other AMD boards in hp_wmi_feature_boards[] may have the same GM29. I've only been able to test 88D2, so I set the flag for that board alone. It may be worth checking the others.
One user-visible change: on 88D2 the profile choices go from cool/balanced/performance to low-power/balanced/performance. That's consistent with the other feature boards, and I've noted it in the commit message.
Tested on 88D2 (BIOS F.20, Ryzen 7 5800H, RTX 3070 Laptop GPU): 100 W GPU limit in performance and 80 W in balanced and low-power, correct profile readback in each, and the fan and power-source results above.
Thanks,
David