Compare commits

...

21 Commits

Author SHA1 Message Date
Luke D. Jones 03e10610dd Bump version 2024-03-13 14:17:24 +13:00
Luke D. Jones a6a10a5bc4 Remove a dbg 2024-03-13 14:16:41 +13:00
Luke D. Jones 0985eca7ce Fix fancurves 2024-03-13 14:14:13 +13:00
Luke D. Jones bb7b3a81fb Bump version 2024-02-24 21:50:52 +13:00
Luke D. Jones 19607d71c3 Prep 5.0.8 release 2024-02-24 17:09:24 +13:00
Luke D. Jones 96f281d789 Remove the use of bytes in zbus signatures 2024-02-23 21:50:53 +13:00
Luke D. Jones 7613eded95 Sane defaults for asusd config 2024-02-23 14:40:00 +13:00
Luke D. Jones 50eccd2b1d Formatting and fixes 2024-02-23 12:36:16 +13:00
Luke Jones ba54007102 Merge branch 'bugfix/persistent-theme' into 'main'
Reintroduce persistent dark/light mode

See merge request asus-linux/asusctl!180
2024-02-19 19:44:59 +00:00
Filip Binkiewicz a028f5375f Reintroduce persistent dark/light mode 2024-02-19 19:27:56 +00:00
Luke Jones 9ec02cd727 Merge branch 'dearner-main-patch-22870' into 'main'
Added G814JZ to aura_support.ron (uses G814JI keymap)

See merge request asus-linux/asusctl!179
2024-02-14 01:40:26 +00:00
Chris Dearner 4b46ece09a Added G814JZ to aura_support.ron (uses G814JI keymap) 2024-02-05 12:49:49 +00:00
Luke D. Jones 086bbd0908 Fix the broken pipe error 2024-02-02 23:26:41 +13:00
Luke D. Jones c94eaa473e Update TS bindings 2024-01-24 22:37:10 +13:00
Luke D. Jones b1b809834b Reload and apply settings if config file externally changed 2024-01-24 12:19:34 +13:00
Luke D. Jones 84183288ec Fix inotify watch failing thanks to vim idiocy 2024-01-23 22:44:20 +13:00
Luke D. Jones 86cbef83b6 Reload asusd.ron if changed 2024-01-22 21:54:19 +13:00
Luke D. Jones 006fb632c4 Doc and feature fixes 2024-01-22 19:33:40 +13:00
Luke D. Jones e3636ed8ce Update smithay-client-toolkit 2024-01-22 12:06:42 +13:00
Luke D. Jones cfd207f251 Remove async-trait crate and set min rustc 1.75 2024-01-15 18:22:41 +13:00
Luke D. Jones d4c68546e7 Added ability to change what EPP is linked with each throttle profile 2024-01-15 18:00:27 +13:00
33 changed files with 943 additions and 510 deletions
+14
View File
@@ -6,6 +6,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
## [v5.0.8]
### Changed
- Reintroduce persisting dark/light mode in config file
- Added ability to change what EPP is linked with each throttle profile
- Don't change EPP or thermal profile if the battery/ac state hasn't actually changed on resume
- Re-implement the `asusctl -s` command (not fully)
- Add more docs to some parts of code, and dbus interfaces
- Reload asusd.ron if changed. Does not notify any dbus listeners (yet)
- Fix the broken pipe error
- Remove the use of bytes in zbus signatures (another cause of broken pipe)
### Added
- Support for G614J LED modes
## [v5.0.7] ## [v5.0.7]
### Changed ### Changed
- Fix to suspend process in anime thread to let custom anims run on wake. - Fix to suspend process in anime thread to let custom anims run on wake.
Generated
+160 -153
View File
@@ -104,9 +104,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]] [[package]]
name = "ahash" name = "ahash"
version = "0.8.6" version = "0.8.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"once_cell", "once_cell",
@@ -164,9 +164,9 @@ dependencies = [
[[package]] [[package]]
name = "anyhow" name = "anyhow"
version = "1.0.76" version = "1.0.79"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59d2a3357dde987206219e78ecfbbb6e8dad06cbb65292758d3270e6254f7355" checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca"
[[package]] [[package]]
name = "arboard" name = "arboard"
@@ -199,7 +199,7 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711"
[[package]] [[package]]
name = "asusctl" name = "asusctl"
version = "5.0.7" version = "5.0.8"
dependencies = [ dependencies = [
"asusd", "asusd",
"cargo-husky", "cargo-husky",
@@ -213,20 +213,21 @@ dependencies = [
"rog_platform", "rog_platform",
"rog_profiles", "rog_profiles",
"tinybmp", "tinybmp",
"tokio",
"toml 0.5.11", "toml 0.5.11",
] ]
[[package]] [[package]]
name = "asusd" name = "asusd"
version = "5.0.7" version = "5.0.8"
dependencies = [ dependencies = [
"async-trait",
"cargo-husky", "cargo-husky",
"concat-idents", "concat-idents",
"config-traits", "config-traits",
"dmi_id", "dmi_id",
"env_logger", "env_logger",
"futures-lite 1.13.0", "futures-lite 1.13.0",
"inotify",
"log", "log",
"logind-zbus", "logind-zbus",
"rog_anime", "rog_anime",
@@ -243,7 +244,7 @@ dependencies = [
[[package]] [[package]]
name = "asusd-user" name = "asusd-user"
version = "5.0.7" version = "5.0.8"
dependencies = [ dependencies = [
"cargo-husky", "cargo-husky",
"config-traits", "config-traits",
@@ -289,7 +290,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c"
dependencies = [ dependencies = [
"concurrent-queue", "concurrent-queue",
"event-listener 4.0.1", "event-listener 4.0.3",
"event-listener-strategy", "event-listener-strategy",
"futures-core", "futures-core",
"pin-project-lite", "pin-project-lite",
@@ -301,11 +302,11 @@ version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c"
dependencies = [ dependencies = [
"async-lock 3.2.0", "async-lock 3.3.0",
"async-task", "async-task",
"concurrent-queue", "concurrent-queue",
"fastrand 2.0.1", "fastrand 2.0.1",
"futures-lite 2.1.0", "futures-lite 2.2.0",
"slab", "slab",
] ]
@@ -343,18 +344,18 @@ dependencies = [
[[package]] [[package]]
name = "async-io" name = "async-io"
version = "2.2.2" version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6afaa937395a620e33dc6a742c593c01aced20aa376ffb0f628121198578ccc7" checksum = "fb41eb19024a91746eba0773aa5e16036045bbf45733766661099e182ea6a744"
dependencies = [ dependencies = [
"async-lock 3.2.0", "async-lock 3.3.0",
"cfg-if", "cfg-if",
"concurrent-queue", "concurrent-queue",
"futures-io", "futures-io",
"futures-lite 2.1.0", "futures-lite 2.2.0",
"parking", "parking",
"polling 3.3.1", "polling 3.3.2",
"rustix 0.38.28", "rustix 0.38.30",
"slab", "slab",
"tracing", "tracing",
"windows-sys 0.52.0", "windows-sys 0.52.0",
@@ -371,11 +372,11 @@ dependencies = [
[[package]] [[package]]
name = "async-lock" name = "async-lock"
version = "3.2.0" version = "3.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7125e42787d53db9dd54261812ef17e937c95a51e4d291373b670342fa44310c" checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b"
dependencies = [ dependencies = [
"event-listener 4.0.1", "event-listener 4.0.3",
"event-listener-strategy", "event-listener-strategy",
"pin-project-lite", "pin-project-lite",
] ]
@@ -404,7 +405,7 @@ dependencies = [
"cfg-if", "cfg-if",
"event-listener 3.1.0", "event-listener 3.1.0",
"futures-lite 1.13.0", "futures-lite 1.13.0",
"rustix 0.38.28", "rustix 0.38.30",
"windows-sys 0.48.0", "windows-sys 0.48.0",
] ]
@@ -416,7 +417,7 @@ checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.43", "syn 2.0.48",
] ]
[[package]] [[package]]
@@ -425,13 +426,13 @@ version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5"
dependencies = [ dependencies = [
"async-io 2.2.2", "async-io 2.3.0",
"async-lock 2.8.0", "async-lock 2.8.0",
"atomic-waker", "atomic-waker",
"cfg-if", "cfg-if",
"futures-core", "futures-core",
"futures-io", "futures-io",
"rustix 0.38.28", "rustix 0.38.30",
"signal-hook-registry", "signal-hook-registry",
"slab", "slab",
"windows-sys 0.48.0", "windows-sys 0.48.0",
@@ -439,19 +440,19 @@ dependencies = [
[[package]] [[package]]
name = "async-task" name = "async-task"
version = "4.6.0" version = "4.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1d90cd0b264dfdd8eb5bad0a2c217c1f88fa96a8573f40e7b12de23fb468f46" checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799"
[[package]] [[package]]
name = "async-trait" name = "async-trait"
version = "0.1.75" version = "0.1.77"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fdf6721fb0140e4f897002dd086c06f6c27775df19cfe1fccb21181a48fd2c98" checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.43", "syn 2.0.48",
] ]
[[package]] [[package]]
@@ -546,17 +547,17 @@ dependencies = [
[[package]] [[package]]
name = "base64" name = "base64"
version = "0.21.5" version = "0.21.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567"
[[package]] [[package]]
name = "bindgen" name = "bindgen"
version = "0.69.1" version = "0.69.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9ffcebc3849946a7170a05992aac39da343a90676ab392c51a4280981d6379c2" checksum = "a4c69fae65a523209d34240b60abe0c42d33d1045d445c0839d8a4894a736e2d"
dependencies = [ dependencies = [
"bitflags 2.4.1", "bitflags 2.4.2",
"cexpr", "cexpr",
"clang-sys", "clang-sys",
"lazy_static", "lazy_static",
@@ -567,7 +568,7 @@ dependencies = [
"regex", "regex",
"rustc-hash", "rustc-hash",
"shlex", "shlex",
"syn 2.0.43", "syn 2.0.48",
] ]
[[package]] [[package]]
@@ -578,9 +579,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]] [[package]]
name = "bitflags" name = "bitflags"
version = "2.4.1" version = "2.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf"
dependencies = [ dependencies = [
"serde", "serde",
] ]
@@ -626,11 +627,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118"
dependencies = [ dependencies = [
"async-channel 2.1.1", "async-channel 2.1.1",
"async-lock 3.2.0", "async-lock 3.3.0",
"async-task", "async-task",
"fastrand 2.0.1", "fastrand 2.0.1",
"futures-io", "futures-io",
"futures-lite 2.1.0", "futures-lite 2.2.0",
"piper", "piper",
"tracing", "tracing",
] ]
@@ -658,7 +659,7 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.43", "syn 2.0.48",
] ]
[[package]] [[package]]
@@ -745,9 +746,9 @@ dependencies = [
[[package]] [[package]]
name = "cfg-expr" name = "cfg-expr"
version = "0.15.5" version = "0.15.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" checksum = "6100bc57b6209840798d95cb2775684849d332f7bd788db2a8c8caf7ef82a41a"
dependencies = [ dependencies = [
"smallvec", "smallvec",
"target-lexicon", "target-lexicon",
@@ -790,9 +791,9 @@ dependencies = [
[[package]] [[package]]
name = "clang-sys" name = "clang-sys"
version = "1.6.1" version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1"
dependencies = [ dependencies = [
"glob", "glob",
"libc", "libc",
@@ -832,7 +833,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f76990911f2267d837d9d0ad060aa63aaad170af40904b29461734c339030d4d" checksum = "f76990911f2267d837d9d0ad060aa63aaad170af40904b29461734c339030d4d"
dependencies = [ dependencies = [
"quote", "quote",
"syn 2.0.43", "syn 2.0.48",
] ]
[[package]] [[package]]
@@ -846,7 +847,7 @@ dependencies = [
[[package]] [[package]]
name = "config-traits" name = "config-traits"
version = "5.0.7" version = "5.0.8"
dependencies = [ dependencies = [
"cargo-husky", "cargo-husky",
"log", "log",
@@ -899,13 +900,13 @@ dependencies = [
[[package]] [[package]]
name = "cpuctl" name = "cpuctl"
version = "5.0.7" version = "5.0.8"
[[package]] [[package]]
name = "cpufeatures" name = "cpufeatures"
version = "0.2.11" version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504"
dependencies = [ dependencies = [
"libc", "libc",
] ]
@@ -921,12 +922,9 @@ dependencies = [
[[package]] [[package]]
name = "crossbeam-utils" name = "crossbeam-utils"
version = "0.8.18" version = "0.8.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345"
dependencies = [
"cfg-if",
]
[[package]] [[package]]
name = "crypto-common" name = "crypto-common"
@@ -940,9 +938,9 @@ dependencies = [
[[package]] [[package]]
name = "deranged" name = "deranged"
version = "0.3.10" version = "0.3.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4"
dependencies = [ dependencies = [
"powerfmt", "powerfmt",
] ]
@@ -1026,7 +1024,7 @@ dependencies = [
[[package]] [[package]]
name = "dmi_id" name = "dmi_id"
version = "5.0.7" version = "5.0.8"
dependencies = [ dependencies = [
"log", "log",
"udev", "udev",
@@ -1165,14 +1163,14 @@ checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.43", "syn 2.0.48",
] ]
[[package]] [[package]]
name = "env_logger" name = "env_logger"
version = "0.10.1" version = "0.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580"
dependencies = [ dependencies = [
"humantime", "humantime",
"is-terminal", "is-terminal",
@@ -1242,9 +1240,9 @@ dependencies = [
[[package]] [[package]]
name = "event-listener" name = "event-listener"
version = "4.0.1" version = "4.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84f2cdcf274580f2d63697192d744727b3198894b1bf02923643bf59e2c26712" checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e"
dependencies = [ dependencies = [
"concurrent-queue", "concurrent-queue",
"parking", "parking",
@@ -1257,7 +1255,7 @@ version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3"
dependencies = [ dependencies = [
"event-listener 4.0.1", "event-listener 4.0.3",
"pin-project-lite", "pin-project-lite",
] ]
@@ -1278,9 +1276,9 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5"
[[package]] [[package]]
name = "fdeflate" name = "fdeflate"
version = "0.3.2" version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7caf4086251adeba90011a7ff9bd1f6d7f7595be0871867daa4dbb0fcf2ca932" checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645"
dependencies = [ dependencies = [
"simd-adler32", "simd-adler32",
] ]
@@ -1387,9 +1385,9 @@ dependencies = [
[[package]] [[package]]
name = "futures-lite" name = "futures-lite"
version = "2.1.0" version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "aeee267a1883f7ebef3700f262d2d54de95dfaf38189015a74fdc4e0c7ad8143" checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba"
dependencies = [ dependencies = [
"fastrand 2.0.1", "fastrand 2.0.1",
"futures-core", "futures-core",
@@ -1406,7 +1404,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.43", "syn 2.0.48",
] ]
[[package]] [[package]]
@@ -1519,9 +1517,9 @@ dependencies = [
[[package]] [[package]]
name = "getrandom" name = "getrandom"
version = "0.2.11" version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"libc", "libc",
@@ -1826,9 +1824,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
[[package]] [[package]]
name = "hermit-abi" name = "hermit-abi"
version = "0.3.3" version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f"
[[package]] [[package]]
name = "hex" name = "hex"
@@ -1853,16 +1851,16 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
[[package]] [[package]]
name = "iana-time-zone" name = "iana-time-zone"
version = "0.1.58" version = "0.1.59"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539"
dependencies = [ dependencies = [
"android_system_properties", "android_system_properties",
"core-foundation-sys", "core-foundation-sys",
"iana-time-zone-haiku", "iana-time-zone-haiku",
"js-sys", "js-sys",
"wasm-bindgen", "wasm-bindgen",
"windows-core", "windows-core 0.52.0",
] ]
[[package]] [[package]]
@@ -1941,13 +1939,13 @@ dependencies = [
[[package]] [[package]]
name = "is-terminal" name = "is-terminal"
version = "0.4.9" version = "0.4.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455"
dependencies = [ dependencies = [
"hermit-abi", "hermit-abi",
"rustix 0.38.28", "rustix 0.38.30",
"windows-sys 0.48.0", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
@@ -2049,9 +2047,9 @@ dependencies = [
[[package]] [[package]]
name = "libc" name = "libc"
version = "0.2.151" version = "0.2.152"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7"
[[package]] [[package]]
name = "libloading" name = "libloading"
@@ -2069,7 +2067,7 @@ version = "0.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8"
dependencies = [ dependencies = [
"bitflags 2.4.1", "bitflags 2.4.2",
"libc", "libc",
"redox_syscall 0.4.1", "redox_syscall 0.4.1",
] ]
@@ -2080,7 +2078,7 @@ version = "0.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607"
dependencies = [ dependencies = [
"bitflags 2.4.1", "bitflags 2.4.2",
"libc", "libc",
"redox_syscall 0.4.1", "redox_syscall 0.4.1",
] ]
@@ -2115,9 +2113,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519"
[[package]] [[package]]
name = "linux-raw-sys" name = "linux-raw-sys"
version = "0.4.12" version = "0.4.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c"
[[package]] [[package]]
name = "lock_api" name = "lock_api"
@@ -2169,9 +2167,9 @@ dependencies = [
[[package]] [[package]]
name = "memchr" name = "memchr"
version = "2.6.4" version = "2.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
[[package]] [[package]]
name = "memmap2" name = "memmap2"
@@ -2405,7 +2403,7 @@ dependencies = [
"proc-macro-crate", "proc-macro-crate",
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.43", "syn 2.0.48",
] ]
[[package]] [[package]]
@@ -2610,15 +2608,15 @@ checksum = "5de5067af0cd27add969cdb4ef2eecc955f59235f3b7a75a3c6ac9562cfb6b81"
[[package]] [[package]]
name = "pkg-config" name = "pkg-config"
version = "0.3.28" version = "0.3.29"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb"
[[package]] [[package]]
name = "png" name = "png"
version = "0.17.10" version = "0.17.11"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64" checksum = "1f6c3c3e617595665b8ea2ff95a86066be38fb121ff920a9c0eb282abcd1da5a"
dependencies = [ dependencies = [
"bitflags 1.3.2", "bitflags 1.3.2",
"crc32fast", "crc32fast",
@@ -2655,14 +2653,14 @@ dependencies = [
[[package]] [[package]]
name = "polling" name = "polling"
version = "3.3.1" version = "3.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cf63fa624ab313c11656b4cda960bfc46c410187ad493c41f6ba2d8c1e991c9e" checksum = "545c980a3880efd47b2e262f6a4bb6daad6555cf3367aa9c4e52895f69537a41"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"concurrent-queue", "concurrent-queue",
"pin-project-lite", "pin-project-lite",
"rustix 0.38.28", "rustix 0.38.30",
"tracing", "tracing",
"windows-sys 0.52.0", "windows-sys 0.52.0",
] ]
@@ -2715,9 +2713,9 @@ dependencies = [
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.71" version = "1.0.78"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75cb1540fadbd5b8fbccc4dddad2734eba435053f725621c070711a14bb5f4b8" checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae"
dependencies = [ dependencies = [
"unicode-ident", "unicode-ident",
] ]
@@ -2733,9 +2731,9 @@ dependencies = [
[[package]] [[package]]
name = "quote" name = "quote"
version = "1.0.33" version = "1.0.35"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
] ]
@@ -2807,9 +2805,9 @@ dependencies = [
[[package]] [[package]]
name = "regex" name = "regex"
version = "1.10.2" version = "1.10.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"memchr", "memchr",
@@ -2819,9 +2817,9 @@ dependencies = [
[[package]] [[package]]
name = "regex-automata" name = "regex-automata"
version = "0.4.3" version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" checksum = "3b7fa1134405e2ec9353fd416b17f8dacd46c473d7d3fd1cf202706a14eb792a"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"memchr", "memchr",
@@ -2836,7 +2834,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
[[package]] [[package]]
name = "rog-control-center" name = "rog-control-center"
version = "5.0.7" version = "5.0.8"
dependencies = [ dependencies = [
"asusd", "asusd",
"cargo-husky", "cargo-husky",
@@ -2869,7 +2867,7 @@ dependencies = [
[[package]] [[package]]
name = "rog_anime" name = "rog_anime"
version = "5.0.7" version = "5.0.8"
dependencies = [ dependencies = [
"cargo-husky", "cargo-husky",
"dmi_id", "dmi_id",
@@ -2886,7 +2884,7 @@ dependencies = [
[[package]] [[package]]
name = "rog_aura" name = "rog_aura"
version = "5.0.7" version = "5.0.8"
dependencies = [ dependencies = [
"cargo-husky", "cargo-husky",
"dmi_id", "dmi_id",
@@ -2900,7 +2898,7 @@ dependencies = [
[[package]] [[package]]
name = "rog_dbus" name = "rog_dbus"
version = "5.0.7" version = "5.0.8"
dependencies = [ dependencies = [
"asusd", "asusd",
"cargo-husky", "cargo-husky",
@@ -2913,7 +2911,7 @@ dependencies = [
[[package]] [[package]]
name = "rog_platform" name = "rog_platform"
version = "5.0.7" version = "5.0.8"
dependencies = [ dependencies = [
"cargo-husky", "cargo-husky",
"concat-idents", "concat-idents",
@@ -2930,7 +2928,7 @@ dependencies = [
[[package]] [[package]]
name = "rog_profiles" name = "rog_profiles"
version = "5.0.7" version = "5.0.8"
dependencies = [ dependencies = [
"cargo-husky", "cargo-husky",
"log", "log",
@@ -2944,7 +2942,7 @@ dependencies = [
[[package]] [[package]]
name = "rog_simulators" name = "rog_simulators"
version = "5.0.7" version = "5.0.8"
dependencies = [ dependencies = [
"glam", "glam",
"log", "log",
@@ -2960,7 +2958,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94" checksum = "b91f7eff05f748767f183df4320a63d6936e9c6107d97c9e6bdd9784f4289c94"
dependencies = [ dependencies = [
"base64", "base64",
"bitflags 2.4.1", "bitflags 2.4.2",
"serde", "serde",
"serde_derive", "serde_derive",
] ]
@@ -3012,14 +3010,14 @@ dependencies = [
[[package]] [[package]]
name = "rustix" name = "rustix"
version = "0.38.28" version = "0.38.30"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca"
dependencies = [ dependencies = [
"bitflags 2.4.1", "bitflags 2.4.2",
"errno", "errno",
"libc", "libc",
"linux-raw-sys 0.4.12", "linux-raw-sys 0.4.13",
"windows-sys 0.52.0", "windows-sys 0.52.0",
] ]
@@ -3088,35 +3086,35 @@ dependencies = [
[[package]] [[package]]
name = "semver" name = "semver"
version = "1.0.20" version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0"
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.193" version = "1.0.195"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02"
dependencies = [ dependencies = [
"serde_derive", "serde_derive",
] ]
[[package]] [[package]]
name = "serde_derive" name = "serde_derive"
version = "1.0.193" version = "1.0.195"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.43", "syn 2.0.48",
] ]
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.108" version = "1.0.111"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4"
dependencies = [ dependencies = [
"itoa", "itoa",
"ryu", "ryu",
@@ -3125,13 +3123,13 @@ dependencies = [
[[package]] [[package]]
name = "serde_repr" name = "serde_repr"
version = "0.1.17" version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3081f5ffbb02284dda55132aa26daecedd7372a42417bbbab6f14ab7d6bb9145" checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.43", "syn 2.0.48",
] ]
[[package]] [[package]]
@@ -3195,9 +3193,9 @@ dependencies = [
[[package]] [[package]]
name = "smallvec" name = "smallvec"
version = "1.11.2" version = "1.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7"
[[package]] [[package]]
name = "smithay-client-toolkit" name = "smithay-client-toolkit"
@@ -3286,7 +3284,7 @@ checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731"
[[package]] [[package]]
name = "supergfxctl" name = "supergfxctl"
version = "5.1.2" version = "5.1.2"
source = "git+https://gitlab.com/asus-linux/supergfxctl.git#af23df7596712bb9433a3be917febadeb3f1f419" source = "git+https://gitlab.com/asus-linux/supergfxctl.git#a54163c4ced0f58dbbc134392d8a2118ee6c5c64"
dependencies = [ dependencies = [
"log", "log",
"logind-zbus", "logind-zbus",
@@ -3311,9 +3309,9 @@ dependencies = [
[[package]] [[package]]
name = "syn" name = "syn"
version = "2.0.43" version = "2.0.48"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
@@ -3345,9 +3343,9 @@ dependencies = [
[[package]] [[package]]
name = "target-lexicon" name = "target-lexicon"
version = "0.12.12" version = "0.12.13"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae"
[[package]] [[package]]
name = "tauri-winrt-notification" name = "tauri-winrt-notification"
@@ -3361,44 +3359,44 @@ dependencies = [
[[package]] [[package]]
name = "tempfile" name = "tempfile"
version = "3.8.1" version = "3.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"fastrand 2.0.1", "fastrand 2.0.1",
"redox_syscall 0.4.1", "redox_syscall 0.4.1",
"rustix 0.38.28", "rustix 0.38.30",
"windows-sys 0.48.0", "windows-sys 0.52.0",
] ]
[[package]] [[package]]
name = "termcolor" name = "termcolor"
version = "1.4.0" version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755"
dependencies = [ dependencies = [
"winapi-util", "winapi-util",
] ]
[[package]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.52" version = "1.0.56"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83a48fd946b02c0a526b2e9481c8e2a17755e47039164a86c4070446e3a4614d" checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad"
dependencies = [ dependencies = [
"thiserror-impl", "thiserror-impl",
] ]
[[package]] [[package]]
name = "thiserror-impl" name = "thiserror-impl"
version = "1.0.52" version = "1.0.56"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7fbe9b594d6568a6a1443250a7e67d80b74e1e96f6d1715e1e21cc1888291d3" checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.43", "syn 2.0.48",
] ]
[[package]] [[package]]
@@ -3492,7 +3490,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.43", "syn 2.0.48",
] ]
[[package]] [[package]]
@@ -3568,7 +3566,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.43", "syn 2.0.48",
] ]
[[package]] [[package]]
@@ -3658,9 +3656,9 @@ dependencies = [
[[package]] [[package]]
name = "unicode-bidi" name = "unicode-bidi"
version = "0.3.14" version = "0.3.15"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75"
[[package]] [[package]]
name = "unicode-ident" name = "unicode-ident"
@@ -3985,7 +3983,7 @@ version = "0.51.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9"
dependencies = [ dependencies = [
"windows-core", "windows-core 0.51.1",
"windows-targets 0.48.5", "windows-targets 0.48.5",
] ]
@@ -3998,6 +3996,15 @@ dependencies = [
"windows-targets 0.48.5", "windows-targets 0.48.5",
] ]
[[package]]
name = "windows-core"
version = "0.52.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9"
dependencies = [
"windows-targets 0.52.0",
]
[[package]] [[package]]
name = "windows-implement" name = "windows-implement"
version = "0.44.0" version = "0.44.0"
@@ -4255,9 +4262,9 @@ dependencies = [
[[package]] [[package]]
name = "winnow" name = "winnow"
version = "0.5.30" version = "0.5.34"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9b5c3db89721d50d0e2a673f5043fc4722f76dcc352d7b1ab8b8288bed4ed2c5" checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16"
dependencies = [ dependencies = [
"memchr", "memchr",
] ]
@@ -4400,7 +4407,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote", "quote",
"syn 2.0.43", "syn 2.0.48",
] ]
[[package]] [[package]]
+2 -2
View File
@@ -4,10 +4,10 @@ default-members = ["asusctl", "asusd", "asusd-user", "cpuctl", "rog-control-cent
resolver = "2" resolver = "2"
[workspace.package] [workspace.package]
version = "5.0.7" version = "5.0.9"
rust-version = "1.75"
[workspace.dependencies] [workspace.dependencies]
async-trait = "^0.1"
tokio = { version = "^1.23.0", default-features = false, features = ["macros", "sync"]} tokio = { version = "^1.23.0", default-features = false, features = ["macros", "sync"]}
concat-idents = "^1.1" concat-idents = "^1.1"
dirs = "^4.0" dirs = "^4.0"
+1 -1
View File
@@ -72,7 +72,7 @@ A gui is now in the repo - ROG Control Center. At this time it is still a WIP, b
# BUILDING # BUILDING
Requirements are rust >= 1.57 installed from rustup.io if the distro provided version is too old, and `make`. Requirements are rust >= 1.75 installed from rustup.io if the distro provided version is too old, and `make`.
**Ubuntu (unsuported):** **Ubuntu (unsuported):**
+1
View File
@@ -22,5 +22,6 @@ gif.workspace = true
tinybmp.workspace = true tinybmp.workspace = true
glam.workspace = true glam.workspace = true
rog_dbus = { path = "../rog-dbus" } rog_dbus = { path = "../rog-dbus" }
tokio = { version = "^1.23.0", default-features = false, features = ["macros", "sync", "rt", "time"]}
cargo-husky.workspace = true cargo-husky.workspace = true
+2 -2
View File
@@ -1,5 +1,5 @@
use gumdrop::Options; use gumdrop::Options;
use rog_platform::platform::PlatformPolicy; use rog_platform::platform::ThrottlePolicy;
use crate::anime_cli::AnimeCommand; use crate::anime_cli::AnimeCommand;
use crate::aura_cli::{LedBrightness, LedPowerCommand1, LedPowerCommand2, SetAuraBuiltin}; use crate::aura_cli::{LedBrightness, LedPowerCommand1, LedPowerCommand2, SetAuraBuiltin};
@@ -60,7 +60,7 @@ pub struct ProfileCommand {
pub profile_get: bool, pub profile_get: bool,
#[options(meta = "", help = "set the active profile")] #[options(meta = "", help = "set the active profile")]
pub profile_set: Option<PlatformPolicy>, pub profile_set: Option<ThrottlePolicy>,
} }
#[derive(Options)] #[derive(Options)]
+2 -2
View File
@@ -1,5 +1,5 @@
use gumdrop::Options; use gumdrop::Options;
use rog_platform::platform::PlatformPolicy; use rog_platform::platform::ThrottlePolicy;
use rog_profiles::fan_curve_set::CurveData; use rog_profiles::fan_curve_set::CurveData;
use rog_profiles::FanCurvePU; use rog_profiles::FanCurvePU;
@@ -18,7 +18,7 @@ pub struct FanCurveCommand {
meta = "", meta = "",
help = "profile to modify fan-curve for. Shows data if no options provided" help = "profile to modify fan-curve for. Shows data if no options provided"
)] )]
pub mod_profile: Option<PlatformPolicy>, pub mod_profile: Option<ThrottlePolicy>,
#[options( #[options(
meta = "", meta = "",
+20 -7
View File
@@ -18,7 +18,7 @@ use rog_aura::usb::{AuraDevRog1, AuraDevTuf, AuraPowerDev};
use rog_aura::{self, AuraEffect}; use rog_aura::{self, AuraEffect};
use rog_dbus::RogDbusClientBlocking; use rog_dbus::RogDbusClientBlocking;
use rog_platform::error::PlatformError; use rog_platform::error::PlatformError;
use rog_platform::platform::{GpuMode, PlatformPolicy, Properties}; use rog_platform::platform::{GpuMode, Properties, ThrottlePolicy};
use rog_profiles::error::ProfileError; use rog_profiles::error::ProfileError;
use crate::aura_cli::{AuraPowerStates, LedBrightness}; use crate::aura_cli::{AuraPowerStates, LedBrightness};
@@ -180,10 +180,23 @@ fn do_parsed(
dbus.proxies().aura().set_brightness(brightness.prev())?; dbus.proxies().aura().set_brightness(brightness.prev())?;
} }
// TODO: if parsed.show_supported {
// if parsed.show_supported { println!("Supported Core Functions:\n{:#?}", supported_interfaces);
// println!("Supported laptop functions:\n\n{}", supported); println!(
// } "Supported Platform Properties:\n{:#?}",
supported_properties
);
if supported_interfaces.contains(&"Aura".to_owned()) {
let bright = dbus.proxies().aura().supported_brightness()?;
let modes = dbus.proxies().aura().supported_basic_modes()?;
let zones = dbus.proxies().aura().supported_basic_zones()?;
let power = dbus.proxies().aura().supported_power_zones()?;
println!("Supported Keyboard Brightness:\n{:#?}", bright);
println!("Supported Aura Modes:\n{:#?}", modes);
println!("Supported Aura Zones:\n{:#?}", zones);
println!("Supported Aura Power Zones:\n{:#?}", power);
}
}
if let Some(chg_limit) = parsed.chg_limit { if let Some(chg_limit) = parsed.chg_limit {
dbus.proxies() dbus.proxies()
@@ -662,7 +675,7 @@ fn handle_throttle_profile(
supported: &[Properties], supported: &[Properties],
cmd: &ProfileCommand, cmd: &ProfileCommand,
) -> Result<(), Box<dyn std::error::Error>> { ) -> Result<(), Box<dyn std::error::Error>> {
if !supported.contains(&Properties::PlatformPolicy) { if !supported.contains(&Properties::ThrottlePolicy) {
println!("Profiles not supported by either this kernel or by the laptop."); println!("Profiles not supported by either this kernel or by the laptop.");
return Err(ProfileError::NotSupported.into()); return Err(ProfileError::NotSupported.into());
} }
@@ -691,7 +704,7 @@ fn handle_throttle_profile(
} }
if cmd.list { if cmd.list {
let res = PlatformPolicy::list(); let res = ThrottlePolicy::list();
for p in &res { for p in &res {
println!("{:?}", p); println!("{:?}", p);
} }
+1 -1
View File
@@ -22,8 +22,8 @@ rog_profiles = { path = "../rog-profiles" }
dmi_id = { path = "../dmi-id" } dmi_id = { path = "../dmi-id" }
futures-lite = "*" futures-lite = "*"
udev.workspace = true udev.workspace = true
inotify.workspace = true
async-trait.workspace = true
tokio.workspace = true tokio.workspace = true
# cli and logging # cli and logging
+118 -39
View File
@@ -1,29 +1,78 @@
use config_traits::{StdConfig, StdConfigLoad3}; use config_traits::{StdConfig, StdConfigLoad3};
use rog_platform::platform::PlatformPolicy; use rog_platform::cpu::CPUEPP;
use rog_platform::platform::ThrottlePolicy;
use serde_derive::{Deserialize, Serialize}; use serde_derive::{Deserialize, Serialize};
const CONFIG_FILE: &str = "asusd.ron"; const CONFIG_FILE: &str = "asusd.ron";
#[derive(Deserialize, Serialize, Default, Debug)] #[derive(Deserialize, Serialize, Debug, PartialEq, PartialOrd)]
pub struct Config { pub struct Config {
/// Save charge limit for restoring on boot /// Save charge limit for restoring on boot/resume
pub charge_control_end_threshold: u8, pub charge_control_end_threshold: u8,
pub panel_od: bool, pub panel_od: bool,
pub mini_led_mode: bool, pub mini_led_mode: bool,
pub disable_nvidia_powerd_on_battery: bool, pub disable_nvidia_powerd_on_battery: bool,
/// An optional command/script to run when power is changed to AC
pub ac_command: String, pub ac_command: String,
/// An optional command/script to run when power is changed to battery
pub bat_command: String, pub bat_command: String,
pub platform_policy_linked_epp: bool, /// Set true if energy_performance_preference should be set if the
pub platform_policy_on_battery: PlatformPolicy, /// throttle/platform profile is changed
pub platform_policy_on_ac: PlatformPolicy, pub throttle_policy_linked_epp: bool,
// /// Which throttle/profile to use on battery power
pub throttle_policy_on_battery: ThrottlePolicy,
/// Which throttle/profile to use on AC power
pub throttle_policy_on_ac: ThrottlePolicy,
/// The energy_performance_preference for this throttle/platform profile
pub throttle_quiet_epp: CPUEPP,
/// The energy_performance_preference for this throttle/platform profile
pub throttle_balanced_epp: CPUEPP,
/// The energy_performance_preference for this throttle/platform profile
pub throttle_performance_epp: CPUEPP,
/// Defaults to `None` if not supported
pub ppt_pl1_spl: Option<u8>, pub ppt_pl1_spl: Option<u8>,
/// Defaults to `None` if not supported
pub ppt_pl2_sppt: Option<u8>, pub ppt_pl2_sppt: Option<u8>,
/// Defaults to `None` if not supported
pub ppt_fppt: Option<u8>, pub ppt_fppt: Option<u8>,
/// Defaults to `None` if not supported
pub ppt_apu_sppt: Option<u8>, pub ppt_apu_sppt: Option<u8>,
/// Defaults to `None` if not supported
pub ppt_platform_sppt: Option<u8>, pub ppt_platform_sppt: Option<u8>,
/// Defaults to `None` if not supported
pub nv_dynamic_boost: Option<u8>, pub nv_dynamic_boost: Option<u8>,
/// Defaults to `None` if not supported
pub nv_temp_target: Option<u8>, pub nv_temp_target: Option<u8>,
/// Temporary state for AC/Batt
#[serde(skip)]
pub last_power_plugged: u8,
}
impl Default for Config {
fn default() -> Self {
Self {
charge_control_end_threshold: 100,
panel_od: false,
mini_led_mode: false,
disable_nvidia_powerd_on_battery: true,
ac_command: Default::default(),
bat_command: Default::default(),
throttle_policy_linked_epp: true,
throttle_policy_on_battery: ThrottlePolicy::Quiet,
throttle_policy_on_ac: ThrottlePolicy::Performance,
throttle_quiet_epp: CPUEPP::Power,
throttle_balanced_epp: CPUEPP::BalancePower,
throttle_performance_epp: CPUEPP::Performance,
ppt_pl1_spl: Default::default(),
ppt_pl2_sppt: Default::default(),
ppt_fppt: Default::default(),
ppt_apu_sppt: Default::default(),
ppt_platform_sppt: Default::default(),
nv_dynamic_boost: Default::default(),
nv_temp_target: Default::default(),
last_power_plugged: Default::default(),
}
}
} }
impl StdConfig for Config { impl StdConfig for Config {
@@ -31,8 +80,8 @@ impl StdConfig for Config {
Config { Config {
charge_control_end_threshold: 100, charge_control_end_threshold: 100,
disable_nvidia_powerd_on_battery: true, disable_nvidia_powerd_on_battery: true,
platform_policy_on_battery: PlatformPolicy::Quiet, throttle_policy_on_battery: ThrottlePolicy::Quiet,
platform_policy_on_ac: PlatformPolicy::Performance, throttle_policy_on_ac: ThrottlePolicy::Performance,
ac_command: String::new(), ac_command: String::new(),
bat_command: String::new(), bat_command: String::new(),
..Default::default() ..Default::default()
@@ -48,7 +97,56 @@ impl StdConfig for Config {
} }
} }
impl StdConfigLoad3<Config462, Config472, Config506> for Config {} impl StdConfigLoad3<Config472, Config506, Config507> for Config {}
#[derive(Deserialize, Serialize)]
pub struct Config507 {
/// Save charge limit for restoring on boot
pub charge_control_end_threshold: u8,
pub panel_od: bool,
pub mini_led_mode: bool,
pub disable_nvidia_powerd_on_battery: bool,
pub ac_command: String,
pub bat_command: String,
pub platform_policy_linked_epp: bool,
pub platform_policy_on_battery: ThrottlePolicy,
pub platform_policy_on_ac: ThrottlePolicy,
//
pub ppt_pl1_spl: Option<u8>,
pub ppt_pl2_sppt: Option<u8>,
pub ppt_fppt: Option<u8>,
pub ppt_apu_sppt: Option<u8>,
pub ppt_platform_sppt: Option<u8>,
pub nv_dynamic_boost: Option<u8>,
pub nv_temp_target: Option<u8>,
}
impl From<Config507> for Config {
fn from(c: Config507) -> Self {
Self {
charge_control_end_threshold: c.charge_control_end_threshold,
panel_od: c.panel_od,
disable_nvidia_powerd_on_battery: c.disable_nvidia_powerd_on_battery,
ac_command: c.ac_command,
bat_command: c.bat_command,
mini_led_mode: c.mini_led_mode,
throttle_policy_linked_epp: true,
throttle_policy_on_battery: c.platform_policy_on_battery,
throttle_policy_on_ac: c.platform_policy_on_ac,
throttle_quiet_epp: CPUEPP::Power,
throttle_balanced_epp: CPUEPP::BalancePower,
throttle_performance_epp: CPUEPP::Performance,
ppt_pl1_spl: c.ppt_pl1_spl,
ppt_pl2_sppt: c.ppt_pl2_sppt,
ppt_fppt: c.ppt_fppt,
ppt_apu_sppt: c.ppt_apu_sppt,
ppt_platform_sppt: c.ppt_platform_sppt,
nv_dynamic_boost: c.nv_dynamic_boost,
nv_temp_target: c.nv_temp_target,
last_power_plugged: 0,
}
}
}
#[derive(Deserialize, Serialize)] #[derive(Deserialize, Serialize)]
pub struct Config506 { pub struct Config506 {
@@ -61,9 +159,9 @@ pub struct Config506 {
pub bat_command: String, pub bat_command: String,
/// Restored on boot as well as when power is plugged /// Restored on boot as well as when power is plugged
#[serde(skip)] #[serde(skip)]
pub platform_policy_to_restore: PlatformPolicy, pub platform_policy_to_restore: ThrottlePolicy,
pub platform_policy_on_battery: PlatformPolicy, pub platform_policy_on_battery: ThrottlePolicy,
pub platform_policy_on_ac: PlatformPolicy, pub platform_policy_on_ac: ThrottlePolicy,
// //
pub ppt_pl1_spl: Option<u8>, pub ppt_pl1_spl: Option<u8>,
pub ppt_pl2_sppt: Option<u8>, pub ppt_pl2_sppt: Option<u8>,
@@ -83,9 +181,12 @@ impl From<Config506> for Config {
ac_command: c.ac_command, ac_command: c.ac_command,
bat_command: c.bat_command, bat_command: c.bat_command,
mini_led_mode: c.mini_led_mode, mini_led_mode: c.mini_led_mode,
platform_policy_linked_epp: true, throttle_policy_linked_epp: true,
platform_policy_on_battery: c.platform_policy_on_battery, throttle_policy_on_battery: c.platform_policy_on_battery,
platform_policy_on_ac: c.platform_policy_on_ac, throttle_policy_on_ac: c.platform_policy_on_ac,
throttle_quiet_epp: CPUEPP::Power,
throttle_balanced_epp: CPUEPP::BalancePower,
throttle_performance_epp: CPUEPP::Performance,
ppt_pl1_spl: c.ppt_pl1_spl, ppt_pl1_spl: c.ppt_pl1_spl,
ppt_pl2_sppt: c.ppt_pl2_sppt, ppt_pl2_sppt: c.ppt_pl2_sppt,
ppt_fppt: c.ppt_fppt, ppt_fppt: c.ppt_fppt,
@@ -93,6 +194,7 @@ impl From<Config506> for Config {
ppt_platform_sppt: c.ppt_platform_sppt, ppt_platform_sppt: c.ppt_platform_sppt,
nv_dynamic_boost: c.nv_dynamic_boost, nv_dynamic_boost: c.nv_dynamic_boost,
nv_temp_target: c.nv_temp_target, nv_temp_target: c.nv_temp_target,
last_power_plugged: 0,
} }
} }
} }
@@ -120,26 +222,3 @@ impl From<Config472> for Config {
} }
} }
} }
#[derive(Deserialize, Serialize)]
pub struct Config462 {
/// Save charge limit for restoring on boot
pub bat_charge_limit: u8,
pub panel_od: bool,
pub disable_nvidia_powerd_on_battery: bool,
pub ac_command: String,
pub bat_command: String,
}
impl From<Config462> for Config {
fn from(c: Config462) -> Self {
Self {
charge_control_end_threshold: c.bat_charge_limit,
panel_od: c.panel_od,
disable_nvidia_powerd_on_battery: true,
ac_command: String::new(),
bat_command: String::new(),
..Default::default()
}
}
}
-4
View File
@@ -1,7 +1,6 @@
use std::sync::atomic::Ordering; use std::sync::atomic::Ordering;
use std::sync::Arc; use std::sync::Arc;
use async_trait::async_trait;
use config_traits::StdConfig; use config_traits::StdConfig;
use log::warn; use log::warn;
use logind_zbus::manager::ManagerProxy; use logind_zbus::manager::ManagerProxy;
@@ -35,7 +34,6 @@ async fn get_logind_manager<'a>() -> ManagerProxy<'a> {
pub struct CtrlAnimeZbus(pub Arc<Mutex<CtrlAnime>>); pub struct CtrlAnimeZbus(pub Arc<Mutex<CtrlAnime>>);
/// The struct with the main dbus methods requires this trait /// The struct with the main dbus methods requires this trait
#[async_trait]
impl crate::ZbusRun for CtrlAnimeZbus { impl crate::ZbusRun for CtrlAnimeZbus {
async fn add_to_server(self, server: &mut Connection) { async fn add_to_server(self, server: &mut Connection) {
Self::add_to_server_helper(self, ANIME_ZBUS_PATH, server).await; Self::add_to_server_helper(self, ANIME_ZBUS_PATH, server).await;
@@ -259,7 +257,6 @@ impl CtrlAnimeZbus {
} }
} }
#[async_trait]
impl crate::CtrlTask for CtrlAnimeZbus { impl crate::CtrlTask for CtrlAnimeZbus {
fn zbus_path() -> &'static str { fn zbus_path() -> &'static str {
ANIME_ZBUS_PATH ANIME_ZBUS_PATH
@@ -385,7 +382,6 @@ impl crate::CtrlTask for CtrlAnimeZbus {
} }
} }
#[async_trait]
impl crate::Reloadable for CtrlAnimeZbus { impl crate::Reloadable for CtrlAnimeZbus {
async fn reload(&mut self) -> Result<(), RogError> { async fn reload(&mut self) -> Result<(), RogError> {
if let Some(lock) = self.0.try_lock() { if let Some(lock) = self.0.try_lock() {
-4
View File
@@ -1,7 +1,6 @@
use std::collections::BTreeMap; use std::collections::BTreeMap;
use std::sync::Arc; use std::sync::Arc;
use async_trait::async_trait;
use config_traits::StdConfig; use config_traits::StdConfig;
use log::{debug, error, info, warn}; use log::{debug, error, info, warn};
use rog_aura::advanced::UsbPackets; use rog_aura::advanced::UsbPackets;
@@ -33,7 +32,6 @@ impl CtrlAuraZbus {
} }
} }
#[async_trait]
impl crate::ZbusRun for CtrlAuraZbus { impl crate::ZbusRun for CtrlAuraZbus {
async fn add_to_server(self, server: &mut Connection) { async fn add_to_server(self, server: &mut Connection) {
Self::add_to_server_helper(self, AURA_ZBUS_PATH, server).await; Self::add_to_server_helper(self, AURA_ZBUS_PATH, server).await;
@@ -205,7 +203,6 @@ impl CtrlAuraZbus {
} }
} }
#[async_trait]
impl CtrlTask for CtrlAuraZbus { impl CtrlTask for CtrlAuraZbus {
fn zbus_path() -> &'static str { fn zbus_path() -> &'static str {
AURA_ZBUS_PATH AURA_ZBUS_PATH
@@ -278,7 +275,6 @@ impl CtrlTask for CtrlAuraZbus {
} }
} }
#[async_trait]
impl crate::Reloadable for CtrlAuraZbus { impl crate::Reloadable for CtrlAuraZbus {
async fn reload(&mut self) -> Result<(), RogError> { async fn reload(&mut self) -> Result<(), RogError> {
let mut ctrl = self.0.lock().await; let mut ctrl = self.0.lock().await;
+42 -63
View File
@@ -1,11 +1,10 @@
use std::path::PathBuf; use std::path::PathBuf;
use std::sync::Arc; use std::sync::Arc;
use async_trait::async_trait;
use config_traits::{StdConfig, StdConfigLoad}; use config_traits::{StdConfig, StdConfigLoad};
use futures_lite::StreamExt; use futures_lite::StreamExt;
use log::{debug, error, info, warn}; use log::{debug, error, info, warn};
use rog_platform::platform::{PlatformPolicy, RogPlatform}; use rog_platform::platform::{RogPlatform, ThrottlePolicy};
use rog_profiles::error::ProfileError; use rog_profiles::error::ProfileError;
use rog_profiles::fan_curve_set::CurveData; use rog_profiles::fan_curve_set::CurveData;
use rog_profiles::{find_fan_curve_node, FanCurvePU, FanCurveProfiles}; use rog_profiles::{find_fan_curve_node, FanCurvePU, FanCurveProfiles};
@@ -22,9 +21,7 @@ pub const FAN_CURVE_ZBUS_PATH: &str = "/org/asuslinux/FanCurves";
#[derive(Deserialize, Serialize, Debug, Default)] #[derive(Deserialize, Serialize, Debug, Default)]
pub struct FanCurveConfig { pub struct FanCurveConfig {
pub balanced: Vec<CurveData>, pub profiles: FanCurveProfiles,
pub performance: Vec<CurveData>,
pub quiet: Vec<CurveData>,
#[serde(skip)] #[serde(skip)]
pub current: u8, pub current: u8,
} }
@@ -50,7 +47,6 @@ impl StdConfigLoad for FanCurveConfig {}
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct CtrlFanCurveZbus { pub struct CtrlFanCurveZbus {
config: Arc<Mutex<FanCurveConfig>>, config: Arc<Mutex<FanCurveConfig>>,
fan_curves: Arc<Mutex<FanCurveProfiles>>,
platform: RogPlatform, platform: RogPlatform,
} }
@@ -65,63 +61,46 @@ impl CtrlFanCurveZbus {
let mut config = FanCurveConfig::new(); let mut config = FanCurveConfig::new();
let mut fan_curves = FanCurveProfiles::default(); let mut fan_curves = FanCurveProfiles::default();
// Only do defaults if the config doesn't already exist // Only do defaults if the config doesn't already exist\
if !config.file_path().exists() { if config.profiles.balanced.is_empty() || !config.file_path().exists() {
info!("{MOD_NAME}: Fetching default fan curves"); info!("{MOD_NAME}: Fetching default fan curves");
for this in [ for this in [
PlatformPolicy::Balanced, ThrottlePolicy::Balanced,
PlatformPolicy::Performance, ThrottlePolicy::Performance,
PlatformPolicy::Quiet, ThrottlePolicy::Quiet,
] { ] {
// For each profile we need to switch to it before we // For each profile we need to switch to it before we
// can read the existing values from hardware. The ACPI method used // can read the existing values from hardware. The ACPI method used
// for this is what limits us. // for this is what limits us.
let next = PlatformPolicy::get_next_profile(this); let next = ThrottlePolicy::next(this);
platform.set_throttle_thermal_policy(next.into())?; platform.set_throttle_thermal_policy(next.into())?;
let active = platform let active = platform
.get_throttle_thermal_policy() .get_throttle_thermal_policy()
.map_or(PlatformPolicy::Balanced, |t| t.into()); .map_or(ThrottlePolicy::Balanced, |t| t.into());
fan_curves.read_from_dev_profile(active, &find_fan_curve_node()?)?;
info!("{MOD_NAME}: {active:?}:"); info!("{MOD_NAME}: {active:?}:");
for curve in fan_curves.get_fan_curves_for(active) { for curve in fan_curves.get_fan_curves_for(active) {
info!("{}", String::from(curve)); info!("{}", String::from(curve));
} }
} }
config.profiles = fan_curves;
config.write(); config.write();
} else { } else {
info!("{MOD_NAME}: Fan curves previously stored, loading..."); info!("{MOD_NAME}: Fan curves previously stored, loading...");
config = config.load(); config = config.load();
fan_curves.balanced = config.balanced.clone();
fan_curves.performance = config.performance.clone();
fan_curves.quiet = config.quiet.clone();
} }
return Ok(Self { return Ok(Self {
config: Arc::new(Mutex::new(config)), config: Arc::new(Mutex::new(config)),
fan_curves: Arc::new(Mutex::new(fan_curves)),
platform, platform,
}); });
} }
Err(ProfileError::NotSupported.into()) Err(ProfileError::NotSupported.into())
} }
pub async fn update_profiles_from_config(&self) {
self.fan_curves.lock().await.balanced = self.config.lock().await.balanced.clone();
self.fan_curves.lock().await.performance = self.config.lock().await.performance.clone();
self.fan_curves.lock().await.quiet = self.config.lock().await.quiet.clone();
}
/// Because this locks both config and fan_curves, it means nothing else can
/// hold a lock across this function call. Stupid choice to do this and
/// needs to be fixed.
pub async fn update_config_from_profiles(&self) {
self.config.lock().await.balanced = self.fan_curves.lock().await.balanced.clone();
self.config.lock().await.performance = self.fan_curves.lock().await.performance.clone();
self.config.lock().await.quiet = self.fan_curves.lock().await.quiet.clone();
}
} }
#[dbus_interface(name = "org.asuslinux.Daemon")] #[dbus_interface(name = "org.asuslinux.Daemon")]
@@ -130,18 +109,19 @@ impl CtrlFanCurveZbus {
/// fan curve if in the same profile mode /// fan curve if in the same profile mode
async fn set_fan_curves_enabled( async fn set_fan_curves_enabled(
&mut self, &mut self,
profile: PlatformPolicy, profile: ThrottlePolicy,
enabled: bool, enabled: bool,
) -> zbus::fdo::Result<()> { ) -> zbus::fdo::Result<()> {
self.fan_curves self.config
.lock() .lock()
.await .await
.profiles
.set_profile_curves_enabled(profile, enabled); .set_profile_curves_enabled(profile, enabled);
self.fan_curves self.config
.lock() .lock()
.await .await
.profiles
.write_profile_curve_to_platform(profile, &mut find_fan_curve_node()?)?; .write_profile_curve_to_platform(profile, &mut find_fan_curve_node()?)?;
self.update_config_from_profiles().await;
self.config.lock().await.write(); self.config.lock().await.write();
Ok(()) Ok(())
} }
@@ -150,32 +130,34 @@ impl CtrlFanCurveZbus {
/// activate a fan curve if in the same profile mode /// activate a fan curve if in the same profile mode
async fn set_profile_fan_curve_enabled( async fn set_profile_fan_curve_enabled(
&mut self, &mut self,
profile: PlatformPolicy, profile: ThrottlePolicy,
fan: FanCurvePU, fan: FanCurvePU,
enabled: bool, enabled: bool,
) -> zbus::fdo::Result<()> { ) -> zbus::fdo::Result<()> {
self.fan_curves self.config
.lock() .lock()
.await .await
.profiles
.set_profile_fan_curve_enabled(profile, fan, enabled); .set_profile_fan_curve_enabled(profile, fan, enabled);
self.fan_curves self.config
.lock() .lock()
.await .await
.profiles
.write_profile_curve_to_platform(profile, &mut find_fan_curve_node()?)?; .write_profile_curve_to_platform(profile, &mut find_fan_curve_node()?)?;
self.update_config_from_profiles().await;
self.config.lock().await.write(); self.config.lock().await.write();
Ok(()) Ok(())
} }
/// Get the fan-curve data for the currently active PlatformPolicy /// Get the fan-curve data for the currently active ThrottlePolicy
async fn fan_curve_data( async fn fan_curve_data(
&mut self, &mut self,
profile: PlatformPolicy, profile: ThrottlePolicy,
) -> zbus::fdo::Result<Vec<CurveData>> { ) -> zbus::fdo::Result<Vec<CurveData>> {
let curve = self let curve = self
.fan_curves .config
.lock() .lock()
.await .await
.profiles
.get_fan_curves_for(profile) .get_fan_curves_for(profile)
.to_vec(); .to_vec();
Ok(curve) Ok(curve)
@@ -185,18 +167,19 @@ impl CtrlFanCurveZbus {
/// Will also activate the fan curve if the user is in the same mode. /// Will also activate the fan curve if the user is in the same mode.
async fn set_fan_curve( async fn set_fan_curve(
&mut self, &mut self,
profile: PlatformPolicy, profile: ThrottlePolicy,
curve: CurveData, curve: CurveData,
) -> zbus::fdo::Result<()> { ) -> zbus::fdo::Result<()> {
self.fan_curves self.config
.lock() .lock()
.await .await
.profiles
.save_fan_curve(curve, profile)?; .save_fan_curve(curve, profile)?;
self.fan_curves self.config
.lock() .lock()
.await .await
.profiles
.write_profile_curve_to_platform(profile, &mut find_fan_curve_node()?)?; .write_profile_curve_to_platform(profile, &mut find_fan_curve_node()?)?;
self.update_config_from_profiles().await;
self.config.lock().await.write(); self.config.lock().await.write();
Ok(()) Ok(())
} }
@@ -208,11 +191,11 @@ impl CtrlFanCurveZbus {
/// read only for the currently active profile. /// read only for the currently active profile.
async fn set_active_curve_to_defaults(&mut self) -> zbus::fdo::Result<()> { async fn set_active_curve_to_defaults(&mut self) -> zbus::fdo::Result<()> {
let active = self.platform.get_throttle_thermal_policy()?; let active = self.platform.get_throttle_thermal_policy()?;
self.fan_curves self.config
.lock() .lock()
.await .await
.profiles
.set_active_curve_to_defaults(active.into(), &mut find_fan_curve_node()?)?; .set_active_curve_to_defaults(active.into(), &mut find_fan_curve_node()?)?;
self.update_config_from_profiles().await;
self.config.lock().await.write(); self.config.lock().await.write();
Ok(()) Ok(())
} }
@@ -222,33 +205,28 @@ impl CtrlFanCurveZbus {
/// ///
/// Each platform_profile has a different default and the defualt can be /// Each platform_profile has a different default and the defualt can be
/// read only for the currently active profile. /// read only for the currently active profile.
async fn reset_profile_curves(&self, profile: PlatformPolicy) -> zbus::fdo::Result<()> { async fn reset_profile_curves(&self, profile: ThrottlePolicy) -> zbus::fdo::Result<()> {
let active = self let active = self.platform.get_throttle_thermal_policy()?;
.platform
.get_throttle_thermal_policy()
.unwrap_or(PlatformPolicy::Balanced.into());
self.platform.set_throttle_thermal_policy(profile.into())?; self.platform.set_throttle_thermal_policy(profile.into())?;
self.fan_curves self.config
.lock() .lock()
.await .await
.profiles
.set_active_curve_to_defaults(active.into(), &mut find_fan_curve_node()?)?; .set_active_curve_to_defaults(active.into(), &mut find_fan_curve_node()?)?;
self.platform.set_throttle_thermal_policy(active)?; self.platform.set_throttle_thermal_policy(active)?;
self.update_config_from_profiles().await;
self.config.lock().await.write(); self.config.lock().await.write();
Ok(()) Ok(())
} }
} }
#[async_trait]
impl crate::ZbusRun for CtrlFanCurveZbus { impl crate::ZbusRun for CtrlFanCurveZbus {
async fn add_to_server(self, server: &mut Connection) { async fn add_to_server(self, server: &mut Connection) {
Self::add_to_server_helper(self, FAN_CURVE_ZBUS_PATH, server).await; Self::add_to_server_helper(self, FAN_CURVE_ZBUS_PATH, server).await;
} }
} }
#[async_trait]
impl CtrlTask for CtrlFanCurveZbus { impl CtrlTask for CtrlFanCurveZbus {
fn zbus_path() -> &'static str { fn zbus_path() -> &'static str {
FAN_CURVE_ZBUS_PATH FAN_CURVE_ZBUS_PATH
@@ -258,7 +236,7 @@ impl CtrlTask for CtrlFanCurveZbus {
let watch_throttle_thermal_policy = self.platform.monitor_throttle_thermal_policy()?; let watch_throttle_thermal_policy = self.platform.monitor_throttle_thermal_policy()?;
let platform = self.platform.clone(); let platform = self.platform.clone();
let config = self.config.clone(); let config = self.config.clone();
let fan_curves = self.fan_curves.clone(); let fan_curves = self.config.clone();
tokio::spawn(async move { tokio::spawn(async move {
let mut buffer = [0; 32]; let mut buffer = [0; 32];
@@ -272,6 +250,7 @@ impl CtrlTask for CtrlFanCurveZbus {
fan_curves fan_curves
.lock() .lock()
.await .await
.profiles
.write_profile_curve_to_platform( .write_profile_curve_to_platform(
profile.into(), profile.into(),
&mut find_fan_curve_node().unwrap(), &mut find_fan_curve_node().unwrap(),
@@ -284,7 +263,6 @@ impl CtrlTask for CtrlFanCurveZbus {
} }
} }
} }
dbg!("STREAM ENDED");
} }
}); });
@@ -292,7 +270,6 @@ impl CtrlTask for CtrlFanCurveZbus {
} }
} }
#[async_trait]
impl crate::Reloadable for CtrlFanCurveZbus { impl crate::Reloadable for CtrlFanCurveZbus {
/// Fetch the active profile and use that to set all related components up /// Fetch the active profile and use that to set all related components up
async fn reload(&mut self) -> Result<(), RogError> { async fn reload(&mut self) -> Result<(), RogError> {
@@ -302,8 +279,10 @@ impl crate::Reloadable for CtrlFanCurveZbus {
// initialises the data from system read and we need to save it // initialises the data from system read and we need to save it
// after // after
loop { loop {
if let Ok(mut curves) = self.fan_curves.try_lock() { if let Ok(mut config) = self.config.try_lock() {
curves.write_profile_curve_to_platform(active, &mut device)?; config
.profiles
.write_profile_curve_to_platform(active, &mut device)?;
break; break;
} }
} }
+294 -48
View File
@@ -1,11 +1,11 @@
use std::path::Path;
use std::process::Command; use std::process::Command;
use std::sync::Arc; use std::sync::Arc;
use async_trait::async_trait;
use config_traits::StdConfig; use config_traits::StdConfig;
use log::{debug, error, info, warn}; use log::{debug, error, info, warn};
use rog_platform::cpu::{CPUControl, CPUGovernor}; use rog_platform::cpu::{CPUControl, CPUGovernor, CPUEPP};
use rog_platform::platform::{GpuMode, PlatformPolicy, Properties, RogPlatform}; use rog_platform::platform::{GpuMode, Properties, RogPlatform, ThrottlePolicy};
use rog_platform::power::AsusPower; use rog_platform::power::AsusPower;
use zbus::export::futures_util::lock::Mutex; use zbus::export::futures_util::lock::Mutex;
use zbus::fdo::Error as FdoErr; use zbus::fdo::Error as FdoErr;
@@ -16,9 +16,10 @@ use crate::ctrl_anime::trait_impls::{CtrlAnimeZbus, ANIME_ZBUS_NAME, ANIME_ZBUS_
use crate::ctrl_aura::trait_impls::{CtrlAuraZbus, AURA_ZBUS_NAME, AURA_ZBUS_PATH}; use crate::ctrl_aura::trait_impls::{CtrlAuraZbus, AURA_ZBUS_NAME, AURA_ZBUS_PATH};
use crate::ctrl_fancurves::{CtrlFanCurveZbus, FAN_CURVE_ZBUS_NAME, FAN_CURVE_ZBUS_PATH}; use crate::ctrl_fancurves::{CtrlFanCurveZbus, FAN_CURVE_ZBUS_NAME, FAN_CURVE_ZBUS_PATH};
use crate::error::RogError; use crate::error::RogError;
use crate::{task_watch_item, task_watch_item_notify, CtrlTask}; use crate::{task_watch_item, task_watch_item_notify, CtrlTask, ReloadAndNotify};
const ZBUS_PATH: &str = "/org/asuslinux/Platform"; const PLATFORM_ZBUS_NAME: &str = "Platform";
const PLATFORM_ZBUS_PATH: &str = "/org/asuslinux/Platform";
macro_rules! platform_get_value { macro_rules! platform_get_value {
($self:ident, $property:tt, $prop_name:literal) => { ($self:ident, $property:tt, $prop_name:literal) => {
@@ -115,7 +116,11 @@ pub struct CtrlPlatform {
} }
impl CtrlPlatform { impl CtrlPlatform {
pub fn new(config: Arc<Mutex<Config>>) -> Result<Self, RogError> { pub fn new(
config: Arc<Mutex<Config>>,
config_path: &Path,
signal_context: SignalContext<'static>,
) -> Result<Self, RogError> {
let platform = RogPlatform::new()?; let platform = RogPlatform::new()?;
let power = AsusPower::new()?; let power = AsusPower::new()?;
@@ -124,14 +129,70 @@ impl CtrlPlatform {
info!("Standard graphics switching will still work."); info!("Standard graphics switching will still work.");
} }
Ok(CtrlPlatform { let config1 = config.clone();
let config_path = config_path.to_owned();
let ret_self = CtrlPlatform {
power, power,
platform, platform,
config, config,
cpu_control: CPUControl::new() cpu_control: CPUControl::new()
.map_err(|e| error!("Couldn't get CPU control sysfs: {e}")) .map_err(|e| error!("Couldn't get CPU control sysfs: {e}"))
.ok(), .ok(),
}) };
let mut inotify_self = ret_self.clone();
tokio::spawn(async move {
use zbus::export::futures_util::StreamExt;
info!("Starting inotify watch for asusd config file");
let mut buffer = [0; 32];
loop {
// vi and vim do stupid shit causing the file watch to be removed
let inotify = inotify::Inotify::init().unwrap();
inotify
.watches()
.add(
&config_path,
inotify::WatchMask::MODIFY
| inotify::WatchMask::CLOSE_WRITE
| inotify::WatchMask::ATTRIB
| inotify::WatchMask::CREATE,
)
.map_err(|e| {
if e.kind() == std::io::ErrorKind::NotFound {
error!("Not found: {:?}", config_path);
} else {
error!("Could not set asusd config inotify: {:?}", config_path);
}
e
})
.ok();
let mut events = inotify.into_event_stream(&mut buffer).unwrap();
while let Some(ev) = events.next().await {
if let Ok(ev) = ev {
if ev.mask == inotify::EventMask::IGNORED {
warn!(
"Something modified asusd.ron vi/vim style. Now need to reload \
inotify watch"
);
break;
}
}
let res = config1.lock().await.read_new();
if let Some(new_cfg) = res {
inotify_self
.reload_and_notify(&signal_context, new_cfg)
.await
.unwrap();
}
}
}
});
Ok(ret_self)
} }
fn set_gfx_mode(&self, mode: GpuMode) -> Result<(), RogError> { fn set_gfx_mode(&self, mode: GpuMode) -> Result<(), RogError> {
@@ -180,18 +241,18 @@ impl CtrlPlatform {
} }
} }
fn check_and_set_epp(&self, profile: PlatformPolicy, change_epp: bool) { fn check_and_set_epp(&self, enegy_pref: CPUEPP, change_epp: bool) {
if !change_epp { if !change_epp {
info!("PlatformPolicy unlinked from EPP"); info!("ThrottlePolicy unlinked from EPP");
return; return;
} }
info!("PlatformPolicy setting EPP"); info!("ThrottlePolicy setting EPP");
if let Some(cpu) = self.cpu_control.as_ref() { if let Some(cpu) = self.cpu_control.as_ref() {
if let Ok(epp) = cpu.get_available_epp() { if let Ok(epp) = cpu.get_available_epp() {
debug!("Available EPP: {epp:?}"); debug!("Available EPP: {epp:?}");
if epp.contains(&profile.into()) { if epp.contains(&enegy_pref) {
debug!("Setting {profile:?}"); debug!("Setting {enegy_pref:?}");
cpu.set_epp(profile.into()).ok(); cpu.set_epp(enegy_pref).ok();
} else if let Ok(gov) = cpu.get_governor() { } else if let Ok(gov) = cpu.get_governor() {
if gov != CPUGovernor::Powersave { if gov != CPUGovernor::Powersave {
warn!("powersave governor is not is use, you should use it."); warn!("powersave governor is not is use, you should use it.");
@@ -201,16 +262,26 @@ impl CtrlPlatform {
} }
} }
async fn get_config_epp_for_throttle(&self, throttle: ThrottlePolicy) -> CPUEPP {
match throttle {
ThrottlePolicy::Balanced => self.config.lock().await.throttle_balanced_epp,
ThrottlePolicy::Performance => self.config.lock().await.throttle_performance_epp,
ThrottlePolicy::Quiet => self.config.lock().await.throttle_quiet_epp,
}
}
async fn update_policy_ac_or_bat(&self, power_plugged: bool, change_epp: bool) { async fn update_policy_ac_or_bat(&self, power_plugged: bool, change_epp: bool) {
let profile = if power_plugged { let throttle = if power_plugged {
self.config.lock().await.platform_policy_on_ac self.config.lock().await.throttle_policy_on_ac
} else { } else {
self.config.lock().await.platform_policy_on_battery self.config.lock().await.throttle_policy_on_battery
}; };
debug!("Setting {throttle:?} before EPP");
let epp = self.get_config_epp_for_throttle(throttle).await;
self.platform self.platform
.set_throttle_thermal_policy(profile.into()) .set_throttle_thermal_policy(throttle.into())
.ok(); .ok();
self.check_and_set_epp(profile, change_epp); self.check_and_set_epp(epp, change_epp);
} }
} }
@@ -252,7 +323,7 @@ impl CtrlPlatform {
platform_name!(panel_od, Properties::PanelOd); platform_name!(panel_od, Properties::PanelOd);
platform_name!(mini_led_mode, Properties::MiniLedMode); platform_name!(mini_led_mode, Properties::MiniLedMode);
platform_name!(egpu_enable, Properties::EgpuEnable); platform_name!(egpu_enable, Properties::EgpuEnable);
platform_name!(throttle_thermal_policy, Properties::PlatformPolicy); platform_name!(throttle_thermal_policy, Properties::ThrottlePolicy);
platform_name!(ppt_pl1_spl, Properties::PptPl1Spl); platform_name!(ppt_pl1_spl, Properties::PptPl1Spl);
platform_name!(ppt_pl2_sppt, Properties::PptPl2Sppt); platform_name!(ppt_pl2_sppt, Properties::PptPl2Sppt);
@@ -291,6 +362,13 @@ impl CtrlPlatform {
{ {
interfaces.push(FAN_CURVE_ZBUS_NAME.to_owned()); interfaces.push(FAN_CURVE_ZBUS_NAME.to_owned());
} }
if server
.interface::<_, CtrlPlatform>(PLATFORM_ZBUS_PATH)
.await
.is_ok()
{
interfaces.push(PLATFORM_ZBUS_NAME.to_owned());
}
interfaces interfaces
} }
@@ -338,14 +416,15 @@ impl CtrlPlatform {
&mut self, &mut self,
#[zbus(signal_context)] ctxt: SignalContext<'_>, #[zbus(signal_context)] ctxt: SignalContext<'_>,
) -> Result<(), FdoErr> { ) -> Result<(), FdoErr> {
let policy: PlatformPolicy = let policy: ThrottlePolicy =
platform_get_value!(self, throttle_thermal_policy, "throttle_thermal_policy") platform_get_value!(self, throttle_thermal_policy, "throttle_thermal_policy")
.map(|n| n.into())?; .map(|n| n.into())?;
let policy = PlatformPolicy::next(&policy); let policy = ThrottlePolicy::next(policy);
if self.platform.has_throttle_thermal_policy() { if self.platform.has_throttle_thermal_policy() {
let change_epp = self.config.lock().await.platform_policy_linked_epp; let change_epp = self.config.lock().await.throttle_policy_linked_epp;
self.check_and_set_epp(policy, change_epp); let epp = self.get_config_epp_for_throttle(policy).await;
self.check_and_set_epp(epp, change_epp);
self.platform self.platform
.set_throttle_thermal_policy(policy.into()) .set_throttle_thermal_policy(policy.into())
.map_err(|err| { .map_err(|err| {
@@ -361,17 +440,18 @@ impl CtrlPlatform {
} }
#[dbus_interface(property)] #[dbus_interface(property)]
fn throttle_thermal_policy(&self) -> Result<PlatformPolicy, FdoErr> { fn throttle_thermal_policy(&self) -> Result<ThrottlePolicy, FdoErr> {
platform_get_value!(self, throttle_thermal_policy, "throttle_thermal_policy") platform_get_value!(self, throttle_thermal_policy, "throttle_thermal_policy")
.map(|n| n.into()) .map(|n| n.into())
} }
#[dbus_interface(property)] #[dbus_interface(property)]
async fn set_throttle_thermal_policy(&mut self, policy: PlatformPolicy) -> Result<(), FdoErr> { async fn set_throttle_thermal_policy(&mut self, policy: ThrottlePolicy) -> Result<(), FdoErr> {
// TODO: watch for external changes // TODO: watch for external changes
if self.platform.has_throttle_thermal_policy() { if self.platform.has_throttle_thermal_policy() {
let change_epp = self.config.lock().await.platform_policy_linked_epp; let change_epp = self.config.lock().await.throttle_policy_linked_epp;
self.check_and_set_epp(policy, change_epp); let epp = self.get_config_epp_for_throttle(policy).await;
self.check_and_set_epp(epp, change_epp);
self.platform self.platform
.set_throttle_thermal_policy(policy.into()) .set_throttle_thermal_policy(policy.into())
.map_err(|err| { .map_err(|err| {
@@ -385,6 +465,91 @@ impl CtrlPlatform {
} }
} }
#[dbus_interface(property)]
async fn throttle_policy_linked_epp(&self) -> Result<bool, FdoErr> {
Ok(self.config.lock().await.throttle_policy_linked_epp)
}
#[dbus_interface(property)]
async fn set_throttle_policy_linked_epp(&self, linked: bool) -> Result<(), zbus::Error> {
self.config.lock().await.throttle_policy_linked_epp = linked;
Ok(())
}
#[dbus_interface(property)]
async fn throttle_policy_on_battery(&self) -> Result<ThrottlePolicy, FdoErr> {
Ok(self.config.lock().await.throttle_policy_on_battery)
}
#[dbus_interface(property)]
async fn set_throttle_policy_on_battery(
&mut self,
policy: ThrottlePolicy,
) -> Result<(), FdoErr> {
self.config.lock().await.throttle_policy_on_battery = policy;
self.set_throttle_thermal_policy(policy).await?;
Ok(())
}
#[dbus_interface(property)]
async fn throttle_policy_on_ac(&self) -> Result<ThrottlePolicy, FdoErr> {
Ok(self.config.lock().await.throttle_policy_on_ac)
}
#[dbus_interface(property)]
async fn set_throttle_policy_on_ac(&mut self, policy: ThrottlePolicy) -> Result<(), FdoErr> {
self.config.lock().await.throttle_policy_on_ac = policy;
self.set_throttle_thermal_policy(policy).await?;
Ok(())
}
/// The energy_performance_preference for the quiet throttle/platform
/// profile
#[dbus_interface(property)]
async fn throttle_quiet_epp(&self) -> Result<CPUEPP, FdoErr> {
Ok(self.config.lock().await.throttle_quiet_epp)
}
#[dbus_interface(property)]
async fn set_throttle_quiet_epp(&mut self, epp: CPUEPP) -> Result<(), FdoErr> {
let change_pp = self.config.lock().await.throttle_policy_linked_epp;
self.config.lock().await.throttle_quiet_epp = epp;
self.check_and_set_epp(epp, change_pp);
Ok(())
}
/// The energy_performance_preference for the balanced throttle/platform
/// profile
#[dbus_interface(property)]
async fn throttle_balanced_epp(&self) -> Result<CPUEPP, FdoErr> {
Ok(self.config.lock().await.throttle_balanced_epp)
}
#[dbus_interface(property)]
async fn set_throttle_balanced_epp(&mut self, epp: CPUEPP) -> Result<(), FdoErr> {
let change_pp = self.config.lock().await.throttle_policy_linked_epp;
self.config.lock().await.throttle_balanced_epp = epp;
self.check_and_set_epp(epp, change_pp);
Ok(())
}
/// The energy_performance_preference for the performance throttle/platform
/// profile
#[dbus_interface(property)]
async fn throttle_performance_epp(&self) -> Result<CPUEPP, FdoErr> {
Ok(self.config.lock().await.throttle_performance_epp)
}
#[dbus_interface(property)]
async fn set_throttle_performance_epp(&mut self, epp: CPUEPP) -> Result<(), FdoErr> {
let change_pp = self.config.lock().await.throttle_policy_linked_epp;
self.config.lock().await.throttle_performance_epp = epp;
self.check_and_set_epp(epp, change_pp);
Ok(())
}
/// ***********************************************************************
#[dbus_interface(property)] #[dbus_interface(property)]
fn post_animation_sound(&self) -> Result<bool, FdoErr> { fn post_animation_sound(&self) -> Result<bool, FdoErr> {
platform_get_value!(self, post_animation_sound, "post_animation_sound") platform_get_value!(self, post_animation_sound, "post_animation_sound")
@@ -438,7 +603,10 @@ impl CtrlPlatform {
platform_get_value!(self, egpu_enable, "egpu_enable") platform_get_value!(self, egpu_enable, "egpu_enable")
} }
/// ************************************************************************ /// ***********************************************************************
/// Set the Package Power Target total of CPU: PL1 on Intel, SPL on AMD.
/// Shown on Intel+Nvidia or AMD+Nvidia based systems:
/// * min=5, max=250
#[dbus_interface(property)] #[dbus_interface(property)]
async fn ppt_pl1_spl(&self) -> Result<u8, FdoErr> { async fn ppt_pl1_spl(&self) -> Result<u8, FdoErr> {
platform_get_value_if_some!(self, ppt_pl1_spl, "ppt_pl1_spl", 5) platform_get_value_if_some!(self, ppt_pl1_spl, "ppt_pl1_spl", 5)
@@ -449,6 +617,9 @@ impl CtrlPlatform {
platform_set_with_min_max!(self, ppt_pl1_spl, "ppt_pl1_spl", value, 5, 250) platform_set_with_min_max!(self, ppt_pl1_spl, "ppt_pl1_spl", value, 5, 250)
} }
/// Set the Slow Package Power Tracking Limit of CPU: PL2 on Intel, SPPT,
/// on AMD. Shown on Intel+Nvidia or AMD+Nvidia based systems:
/// * min=5, max=250
#[dbus_interface(property)] #[dbus_interface(property)]
async fn ppt_pl2_sppt(&self) -> Result<u8, FdoErr> { async fn ppt_pl2_sppt(&self) -> Result<u8, FdoErr> {
platform_get_value_if_some!(self, ppt_pl2_sppt, "ppt_pl2_sppt", 5) platform_get_value_if_some!(self, ppt_pl2_sppt, "ppt_pl2_sppt", 5)
@@ -459,6 +630,8 @@ impl CtrlPlatform {
platform_set_with_min_max!(self, ppt_pl2_sppt, "ppt_pl2_sppt", value, 5, 250) platform_set_with_min_max!(self, ppt_pl2_sppt, "ppt_pl2_sppt", value, 5, 250)
} }
/// Set the Fast Package Power Tracking Limit of CPU. AMD+Nvidia only:
/// * min=5, max=250
#[dbus_interface(property)] #[dbus_interface(property)]
async fn ppt_fppt(&self) -> Result<u8, FdoErr> { async fn ppt_fppt(&self) -> Result<u8, FdoErr> {
platform_get_value_if_some!(self, ppt_fppt, "ppt_fppt", 5) platform_get_value_if_some!(self, ppt_fppt, "ppt_fppt", 5)
@@ -469,6 +642,8 @@ impl CtrlPlatform {
platform_set_with_min_max!(self, ppt_fppt, "ppt_fppt", value, 5, 250) platform_set_with_min_max!(self, ppt_fppt, "ppt_fppt", value, 5, 250)
} }
/// Set the APU SPPT limit. Shown on full AMD systems only:
/// * min=5, max=130
#[dbus_interface(property)] #[dbus_interface(property)]
async fn ppt_apu_sppt(&self) -> Result<u8, FdoErr> { async fn ppt_apu_sppt(&self) -> Result<u8, FdoErr> {
platform_get_value_if_some!(self, ppt_apu_sppt, "ppt_apu_sppt", 5) platform_get_value_if_some!(self, ppt_apu_sppt, "ppt_apu_sppt", 5)
@@ -479,6 +654,8 @@ impl CtrlPlatform {
platform_set_with_min_max!(self, ppt_apu_sppt, "ppt_apu_sppt", value, 5, 130) platform_set_with_min_max!(self, ppt_apu_sppt, "ppt_apu_sppt", value, 5, 130)
} }
/// Set the platform SPPT limit. Shown on full AMD systems only:
/// * min=5, max=130
#[dbus_interface(property)] #[dbus_interface(property)]
async fn ppt_platform_sppt(&self) -> Result<u8, FdoErr> { async fn ppt_platform_sppt(&self) -> Result<u8, FdoErr> {
platform_get_value_if_some!(self, ppt_platform_sppt, "ppt_platform_sppt", 5) platform_get_value_if_some!(self, ppt_platform_sppt, "ppt_platform_sppt", 5)
@@ -489,6 +666,8 @@ impl CtrlPlatform {
platform_set_with_min_max!(self, ppt_platform_sppt, "ppt_platform_sppt", value, 5, 130) platform_set_with_min_max!(self, ppt_platform_sppt, "ppt_platform_sppt", value, 5, 130)
} }
/// Set the dynamic boost limit of the Nvidia dGPU:
/// * min=5, max=25
#[dbus_interface(property)] #[dbus_interface(property)]
async fn nv_dynamic_boost(&self) -> Result<u8, FdoErr> { async fn nv_dynamic_boost(&self) -> Result<u8, FdoErr> {
platform_get_value_if_some!(self, nv_dynamic_boost, "nv_dynamic_boost", 5) platform_get_value_if_some!(self, nv_dynamic_boost, "nv_dynamic_boost", 5)
@@ -499,6 +678,8 @@ impl CtrlPlatform {
platform_set_with_min_max!(self, nv_dynamic_boost, "nv_dynamic_boost", value, 5, 25) platform_set_with_min_max!(self, nv_dynamic_boost, "nv_dynamic_boost", value, 5, 25)
} }
/// Set the target temperature limit of the Nvidia dGPU:
/// * min=75, max=87
#[dbus_interface(property)] #[dbus_interface(property)]
async fn nv_temp_target(&self) -> Result<u8, FdoErr> { async fn nv_temp_target(&self) -> Result<u8, FdoErr> {
platform_get_value_if_some!(self, nv_temp_target, "nv_temp_target", 5) platform_get_value_if_some!(self, nv_temp_target, "nv_temp_target", 5)
@@ -510,14 +691,75 @@ impl CtrlPlatform {
} }
} }
#[async_trait]
impl crate::ZbusRun for CtrlPlatform { impl crate::ZbusRun for CtrlPlatform {
async fn add_to_server(self, server: &mut Connection) { async fn add_to_server(self, server: &mut Connection) {
Self::add_to_server_helper(self, ZBUS_PATH, server).await; Self::add_to_server_helper(self, PLATFORM_ZBUS_PATH, server).await;
}
}
impl ReloadAndNotify for CtrlPlatform {
type Data = Config;
async fn reload_and_notify(
&mut self,
signal_context: &SignalContext<'static>,
data: Self::Data,
) -> Result<(), RogError> {
let mut config = self.config.lock().await;
if *config != data {
info!("asusd.ron updated externally, reloading and updating internal copy");
if self.power.has_charge_control_end_threshold() {
self.power
.set_charge_control_end_threshold(data.charge_control_end_threshold)?;
self.charge_control_end_threshold_changed(signal_context)
.await?;
}
if self.platform.has_panel_od() && config.panel_od != data.panel_od {
self.platform.set_panel_od(data.panel_od)?;
self.panel_od_changed(signal_context).await?;
}
if self.platform.has_mini_led_mode() && config.mini_led_mode != data.mini_led_mode {
self.platform.set_mini_led_mode(data.mini_led_mode)?;
self.mini_led_mode_changed(signal_context).await?;
}
if self.platform.has_throttle_thermal_policy()
&& config.throttle_policy_linked_epp != data.throttle_policy_linked_epp
{
// TODO: extra stuff
}
macro_rules! ppt_reload_and_notify {
($property:tt, $prop_name:literal) => {
concat_idents::concat_idents!(has = has_, $property {
if self.platform.has() && config.$property != data.$property {
concat_idents::concat_idents!(set = set_, $property {
self.platform
.set_ppt_pl1_spl(data.$property.unwrap_or_default())?;});
concat_idents::concat_idents!(changed = $property, _changed {
self.ppt_pl1_spl_changed(signal_context).await?;});
}
})
}
}
ppt_reload_and_notify!(ppt_pl1_spl, "ppt_pl1_spl");
ppt_reload_and_notify!(ppt_pl2_sppt, "ppt_pl2_sppt");
ppt_reload_and_notify!(ppt_fppt, "ppt_fppt");
ppt_reload_and_notify!(ppt_apu_sppt, "ppt_apu_sppt");
ppt_reload_and_notify!(ppt_platform_sppt, "ppt_platform_sppt");
ppt_reload_and_notify!(nv_dynamic_boost, "nv_dynamic_boost");
ppt_reload_and_notify!(nv_temp_target, "nv_temp_target");
*config = data;
}
Ok(())
} }
} }
#[async_trait]
impl crate::Reloadable for CtrlPlatform { impl crate::Reloadable for CtrlPlatform {
async fn reload(&mut self) -> Result<(), RogError> { async fn reload(&mut self) -> Result<(), RogError> {
if self.platform.has_panel_od() { if self.platform.has_panel_od() {
@@ -537,8 +779,9 @@ impl crate::Reloadable for CtrlPlatform {
} }
if let Ok(power_plugged) = self.power.get_online() { if let Ok(power_plugged) = self.power.get_online() {
self.config.lock().await.last_power_plugged = power_plugged;
if self.platform.has_throttle_thermal_policy() { if self.platform.has_throttle_thermal_policy() {
let change_epp = self.config.lock().await.platform_policy_linked_epp; let change_epp = self.config.lock().await.throttle_policy_linked_epp;
self.update_policy_ac_or_bat(power_plugged > 0, change_epp) self.update_policy_ac_or_bat(power_plugged > 0, change_epp)
.await; .await;
} }
@@ -580,10 +823,9 @@ impl CtrlPlatform {
task_watch_item_notify!(nv_temp_target platform); task_watch_item_notify!(nv_temp_target platform);
} }
#[async_trait]
impl CtrlTask for CtrlPlatform { impl CtrlTask for CtrlPlatform {
fn zbus_path() -> &'static str { fn zbus_path() -> &'static str {
ZBUS_PATH PLATFORM_ZBUS_PATH
} }
async fn create_tasks(&self, signal_ctxt: SignalContext<'static>) -> Result<(), RogError> { async fn create_tasks(&self, signal_ctxt: SignalContext<'static>) -> Result<(), RogError> {
@@ -619,15 +861,18 @@ impl CtrlTask for CtrlPlatform {
.ok(); .ok();
} }
if let Ok(power_plugged) = platform1.power.get_online() { if let Ok(power_plugged) = platform1.power.get_online() {
if !sleeping && platform1.platform.has_throttle_thermal_policy() { if platform1.config.lock().await.last_power_plugged != power_plugged {
let change_epp = if !sleeping && platform1.platform.has_throttle_thermal_policy() {
platform1.config.lock().await.platform_policy_linked_epp; let change_epp =
platform1 platform1.config.lock().await.throttle_policy_linked_epp;
.update_policy_ac_or_bat(power_plugged > 0, change_epp) platform1
.await; .update_policy_ac_or_bat(power_plugged > 0, change_epp)
} .await;
if !sleeping { }
platform1.run_ac_or_bat_cmd(power_plugged > 0).await; if !sleeping {
platform1.run_ac_or_bat_cmd(power_plugged > 0).await;
}
platform1.config.lock().await.last_power_plugged = power_plugged;
} }
} }
} }
@@ -658,7 +903,7 @@ impl CtrlTask for CtrlPlatform {
// power change // power change
async move { async move {
if platform3.platform.has_throttle_thermal_policy() { if platform3.platform.has_throttle_thermal_policy() {
let change_epp = platform3.config.lock().await.platform_policy_linked_epp; let change_epp = platform3.config.lock().await.throttle_policy_linked_epp;
platform3 platform3
.update_policy_ac_or_bat(power_plugged, change_epp) .update_policy_ac_or_bat(power_plugged, change_epp)
.await; .await;
@@ -705,13 +950,14 @@ impl CtrlTask for CtrlPlatform {
if let Ok(profile) = ctrl if let Ok(profile) = ctrl
.platform .platform
.get_throttle_thermal_policy() .get_throttle_thermal_policy()
.map(PlatformPolicy::from) .map(ThrottlePolicy::from)
.map_err(|e| { .map_err(|e| {
error!("Platform: get_throttle_thermal_policy error: {e}"); error!("Platform: get_throttle_thermal_policy error: {e}");
}) })
{ {
let change_epp = ctrl.config.lock().await.platform_policy_linked_epp; let change_epp = ctrl.config.lock().await.throttle_policy_linked_epp;
ctrl.check_and_set_epp(profile, change_epp); let epp = ctrl.get_config_epp_for_throttle(profile).await;
ctrl.check_and_set_epp(epp, change_epp);
} }
} }
} }
+6 -1
View File
@@ -64,11 +64,16 @@ async fn start_daemon() -> Result<(), Box<dyn Error>> {
let mut connection = Connection::system().await?; let mut connection = Connection::system().await?;
let config = Config::new().load(); let config = Config::new().load();
let cfg_path = config.file_path();
let config = Arc::new(Mutex::new(config)); let config = Arc::new(Mutex::new(config));
// supported.add_to_server(&mut connection).await; // supported.add_to_server(&mut connection).await;
match CtrlPlatform::new(config.clone()) { match CtrlPlatform::new(
config.clone(),
&cfg_path,
CtrlPlatform::signal_context(&connection)?,
) {
Ok(ctrl) => { Ok(ctrl) => {
let sig_ctx = CtrlPlatform::signal_context(&connection)?; let sig_ctx = CtrlPlatform::signal_context(&connection)?;
start_tasks(ctrl, &mut connection, sig_ctx).await?; start_tasks(ctrl, &mut connection, sig_ctx).await?;
+86 -71
View File
@@ -15,7 +15,6 @@ pub mod error;
use std::future::Future; use std::future::Future;
use std::time::Duration; use std::time::Duration;
use async_trait::async_trait;
use dmi_id::DMIID; use dmi_id::DMIID;
use futures_lite::stream::StreamExt; use futures_lite::stream::StreamExt;
use log::{debug, info, warn}; use log::{debug, info, warn};
@@ -130,34 +129,44 @@ pub fn print_board_info() {
info!("Board name: {}", dmi.board_name); info!("Board name: {}", dmi.board_name);
} }
#[async_trait]
pub trait Reloadable { pub trait Reloadable {
async fn reload(&mut self) -> Result<(), RogError>; fn reload(&mut self) -> impl std::future::Future<Output = Result<(), RogError>> + Send;
} }
#[async_trait] pub trait ReloadAndNotify {
pub trait ZbusRun { type Data: Send;
async fn add_to_server(self, server: &mut Connection);
async fn add_to_server_helper( fn reload_and_notify(
&mut self,
signal_context: &SignalContext<'static>,
data: Self::Data,
) -> impl std::future::Future<Output = Result<(), RogError>> + Send;
}
pub trait ZbusRun {
fn add_to_server(self, server: &mut Connection)
-> impl std::future::Future<Output = ()> + Send;
fn add_to_server_helper(
iface: impl zbus::Interface, iface: impl zbus::Interface,
path: &str, path: &str,
server: &mut Connection, server: &mut Connection,
) { ) -> impl std::future::Future<Output = ()> + Send {
server async move {
.object_server() server
.at(&ObjectPath::from_str_unchecked(path), iface) .object_server()
.await .at(&ObjectPath::from_str_unchecked(path), iface)
.map_err(|err| { .await
warn!("{}: add_to_server {}", path, err); .map_err(|err| {
err warn!("{}: add_to_server {}", path, err);
}) err
.ok(); })
.ok();
}
} }
} }
/// Set up a task to run on the async executor /// Set up a task to run on the async executor
#[async_trait]
pub trait CtrlTask { pub trait CtrlTask {
fn zbus_path() -> &'static str; fn zbus_path() -> &'static str;
@@ -168,7 +177,10 @@ pub trait CtrlTask {
/// Implement to set up various tasks that may be required, using the /// Implement to set up various tasks that may be required, using the
/// `Executor`. No blocking loops are allowed, or they must be run on a /// `Executor`. No blocking loops are allowed, or they must be run on a
/// separate thread. /// separate thread.
async fn create_tasks(&self, signal: SignalContext<'static>) -> Result<(), RogError>; fn create_tasks(
&self,
signal: SignalContext<'static>,
) -> impl std::future::Future<Output = Result<(), RogError>> + Send;
// /// Create a timed repeating task // /// Create a timed repeating task
// async fn repeating_task(&self, millis: u64, mut task: impl FnMut() + Send + // async fn repeating_task(&self, millis: u64, mut task: impl FnMut() + Send +
@@ -186,7 +198,7 @@ pub trait CtrlTask {
/// ///
/// The closures can potentially block, so execution time should be the /// The closures can potentially block, so execution time should be the
/// minimal possible such as save a variable. /// minimal possible such as save a variable.
async fn create_sys_event_tasks< fn create_sys_event_tasks<
Fut1, Fut1,
Fut2, Fut2,
Fut3, Fut3,
@@ -201,7 +213,8 @@ pub trait CtrlTask {
mut on_prepare_for_shutdown: F2, mut on_prepare_for_shutdown: F2,
mut on_lid_change: F3, mut on_lid_change: F3,
mut on_external_power_change: F4, mut on_external_power_change: F4,
) where ) -> impl std::future::Future<Output = ()> + Send
where
F1: FnMut(bool) -> Fut1, F1: FnMut(bool) -> Fut1,
F2: FnMut(bool) -> Fut2, F2: FnMut(bool) -> Fut2,
F3: FnMut(bool) -> Fut3, F3: FnMut(bool) -> Fut3,
@@ -211,70 +224,72 @@ pub trait CtrlTask {
Fut3: Future<Output = ()> + Send, Fut3: Future<Output = ()> + Send,
Fut4: Future<Output = ()> + Send, Fut4: Future<Output = ()> + Send,
{ {
let connection = Connection::system() async {
.await let connection = Connection::system()
.expect("Controller could not create dbus connection"); .await
.expect("Controller could not create dbus connection");
let manager = ManagerProxy::builder(&connection) let manager = ManagerProxy::builder(&connection)
.cache_properties(CacheProperties::No) .cache_properties(CacheProperties::No)
.build() .build()
.await .await
.expect("Controller could not create ManagerProxy"); .expect("Controller could not create ManagerProxy");
let manager1 = manager.clone(); let manager1 = manager.clone();
tokio::spawn(async move { tokio::spawn(async move {
if let Ok(mut notif) = manager1.receive_prepare_for_shutdown().await { if let Ok(mut notif) = manager1.receive_prepare_for_shutdown().await {
while let Some(event) = notif.next().await { while let Some(event) = notif.next().await {
// blocks thread :| // blocks thread :|
if let Ok(args) = event.args() { if let Ok(args) = event.args() {
debug!("Doing on_prepare_for_shutdown({})", args.start); debug!("Doing on_prepare_for_shutdown({})", args.start);
on_prepare_for_shutdown(args.start).await; on_prepare_for_shutdown(args.start).await;
}
} }
} }
} });
});
let manager2 = manager.clone(); let manager2 = manager.clone();
tokio::spawn(async move { tokio::spawn(async move {
if let Ok(mut notif) = manager2.receive_prepare_for_sleep().await { if let Ok(mut notif) = manager2.receive_prepare_for_sleep().await {
while let Some(event) = notif.next().await { while let Some(event) = notif.next().await {
// blocks thread :| // blocks thread :|
if let Ok(args) = event.args() { if let Ok(args) = event.args() {
debug!("Doing on_prepare_for_sleep({})", args.start); debug!("Doing on_prepare_for_sleep({})", args.start);
on_prepare_for_sleep(args.start).await; on_prepare_for_sleep(args.start).await;
}
} }
} }
} });
});
let manager3 = manager.clone(); let manager3 = manager.clone();
tokio::spawn(async move { tokio::spawn(async move {
let mut last_power = manager3.on_external_power().await.unwrap_or_default(); let mut last_power = manager3.on_external_power().await.unwrap_or_default();
loop { loop {
if let Ok(next) = manager3.on_external_power().await { if let Ok(next) = manager3.on_external_power().await {
if next != last_power { if next != last_power {
last_power = next; last_power = next;
on_external_power_change(next).await; on_external_power_change(next).await;
}
} }
sleep(Duration::from_secs(2)).await;
} }
sleep(Duration::from_secs(2)).await; });
}
});
tokio::spawn(async move { tokio::spawn(async move {
let mut last_lid = manager.lid_closed().await.unwrap_or_default(); let mut last_lid = manager.lid_closed().await.unwrap_or_default();
// need to loop on these as they don't emit signals // need to loop on these as they don't emit signals
loop { loop {
if let Ok(next) = manager.lid_closed().await { if let Ok(next) = manager.lid_closed().await {
if next != last_lid { if next != last_lid {
last_lid = next; last_lid = next;
on_lid_change(next).await; on_lid_change(next).await;
}
} }
sleep(Duration::from_secs(2)).await;
} }
sleep(Duration::from_secs(2)).await; });
} }
});
} }
} }
@@ -19,7 +19,7 @@
<arg name="enabled" type="b" direction="in"/> <arg name="enabled" type="b" direction="in"/>
</method> </method>
<!-- <!--
Get the fan-curve data for the currently active PlatformPolicy Get the fan-curve data for the currently active ThrottlePolicy
--> -->
<method name="FanCurveData"> <method name="FanCurveData">
<arg name="profile" type="s" direction="in"/> <arg name="profile" type="s" direction="in"/>
+2 -2
View File
@@ -28,7 +28,7 @@ export enum GpuMode {
} }
/** `throttle_thermal_policy` in asus_wmi */ /** `throttle_thermal_policy` in asus_wmi */
export enum PlatformPolicy { export enum ThrottlePolicy {
Balanced = "Balanced", Balanced = "Balanced",
Performance = "Performance", Performance = "Performance",
Quiet = "Quiet", Quiet = "Quiet",
@@ -43,7 +43,7 @@ export enum Properties {
PanelOd = "PanelOd", PanelOd = "PanelOd",
MiniLedMode = "MiniLedMode", MiniLedMode = "MiniLedMode",
EgpuEnable = "EgpuEnable", EgpuEnable = "EgpuEnable",
PlatformPolicy = "PlatformPolicy", ThrottlePolicy = "ThrottlePolicy",
PptPl1Spl = "PptPl1Spl", PptPl1Spl = "PptPl1Spl",
PptPl2Sppt = "PptPl2Sppt", PptPl2Sppt = "PptPl2Sppt",
PptFppt = "PptFppt", PptFppt = "PptFppt",
+14
View File
@@ -109,6 +109,20 @@ where
} }
} }
/// Open and parse the config file to self from ron format
fn read_new(&self) -> Option<Self> {
if let Ok(data) = fs::read_to_string(self.file_path()) {
if data.is_empty() {
warn!("File is empty {:?}", self.file_path());
} else if let Ok(data) = ron::from_str(&data) {
return Some(data);
} else {
warn!("Could not deserialise {:?}", self.file_path());
}
}
None
}
/// Write the config file data to pretty ron format /// Write the config file data to pretty ron format
fn write(&self) { fn write(&self) {
let mut file = match File::create(self.file_path()) { let mut file = match File::create(self.file_path()) {
+17 -1
View File
@@ -239,6 +239,14 @@
advanced_type: PerKey, advanced_type: PerKey,
power_zones: [Keyboard], power_zones: [Keyboard],
), ),
(
board_name: "G614J",
layout_name: "g634j-per-key",
basic_modes: [Static, Breathe, Pulse, Strobe, Rainbow],
basic_zones: [],
advanced_type: None,
power_zones: [Keyboard, Lightbar],
),
( (
board_name: "G634J", board_name: "G634J",
layout_name: "g634j-per-key", layout_name: "g634j-per-key",
@@ -407,6 +415,14 @@
advanced_type: PerKey, advanced_type: PerKey,
power_zones: [Keyboard, Lightbar], power_zones: [Keyboard, Lightbar],
), ),
(
board_name: "G814JZ",
layout_name: "g814ji-per-key",
basic_modes: [Static, Breathe, Strobe, Rainbow, Star, Rain, Highlight, Laser, Ripple, Pulse, Comet, Flash],
basic_zones: [],
advanced_type: PerKey,
power_zones: [Keyboard, Lightbar],
),
( (
board_name: "G834JZ", board_name: "G834JZ",
layout_name: "g814ji-per-key", layout_name: "g814ji-per-key",
@@ -711,4 +727,4 @@
advanced_type: None, advanced_type: None,
power_zones: [Keyboard], power_zones: [Keyboard],
), ),
]) ])
+2 -2
View File
@@ -137,7 +137,7 @@ pub struct AuraPowerDev {
#[cfg_attr( #[cfg_attr(
feature = "dbus", feature = "dbus",
derive(Type, Value, OwnedValue), derive(Type, Value, OwnedValue),
zvariant(signature = "y") zvariant(signature = "u")
)] )]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[repr(u32)] #[repr(u32)]
@@ -172,7 +172,7 @@ impl AuraDevTuf {
#[cfg_attr( #[cfg_attr(
feature = "dbus", feature = "dbus",
derive(Type, Value, OwnedValue), derive(Type, Value, OwnedValue),
zvariant(signature = "y") zvariant(signature = "u")
)] )]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[repr(u32)] #[repr(u32)]
+12
View File
@@ -22,6 +22,8 @@ use rog_control_center::{
get_ipc_file, on_tmp_dir_exists, print_versions, RogApp, RogDbusClientBlocking, SHOWING_GUI, get_ipc_file, on_tmp_dir_exists, print_versions, RogApp, RogDbusClientBlocking, SHOWING_GUI,
SHOW_GUI, SHOW_GUI,
}; };
#[cfg(not(feature = "mocking"))]
use supergfxctl::zbus_proxy::DaemonProxyBlocking as GfxProxyBlocking;
use tokio::runtime::Runtime; use tokio::runtime::Runtime;
#[cfg(not(feature = "mocking"))] #[cfg(not(feature = "mocking"))]
@@ -197,6 +199,16 @@ fn main() -> Result<()> {
init_tray(supported_properties, states.clone()); init_tray(supported_properties, states.clone());
} }
if let Ok(mut states) = states.lock() {
// For some reason the gui is causing a broke pipe error on dbus send, so
// replace it.
let (asus_dbus, conn) =
rog_dbus::RogDbusClientBlocking::new().expect("Couldn't connect to asusd");
states.asus_dbus = asus_dbus;
let gfx_dbus = GfxProxyBlocking::new(&conn).expect("Couldn't connect to supergfxd");
states.gfx_dbus = gfx_dbus;
}
let mut bg_check_spawned = false; let mut bg_check_spawned = false;
loop { loop {
if !running_in_bg.load(Ordering::Relaxed) { if !running_in_bg.load(Ordering::Relaxed) {
@@ -1,5 +1,5 @@
use egui::{RichText, Ui}; use egui::{RichText, Ui};
use rog_platform::platform::PlatformPolicy; use rog_platform::platform::ThrottlePolicy;
use crate::system_state::{FanCurvesState, SystemState}; use crate::system_state::{FanCurvesState, SystemState};
use crate::widgets::fan_graphs; use crate::widgets::fan_graphs;
@@ -29,7 +29,7 @@ impl RogApp {
} }
fn fan_curve( fn fan_curve(
current: &mut PlatformPolicy, current: &mut ThrottlePolicy,
curves: &mut FanCurvesState, curves: &mut FanCurvesState,
dbus: &RogDbusClientBlocking<'_>, dbus: &RogDbusClientBlocking<'_>,
do_error: &mut Option<String>, do_error: &mut Option<String>,
+8 -8
View File
@@ -10,7 +10,7 @@ use rog_aura::aura_detection::PowerZones;
use rog_aura::layouts::KeyLayout; use rog_aura::layouts::KeyLayout;
use rog_aura::usb::{AuraDevice, AuraPowerDev}; use rog_aura::usb::{AuraDevice, AuraPowerDev};
use rog_aura::{AuraEffect, AuraModeNum, AuraZone, LedBrightness}; use rog_aura::{AuraEffect, AuraModeNum, AuraZone, LedBrightness};
use rog_platform::platform::{GpuMode, PlatformPolicy}; use rog_platform::platform::{GpuMode, ThrottlePolicy};
use rog_profiles::fan_curve_set::CurveData; use rog_profiles::fan_curve_set::CurveData;
use rog_profiles::FanCurvePU; use rog_profiles::FanCurvePU;
use supergfxctl::pci_device::{GfxMode, GfxPower}; use supergfxctl::pci_device::{GfxMode, GfxPower};
@@ -34,7 +34,7 @@ pub struct PlatformState {
pub mini_led_mode: Option<bool>, pub mini_led_mode: Option<bool>,
pub dgpu_disable: Option<bool>, pub dgpu_disable: Option<bool>,
pub egpu_enable: Option<bool>, pub egpu_enable: Option<bool>,
pub throttle: Option<PlatformPolicy>, pub throttle: Option<ThrottlePolicy>,
pub charge_limit: Option<u8>, pub charge_limit: Option<u8>,
} }
@@ -65,9 +65,9 @@ impl PlatformState {
#[derive(Clone, Debug, Default)] #[derive(Clone, Debug, Default)]
pub struct FanCurvesState { pub struct FanCurvesState {
pub show_curve: PlatformPolicy, pub show_curve: ThrottlePolicy,
pub show_graph: FanCurvePU, pub show_graph: FanCurvePU,
pub curves: BTreeMap<PlatformPolicy, Vec<CurveData>>, pub curves: BTreeMap<ThrottlePolicy, Vec<CurveData>>,
pub available_fans: HashSet<FanCurvePU>, pub available_fans: HashSet<FanCurvePU>,
pub drag_delta: Vec2, pub drag_delta: Vec2,
} }
@@ -75,13 +75,13 @@ pub struct FanCurvesState {
impl FanCurvesState { impl FanCurvesState {
pub fn new(dbus: &RogDbusClientBlocking<'_>) -> Result<Self> { pub fn new(dbus: &RogDbusClientBlocking<'_>) -> Result<Self> {
let profiles = vec![ let profiles = vec![
PlatformPolicy::Balanced, ThrottlePolicy::Balanced,
PlatformPolicy::Quiet, ThrottlePolicy::Quiet,
PlatformPolicy::Performance, ThrottlePolicy::Performance,
]; ];
let mut available_fans = HashSet::new(); let mut available_fans = HashSet::new();
let mut curves: BTreeMap<PlatformPolicy, Vec<CurveData>> = BTreeMap::new(); let mut curves: BTreeMap<ThrottlePolicy, Vec<CurveData>> = BTreeMap::new();
for p in &profiles { for p in &profiles {
if let Ok(curve) = dbus.proxies().fan_curves().fan_curve_data(*p) { if let Ok(curve) = dbus.proxies().fan_curves().fan_curve_data(*p) {
if available_fans.is_empty() { if available_fans.is_empty() {
+5 -5
View File
@@ -14,7 +14,7 @@ use notify_rust::{Hint, Notification, NotificationHandle, Urgency};
use rog_dbus::zbus_anime::AnimeProxy; use rog_dbus::zbus_anime::AnimeProxy;
use rog_dbus::zbus_aura::AuraProxy; use rog_dbus::zbus_aura::AuraProxy;
use rog_dbus::zbus_platform::PlatformProxy; use rog_dbus::zbus_platform::PlatformProxy;
use rog_platform::platform::{GpuMode, PlatformPolicy}; use rog_platform::platform::{GpuMode, ThrottlePolicy};
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use supergfxctl::actions::UserActionRequired as GfxUserAction; use supergfxctl::actions::UserActionRequired as GfxUserAction;
use supergfxctl::pci_device::{GfxMode, GfxPower}; use supergfxctl::pci_device::{GfxMode, GfxPower};
@@ -546,11 +546,11 @@ fn _ac_power_notification(message: &str, on: &bool) -> Result<NotificationHandle
Ok(base_notification(message, &data).show()?) Ok(base_notification(message, &data).show()?)
} }
fn do_thermal_notif(message: &str, profile: &PlatformPolicy) -> Result<NotificationHandle> { fn do_thermal_notif(message: &str, profile: &ThrottlePolicy) -> Result<NotificationHandle> {
let icon = match profile { let icon = match profile {
PlatformPolicy::Balanced => "asus_notif_yellow", ThrottlePolicy::Balanced => "asus_notif_yellow",
PlatformPolicy::Performance => "asus_notif_red", ThrottlePolicy::Performance => "asus_notif_red",
PlatformPolicy::Quiet => "asus_notif_green", ThrottlePolicy::Quiet => "asus_notif_green",
}; };
let profile: &str = (*profile).into(); let profile: &str = (*profile).into();
let mut notif = base_notification(message, &profile.to_uppercase()); let mut notif = base_notification(message, &profile.to_uppercase());
+6 -2
View File
@@ -1,6 +1,6 @@
use egui::plot::{Line, Plot, Points}; use egui::plot::{Line, Plot, Points};
use egui::Ui; use egui::Ui;
use rog_platform::platform::PlatformPolicy; use rog_platform::platform::ThrottlePolicy;
use rog_profiles::fan_curve_set::CurveData; use rog_profiles::fan_curve_set::CurveData;
use rog_profiles::FanCurvePU; use rog_profiles::FanCurvePU;
@@ -13,9 +13,13 @@ pub fn fan_graphs(
do_error: &mut Option<String>, do_error: &mut Option<String>,
ui: &mut Ui, ui: &mut Ui,
) { ) {
if curves.available_fans.is_empty() {
return; // TODO:
}
ui.separator(); ui.separator();
let mut item = |profile: PlatformPolicy, ui: &mut Ui| { let mut item = |profile: ThrottlePolicy, ui: &mut Ui| {
ui.group(|ui| { ui.group(|ui| {
if ui if ui
.selectable_value(&mut curves.show_curve, profile, format!("{profile:?}")) .selectable_value(&mut curves.show_curve, profile, format!("{profile:?}"))
+3 -3
View File
@@ -1,5 +1,5 @@
use egui::Ui; use egui::Ui;
use rog_platform::platform::{GpuMode, PlatformPolicy}; use rog_platform::platform::{GpuMode, ThrottlePolicy};
use crate::system_state::SystemState; use crate::system_state::SystemState;
@@ -7,7 +7,7 @@ pub fn platform_profile(states: &mut SystemState, ui: &mut Ui) {
if let Some(mut throttle) = states.bios.throttle { if let Some(mut throttle) = states.bios.throttle {
ui.heading("Platform profile"); ui.heading("Platform profile");
let mut item = |p: PlatformPolicy, ui: &mut Ui| { let mut item = |p: ThrottlePolicy, ui: &mut Ui| {
if ui if ui
.selectable_value(&mut throttle, p, format!("{p:?}")) .selectable_value(&mut throttle, p, format!("{p:?}"))
.clicked() .clicked()
@@ -25,7 +25,7 @@ pub fn platform_profile(states: &mut SystemState, ui: &mut Ui) {
}; };
ui.horizontal_wrapped(|ui| { ui.horizontal_wrapped(|ui| {
for a in PlatformPolicy::list() { for a in ThrottlePolicy::list() {
item(a, ui); item(a, ui);
} }
}); });
+31 -1
View File
@@ -8,7 +8,7 @@ impl RogApp {
// The top panel is often a good place for a menu bar: // The top panel is often a good place for a menu bar:
egui::menu::bar(ui, |ui| { egui::menu::bar(ui, |ui| {
ui.horizontal(|ui| { ui.horizontal(|ui| {
egui::global_dark_light_mode_buttons(ui); self.dark_light_mode_buttons(ui);
egui::warn_if_debug_build(ui); egui::warn_if_debug_build(ui);
}); });
@@ -44,4 +44,34 @@ impl RogApp {
}); });
}); });
} }
fn dark_light_mode_buttons(&mut self, ui: &mut egui::Ui) {
let load_from_cfg = self.config.dark_mode != ui.ctx().style().visuals.dark_mode;
if ui
.add(egui::SelectableLabel::new(
!self.config.dark_mode,
"☀ Light",
))
.clicked()
|| (load_from_cfg && !self.config.dark_mode)
{
ui.ctx().set_visuals(egui::Visuals::light());
}
if ui
.add(egui::SelectableLabel::new(self.config.dark_mode, "🌙 Dark"))
.clicked()
|| (load_from_cfg && self.config.dark_mode)
{
ui.ctx().set_visuals(egui::Visuals::dark());
}
let applied_dark_mode = ui.ctx().style().visuals.dark_mode;
if self.config.dark_mode != applied_dark_mode {
self.config.dark_mode = applied_dark_mode;
let tmp = self.config.enabled_notifications.clone();
self.config.save(&tmp).ok();
}
}
} }
+6 -6
View File
@@ -20,7 +20,7 @@
//! //!
//! …consequently `zbus-xmlgen` did not generate code for the above interfaces. //! …consequently `zbus-xmlgen` did not generate code for the above interfaces.
use rog_platform::platform::PlatformPolicy; use rog_platform::platform::ThrottlePolicy;
use rog_profiles::fan_curve_set::CurveData; use rog_profiles::fan_curve_set::CurveData;
use rog_profiles::FanCurvePU; use rog_profiles::FanCurvePU;
use zbus::dbus_proxy; use zbus::dbus_proxy;
@@ -32,30 +32,30 @@ use zbus::dbus_proxy;
)] )]
trait FanCurves { trait FanCurves {
/// Get the fan-curve data for the currently active PlatformProfile /// Get the fan-curve data for the currently active PlatformProfile
fn fan_curve_data(&self, profile: PlatformPolicy) -> zbus::Result<Vec<CurveData>>; fn fan_curve_data(&self, profile: ThrottlePolicy) -> zbus::Result<Vec<CurveData>>;
/// Reset the stored (self) and device curve to the defaults of the /// Reset the stored (self) and device curve to the defaults of the
/// platform. /// platform.
/// ///
/// Each platform_profile has a different default and the defualt can be /// Each platform_profile has a different default and the defualt can be
/// read only for the currently active profile. /// read only for the currently active profile.
fn reset_profile_curves(&self, profile: PlatformPolicy) -> zbus::fdo::Result<()>; fn reset_profile_curves(&self, profile: ThrottlePolicy) -> zbus::Result<()>;
/// SetActiveCurveToDefaults method /// SetActiveCurveToDefaults method
fn set_active_curve_to_defaults(&self) -> zbus::Result<()>; fn set_active_curve_to_defaults(&self) -> zbus::Result<()>;
/// Set the fan curve for the specified profile, or the profile the user is /// Set the fan curve for the specified profile, or the profile the user is
/// currently in if profile == None. Will also activate the fan curve. /// currently in if profile == None. Will also activate the fan curve.
fn set_fan_curve(&self, profile: PlatformPolicy, curve: CurveData) -> zbus::Result<()>; fn set_fan_curve(&self, profile: ThrottlePolicy, curve: CurveData) -> zbus::Result<()>;
/// Set a profile fan curve enabled status. Will also activate a fan curve. /// Set a profile fan curve enabled status. Will also activate a fan curve.
fn set_fan_curves_enabled(&self, profile: PlatformPolicy, enabled: bool) -> zbus::Result<()>; fn set_fan_curves_enabled(&self, profile: ThrottlePolicy, enabled: bool) -> zbus::Result<()>;
/// Set a single fan curve for a profile to enabled status. Will also /// Set a single fan curve for a profile to enabled status. Will also
/// activate a fan curve. /// activate a fan curve.
async fn set_profile_fan_curve_enabled( async fn set_profile_fan_curve_enabled(
&self, &self,
profile: PlatformPolicy, profile: ThrottlePolicy,
fan: FanCurvePU, fan: FanCurvePU,
enabled: bool, enabled: bool,
) -> zbus::Result<()>; ) -> zbus::Result<()>;
+4 -4
View File
@@ -20,7 +20,7 @@
//! //!
//! …consequently `zbus-xmlgen` did not generate code for the above interfaces. //! …consequently `zbus-xmlgen` did not generate code for the above interfaces.
use rog_platform::platform::{GpuMode, PlatformPolicy, Properties}; use rog_platform::platform::{GpuMode, Properties, ThrottlePolicy};
use zbus::dbus_proxy; use zbus::dbus_proxy;
#[dbus_proxy( #[dbus_proxy(
@@ -118,9 +118,9 @@ trait Platform {
#[dbus_proxy(property)] #[dbus_proxy(property)]
fn set_ppt_platform_sppt(&self, value: u8) -> zbus::Result<()>; fn set_ppt_platform_sppt(&self, value: u8) -> zbus::Result<()>;
/// PlatformPolicy property /// ThrottlePolicy property
#[dbus_proxy(property)] #[dbus_proxy(property)]
fn throttle_thermal_policy(&self) -> zbus::Result<PlatformPolicy>; fn throttle_thermal_policy(&self) -> zbus::Result<ThrottlePolicy>;
#[dbus_proxy(property)] #[dbus_proxy(property)]
fn set_throttle_thermal_policy(&self, value: PlatformPolicy) -> zbus::Result<()>; fn set_throttle_thermal_policy(&self, value: ThrottlePolicy) -> zbus::Result<()>;
} }
+20 -9
View File
@@ -6,7 +6,7 @@ use typeshare::typeshare;
use zbus::zvariant::{OwnedValue, Type, Value}; use zbus::zvariant::{OwnedValue, Type, Value};
use crate::error::{PlatformError, Result}; use crate::error::{PlatformError, Result};
use crate::platform::PlatformPolicy; use crate::platform::ThrottlePolicy;
use crate::{read_attr_string, to_device}; use crate::{read_attr_string, to_device};
const ATTR_AVAILABLE_GOVERNORS: &str = "cpufreq/scaling_available_governors"; const ATTR_AVAILABLE_GOVERNORS: &str = "cpufreq/scaling_available_governors";
@@ -180,12 +180,23 @@ impl From<CPUGovernor> for String {
} }
#[typeshare] #[typeshare]
#[repr(u8)] #[repr(u32)]
#[derive( #[derive(
Deserialize, Serialize, Type, Value, OwnedValue, Debug, PartialEq, PartialOrd, Clone, Copy, Deserialize,
Serialize,
Type,
Value,
OwnedValue,
Default,
Debug,
PartialEq,
PartialOrd,
Clone,
Copy,
)] )]
#[zvariant(signature = "s")] #[zvariant(signature = "u")]
pub enum CPUEPP { pub enum CPUEPP {
#[default]
Default = 0, Default = 0,
Performance = 1, Performance = 1,
BalancePerformance = 2, BalancePerformance = 2,
@@ -193,12 +204,12 @@ pub enum CPUEPP {
Power = 4, Power = 4,
} }
impl From<PlatformPolicy> for CPUEPP { impl From<ThrottlePolicy> for CPUEPP {
fn from(value: PlatformPolicy) -> Self { fn from(value: ThrottlePolicy) -> Self {
match value { match value {
PlatformPolicy::Balanced => CPUEPP::BalancePerformance, ThrottlePolicy::Balanced => CPUEPP::BalancePerformance,
PlatformPolicy::Performance => CPUEPP::Performance, ThrottlePolicy::Performance => CPUEPP::Performance,
PlatformPolicy::Quiet => CPUEPP::Power, ThrottlePolicy::Quiet => CPUEPP::Power,
} }
} }
} }
+22 -32
View File
@@ -249,7 +249,7 @@ impl Display for GpuMode {
} }
#[typeshare] #[typeshare]
#[repr(u8)] #[repr(u32)]
#[derive( #[derive(
Deserialize, Deserialize,
Serialize, Serialize,
@@ -266,17 +266,17 @@ impl Display for GpuMode {
Clone, Clone,
Copy, Copy,
)] )]
#[zvariant(signature = "s")] #[zvariant(signature = "u")]
/// `throttle_thermal_policy` in asus_wmi /// `throttle_thermal_policy` in asus_wmi
pub enum PlatformPolicy { pub enum ThrottlePolicy {
#[default] #[default]
Balanced = 0, Balanced = 0,
Performance = 1, Performance = 1,
Quiet = 2, Quiet = 2,
} }
impl PlatformPolicy { impl ThrottlePolicy {
pub const fn next(&self) -> Self { pub const fn next(self) -> Self {
match self { match self {
Self::Balanced => Self::Performance, Self::Balanced => Self::Performance,
Self::Performance => Self::Quiet, Self::Performance => Self::Quiet,
@@ -289,7 +289,7 @@ impl PlatformPolicy {
} }
} }
impl From<u8> for PlatformPolicy { impl From<u8> for ThrottlePolicy {
fn from(num: u8) -> Self { fn from(num: u8) -> Self {
match num { match num {
0 => Self::Balanced, 0 => Self::Balanced,
@@ -303,55 +303,45 @@ impl From<u8> for PlatformPolicy {
} }
} }
impl From<PlatformPolicy> for u8 { impl From<ThrottlePolicy> for u8 {
fn from(p: PlatformPolicy) -> Self { fn from(p: ThrottlePolicy) -> Self {
match p { match p {
PlatformPolicy::Balanced => 0, ThrottlePolicy::Balanced => 0,
PlatformPolicy::Performance => 1, ThrottlePolicy::Performance => 1,
PlatformPolicy::Quiet => 2, ThrottlePolicy::Quiet => 2,
} }
} }
} }
impl From<PlatformPolicy> for &str { impl From<ThrottlePolicy> for &str {
fn from(profile: PlatformPolicy) -> &'static str { fn from(profile: ThrottlePolicy) -> &'static str {
match profile { match profile {
PlatformPolicy::Balanced => "balanced", ThrottlePolicy::Balanced => "balanced",
PlatformPolicy::Performance => "performance", ThrottlePolicy::Performance => "performance",
PlatformPolicy::Quiet => "quiet", ThrottlePolicy::Quiet => "quiet",
} }
} }
} }
impl std::str::FromStr for PlatformPolicy { impl std::str::FromStr for ThrottlePolicy {
type Err = PlatformError; type Err = PlatformError;
fn from_str(profile: &str) -> Result<Self> { fn from_str(profile: &str) -> Result<Self> {
match profile.to_ascii_lowercase().trim() { match profile.to_ascii_lowercase().trim() {
"balanced" => Ok(PlatformPolicy::Balanced), "balanced" => Ok(ThrottlePolicy::Balanced),
"performance" => Ok(PlatformPolicy::Performance), "performance" => Ok(ThrottlePolicy::Performance),
"quiet" => Ok(PlatformPolicy::Quiet), "quiet" => Ok(ThrottlePolicy::Quiet),
_ => Err(PlatformError::NotSupported), _ => Err(PlatformError::NotSupported),
} }
} }
} }
impl Display for PlatformPolicy { impl Display for ThrottlePolicy {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self) write!(f, "{:?}", self)
} }
} }
impl PlatformPolicy {
pub fn get_next_profile(current: PlatformPolicy) -> PlatformPolicy {
match current {
PlatformPolicy::Balanced => PlatformPolicy::Performance,
PlatformPolicy::Performance => PlatformPolicy::Quiet,
PlatformPolicy::Quiet => PlatformPolicy::Balanced,
}
}
}
/// CamelCase names of the properties. Intended for use with DBUS /// CamelCase names of the properties. Intended for use with DBUS
#[typeshare] #[typeshare]
#[repr(u8)] #[repr(u8)]
@@ -365,7 +355,7 @@ pub enum Properties {
PanelOd, PanelOd,
MiniLedMode, MiniLedMode,
EgpuEnable, EgpuEnable,
PlatformPolicy, ThrottlePolicy,
PptPl1Spl, PptPl1Spl,
PptPl2Sppt, PptPl2Sppt,
PptFppt, PptFppt,
+39 -34
View File
@@ -4,12 +4,13 @@ pub mod fan_curve_set;
use error::ProfileError; use error::ProfileError;
use fan_curve_set::CurveData; use fan_curve_set::CurveData;
use log::debug; use log::debug;
use rog_platform::platform::PlatformPolicy; use rog_platform::platform::ThrottlePolicy;
use serde_derive::{Deserialize, Serialize}; use serde_derive::{Deserialize, Serialize};
use typeshare::typeshare; use typeshare::typeshare;
pub use udev::Device; pub use udev::Device;
#[cfg(feature = "dbus")] #[cfg(feature = "dbus")]
use zbus::zvariant::Type; use zbus::zvariant::Type;
use zbus::zvariant::{OwnedValue, Value};
pub const VERSION: &str = env!("CARGO_PKG_VERSION"); pub const VERSION: &str = env!("CARGO_PKG_VERSION");
@@ -31,12 +32,16 @@ pub fn find_fan_curve_node() -> Result<Device, ProfileError> {
} }
#[typeshare] #[typeshare]
#[cfg_attr(feature = "dbus", derive(Type), zvariant(signature = "s"))] #[cfg_attr(
feature = "dbus",
derive(Type, Value, OwnedValue),
zvariant(signature = "s")
)]
#[derive(Deserialize, Serialize, Debug, Hash, PartialEq, Eq, Clone, Copy)] #[derive(Deserialize, Serialize, Debug, Hash, PartialEq, Eq, Clone, Copy)]
pub enum FanCurvePU { pub enum FanCurvePU {
CPU, CPU = 0,
GPU, GPU = 1,
MID, MID = 2,
} }
impl FanCurvePU { impl FanCurvePU {
@@ -118,7 +123,7 @@ impl FanCurveProfiles {
/// ///
pub fn read_from_dev_profile( pub fn read_from_dev_profile(
&mut self, &mut self,
profile: PlatformPolicy, profile: ThrottlePolicy,
device: &Device, device: &Device,
) -> Result<(), ProfileError> { ) -> Result<(), ProfileError> {
let fans = Self::supported_fans()?; let fans = Self::supported_fans()?;
@@ -136,9 +141,9 @@ impl FanCurveProfiles {
} }
match profile { match profile {
PlatformPolicy::Balanced => self.balanced = curves, ThrottlePolicy::Balanced => self.balanced = curves,
PlatformPolicy::Performance => self.performance = curves, ThrottlePolicy::Performance => self.performance = curves,
PlatformPolicy::Quiet => self.quiet = curves, ThrottlePolicy::Quiet => self.quiet = curves,
} }
Ok(()) Ok(())
} }
@@ -150,7 +155,7 @@ impl FanCurveProfiles {
/// read only for the currently active profile. /// read only for the currently active profile.
pub fn set_active_curve_to_defaults( pub fn set_active_curve_to_defaults(
&mut self, &mut self,
profile: PlatformPolicy, profile: ThrottlePolicy,
device: &mut Device, device: &mut Device,
) -> Result<(), ProfileError> { ) -> Result<(), ProfileError> {
let fans = Self::supported_fans()?; let fans = Self::supported_fans()?;
@@ -170,13 +175,13 @@ impl FanCurveProfiles {
// TODO: Make this return an error if curve is zeroed // TODO: Make this return an error if curve is zeroed
pub fn write_profile_curve_to_platform( pub fn write_profile_curve_to_platform(
&mut self, &mut self,
profile: PlatformPolicy, profile: ThrottlePolicy,
device: &mut Device, device: &mut Device,
) -> Result<(), ProfileError> { ) -> Result<(), ProfileError> {
let fans = match profile { let fans = match profile {
PlatformPolicy::Balanced => &mut self.balanced, ThrottlePolicy::Balanced => &mut self.balanced,
PlatformPolicy::Performance => &mut self.performance, ThrottlePolicy::Performance => &mut self.performance,
PlatformPolicy::Quiet => &mut self.quiet, ThrottlePolicy::Quiet => &mut self.quiet,
}; };
for fan in fans { for fan in fans {
debug!("write_profile_curve_to_platform: writing profile:{profile}, {fan:?}"); debug!("write_profile_curve_to_platform: writing profile:{profile}, {fan:?}");
@@ -185,19 +190,19 @@ impl FanCurveProfiles {
Ok(()) Ok(())
} }
pub fn set_profile_curves_enabled(&mut self, profile: PlatformPolicy, enabled: bool) { pub fn set_profile_curves_enabled(&mut self, profile: ThrottlePolicy, enabled: bool) {
match profile { match profile {
PlatformPolicy::Balanced => { ThrottlePolicy::Balanced => {
for curve in self.balanced.iter_mut() { for curve in self.balanced.iter_mut() {
curve.enabled = enabled; curve.enabled = enabled;
} }
} }
PlatformPolicy::Performance => { ThrottlePolicy::Performance => {
for curve in self.performance.iter_mut() { for curve in self.performance.iter_mut() {
curve.enabled = enabled; curve.enabled = enabled;
} }
} }
PlatformPolicy::Quiet => { ThrottlePolicy::Quiet => {
for curve in self.quiet.iter_mut() { for curve in self.quiet.iter_mut() {
curve.enabled = enabled; curve.enabled = enabled;
} }
@@ -207,12 +212,12 @@ impl FanCurveProfiles {
pub fn set_profile_fan_curve_enabled( pub fn set_profile_fan_curve_enabled(
&mut self, &mut self,
profile: PlatformPolicy, profile: ThrottlePolicy,
fan: FanCurvePU, fan: FanCurvePU,
enabled: bool, enabled: bool,
) { ) {
match profile { match profile {
PlatformPolicy::Balanced => { ThrottlePolicy::Balanced => {
for curve in self.balanced.iter_mut() { for curve in self.balanced.iter_mut() {
if curve.fan == fan { if curve.fan == fan {
curve.enabled = enabled; curve.enabled = enabled;
@@ -220,7 +225,7 @@ impl FanCurveProfiles {
} }
} }
} }
PlatformPolicy::Performance => { ThrottlePolicy::Performance => {
for curve in self.performance.iter_mut() { for curve in self.performance.iter_mut() {
if curve.fan == fan { if curve.fan == fan {
curve.enabled = enabled; curve.enabled = enabled;
@@ -228,7 +233,7 @@ impl FanCurveProfiles {
} }
} }
} }
PlatformPolicy::Quiet => { ThrottlePolicy::Quiet => {
for curve in self.quiet.iter_mut() { for curve in self.quiet.iter_mut() {
if curve.fan == fan { if curve.fan == fan {
curve.enabled = enabled; curve.enabled = enabled;
@@ -239,31 +244,31 @@ impl FanCurveProfiles {
} }
} }
pub fn get_fan_curves_for(&self, name: PlatformPolicy) -> &[CurveData] { pub fn get_fan_curves_for(&self, name: ThrottlePolicy) -> &[CurveData] {
match name { match name {
PlatformPolicy::Balanced => &self.balanced, ThrottlePolicy::Balanced => &self.balanced,
PlatformPolicy::Performance => &self.performance, ThrottlePolicy::Performance => &self.performance,
PlatformPolicy::Quiet => &self.quiet, ThrottlePolicy::Quiet => &self.quiet,
} }
} }
pub fn get_fan_curve_for(&self, name: &PlatformPolicy, pu: FanCurvePU) -> Option<&CurveData> { pub fn get_fan_curve_for(&self, name: &ThrottlePolicy, pu: FanCurvePU) -> Option<&CurveData> {
match name { match name {
PlatformPolicy::Balanced => { ThrottlePolicy::Balanced => {
for this_curve in self.balanced.iter() { for this_curve in self.balanced.iter() {
if this_curve.fan == pu { if this_curve.fan == pu {
return Some(this_curve); return Some(this_curve);
} }
} }
} }
PlatformPolicy::Performance => { ThrottlePolicy::Performance => {
for this_curve in self.performance.iter() { for this_curve in self.performance.iter() {
if this_curve.fan == pu { if this_curve.fan == pu {
return Some(this_curve); return Some(this_curve);
} }
} }
} }
PlatformPolicy::Quiet => { ThrottlePolicy::Quiet => {
for this_curve in self.quiet.iter() { for this_curve in self.quiet.iter() {
if this_curve.fan == pu { if this_curve.fan == pu {
return Some(this_curve); return Some(this_curve);
@@ -277,10 +282,10 @@ impl FanCurveProfiles {
pub fn save_fan_curve( pub fn save_fan_curve(
&mut self, &mut self,
curve: CurveData, curve: CurveData,
profile: PlatformPolicy, profile: ThrottlePolicy,
) -> Result<(), ProfileError> { ) -> Result<(), ProfileError> {
match profile { match profile {
PlatformPolicy::Balanced => { ThrottlePolicy::Balanced => {
for this_curve in self.balanced.iter_mut() { for this_curve in self.balanced.iter_mut() {
if this_curve.fan == curve.fan { if this_curve.fan == curve.fan {
*this_curve = curve; *this_curve = curve;
@@ -288,7 +293,7 @@ impl FanCurveProfiles {
} }
} }
} }
PlatformPolicy::Performance => { ThrottlePolicy::Performance => {
for this_curve in self.performance.iter_mut() { for this_curve in self.performance.iter_mut() {
if this_curve.fan == curve.fan { if this_curve.fan == curve.fan {
*this_curve = curve; *this_curve = curve;
@@ -296,7 +301,7 @@ impl FanCurveProfiles {
} }
} }
} }
PlatformPolicy::Quiet => { ThrottlePolicy::Quiet => {
for this_curve in self.quiet.iter_mut() { for this_curve in self.quiet.iter_mut() {
if this_curve.fan == curve.fan { if this_curve.fan == curve.fan {
*this_curve = curve; *this_curve = curve;