sebanc / brunch

Boot ChromeOS on x86_64 PC - Supports Intel CPU/GPU from 8th gen or AMD Ryzen
GNU General Public License v3.0
3.54k stars 387 forks source link

Support new kernel surface linux #1826

Open nhatminhhp1999 opened 1 year ago

nhatminhhp1999 commented 1 year ago

In the new kernel release, surface linux team has added many important support for surface pro 8+9. I hope you can add the kernel to your project

3xfc commented 1 year ago

I would also be interested in this, since Brunch does not seem to support the touchscreen or the keyboard on my Surface Pro 9. (Brunch unstable with the option ithc_touchscreen does not work either.)

3xfc commented 1 year ago

I created a fork of Brunch that has fully working type cover and touchscreen support on my Surface Pro 9 in the latest release. I'm not opening a pull request because I deleted / slightly modified some kernel patches to get it to build (which might break Brunch on other devices), as well as the code being kind of sloppy.

sebanc commented 1 year ago

Thanks a lot a @peter-marshall5, even though I applied the changes a bit differently your fork was very helpful.

Could someone try this brunch unstable build with kernel 6.1 ? https://github.com/sebanc/brunch-unstable/releases/tag/r111-unstable-20230424

3xfc commented 1 year ago

I just tried it out, and everything is working properly. The battery power usage does seem to be a lot higher than on Linux, though. Strangely, the CPU clock jumps up higher than 3GHz and the power usage spikes insanely high when touching the screen or using the stylus. There is nothing with excessively high CPU usage in top during this time and the CPU usage stays within 20%. The same issue occurs on my own fork as well. Could this be caused by (in this case broken) interactivity boosting in Chrome OS?

Here's a screenshot of powertop running in Brioche. The power usage seems related to /dev/ttyS0. Screenshot 2023-04-24 6 40 43 PM

3xfc commented 1 year ago

~Strangely, the issue with the CPU boosting to its max clock is no longer happening after disabling 81-power_settings.sh in the Brunch patches folder~ Never mind, that's after using TLP inside Brioche to limit the max CPU performance. However, the wakeups caused by ttyS0 are now gone.

sebanc commented 1 year ago

This is very interesting, however I don't really understand how 81-power_settings.sh patch could impact wakeups caused by ttyS0.

Did you maybe also remove 99-services.sh patch ? this one would be more likely to cause issues with ttyS0 and I am not actually sure if it is necessary.

3xfc commented 1 year ago

I tried messing around with 99-services.patch, and I can confirm that disabling it causes the ttyS0 issue to appear. Just to clarify, the issue would happen when the system was idle. The touchscreen power usage is a separate issue.

3xfc commented 1 year ago

This is getting even stranger. Chrome OS now seems to be accessing the touchscreen without iptsd. Touch still works after running sudo stop ipts, and ps -A | grep ipts doesn't yield anything. Touch also works when booting without the ithc_touchscreen option.

3xfc commented 1 year ago

I fixed the CPU frequency issue by setting the Intel HWP mode to power or balance_power. (It's set to balance_performance by default.)

This can be done by running echo balance_power | sudo tee /sys/bus/cpu/devices/cpu*/cpufreq/energy_performance_preference power.