BeardOverflow / msi-ec

GNU General Public License v2.0
134 stars 41 forks source link

Add `Katana 17 B11UCX (17L2EMS1)` support #97

Closed fuckgithubanyway closed 6 months ago

fuckgithubanyway commented 7 months ago

Something went wrong with the previous pull request. I'm duplicating it here.

device: MSI Katana 17 B11UCX-897XRU -family: GF -version: REV:1.0

motherboard: MS-17L2 *-firmware: E17L2IMS.317

CPU: 11th Gen Intel(R) Core(TM) i5-11260H @ 2.60GHz iGPU: TigerLake-H GT1 [UHD Graphics] dGPU: GA107 [GeForce RTX 2050]

EC firmware version: 17L2EMS1.108

EC_dump in default state:

     | _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f
-----+------------------------------------------------
0x0_ | 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1_ | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x2_ | 00 00 00 00 00 00 00 00 0a 05 00 00 00 04 0b 0b
0x3_ | 02 05 00 0d 00 00 50 81 d2 11 88 2c c8 01 c0 00
0x4_ | f8 11 36 00 cb 11 90 fb 78 09 04 2c c1 0b fa 32
0x5_ | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x6_ | 00 00 00 00 00 00 00 00 25 00 37 40 49 4c 52 58
0x7_ | 64 26 26 2b 30 36 3c 46 55 64 08 03 03 03 03 03
0x8_ | 00 00 37 3d 43 49 4f 54 63 00 00 2b 30 36 3c 46
0x9_ | 55 64 08 03 03 03 03 02 02 0f 7d 02 0a 78 32 00
0xa_ | 31 37 4c 32 45 4d 53 31 2e 31 30 38 30 34 31 30
0xb_ | 32 30 32 33 31 33 3a 34 34 3a 34 32 00 00 00 08
0xc_ | 00 00 01 25 00 00 00 00 00 d3 00 00 00 00 00 00
0xd_ | 00 00 c1 81 0d 00 05 bc 00 01 00 00 00 00 00 00
0xe_ | e2 00 00 cb 11 00 00 40 40 00 00 00 00 d1 00 00
0xf_ | 00 00 70 00 00 64 00 00 64 00 00 00 00 00 00 00

EC_dump in charging + cooler_boost + micmute_led is on + kbd_bl is off + webcam is off :

     | _0 _1 _2 _3 _4 _5 _6 _7 _8 _9 _a _b _c _d _e _f
-----+------------------------------------------------
0x0_ | 00 80 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x1_ | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x2_ | 00 00 00 00 00 00 00 00 0a 05 00 00 02 04 09 0b
0x3_ | 03 01 00 0d 01 00 50 81 d2 11 88 2c c8 01 c0 00
0x4_ | f8 11 34 00 cb 11 00 00 2d 09 fa 2c ca 0b fa 32
0x5_ | 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x6_ | 00 00 00 00 00 00 00 00 26 00 37 40 49 4c 52 58
0x7_ | 64 26 26 2b 30 36 3c 46 55 64 08 03 03 03 03 03
0x8_ | 21 00 37 3d 43 49 4f 54 63 00 00 2b 30 36 3c 46
0x9_ | 55 64 08 03 03 03 03 02 82 0f 7d 02 0a 78 35 00
0xa_ | 31 37 4c 32 45 4d 53 31 2e 31 30 38 30 34 31 30
0xb_ | 32 30 32 33 31 33 3a 34 34 3a 34 32 00 00 00 08
0xc_ | 00 00 01 25 00 00 00 00 00 54 00 51 00 00 00 00
0xd_ | 00 00 c1 80 0d 00 05 bc 00 01 00 00 00 00 00 00
0xe_ | e2 00 00 cb 11 00 00 40 40 00 00 00 00 c0 00 00
0xf_ | 00 00 70 00 00 64 00 00 64 00 00 00 00 00 00 00

After several weeks of use, no critical problems were noticed. The functions documented by the driver work correctly.

Noticed discrepancy in items ../fn_key and ../win_key. The states indicated in them are in fact inverted.

teackot commented 6 months ago

Hi, I'm back! Sorry for the delay. Thanks for the dumps. I've only found one little problem

charge control
usb share - thanks for documenting it
webcam
fn/win
cooler boost
shift mode
super battery
fan mode
cpu
gpu.rt_temp ~❌~ ✓ the first dump reports 00 at 0x80, seems wrong unless you're using the laptop outdoors this winter =)
edit: it is 0 when the gpu is inactive
gpu.rt_fan
LEDs
backlight

Noticed discrepancy in items ../fn_key and ../win_key. The states indicated in them are in fact inverted.

It's a known proplem on laptops that have win key on the left and fn key on the right

Other than the gpu.rt_temp_address problem, everything else looks good

glpnk commented 6 months ago

@teackot I think MSI software somehow deals with inverted WinFn switch, because toggle for this is present in software, but always false, at least on server or middleware side

teackot commented 6 months ago

~If I remember correctly, the switch in the MSI app just controls whether the keys are swapped or not. It doesn't care about the actual placement of the keys on the keyboard.~

~Our driver, however, specifies the placement of each key explicitly - 'left' or 'right'. It assumes that Fn is physically on the left and Win is on the right, which is not the case for Katana 17.~

~If we want to keep the current explicit behaviour, I think we'll have to either specify the "invertedness" for each model in our configs, or determine it programmatically~

~Or, we can simplify things for us and do it the MSI's way, but lose the explicitness.~

teackot commented 6 months ago

Forget what I just said, MSI app also shows the placement explicitly

Screenshot from 2023-12-21 00-40-32

glpnk commented 6 months ago

But it supported only on model where this settings could be obtained from reading some UEFI var. Also it is kinda spaghetti code. I don't know can I share on github part of decompiled C# code, but you can check file from MSI NBFoundation Service folder OmApSvcBroker.exe OmApSvcBroker.CS.WinAndFnChange Class.

fuckgithubanyway commented 6 months ago

Hello comrades. Regarding the temperature of absolute zero on the GPU, the situation is as follows:

Here is a screenshot of the MSI center in the absence of a significant graphic load. Probably at such moments the graphics module of the central processor is used. iGPU

And here is the result after launching the video player. dGPU

The same behavior is observed in Linux.

fuckgithubanyway commented 6 months ago

+task manager indicators

iGPU_PM

dGPU_PM

teackot commented 6 months ago

@glpnk

but you can check file from MSI NBFoundation Service folder OmApSvcBroker.exe OmApSvcBroker.CS.WinAndFnChange Class.

Good idea. I guess I'll install a Windows VM and take a look (I couldn't install the dragon center with wine :(, )

teackot commented 6 months ago

@fuckgithubanyway

That explains everything! I guess the PR is ready to be merged

glpnk commented 6 months ago

@teackot Nah don't do it, I can send it to your email. Also I'm now working on MSI software analysis and post reports in #98. Also in NoteBook Fan Control mentioned that we just can analyze DSDT table .

But software analysis is useful to check for similarities and diffs

teackot commented 6 months ago

Also I'm now working on MSI software analysis and post reports in #98

Great! I see I missed a lot while I was away