From cdd9778b2a2da259664ea8b5af030fd40308a25f Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Wed, 25 Aug 2021 13:50:48 +0200 Subject: [PATCH 1/2] contrib/thermald: Use a coherent structure --- contrib/thermald/README.md | 5 ++++- .../thermal-conf.xml} | 8 ++++---- .../{SurfacePro5 => surface_pro_5}/40-surface-power.rules | 0 contrib/thermald/{SurfacePro5 => surface_pro_5}/README.md | 0 .../thermal-conf.xml.auto.cool | 0 .../thermal-conf.xml.auto.mobile | 0 .../thermal-conf.xml.auto.performance | 0 .../thermal-cpu-cdev-order.xml | 1 - .../{SurfacePro5 => surface_pro_5}/thermald.service | 0 9 files changed, 8 insertions(+), 6 deletions(-) rename contrib/thermald/{example_config_SL1.xml => surface_laptop_1/thermal-conf.xml} (92%) rename contrib/thermald/{SurfacePro5 => surface_pro_5}/40-surface-power.rules (100%) rename contrib/thermald/{SurfacePro5 => surface_pro_5}/README.md (100%) rename contrib/thermald/{SurfacePro5 => surface_pro_5}/thermal-conf.xml.auto.cool (100%) rename contrib/thermald/{SurfacePro5 => surface_pro_5}/thermal-conf.xml.auto.mobile (100%) rename contrib/thermald/{SurfacePro5 => surface_pro_5}/thermal-conf.xml.auto.performance (100%) rename contrib/thermald/{SurfacePro5 => surface_pro_5}/thermal-cpu-cdev-order.xml (99%) rename contrib/thermald/{SurfacePro5 => surface_pro_5}/thermald.service (100%) diff --git a/contrib/thermald/README.md b/contrib/thermald/README.md index 8a3349313..f3e2b9cc5 100644 --- a/contrib/thermald/README.md +++ b/contrib/thermald/README.md @@ -5,9 +5,12 @@ Modify the `65000` value to adapt that to your liking Tested on a Surface Book 2, other devices may need adapting, see e.g. the [thermald man page](http://manpages.ubuntu.com/manpages/trusty/man5/thermal-conf.xml.5.html). +More complex and device specific examples can be found in subdirectories +If any subdirectory does not have both files or any dedicated instructions, use the missing files provided here and/or follow these instructions. + ## Installation -Both XML files need to be placed in the `/etc/thermald/` directory. +Both XML files (`thermal-conf.xml` and `thermal-cpu-cdev-order-xml`) need to be placed in the `/etc/thermald/` directory. Newer thermald versions attempt to automatically load the configuration from ACPI. If you want to use a manual configuration with such a version, you may need to remove the `--adaptive` option from the systemd service `ExecStart` line. diff --git a/contrib/thermald/example_config_SL1.xml b/contrib/thermald/surface_laptop_1/thermal-conf.xml similarity index 92% rename from contrib/thermald/example_config_SL1.xml rename to contrib/thermald/surface_laptop_1/thermal-conf.xml index be53478d6..40004f5ba 100644 --- a/contrib/thermald/example_config_SL1.xml +++ b/contrib/thermald/surface_laptop_1/thermal-conf.xml @@ -1,9 +1,9 @@ - Override - * - QUIET + Override + * + QUIET test @@ -46,4 +46,4 @@ - + \ No newline at end of file diff --git a/contrib/thermald/SurfacePro5/40-surface-power.rules b/contrib/thermald/surface_pro_5/40-surface-power.rules similarity index 100% rename from contrib/thermald/SurfacePro5/40-surface-power.rules rename to contrib/thermald/surface_pro_5/40-surface-power.rules diff --git a/contrib/thermald/SurfacePro5/README.md b/contrib/thermald/surface_pro_5/README.md similarity index 100% rename from contrib/thermald/SurfacePro5/README.md rename to contrib/thermald/surface_pro_5/README.md diff --git a/contrib/thermald/SurfacePro5/thermal-conf.xml.auto.cool b/contrib/thermald/surface_pro_5/thermal-conf.xml.auto.cool similarity index 100% rename from contrib/thermald/SurfacePro5/thermal-conf.xml.auto.cool rename to contrib/thermald/surface_pro_5/thermal-conf.xml.auto.cool diff --git a/contrib/thermald/SurfacePro5/thermal-conf.xml.auto.mobile b/contrib/thermald/surface_pro_5/thermal-conf.xml.auto.mobile similarity index 100% rename from contrib/thermald/SurfacePro5/thermal-conf.xml.auto.mobile rename to contrib/thermald/surface_pro_5/thermal-conf.xml.auto.mobile diff --git a/contrib/thermald/SurfacePro5/thermal-conf.xml.auto.performance b/contrib/thermald/surface_pro_5/thermal-conf.xml.auto.performance similarity index 100% rename from contrib/thermald/SurfacePro5/thermal-conf.xml.auto.performance rename to contrib/thermald/surface_pro_5/thermal-conf.xml.auto.performance diff --git a/contrib/thermald/SurfacePro5/thermal-cpu-cdev-order.xml b/contrib/thermald/surface_pro_5/thermal-cpu-cdev-order.xml similarity index 99% rename from contrib/thermald/SurfacePro5/thermal-cpu-cdev-order.xml rename to contrib/thermald/surface_pro_5/thermal-cpu-cdev-order.xml index e690c5a26..75fe44a1e 100644 --- a/contrib/thermald/SurfacePro5/thermal-cpu-cdev-order.xml +++ b/contrib/thermald/surface_pro_5/thermal-cpu-cdev-order.xml @@ -15,4 +15,3 @@ The Following cooling device can present cpufreq Processor - diff --git a/contrib/thermald/SurfacePro5/thermald.service b/contrib/thermald/surface_pro_5/thermald.service similarity index 100% rename from contrib/thermald/SurfacePro5/thermald.service rename to contrib/thermald/surface_pro_5/thermald.service From dd0c84f0f17676ca95571454c47625c52d998f7a Mon Sep 17 00:00:00 2001 From: Maximilian Luz Date: Wed, 25 Aug 2021 14:02:19 +0200 Subject: [PATCH 2/2] contrib/thermald: Be consistent about formatting --- .../surface_laptop_1/thermal-conf.xml | 2 +- .../surface_pro_5/40-surface-power.rules | 2 - .../surface_pro_5/thermal-conf.xml.auto.cool | 166 ++++++++-------- .../thermal-conf.xml.auto.mobile | 186 +++++++++--------- .../thermal-conf.xml.auto.performance | 146 +++++++------- .../surface_pro_5/thermal-cpu-cdev-order.xml | 21 +- .../thermald/surface_pro_5/thermald.service | 1 - contrib/thermald/thermal-conf.xml | 50 ++--- contrib/thermald/thermal-cpu-cdev-order.xml | 12 +- 9 files changed, 284 insertions(+), 302 deletions(-) diff --git a/contrib/thermald/surface_laptop_1/thermal-conf.xml b/contrib/thermald/surface_laptop_1/thermal-conf.xml index 40004f5ba..005b52b55 100644 --- a/contrib/thermald/surface_laptop_1/thermal-conf.xml +++ b/contrib/thermald/surface_laptop_1/thermal-conf.xml @@ -46,4 +46,4 @@ - \ No newline at end of file + diff --git a/contrib/thermald/surface_pro_5/40-surface-power.rules b/contrib/thermald/surface_pro_5/40-surface-power.rules index 018e1f5f2..143a4d712 100644 --- a/contrib/thermald/surface_pro_5/40-surface-power.rules +++ b/contrib/thermald/surface_pro_5/40-surface-power.rules @@ -23,8 +23,6 @@ # E: POWER_SUPPLY_ONLINE=0 # E: SUBSYSTEM=power_supply - - # Plugged SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", RUN+="/usr/bin/logger -t surface power supply online" SUBSYSTEM=="power_supply", ENV{POWER_SUPPLY_ONLINE}=="1", RUN+="/usr/bin/surface profile set performance" diff --git a/contrib/thermald/surface_pro_5/thermal-conf.xml.auto.cool b/contrib/thermald/surface_pro_5/thermal-conf.xml.auto.cool index 14be11d35..a8798adc3 100644 --- a/contrib/thermald/surface_pro_5/thermal-conf.xml.auto.cool +++ b/contrib/thermald/surface_pro_5/thermal-conf.xml.auto.cool @@ -1,85 +1,83 @@ - - - - - Auto generated - Surface Pro - QUIET - - 0 - 3000 - 25000 - 28000 - 32000 - 500 - - - - auto_zone_0 - - - pch_skylake - 46000 - Passive - - B0D4 - 20 - 15000000 - - - - pch_skylake - 49000 - Passive - - B0D4 - 20 - 13000000 - - - - pch_skylake - 52000 - Passive - - B0D4 - 20 - 11000000 - - - - pch_skylake - 56000 - Passive - - B0D4 - 20 - 9000000 - - - - pch_skylake - 59000 - Passive - - B0D4 - 15 - 7000000 - - - - pch_skylake - 62000 - Passive - - B0D4 - 10 - 6000000 - - - - - - + + + + Auto generated + Surface Pro + QUIET + + 0 + 3000 + 25000 + 28000 + 32000 + 500 + + + + auto_zone_0 + + + pch_skylake + 46000 + Passive + + B0D4 + 20 + 15000000 + + + + pch_skylake + 49000 + Passive + + B0D4 + 20 + 13000000 + + + + pch_skylake + 52000 + Passive + + B0D4 + 20 + 11000000 + + + + pch_skylake + 56000 + Passive + + B0D4 + 20 + 9000000 + + + + pch_skylake + 59000 + Passive + + B0D4 + 15 + 7000000 + + + + pch_skylake + 62000 + Passive + + B0D4 + 10 + 6000000 + + + + + + - diff --git a/contrib/thermald/surface_pro_5/thermal-conf.xml.auto.mobile b/contrib/thermald/surface_pro_5/thermal-conf.xml.auto.mobile index 538d6a585..38b4a78ff 100644 --- a/contrib/thermald/surface_pro_5/thermal-conf.xml.auto.mobile +++ b/contrib/thermald/surface_pro_5/thermal-conf.xml.auto.mobile @@ -1,95 +1,93 @@ - - - - - Auto generated - Surface Pro - QUIET - - 0 - 3000 - 15000 - 28000 - 32000 - 500 - - - - auto_zone_0 - - - pch_skylake - 39000 - Passive - - B0D4 - 10 - 15000000 - - - - pch_skylake - 43000 - Passive - - B0D4 - 10 - 10000000 - - - - pch_skylake - 47000 - Passive - - B0D4 - 10 - 8000000 - - - - pch_skylake - 49000 - Passive - - B0D4 - 10 - 6000000 - - - - pch_skylake - 51000 - Passive - - B0D4 - 5 - 5000000 - - - - pch_skylake - 53000 - Passive - - B0D4 - 5 - 4000000 - - - - pch_skylake - 54000 - Passive - - B0D4 - 5 - 3000000 - - - - - - + + + + Auto generated + Surface Pro + QUIET + + 0 + 3000 + 15000 + 28000 + 32000 + 500 + + + + auto_zone_0 + + + pch_skylake + 39000 + Passive + + B0D4 + 10 + 15000000 + + + + pch_skylake + 43000 + Passive + + B0D4 + 10 + 10000000 + + + + pch_skylake + 47000 + Passive + + B0D4 + 10 + 8000000 + + + + pch_skylake + 49000 + Passive + + B0D4 + 10 + 6000000 + + + + pch_skylake + 51000 + Passive + + B0D4 + 5 + 5000000 + + + + pch_skylake + 53000 + Passive + + B0D4 + 5 + 4000000 + + + + pch_skylake + 54000 + Passive + + B0D4 + 5 + 3000000 + + + + + + - diff --git a/contrib/thermald/surface_pro_5/thermal-conf.xml.auto.performance b/contrib/thermald/surface_pro_5/thermal-conf.xml.auto.performance index fb06d3360..00c75921a 100644 --- a/contrib/thermald/surface_pro_5/thermal-conf.xml.auto.performance +++ b/contrib/thermald/surface_pro_5/thermal-conf.xml.auto.performance @@ -1,75 +1,73 @@ - - - - - Auto generated - Surface Pro - QUIET - - 0 - 3000 - 15000 - 28000 - 32000 - 500 - - - - auto_zone_0 - - - pch_skylake - 54000 - Passive - - B0D4 - 10 - 15000000 - - - - pch_skylake - 58000 - Passive - - B0D4 - 10 - 13000000 - - - - pch_skylake - 60000 - Passive - - B0D4 - 5 - 9000000 - - - - pch_skylake - 62000 - Passive - - B0D4 - 5 - 7000000 - - - - pch_skylake - 63000 - Passive - - B0D4 - 5 - 6000000 - - - - - - + + + + Auto generated + Surface Pro + QUIET + + 0 + 3000 + 15000 + 28000 + 32000 + 500 + + + + auto_zone_0 + + + pch_skylake + 54000 + Passive + + B0D4 + 10 + 15000000 + + + + pch_skylake + 58000 + Passive + + B0D4 + 10 + 13000000 + + + + pch_skylake + 60000 + Passive + + B0D4 + 5 + 9000000 + + + + pch_skylake + 62000 + Passive + + B0D4 + 5 + 7000000 + + + + pch_skylake + 63000 + Passive + + B0D4 + 5 + 6000000 + + + + + + - diff --git a/contrib/thermald/surface_pro_5/thermal-cpu-cdev-order.xml b/contrib/thermald/surface_pro_5/thermal-cpu-cdev-order.xml index 75fe44a1e..b6cb80a22 100644 --- a/contrib/thermald/surface_pro_5/thermal-cpu-cdev-order.xml +++ b/contrib/thermald/surface_pro_5/thermal-cpu-cdev-order.xml @@ -1,17 +1,8 @@ - - - - - rapl_controller - intel_pstate - intel_powerclamp - cpufreq - Processor + + rapl_controller + intel_pstate + intel_powerclamp + cpufreq + Processor diff --git a/contrib/thermald/surface_pro_5/thermald.service b/contrib/thermald/surface_pro_5/thermald.service index 9445c2a4d..1353c0653 100644 --- a/contrib/thermald/surface_pro_5/thermald.service +++ b/contrib/thermald/surface_pro_5/thermald.service @@ -11,4 +11,3 @@ ExecStart=/usr/sbin/thermald --systemd --dbus-enable [Install] WantedBy=multi-user.target Alias=dbus-org.freedesktop.thermald.service - diff --git a/contrib/thermald/thermal-conf.xml b/contrib/thermald/thermal-conf.xml index b1efeb395..b25821df1 100644 --- a/contrib/thermald/thermal-conf.xml +++ b/contrib/thermald/thermal-conf.xml @@ -1,27 +1,27 @@ - + - - Intel Powered Laptop - * - QUIET - - - cpu - - - x86_pkg_temp - 65000 - passive - SEQUENTIAL - - 1 - rapl_controller - 100 - 5 - - - - - - + + Intel Powered Laptop + * + QUIET + + + cpu + + + x86_pkg_temp + 65000 + passive + SEQUENTIAL + + 1 + rapl_controller + 100 + 5 + + + + + + diff --git a/contrib/thermald/thermal-cpu-cdev-order.xml b/contrib/thermald/thermal-cpu-cdev-order.xml index 5877d4856..b6cb80a22 100644 --- a/contrib/thermald/thermal-cpu-cdev-order.xml +++ b/contrib/thermald/thermal-cpu-cdev-order.xml @@ -1,8 +1,8 @@ - - rapl_controller - intel_pstate - intel_powerclamp - cpufreq - Processor + + rapl_controller + intel_pstate + intel_powerclamp + cpufreq + Processor