Open Someone52 opened 3 years ago
Available DYTC modes may vary in different models. However, only documented modes in https://patchwork.kernel.org/project/linux-acpi/patch/20201211020630.305905-3-markpearson@lenovo.com/ is added. Other modes in DSDT are just made into unused macro.
If you are interested in further investigation, you can try following steps and maybe can find something useful.
ioio -s ThinkVPC DYTCMode 0x12b001
After some more investigation, there seem to be 8 performance modes for the 0xD (13) command.
ioio -s ThinkVPC DYTCMode 0x11D001 ioio -s ThinkVPC DYTCMode 0x12D001 & etc
Modes 1-4 seem to be quiet, noticeably reducing the cooling fan speed (which is good because it seems like mode 4 is how it runs by default on windows) 1-3 seem to reduce cpu frequencies to 0,4ghz - 0,5ghz range which is definitely unusable and way too laggy. 4 reduces it to around 0,6ghz - 1,5 ghz, which seems to be optimal
5 and 6 seems to be how it runs by default, with fans blowing noticeably louder. 7 and 8 seem to let the cpu boost a little bit more and temperatures to climb higher, but need more testing just to be sure.
There is a catch though, it seems like the sequence of commands is very important. Before sending the mode command, a disable has to be set: ioio -s ThinkVPC DYTCMode 0x0FD001 And only then a performance mode can be set: ioio -s ThinkVPC DYTCMode 0x14D001
Otherwise, if not doing this with proper sequence the laptop sometimes end up glitching and cpu seems to lock up at a clock of 0,4ghz and stay at that until proper sequence (or at least two 0x1FF resets) are sent.
Other functions (0x1 - lapmode, 0x4 - ??) seem to have no noticeable effect.
Edit: after futher testing on my i7-8565u and monitoring speeds/temps/etc
Modes 1-4:
Modes 5-6:
Modes 7-8
I have made a pull request containing the implementation of my findings. https://github.com/zhen-zen/YogaSMC/pull/111
Thank you for implementing support for this function. The PR looks good and maybe we can carry out preciser control based on DYTC version.
PSC function is also spotted on X1 Extreme and X1C6. Both machine has DYTC version 4.2, but the latter one has the following restriction:
If (((Local3 != 0x02) && ((Local3 != 0x07) && (Local3 != 0x08))))
{
ADBG ("PSC InValid Mode, Clear the PSC State.")
Local4 = 0x00
}
So I'm not sure if this function is ready on 4.2 version.
@1Revenger1 @tylernguyen @benbender Does current mode control work on your laptop? And how about the linked PR by @Someone52 ?
And prior to version 4.2, it seems that PSC mode is not supported. The 4.1 one from E580 even has few modes than mine (4.0). Maybe we can judge the availability of PSC mode by DYTC version?
The most complete DYTC method I have seen is obtained from Yoga C940 (15)
STD (0x0): 0xf, - // standard
CQL (0x1): 0xf, 0/1 // lap (check specific mode under desk/MMC)
TIO (0x2): 0xf, 0/1
MYH (0x3):
TBL: 0x0, 1
TNT: 0x1, 1
LFT: 0x2, 1
MASK: 0xf, 0
STP (0x4): 0xf, 0/1
CQH (0x5): 0xf, 0/1
DCC (0x6): 0xf, 0/1
SFN (0x7): 0xf, 0/1
DMC (0x8): 0xf, 0/1
FHP (0x9): 0xf, 0/1
IFC (0xa): 0xf, 0/1
MMC (0xb): // desk
PFM: 0x2, 1 // performance
QUT: 0x3, 1 // quiet
MASK: 0xf, 1 // balance
MSC (0xc): 0xf, 0/1
PSC (0xd):
0x1-0x8, 1
0xf, 0
CSC (0xe): 0xf, 0/1
Currently I don't have many samples on DYTC 5.0 and newer. But at least yours is covered by the list above.
Just tested on my device and it appears to function correctly. The changes are reflected in IORegistryExplorer and no errors are created when looking through log show --last boot | grep -i ysmc
. There doesn't seem to really be any change on how my device uses the fans, though that was the case with the old implementation of DYTC as well. Additionally, I am able to select Quiet values (before this PR, if I set quiet, it would revert back to Normal). Here is a picture from IOReg:
Edit: I just now realized that this should've gone under the PR, oops
The normal mode is called MMC AUTO mode in Yoga C940 (15) example above. It seems that on X1E and X1C6, supported mode is 1/2/f instead of 3/2/f for quiet/performance/balance (aka AUTO). I don't know how to distinguish them, maybe some different command below may help that.
For version 5.0, only normal mode is supported for E590 and X1C7 don't have MMC function at all.
And it's quite confusing that they still stick to the MMC function in https://patchwork.kernel.org/project/platform-driver-x86/patch/20210111162237.3469-1-markpearson@lenovo.com/ where requires DYTC version 5 and newer.
@zhen-zen
The current mode control doesn't work on my x1c6. It's limited to only Balance or Performance. The same thing goes for the new PR.
@zhen-zen
The current mode control doesn't work on my x1c6. It's limited to only Balance or Performance. The same thing goes for the new PR.
I suppose at least 2/7/8 should work for your model. So it's a bit strange here. When you are available, can you check the initial DYTC result in debug log after switching to different thermal mode in Vantage / BIOS?
Finally got some time for #116 . Please try that and I will merge both PR.
Lenovo Thinkpad E590 When trying to set the modes, I get the following:
YSMC - Info: ThinkVPC::KHEY DYTCMode command 0x12b001 result: 0x0000000a (invalid argument) YSMC - Info: ThinkVPC::HKEY DYTCMode toggle failed
After a bit of investigation, i've decompiled the dytc method on my laptop, which is as follows:
As evident by the code here:
The method 0x0B ( which is
#define DYTC_FUNCTION_MMC 11 /* Function = 11, desk mode, priority 3 */
) does seem to be disabled and rejects all arguments apart from ICMode=0xF / ValidF = 0x0Method method 0x0D ( which is not documented) however does seem to do change something (most likely the same performance modes)