From a4e1ece099e862c539ee51e5bf571313fa9e27d1 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sat, 29 Apr 2023 10:41:47 -0400 Subject: [PATCH 01/26] Update h2 --- backend/Cargo.lock | 155 ++++++++++------ backend/limits_core/Cargo.lock | 20 +-- backend/limits_srv/Cargo.lock | 175 +++++++++++++------ backend/src/settings/steam_deck/oc_limits.rs | 1 + 4 files changed, 237 insertions(+), 114 deletions(-) diff --git a/backend/Cargo.lock b/backend/Cargo.lock index 0f3aad4..82681fb 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -46,9 +46,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" dependencies = [ "memchr", ] @@ -85,7 +85,7 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -96,7 +96,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -166,9 +166,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.12.0" +version = "3.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" +checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8" [[package]] name = "bytecount" @@ -265,15 +265,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280a9f2d8b3a38871a3c8a46fb80db65e5e5ed97da80c4d08bf27fb63e35e181" +checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" dependencies = [ "libc", ] @@ -330,7 +330,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -347,7 +347,7 @@ checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -539,9 +539,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" dependencies = [ "cfg-if", "libc", @@ -566,9 +566,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "h2" -version = "0.3.16" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be7b54589b581f624f566bf5d8eb2bab1db736c51528720b6bd36b96b55924d" +checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21" dependencies = [ "bytes", "fnv", @@ -665,9 +665,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.25" +version = "0.14.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" +checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" dependencies = [ "bytes", "futures-channel", @@ -689,9 +689,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.54" +version = "0.1.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c17cc76786e99f8d2f055c11159e7f0091c42474dcc3189fbab96072e873e6d" +checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -760,9 +760,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.140" +version = "0.2.142" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" +checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" [[package]] name = "libloading" @@ -1086,9 +1086,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.55" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d0dd4be24fcdcfeaa12a432d588dc59bbad6cad3510c67e74a2b6b2fc950564" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" dependencies = [ "unicode-ident", ] @@ -1134,9 +1134,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.3" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" +checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" dependencies = [ "aho-corasick", "memchr", @@ -1145,9 +1145,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.29" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" [[package]] name = "rustc-hash" @@ -1184,29 +1184,29 @@ checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" [[package]] name = "serde" -version = "1.0.159" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065" +checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.159" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" +checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] name = "serde_json" -version = "1.0.95" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" dependencies = [ "itoa", "ryu", @@ -1291,9 +1291,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.13" +version = "2.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c9da457c5285ac1f936ebd076af6dac17a61cfe7826f2076b4d015cf47bc8ec" +checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" dependencies = [ "proc-macro2", "quote", @@ -1326,7 +1326,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -1777,11 +1777,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.46.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdacb41e6a96a052c6cb63a144f24900236121c6f63f4f8219fef5977ecb0c25" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets", + "windows-targets 0.48.0", ] [[package]] @@ -1790,7 +1790,7 @@ version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows-targets", + "windows-targets 0.42.2", ] [[package]] @@ -1799,13 +1799,28 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", ] [[package]] @@ -1814,42 +1829,84 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + [[package]] name = "windows_i686_gnu" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + [[package]] name = "windows_i686_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + [[package]] name = "winnow" version = "0.4.1" diff --git a/backend/limits_core/Cargo.lock b/backend/limits_core/Cargo.lock index 1fe94f4..1914c35 100644 --- a/backend/limits_core/Cargo.lock +++ b/backend/limits_core/Cargo.lock @@ -18,9 +18,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.54" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e472a104799c74b514a57226160104aa483546de37e839ec50e3c2e41dd87534" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" dependencies = [ "unicode-ident", ] @@ -42,18 +42,18 @@ checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" [[package]] name = "serde" -version = "1.0.159" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065" +checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.159" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" +checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" dependencies = [ "proc-macro2", "quote", @@ -62,9 +62,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.95" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" dependencies = [ "itoa", "ryu", @@ -73,9 +73,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.12" +version = "2.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79d9531f94112cfc3e4c8f5f02cb2b58f72c97b7efd85f70203cc6d8efda5927" +checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" dependencies = [ "proc-macro2", "quote", diff --git a/backend/limits_srv/Cargo.lock b/backend/limits_srv/Cargo.lock index b0d4490..5f1434c 100644 --- a/backend/limits_srv/Cargo.lock +++ b/backend/limits_srv/Cargo.lock @@ -46,9 +46,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.12.0" +version = "3.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" +checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8" [[package]] name = "byteorder" @@ -101,15 +101,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280a9f2d8b3a38871a3c8a46fb80db65e5e5ed97da80c4d08bf27fb63e35e181" +checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" dependencies = [ "libc", ] @@ -148,7 +148,7 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.12", + "syn 2.0.15", ] [[package]] @@ -165,7 +165,7 @@ checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.12", + "syn 2.0.15", ] [[package]] @@ -247,9 +247,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" dependencies = [ "cfg-if", "libc", @@ -258,9 +258,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.16" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be7b54589b581f624f566bf5d8eb2bab1db736c51528720b6bd36b96b55924d" +checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21" dependencies = [ "bytes", "fnv", @@ -351,9 +351,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.25" +version = "0.14.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" +checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" dependencies = [ "bytes", "futures-channel", @@ -375,9 +375,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.54" +version = "0.1.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c17cc76786e99f8d2f055c11159e7f0091c42474dcc3189fbab96072e873e6d" +checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -434,9 +434,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.140" +version = "0.2.142" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" +checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" [[package]] name = "limits_core" @@ -507,7 +507,7 @@ dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -605,9 +605,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.54" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e472a104799c74b514a57226160104aa483546de37e839ec50e3c2e41dd87534" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" dependencies = [ "unicode-ident", ] @@ -680,29 +680,29 @@ checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" [[package]] name = "serde" -version = "1.0.159" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065" +checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.159" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" +checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" dependencies = [ "proc-macro2", "quote", - "syn 2.0.12", + "syn 2.0.15", ] [[package]] name = "serde_json" -version = "1.0.95" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" dependencies = [ "itoa", "ryu", @@ -764,9 +764,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.12" +version = "2.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79d9531f94112cfc3e4c8f5f02cb2b58f72c97b7efd85f70203cc6d8efda5927" +checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" dependencies = [ "proc-macro2", "quote", @@ -799,7 +799,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.12", + "syn 2.0.15", ] [[package]] @@ -830,9 +830,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.27.0" +version = "1.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" +checksum = "c3c786bf8134e5a3a166db9b29ab8f48134739014a3eca7bc6bfa95d673b136f" dependencies = [ "autocfg", "bytes", @@ -842,25 +842,25 @@ dependencies = [ "pin-project-lite", "socket2", "tokio-macros", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.12", + "syn 2.0.15", ] [[package]] name = "tokio-stream" -version = "0.1.12" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", "pin-project-lite", @@ -881,9 +881,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ "bytes", "futures-core", @@ -901,11 +901,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "cf9cf6a813d3f40c88b0b6b6f29a5c95c6cdbf97c1f9cc53fb820200f5ad814d" dependencies = [ - "cfg-if", "log", "pin-project-lite", "tracing-core", @@ -1150,11 +1149,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.46.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdacb41e6a96a052c6cb63a144f24900236121c6f63f4f8219fef5977ecb0c25" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets", + "windows-targets 0.48.0", ] [[package]] @@ -1163,7 +1162,16 @@ version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows-targets", + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", ] [[package]] @@ -1172,13 +1180,28 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", ] [[package]] @@ -1187,38 +1210,80 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + [[package]] name = "windows_i686_gnu" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + [[package]] name = "windows_i686_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" diff --git a/backend/src/settings/steam_deck/oc_limits.rs b/backend/src/settings/steam_deck/oc_limits.rs index d0cbeac..69aa364 100644 --- a/backend/src/settings/steam_deck/oc_limits.rs +++ b/backend/src/settings/steam_deck/oc_limits.rs @@ -171,6 +171,7 @@ fn oc_limits_filepath() -> std::path::PathBuf { mod tests { use super::*; + #[cfg(not(feature = "dev_stuff"))] // this can fail due to reading from incompletely-written file otherwise #[test] fn load_pt_oc() { let mut file = std::fs::File::open("../pt_oc.json").unwrap(); From 23d6e49491d85b90887fbbf74bafb4d6903114b2 Mon Sep 17 00:00:00 2001 From: Marco Rodolfi Date: Wed, 3 May 2023 00:01:45 +0200 Subject: [PATCH 02/26] Added italian translation (#98) * Added italian translation * Updated it translation with latest strings --- translations/it-IT.mo | Bin 0 -> 2867 bytes translations/it-IT.po | 244 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 244 insertions(+) create mode 100644 translations/it-IT.mo create mode 100644 translations/it-IT.po diff --git a/translations/it-IT.mo b/translations/it-IT.mo new file mode 100644 index 0000000000000000000000000000000000000000..c615b2454f79b8e05777f2ca33dee6db18a140d8 GIT binary patch literal 2867 zcmZ{l?Q0xG9LGnk4?U~asYr?ss~+f6Qsh4wl$mmJAe`$lB$c5)fJJG0%H zy=&sj`a%(WAu34UDELBrsfY?9NMHIw5a~;)eP=2D0V3%4x3imEqb@i5+1Z_k-_v~W z*F8HvV7LObXVBifi?J#2_T9MQx^WL<4}iac2f^N)aJ$0?B3 zJp+=R(;(T?25B7wJ_No|ynnmse^~HS5L>V>K(gm+kmi41^nV1&zMsK8;BAoh{~IL# zc4HFt_km>3FnAaYKw75>()?FJvZoKyyenV}F@Fan`)}ao1o%5h{R6nsddEP@&vB6U znFlHE7r;qSgZQz}af3!8349E^4juw;fn?7v1a%nP2U0CegZQxo zHyXbIk{$1Yn8MxzPlH!MTK^Z2*11{q{{YGFzY6ZG`0sl`ykdtzvgag7<0gv!i{MH0 z=Rw-nf#mO7Ao=qVxEK5cBzwLA$=>h4N5EU)5%5ot>^X=V%{u`i%L6n>gADG|KznMfrIcjp9!>lOHgb zJ&$$_jV_7-)fv_P<7gDKAvB6bc~KtrqdkrG92(U}c~R}{qfR~S3Ehz)t4ERPbGIh> z+2(mLl_KQM@X+wSNiVW#;hap@8NRZ!Ya;DpV3wv*JAO{Z%GvU5-YYu|6H0d0XqTFZ zxBU{lN#0+Rnv1@;h+%#?HY3|v7xz_>MOb#m^mQjPor}C7V*?9jQq_|wo7JKn zNy|+b20Dw|GL<3OZa2RqG7SnxI!3RmZiX$D(QHmw*KD@<&@01i&ZHg5m+K9#G~7iH zg2eP?%40I!f8A!d|B{MW=8>68<)uvO&UzV$d4y=*z(#FSmWN}z>jPdl#AQA-BdzM{ zVTO*1vzQMZ9e8fMv@y_&>*y%$hxt#+c4QO@Elp-w9`Qx^*^_J$86EP;8fHs6Qd+Vl z*p;eK@;cJonrU(?om0ANSyQG~Sw|Udre;+|k~Jw3%}8vzR(@EPB1xk4t;s8m7F!WL z$rC@73mqbus3GOJmX{rODwb?TMzZ64qR?@?Z89AqiJJQy+eD%mSCED>L9M(LVP0xp z$J}5c3|=Nnjjr+D*vMFAStcfRLBn=c7))nf8?;P~uQ`|4+URIkxwWi4(lPPq;=ERw z9nGC;857x2Wo;&HrMVO=%bub&gBet1jgMEyCxYs!pgPXSs^GIwmGTA{;$5C^UG1p7EdW;BU}(v$hI zKr*Jzx8{P=TjOZERaEko&f23+Po$X;L&$+=Bc*^1|?*Ov{!{w*xI z4L*9?miqrlHDKSMQ%FwnTu4sQ+msxP+NL;y^u~M6a?vqtDHRZ%JfWMSvtoLw zupJ1u;*sPkPK, 2023. +msgid "" +msgstr "" +"Project-Id-Version: v1.1\n" +"Report-Msgid-Bugs-To: https://github.com/NGnius/PowerTools/issues\n" +"POT-Creation-Date: 2023-01-09 19:52-0500\n" +"PO-Revision-Date: 2023-05-02 10:04+0200\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: it_IT\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.2.2\n" + +# -- index.tsx -- +# (Section title) +#: index.tsx:226 +msgid "Miscellaneous" +msgstr "Miscellanea" + +# (Profile persistence toggle, a bit like SteamOS's "Use per-game profile") +#: index.tsx:226 +msgid "Persistent Profile" +msgstr "Profilo persistente" + +# (Profile persistence toggle description) +#: index.tsx:227 +msgid "Save profile and load it next time" +msgstr "Salva il profilo e caricalo la prossima volta" + +# (Profile display) +#: index.tsx:239 +msgid "Profile" +msgstr "Profilo" + +# (Button to reset everything to system defaults) +#: index.tsx:276 +msgid "Reapply settings" +msgstr "Riapplica impostazioni" + +# (Button to reset everything to system defaults) +#: index.tsx:297 +msgid "Defaults" +msgstr "Default" + +# -- components/battery.tsx -- +# (Battery section title) +#: components/battery.tsx:42 +msgid "Battery" +msgstr "Batteria" + +# (Charge of battery at this moment, with percentage of expected full charge in brackets) +#: components/battery.tsx:46 +msgid "Now (Charge)" +msgstr "Ora (Carica)" + +# (Maximum capacity of battery, with percentage of design capacity in brackets) +#: components/battery.tsx:52 +msgid "Max (Design)" +msgstr "Mass (Design)" + +# (Charge current limit override toggle) +#: components/battery.tsx:59 +msgid "Charge Current Limits" +msgstr "Limiti di corrente di carica" + +# (Charge current limit override toggle description) +#: components/battery.tsx:60 +msgid "Control battery charge rate when awake" +msgstr "Controlla la velocità di ricarica quando il Deck è attivo" + +# (Battery maximum input current with unit) +#: components/battery.tsx:74 +msgid "Maximum (mA)" +msgstr "Massimo (mA)" + +# (Battery charge mode override toggle) +#: components/battery.tsx:97,115 +msgid "Charge Mode" +msgstr "Modalità di ricarica" + +# (Battery charge mode override toggle description) +#: components/battery.tsx:98 +msgid "Force battery charge mode" +msgstr "Forza la modalità di ricarica della batteria" + +# (Battery charge mode dropdown) +#: components/battery.tsx:112 +msgid "Mode" +msgstr "Modalità" + +# (Battery electrical current display) +#: components/battery.tsx:133 +msgid "Current" +msgstr "Corrente" + +# (Battery charging maximum) +#: components/battery.tsx:141 +msgid "Charge Limit" +msgstr "Limite di carica" + +# (Battery charging maximum description) +#: components/battery.tsx:142 +msgid "Limit battery charge when awake" +msgstr "Limita la carica della batteria quando il Deck è attivo" + +# (Battery charging maximum slider) +#: components/battery.tsx:156 +msgid "Maximum (%)" +msgstr "Massimo (%)" + +# -- components/cpus.tsx -- +# (CPU section title) +#: components/cpus.tsx:64 +msgid "CPU" +msgstr "CPU" + +# (CPU advanced mode toggle) +#: components/cpus.tsx:70 +msgid "Advanced" +msgstr "Avanzate" + +# (CPU advanced mode toggle description) +#: components/cpus.tsx:71 +msgid "Enables per-thread configuration" +msgstr "Abilita configurazione per thread" + +# (CPU Simultaneous MultiThreading toggle) +#: components/cpus.tsx:88 +msgid "SMT" +msgstr "SMT" + +# (CPU SMT toggle description) +#: components/cpus.tsx:89 +msgid "Enables odd-numbered CPUs" +msgstr "Abilita CPU dispari" + +# (CPU thread count slider) +#: components/cpus.tsx:106 +msgid "Threads" +msgstr "Threads" + +# (Clock speed override toggle) +#: components/cpus.tsx:137 components/gpu.tsx:112 +msgid "Frequency Limits" +msgstr "Limiti di frequenza" + +# (Clock speed override toggle description) +#: components/cpus.tsx:138 components/gpu.tsx:113 +msgid "Set bounds on clock speed" +msgstr "Imposta limiti di frequenza di clock" + +# (Minimum clock speed with unit) +#: components/cpus.tsx:165 components/gpu.tsx:137 +msgid "Minimum (MHz)" +msgstr "Minimo (MHz)" + +# (Maximum clock speed with unit) +#: components/cpus.tsx:195 components/gpu.tsx:160 +msgid "Maximum (MHz)" +msgstr "Massimo (MHz)" + +# advanced mode +# (CPU selection slider) +#: components/cpus.tsx:226 +msgid "Selected CPU" +msgstr "CPU selezionata" + +# (CPU Online toggle) +#: components/cpus.tsx:246 +msgid "Online" +msgstr "Online" + +# (CPU Online description) +#: components/cpus.tsx:247 +msgid "Allow the CPU thread to do work" +msgstr "Permetti al thread della CPU di eseguire operazioni" + +# (CPU scheduling governor dropdown -- governor names are not translated) +#: components/cpus.tsx:342 +msgid "Governor" +msgstr "Governor" + +# -- components/debug.tsx -- +# (Debug section title) +#: components/debug.tsx:29 +msgid "Debug" +msgstr "Debug" + +# (Version display for native back-end of PowerTools) +#: components/debug.tsx:33 +msgid "Native" +msgstr "Nativo" + +# (Mode display for framework of USDPL API) +#: components/debug.tsx:47 +msgid "Framework" +msgstr "Framework" + +# (Display for software implementation in PowerTools which applies settings) +#: components/debug.tsx:54 +msgid "Driver" +msgstr "Driver" + +# -- components/gpu.tsx -- +# (GPU section title) +#: components/gpu.tsx:34 +msgid "GPU" +msgstr "GPU" + +# (PPT Limits override toggle) +#: components/gpu.tsx:39 +msgid "PowerPlay Limits" +msgstr "Limiti PowerPlay" + +# (PPT Limits override toggle description) +#: components/gpu.tsx:40 +msgid "Override APU TDP settings" +msgstr "Sovrascrivi le impostazioni di TDP della APU" + +# (SlowPPT slider with unit) +#: components/gpu.tsx:63 +msgid "SlowPPT (W)" +msgstr "SlowPPT (W)" + +# (FastPPT slider with unit) +#: components/gpu.tsx:87 +msgid "FastPPT (W)" +msgstr "FastPPT (W)" + +# (Reduce memory clock speed toggle) +#: components/gpu.tsx:112 +msgid "Downclock Memory" +msgstr "Downclock RAM" + +# (Reduce memory clock speed toggle description) +#: components/gpu.tsx:112 +msgid "Force RAM into low-power mode" +msgstr "Forza la RAM in modalità a basso consumo" From f8ea999604e0829b9f16bd59287de1a71a799e29 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Thu, 25 May 2023 21:03:13 -0400 Subject: [PATCH 03/26] Refactor steam_deck to modularize system interactions --- backend/Cargo.lock | 2 +- backend/Cargo.toml | 2 +- backend/limits_core/Cargo.lock | 2 +- backend/limits_core/Cargo.toml | 2 +- backend/limits_core/src/json/base.rs | 48 +++--- backend/limits_core/src/json/range.rs | 4 +- backend/limits_srv/Cargo.toml | 4 +- backend/src/api/api_types.rs | 12 +- backend/src/api/cpu.rs | 8 +- backend/src/api/gpu.rs | 8 +- backend/src/api/handler.rs | 4 +- backend/src/api/utility.rs | 12 +- backend/src/persist/general.rs | 4 +- backend/src/settings/generic/cpu.rs | 13 +- backend/src/settings/generic/gpu.rs | 51 +++++- backend/src/settings/generic_amd/gpu.rs | 68 ++++---- backend/src/settings/min_max.rs | 8 +- backend/src/settings/steam_deck/battery.rs | 49 +++--- backend/src/settings/steam_deck/cpu.rs | 154 +++++++++++-------- backend/src/settings/steam_deck/gpu.rs | 152 ++++++++---------- backend/src/settings/steam_deck/oc_limits.rs | 2 +- 21 files changed, 329 insertions(+), 280 deletions(-) diff --git a/backend/Cargo.lock b/backend/Cargo.lock index 82681fb..3c098c3 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -799,7 +799,7 @@ dependencies = [ [[package]] name = "limits_core" -version = "1.0.0" +version = "2.0.0" dependencies = [ "serde", "serde_json", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index c441c74..b6d2e47 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -25,7 +25,7 @@ log = "0.4" simplelog = "0.12" # limits & driver functionality -limits_core = { version = "1.0.0", path = "./limits_core" } +limits_core = { version = "2", path = "./limits_core" } regex = "1" libryzenadj = { version = "0.12" } # ureq's tls feature does not like musl targets diff --git a/backend/limits_core/Cargo.lock b/backend/limits_core/Cargo.lock index 1914c35..ac3e0ed 100644 --- a/backend/limits_core/Cargo.lock +++ b/backend/limits_core/Cargo.lock @@ -10,7 +10,7 @@ checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] name = "limits_core" -version = "1.0.0" +version = "2.0.0" dependencies = [ "serde", "serde_json", diff --git a/backend/limits_core/Cargo.toml b/backend/limits_core/Cargo.toml index 2bb9e77..7dd5c63 100644 --- a/backend/limits_core/Cargo.toml +++ b/backend/limits_core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "limits_core" -version = "1.0.0" +version = "2.0.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/backend/limits_core/src/json/base.rs b/backend/limits_core/src/json/base.rs index d6e013c..41e9801 100644 --- a/backend/limits_core/src/json/base.rs +++ b/backend/limits_core/src/json/base.rs @@ -57,16 +57,16 @@ impl Default for Base { }, limits: vec![ super::Limits::Cpu(super::CpuLimit::GenericAMD(super::GenericCpuLimit { - clock_min: Some(super::RangeLimit { min: 1000, max: 3700 }), - clock_max: Some(super::RangeLimit { min: 1000, max: 3700 }), + clock_min: Some(super::RangeLimit { min: Some(1000), max: Some(3700) }), + clock_max: Some(super::RangeLimit { min: Some(1000), max: Some(3700) }), clock_step: 100, })), super::Limits::Gpu(super::GpuLimit::GenericAMD(super::GenericGpuLimit { - fast_ppt: Some(super::RangeLimit { min: 1_000_000, max: 25_000_000 }), - slow_ppt: Some(super::RangeLimit { min: 1_000_000, max: 25_000_000 }), + fast_ppt: Some(super::RangeLimit { min: Some(1_000_000), max: Some(25_000_000) }), + slow_ppt: Some(super::RangeLimit { min: Some(1_000_000), max: Some(25_000_000) }), ppt_step: Some(1_000_000), - clock_min: Some(super::RangeLimit { min: 400, max: 1100 }), - clock_max: Some(super::RangeLimit { min: 400, max: 1100 }), + clock_min: Some(super::RangeLimit { min: Some(400), max: Some(1100) }), + clock_max: Some(super::RangeLimit { min: Some(400), max: Some(1100) }), clock_step: Some(100), ..Default::default() })), @@ -84,16 +84,16 @@ impl Default for Base { }, limits: vec![ super::Limits::Cpu(super::CpuLimit::GenericAMD(super::GenericCpuLimit { - clock_min: Some(super::RangeLimit { min: 1000, max: 4000 }), - clock_max: Some(super::RangeLimit { min: 1000, max: 4000 }), + clock_min: Some(super::RangeLimit { min: Some(1000), max: Some(4000) }), + clock_max: Some(super::RangeLimit { min: Some(1000), max: Some(4000) }), clock_step: 100, })), super::Limits::Gpu(super::GpuLimit::GenericAMD(super::GenericGpuLimit { - fast_ppt: Some(super::RangeLimit { min: 1_000_000, max: 25_000_000 }), - slow_ppt: Some(super::RangeLimit { min: 1_000_000, max: 25_000_000 }), + fast_ppt: Some(super::RangeLimit { min: Some(1_000_000), max: Some(25_000_000) }), + slow_ppt: Some(super::RangeLimit { min: Some(1_000_000), max: Some(25_000_000) }), ppt_step: Some(1_000_000), - clock_min: Some(super::RangeLimit { min: 400, max: 1600 }), - clock_max: Some(super::RangeLimit { min: 400, max: 1600 }), + clock_min: Some(super::RangeLimit { min: Some(400), max: Some(1600) }), + clock_max: Some(super::RangeLimit { min: Some(400), max: Some(1600) }), clock_step: Some(100), ..Default::default() })), @@ -111,16 +111,16 @@ impl Default for Base { }, limits: vec![ super::Limits::Cpu(super::CpuLimit::GenericAMD(super::GenericCpuLimit { - clock_min: Some(super::RangeLimit { min: 1000, max: 4500 }), - clock_max: Some(super::RangeLimit { min: 1000, max: 4500 }), + clock_min: Some(super::RangeLimit { min: Some(1000), max: Some(4500) }), + clock_max: Some(super::RangeLimit { min: Some(1000), max: Some(4500) }), clock_step: 100, })), super::Limits::Gpu(super::GpuLimit::GenericAMD(super::GenericGpuLimit { - fast_ppt: Some(super::RangeLimit { min: 1_000_000, max: 25_000_000 }), - slow_ppt: Some(super::RangeLimit { min: 1_000_000, max: 25_000_000 }), + fast_ppt: Some(super::RangeLimit { min: Some(1_000_000), max: Some(25_000_000) }), + slow_ppt: Some(super::RangeLimit { min: Some(1_000_000), max: Some(25_000_000) }), ppt_step: Some(1_000_000), - clock_min: Some(super::RangeLimit { min: 400, max: 2000 }), - clock_max: Some(super::RangeLimit { min: 400, max: 2000 }), + clock_min: Some(super::RangeLimit { min: Some(400), max: Some(2000) }), + clock_max: Some(super::RangeLimit { min: Some(400), max: Some(2000) }), clock_step: Some(100), ..Default::default() })), @@ -138,16 +138,16 @@ impl Default for Base { }, limits: vec![ super::Limits::Cpu(super::CpuLimit::Generic(super::GenericCpuLimit { - clock_min: Some(super::RangeLimit { min: 1000, max: 4700 }), - clock_max: Some(super::RangeLimit { min: 1000, max: 4700 }), + clock_min: Some(super::RangeLimit { min: Some(1000), max: Some(4700) }), + clock_max: Some(super::RangeLimit { min: Some(1000), max: Some(4700) }), clock_step: 100, })), super::Limits::Gpu(super::GpuLimit::Generic(super::GenericGpuLimit { - fast_ppt: Some(super::RangeLimit { min: 1_000_000, max: 28_000_000 }), - slow_ppt: Some(super::RangeLimit { min: 1_000_000, max: 28_000_000 }), + fast_ppt: Some(super::RangeLimit { min: Some(1_000_000), max: Some(28_000_000) }), + slow_ppt: Some(super::RangeLimit { min: Some(1_000_000), max: Some(28_000_000) }), ppt_step: Some(1_000_000), - clock_min: Some(super::RangeLimit { min: 400, max: 2200 }), - clock_max: Some(super::RangeLimit { min: 400, max: 2200 }), + clock_min: Some(super::RangeLimit { min: Some(400), max: Some(2200) }), + clock_max: Some(super::RangeLimit { min: Some(400), max: Some(2200) }), clock_step: Some(100), ..Default::default() })), diff --git a/backend/limits_core/src/json/range.rs b/backend/limits_core/src/json/range.rs index 2ea3718..49135eb 100644 --- a/backend/limits_core/src/json/range.rs +++ b/backend/limits_core/src/json/range.rs @@ -3,6 +3,6 @@ use serde::{Deserialize, Serialize}; /// Base JSON limits information #[derive(Serialize, Deserialize, Debug, Clone)] pub struct RangeLimit { - pub min: T, - pub max: T, + pub min: Option, + pub max: Option, } diff --git a/backend/limits_srv/Cargo.toml b/backend/limits_srv/Cargo.toml index 67305c8..11cd344 100644 --- a/backend/limits_srv/Cargo.toml +++ b/backend/limits_srv/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "limits_srv" -version = "1.0.0" +version = "2.0.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -limits_core = { version = "1.0.0", path = "../limits_core" } +limits_core = { version = "2.0.0", path = "../limits_core" } chrono = { version = "0.4" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/backend/src/api/api_types.rs b/backend/src/api/api_types.rs index aa904b5..8d72107 100644 --- a/backend/src/api/api_types.rs +++ b/backend/src/api/api_types.rs @@ -1,18 +1,14 @@ use serde::{Deserialize, Serialize}; -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Clone, Debug)] pub struct RangeLimit { pub min: T, pub max: T, } -impl From> for RangeLimit { - #[inline] - fn from(other: limits_core::json::RangeLimit) -> Self { - RangeLimit { - min: other.min, - max: other.max, - } +impl RangeLimit { + pub fn new(min: T, max: T) -> Self { + Self { min, max } } } diff --git a/backend/src/api/cpu.rs b/backend/src/api/cpu.rs index c737aac..bd19eab 100644 --- a/backend/src/api/cpu.rs +++ b/backend/src/api/cpu.rs @@ -6,6 +6,7 @@ use usdpl_back::AsyncCallable; use crate::settings::{MinMax, SettingError, SettingVariant}; //use crate::utility::{unwrap_lock, unwrap_maybe_fatal}; use super::handler::{ApiMessage, CpuMessage}; +use super::utility::map_optional; /// Available CPUs web method pub fn max_cpus(_: super::ApiParameterType) -> super::ApiParameterType { @@ -205,8 +206,8 @@ pub fn set_clock_limits( setter( index as usize, MinMax { - min: safe_min as u64, - max: safe_max as u64, + min: Some(safe_min as u64), + max: Some(safe_max as u64), }, ); vec![safe_min.into(), safe_max.into()] @@ -220,6 +221,7 @@ pub fn set_clock_limits( vec!["set_clock_limits missing parameter 0".into()] } } + // TODO allow param 0 and/or 1 to be Primitive::Empty } pub fn get_clock_limits( @@ -245,7 +247,7 @@ pub fn get_clock_limits( move |params_in: super::ApiParameterType| { if let Some(&Primitive::F64(index)) = params_in.get(0) { if let Some(min_max) = getter(index as usize) { - vec![min_max.min.into(), min_max.max.into()] + vec![map_optional(min_max.min), map_optional(min_max.max)] } else { vec![Primitive::Empty, Primitive::Empty] } diff --git a/backend/src/api/gpu.rs b/backend/src/api/gpu.rs index 3829d30..320a331 100644 --- a/backend/src/api/gpu.rs +++ b/backend/src/api/gpu.rs @@ -3,6 +3,7 @@ use std::sync::{Arc, Mutex}; use usdpl_back::core::serdes::Primitive; use usdpl_back::AsyncCallable; +use super::utility::map_optional; use crate::settings::MinMax; //use crate::utility::{unwrap_lock, unwrap_maybe_fatal}; use super::handler::{ApiMessage, GpuMessage}; @@ -94,8 +95,8 @@ pub fn set_clock_limits( let safe_max = if max < min { min } else { max }; let safe_min = if min > max { max } else { min }; setter(MinMax { - min: safe_min as _, - max: safe_max as _, + min: Some(safe_min as _), + max: Some(safe_max as _), }); vec![(safe_min as u64).into(), (safe_max as u64).into()] } else { @@ -105,6 +106,7 @@ pub fn set_clock_limits( vec!["set_clock_limits missing parameter 0".into()] } } + // TODO allow param 0 and/or 1 to be Primitive::Empty } pub fn get_clock_limits(sender: Sender) -> impl AsyncCallable { @@ -131,7 +133,7 @@ pub fn get_clock_limits(sender: Sender) -> impl AsyncCallable { set_get: getter, trans_getter: |clocks: Option>| { clocks - .map(|x| vec![x.min.into(), x.max.into()]) + .map(|x| vec![map_optional(x.min), map_optional(x.max)]) .unwrap_or_else(|| vec![Primitive::Empty, Primitive::Empty]) }, } diff --git a/backend/src/api/handler.rs b/backend/src/api/handler.rs index 57f57f5..2ff576a 100644 --- a/backend/src/api/handler.rs +++ b/backend/src/api/handler.rs @@ -268,7 +268,9 @@ impl ApiMessageHandler { while let Ok(msg) = self.intake.try_recv() { dirty |= self.process(settings, msg); } - if dirty /*|| dirty_echo */ { + if dirty + /*|| dirty_echo */ + { //dirty_echo = dirty; // echo only once // run on_set diff --git a/backend/src/api/utility.rs b/backend/src/api/utility.rs index 7cec146..fda4404 100644 --- a/backend/src/api/utility.rs +++ b/backend/src/api/utility.rs @@ -19,10 +19,7 @@ pub fn map_optional_result>( result: Result, SettingError>, ) -> super::ApiParameterType { match result { - Ok(val) => match val { - Some(val) => vec![val.into()], - None => vec![Primitive::Empty], - }, + Ok(val) => vec![map_optional(val)], Err(e) => { log::debug!("Mapping error to primitive: {}", e); vec![e.msg.into()] @@ -30,6 +27,13 @@ pub fn map_optional_result>( } } +pub fn map_optional>(option: Option) -> Primitive { + match option { + Some(val) => val.into(), + None => Primitive::Empty, + } +} + /*#[inline] pub fn map_empty_result>( result: Result<(), SettingError>, diff --git a/backend/src/persist/general.rs b/backend/src/persist/general.rs index d012743..9148675 100644 --- a/backend/src/persist/general.rs +++ b/backend/src/persist/general.rs @@ -58,6 +58,6 @@ impl SettingsJson { #[derive(Serialize, Deserialize, Clone)] pub struct MinMaxJson { - pub max: T, - pub min: T, + pub max: Option, + pub min: Option, } diff --git a/backend/src/settings/generic/cpu.rs b/backend/src/settings/generic/cpu.rs index 3e838ce..b821053 100644 --- a/backend/src/settings/generic/cpu.rs +++ b/backend/src/settings/generic/cpu.rs @@ -3,6 +3,7 @@ use std::convert::{AsMut, AsRef, Into}; use limits_core::json::GenericCpuLimit; use super::FromGenericCpuInfo; +use crate::api::RangeLimit; use crate::persist::CpuJson; use crate::settings::{min_max_from_json, MinMax}; use crate::settings::{OnResume, OnSet, SettingError}; @@ -330,8 +331,16 @@ impl Cpu { fn limits(&self) -> crate::api::CpuLimits { crate::api::CpuLimits { - clock_min_limits: self.limits.clock_min.clone().map(|x| x.into()), - clock_max_limits: self.limits.clock_max.clone().map(|x| x.into()), + clock_min_limits: self + .limits + .clock_min + .clone() + .map(|x| RangeLimit::new(x.min.unwrap_or(0), x.max.unwrap_or(5_000))), + clock_max_limits: self + .limits + .clock_max + .clone() + .map(|x| RangeLimit::new(x.min.unwrap_or(0), x.max.unwrap_or(5_000))), clock_step: self.limits.clock_step, governors: self.governors(), } diff --git a/backend/src/settings/generic/gpu.rs b/backend/src/settings/generic/gpu.rs index f8d1a5c..b388df1 100644 --- a/backend/src/settings/generic/gpu.rs +++ b/backend/src/settings/generic/gpu.rs @@ -2,6 +2,7 @@ use std::convert::Into; use limits_core::json::GenericGpuLimit; +use crate::api::RangeLimit; use crate::persist::GpuJson; use crate::settings::TGpu; use crate::settings::{min_max_from_json, MinMax}; @@ -97,14 +98,38 @@ impl crate::settings::OnPowerEvent for Gpu {} impl TGpu for Gpu { fn limits(&self) -> crate::api::GpuLimits { crate::api::GpuLimits { - fast_ppt_limits: self.limits.fast_ppt.clone().map(|x| x.into()), - slow_ppt_limits: self.limits.slow_ppt.clone().map(|x| x.into()), + fast_ppt_limits: self + .limits + .fast_ppt + .clone() + .map(|x| RangeLimit::new(x.min.unwrap_or(0), x.max.unwrap_or(15_000_000))), + slow_ppt_limits: self + .limits + .slow_ppt + .clone() + .map(|x| RangeLimit::new(x.min.unwrap_or(0), x.max.unwrap_or(15_000_000))), ppt_step: self.limits.ppt_step.unwrap_or(1_000_000), - tdp_limits: self.limits.tdp.clone().map(|x| x.into()), - tdp_boost_limits: self.limits.tdp_boost.clone().map(|x| x.into()), + tdp_limits: self + .limits + .tdp + .clone() + .map(|x| RangeLimit::new(x.min.unwrap_or(0), x.max.unwrap_or(15_000_000))), + tdp_boost_limits: self + .limits + .tdp_boost + .clone() + .map(|x| RangeLimit::new(x.min.unwrap_or(0), x.max.unwrap_or(15_000_000))), tdp_step: self.limits.tdp_step.unwrap_or(42), - clock_min_limits: self.limits.clock_min.clone().map(|x| x.into()), - clock_max_limits: self.limits.clock_max.clone().map(|x| x.into()), + clock_min_limits: self + .limits + .clock_min + .clone() + .map(|x| RangeLimit::new(x.min.unwrap_or(0), x.max.unwrap_or(3_000))), + clock_max_limits: self + .limits + .clock_max + .clone() + .map(|x| RangeLimit::new(x.min.unwrap_or(0), x.max.unwrap_or(3_000))), clock_step: self.limits.clock_step.unwrap_or(100), memory_control_capable: false, } @@ -116,10 +141,20 @@ impl TGpu for Gpu { fn ppt(&mut self, fast: Option, slow: Option) { if let Some(fast_lims) = &self.limits.fast_ppt { - self.fast_ppt = fast.map(|x| x.clamp(fast_lims.min, fast_lims.max)); + self.fast_ppt = fast.map(|x| { + x.clamp( + fast_lims.min.unwrap_or(0), + fast_lims.max.unwrap_or(u64::MAX), + ) + }); } if let Some(slow_lims) = &self.limits.slow_ppt { - self.slow_ppt = slow.map(|x| x.clamp(slow_lims.min, slow_lims.max)); + self.slow_ppt = slow.map(|x| { + x.clamp( + slow_lims.min.unwrap_or(0), + slow_lims.max.unwrap_or(u64::MAX), + ) + }); } } diff --git a/backend/src/settings/generic_amd/gpu.rs b/backend/src/settings/generic_amd/gpu.rs index 841393b..9af3bc2 100644 --- a/backend/src/settings/generic_amd/gpu.rs +++ b/backend/src/settings/generic_amd/gpu.rs @@ -128,24 +128,22 @@ impl Gpu { } if let Some(clock_limits) = &self.generic.clock_limits { self.state.clock_limits_set = true; - lock.set_max_gfxclk_freq(clock_limits.max as _) - .map_err(|e| SettingError { - msg: format!( - "RyzenAdj set_max_gfxclk_freq({}) err: {}", - clock_limits.max, e - ), - setting: SettingVariant::Gpu, - }) - .unwrap_or_else(|e| errors.push(e)); - lock.set_min_gfxclk_freq(clock_limits.min as _) - .map_err(|e| SettingError { - msg: format!( - "RyzenAdj set_min_gfxclk_freq({}) err: {}", - clock_limits.min, e - ), - setting: SettingVariant::Gpu, - }) - .unwrap_or_else(|e| errors.push(e)); + if let Some(max) = clock_limits.max { + lock.set_max_gfxclk_freq(max as _) + .map_err(|e| SettingError { + msg: format!("RyzenAdj set_max_gfxclk_freq({}) err: {}", max, e), + setting: SettingVariant::Gpu, + }) + .unwrap_or_else(|e| errors.push(e)); + } + if let Some(min) = clock_limits.min { + lock.set_min_gfxclk_freq(min as _) + .map_err(|e| SettingError { + msg: format!("RyzenAdj set_min_gfxclk_freq({}) err: {}", min, e), + setting: SettingVariant::Gpu, + }) + .unwrap_or_else(|e| errors.push(e)); + } } else if self.state.clock_limits_set { self.state.clock_limits_set = false; let limits = self.generic.limits(); @@ -218,24 +216,22 @@ impl Gpu { .unwrap_or_else(|e| errors.push(e)); } if let Some(clock_limits) = &self.generic.clock_limits { - lock.set_max_gfxclk_freq(clock_limits.max as _) - .map_err(|e| SettingError { - msg: format!( - "RyzenAdj set_max_gfxclk_freq({}) err: {}", - clock_limits.max, e - ), - setting: SettingVariant::Gpu, - }) - .unwrap_or_else(|e| errors.push(e)); - lock.set_min_gfxclk_freq(clock_limits.min as _) - .map_err(|e| SettingError { - msg: format!( - "RyzenAdj set_min_gfxclk_freq({}) err: {}", - clock_limits.min, e - ), - setting: SettingVariant::Gpu, - }) - .unwrap_or_else(|e| errors.push(e)); + if let Some(max) = clock_limits.max { + lock.set_max_gfxclk_freq(max as _) + .map_err(|e| SettingError { + msg: format!("RyzenAdj set_max_gfxclk_freq({}) err: {}", max, e), + setting: SettingVariant::Gpu, + }) + .unwrap_or_else(|e| errors.push(e)); + } + if let Some(min) = clock_limits.min { + lock.set_min_gfxclk_freq(min as _) + .map_err(|e| SettingError { + msg: format!("RyzenAdj set_min_gfxclk_freq({}) err: {}", min, e), + setting: SettingVariant::Gpu, + }) + .unwrap_or_else(|e| errors.push(e)); + } } Ok(()) } diff --git a/backend/src/settings/min_max.rs b/backend/src/settings/min_max.rs index c1c9563..e307268 100644 --- a/backend/src/settings/min_max.rs +++ b/backend/src/settings/min_max.rs @@ -8,8 +8,8 @@ pub type MinMax = RangeLimit; pub fn min_max_from_json>(other: MinMaxJson, _version: u64) -> MinMax { MinMax { - max: other.max.into(), - min: other.min.into(), + max: other.max.map(|x| x.into()), + min: other.min.map(|x| x.into()), } } @@ -17,8 +17,8 @@ impl, Y> Into> for RangeLimit { #[inline] fn into(self) -> MinMaxJson { MinMaxJson { - max: self.max.into(), - min: self.min.into(), + max: self.max.map(|x| x.into()), + min: self.min.map(|x| x.into()), } } } diff --git a/backend/src/settings/steam_deck/battery.rs b/backend/src/settings/steam_deck/battery.rs index 4a5305c..9ea5372 100644 --- a/backend/src/settings/steam_deck/battery.rs +++ b/backend/src/settings/steam_deck/battery.rs @@ -99,12 +99,12 @@ impl EventInstruction { .trim_start_matches('>') .parse::() .ok() - .map(|x| EventTrigger::BatteryAbove(x/100.0)), + .map(|x| EventTrigger::BatteryAbove(x / 100.0)), s if s.starts_with('<') => s .trim_start_matches('<') .parse::() .ok() - .map(|x| EventTrigger::BatteryBelow(x/100.0)), + .map(|x| EventTrigger::BatteryBelow(x / 100.0)), _ => None, } } @@ -244,6 +244,30 @@ impl Battery { } } + fn set_charge_rate(&mut self) -> Result<(), SettingError> { + if let Some(charge_rate) = self.charge_rate { + self.state.charge_rate_set = true; + usdpl_back::api::files::write_single(BATTERY_CHARGE_RATE_PATH, charge_rate).map_err( + |e| SettingError { + msg: format!("Failed to write to `{}`: {}", BATTERY_CHARGE_RATE_PATH, e), + setting: crate::settings::SettingVariant::Battery, + }, + ) + } else if self.state.charge_rate_set { + self.state.charge_rate_set = false; + usdpl_back::api::files::write_single( + BATTERY_CHARGE_RATE_PATH, + self.limits.charge_rate.max, + ) + .map_err(|e| SettingError { + msg: format!("Failed to write to `{}`: {}", BATTERY_CHARGE_RATE_PATH, e), + setting: crate::settings::SettingVariant::Battery, + }) + } else { + Ok(()) + } + } + fn set_charge_mode(&mut self) -> Result<(), SettingError> { if let Some(charge_mode) = self.charge_mode { self.state.charge_mode_set = true; @@ -268,26 +292,7 @@ impl Battery { fn set_all(&mut self) -> Result<(), Vec> { let mut errors = Vec::new(); - if let Some(charge_rate) = self.charge_rate { - self.state.charge_rate_set = true; - usdpl_back::api::files::write_single(BATTERY_CHARGE_RATE_PATH, charge_rate) - .map_err(|e| SettingError { - msg: format!("Failed to write to `{}`: {}", BATTERY_CHARGE_RATE_PATH, e), - setting: crate::settings::SettingVariant::Battery, - }) - .unwrap_or_else(|e| errors.push(e)); - } else if self.state.charge_rate_set { - self.state.charge_rate_set = false; - usdpl_back::api::files::write_single( - BATTERY_CHARGE_RATE_PATH, - self.limits.charge_rate.max, - ) - .map_err(|e| SettingError { - msg: format!("Failed to write to `{}`: {}", BATTERY_CHARGE_RATE_PATH, e), - setting: crate::settings::SettingVariant::Battery, - }) - .unwrap_or_else(|e| errors.push(e)); - } + self.set_charge_rate().unwrap_or_else(|e| errors.push(e)); self.set_charge_mode().unwrap_or_else(|e| errors.push(e)); if errors.is_empty() { Ok(()) diff --git a/backend/src/settings/steam_deck/cpu.rs b/backend/src/settings/steam_deck/cpu.rs index 91ec128..58c315e 100644 --- a/backend/src/settings/steam_deck/cpu.rs +++ b/backend/src/settings/steam_deck/cpu.rs @@ -234,6 +234,11 @@ pub struct Cpu { const CPU_CLOCK_LIMITS_PATH: &str = "/sys/class/drm/card0/device/pp_od_clk_voltage"; +enum ClockType { + Min = 0, + Max = 1, +} + impl Cpu { #[inline] fn from_json(other: CpuJson, version: u64, i: usize, oc_limits: CpuLimits) -> Self { @@ -257,86 +262,91 @@ impl Cpu { } } - fn set_force_performance_related(&mut self) -> Result<(), Vec> { - let mut errors = Vec::new(); + fn set_clock_limit(index: usize, speed: u64, mode: ClockType) -> Result<(), SettingError> { + let payload = format!("p {} {} {}\n", index / 2, mode as u8, speed); + usdpl_back::api::files::write_single(CPU_CLOCK_LIMITS_PATH, &payload).map_err(|e| { + SettingError { + msg: format!( + "Failed to write `{}` to `{}`: {}", + &payload, CPU_CLOCK_LIMITS_PATH, e + ), + setting: crate::settings::SettingVariant::Cpu, + } + }) + } - // set clock limits - //log::debug!("Setting {} to manual", CPU_FORCE_LIMITS_PATH); - //let mode: String = usdpl_back::api::files::read_single(CPU_FORCE_LIMITS_PATH.to_owned()).unwrap(); + fn set_clock_limits(&mut self) -> Result<(), Vec> { + let mut errors = Vec::new(); if let Some(clock_limits) = &self.clock_limits { POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.set_cpu(true, self.index); POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.enforce_level()?; log::debug!( - "Setting CPU {} (min, max) clockspeed to ({}, {})", + "Setting CPU {} (min, max) clockspeed to ({:?}, {:?})", self.index, clock_limits.min, clock_limits.max ); self.state.clock_limits_set = true; // max clock - let payload_max = format!("p {} 1 {}\n", self.index / 2, clock_limits.max); - usdpl_back::api::files::write_single(CPU_CLOCK_LIMITS_PATH, &payload_max) - .map_err(|e| SettingError { - msg: format!( - "Failed to write `{}` to `{}`: {}", - &payload_max, CPU_CLOCK_LIMITS_PATH, e - ), - setting: crate::settings::SettingVariant::Cpu, - }) - .unwrap_or_else(|e| errors.push(e)); + if let Some(max) = clock_limits.max { + Self::set_clock_limit(self.index, max, ClockType::Max) + .unwrap_or_else(|e| errors.push(e)); + } // min clock - let valid_min = if clock_limits.min < self.limits.clock_min.min { - self.limits.clock_min.min + if let Some(min) = clock_limits.min { + let valid_min = if min < self.limits.clock_min.min { + self.limits.clock_min.min + } else { + min + }; + Self::set_clock_limit(self.index, valid_min, ClockType::Min) + .unwrap_or_else(|e| errors.push(e)); + } + + if errors.is_empty() { + Ok(()) } else { - clock_limits.min - }; - let payload_min = format!("p {} 0 {}\n", self.index / 2, valid_min); - usdpl_back::api::files::write_single(CPU_CLOCK_LIMITS_PATH, &payload_min) - .map_err(|e| SettingError { - msg: format!( - "Failed to write `{}` to `{}`: {}", - &payload_min, CPU_CLOCK_LIMITS_PATH, e - ), - setting: crate::settings::SettingVariant::Cpu, - }) - .unwrap_or_else(|e| errors.push(e)); + Err(errors) + } } else if self.state.clock_limits_set || (self.state.is_resuming && !self.limits.skip_resume_reclock) || POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.needs_manual() { + let mut errors = Vec::new(); self.state.clock_limits_set = false; + POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.set_cpu(false, self.index); if POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.needs_manual() { POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.enforce_level()?; // disable manual clock limits log::debug!("Setting CPU {} to default clockspeed", self.index); // max clock - let payload_max = format!("p {} 1 {}\n", self.index / 2, self.limits.clock_max.max); - usdpl_back::api::files::write_single(CPU_CLOCK_LIMITS_PATH, &payload_max) - .map_err(|e| SettingError { - msg: format!( - "Failed to write `{}` to `{}`: {}", - &payload_max, CPU_CLOCK_LIMITS_PATH, e - ), - setting: crate::settings::SettingVariant::Cpu, - }) + Self::set_clock_limit(self.index, self.limits.clock_max.max, ClockType::Max) .unwrap_or_else(|e| errors.push(e)); // min clock - let payload_min = format!("p {} 0 {}\n", self.index / 2, self.limits.clock_min.min); - usdpl_back::api::files::write_single(CPU_CLOCK_LIMITS_PATH, &payload_min) - .map_err(|e| SettingError { - msg: format!( - "Failed to write `{}` to `{}`: {}", - &payload_min, CPU_CLOCK_LIMITS_PATH, e - ), - setting: crate::settings::SettingVariant::Cpu, - }) + Self::set_clock_limit(self.index, self.limits.clock_min.min, ClockType::Min) .unwrap_or_else(|e| errors.push(e)); } - POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.set_cpu(false, self.index); POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT .enforce_level() .unwrap_or_else(|mut e| errors.append(&mut e)); + if errors.is_empty() { + Ok(()) + } else { + Err(errors) + } + } else { + Ok(()) } + } + + fn set_force_performance_related(&mut self) -> Result<(), Vec> { + let mut errors = Vec::new(); + + // set clock limits + //log::debug!("Setting {} to manual", CPU_FORCE_LIMITS_PATH); + //let mode: String = usdpl_back::api::files::read_single(CPU_FORCE_LIMITS_PATH.to_owned()).unwrap(); + self.set_clock_limits() + .unwrap_or_else(|mut e| errors.append(&mut e)); // commit changes (if no errors have already occured) if errors.is_empty() { if POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.needs_manual() { @@ -354,6 +364,23 @@ impl Cpu { } } + fn set_governor(&self) -> Result<(), SettingError> { + if self.index == 0 || self.online { + let governor_path = cpu_governor_path(self.index); + usdpl_back::api::files::write_single(&governor_path, &self.governor).map_err(|e| { + SettingError { + msg: format!( + "Failed to write `{}` to `{}`: {}", + &self.governor, &governor_path, e + ), + setting: crate::settings::SettingVariant::Cpu, + } + }) + } else { + Ok(()) + } + } + fn set_all(&mut self) -> Result<(), Vec> { let mut errors = Vec::new(); // set cpu online/offline @@ -371,19 +398,8 @@ impl Cpu { self.set_force_performance_related() .unwrap_or_else(|mut e| errors.append(&mut e)); - // set governor - if self.index == 0 || self.online { - let governor_path = cpu_governor_path(self.index); - usdpl_back::api::files::write_single(&governor_path, &self.governor) - .map_err(|e| SettingError { - msg: format!( - "Failed to write `{}` to `{}`: {}", - &self.governor, &governor_path, e - ), - setting: crate::settings::SettingVariant::Cpu, - }) - .unwrap_or_else(|e| errors.push(e)); - } + self.set_governor().unwrap_or_else(|e| errors.push(e)); + if errors.is_empty() { Ok(()) } else { @@ -393,12 +409,14 @@ impl Cpu { fn clamp_all(&mut self) { if let Some(clock_limits) = &mut self.clock_limits { - clock_limits.min = clock_limits - .min - .clamp(self.limits.clock_min.min, self.limits.clock_min.max); - clock_limits.max = clock_limits - .max - .clamp(self.limits.clock_max.min, self.limits.clock_max.max); + if let Some(min) = clock_limits.min { + clock_limits.min = + Some(min.clamp(self.limits.clock_min.min, self.limits.clock_min.max)); + } + if let Some(max) = clock_limits.max { + clock_limits.max = + Some(max.clamp(self.limits.clock_max.min, self.limits.clock_max.max)); + } } } diff --git a/backend/src/settings/steam_deck/gpu.rs b/backend/src/settings/steam_deck/gpu.rs index 83bf2bd..c44f3af 100644 --- a/backend/src/settings/steam_deck/gpu.rs +++ b/backend/src/settings/steam_deck/gpu.rs @@ -26,6 +26,11 @@ pub struct Gpu { const GPU_CLOCK_LIMITS_PATH: &str = "/sys/class/drm/card0/device/pp_od_clk_voltage"; const GPU_MEMORY_DOWNCLOCK_PATH: &str = "/sys/class/drm/card0/device/pp_dpm_fclk"; +enum ClockType { + Min = 0, + Max = 1, +} + impl Gpu { #[inline] pub fn from_json(other: GpuJson, version: u64) -> Self { @@ -57,6 +62,28 @@ impl Gpu { } } + fn set_clock_limit(speed: u64, mode: ClockType) -> Result<(), SettingError> { + let payload = format!("s {} {}\n", mode as u8, speed); + usdpl_back::api::files::write_single(GPU_CLOCK_LIMITS_PATH, &payload).map_err(|e| { + SettingError { + msg: format!( + "Failed to write `{}` to `{}`: {}", + &payload, GPU_CLOCK_LIMITS_PATH, e + ), + setting: crate::settings::SettingVariant::Gpu, + } + }) + } + + fn set_confirm() -> Result<(), SettingError> { + usdpl_back::api::files::write_single(GPU_CLOCK_LIMITS_PATH, "c\n").map_err(|e| { + SettingError { + msg: format!("Failed to write `c` to `{}`: {}", GPU_CLOCK_LIMITS_PATH, e), + setting: crate::settings::SettingVariant::Gpu, + } + }) + } + fn set_clocks(&mut self) -> Result<(), Vec> { let mut errors = Vec::new(); if let Some(clock_limits) = &self.clock_limits { @@ -65,81 +92,37 @@ impl Gpu { // set clock limits self.state.clock_limits_set = true; // max clock - let payload_max = format!("s 1 {}\n", clock_limits.max); - usdpl_back::api::files::write_single(GPU_CLOCK_LIMITS_PATH, &payload_max) - .map_err(|e| SettingError { - msg: format!( - "Failed to write `{}` to `{}`: {}", - &payload_max, GPU_CLOCK_LIMITS_PATH, e - ), - setting: crate::settings::SettingVariant::Gpu, - }) - .unwrap_or_else(|e| errors.push(e)); + if let Some(max) = clock_limits.max { + Self::set_clock_limit(max, ClockType::Max).unwrap_or_else(|e| errors.push(e)); + } // min clock - let payload_min = format!("s 0 {}\n", clock_limits.min); - usdpl_back::api::files::write_single(GPU_CLOCK_LIMITS_PATH, &payload_min) - .map_err(|e| SettingError { - msg: format!( - "Failed to write `{}` to `{}`: {}", - &payload_min, GPU_CLOCK_LIMITS_PATH, e - ), - setting: crate::settings::SettingVariant::Gpu, - }) - .unwrap_or_else(|e| errors.push(e)); - usdpl_back::api::files::write_single(GPU_CLOCK_LIMITS_PATH, "c\n").unwrap_or_else( - |e| { - errors.push(SettingError { - msg: format!("Failed to write `c` to `{}`: {}", GPU_CLOCK_LIMITS_PATH, e), - setting: crate::settings::SettingVariant::Gpu, - }) - }, - ); + if let Some(min) = clock_limits.min { + Self::set_clock_limit(min, ClockType::Min).unwrap_or_else(|e| errors.push(e)); + } + + Self::set_confirm().unwrap_or_else(|e| errors.push(e)); } else if self.state.clock_limits_set || (self.state.is_resuming && !self.limits.skip_resume_reclock) || POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.needs_manual() { self.state.clock_limits_set = false; + POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.set_gpu(self.slow_memory); if POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.needs_manual() { POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.enforce_level()?; // disable manual clock limits // max clock - let payload_max = format!("s 1 {}\n", self.limits.clock_max.max); - usdpl_back::api::files::write_single(GPU_CLOCK_LIMITS_PATH, &payload_max) - .map_err(|e| SettingError { - msg: format!( - "Failed to write `{}` to `{}`: {}", - &payload_max, GPU_CLOCK_LIMITS_PATH, e - ), - setting: crate::settings::SettingVariant::Gpu, - }) + Self::set_clock_limit(self.limits.clock_max.max, ClockType::Max) .unwrap_or_else(|e| errors.push(e)); // min clock - let payload_min = format!("s 0 {}\n", self.limits.clock_min.min); - usdpl_back::api::files::write_single(GPU_CLOCK_LIMITS_PATH, &payload_min) - .map_err(|e| SettingError { - msg: format!( - "Failed to write `{}` to `{}`: {}", - &payload_min, GPU_CLOCK_LIMITS_PATH, e - ), - setting: crate::settings::SettingVariant::Gpu, - }) + Self::set_clock_limit(self.limits.clock_min.min, ClockType::Min) .unwrap_or_else(|e| errors.push(e)); - usdpl_back::api::files::write_single(GPU_CLOCK_LIMITS_PATH, "c\n").unwrap_or_else( - |e| { - errors.push(SettingError { - msg: format!( - "Failed to write `c` to `{}`: {}", - GPU_CLOCK_LIMITS_PATH, e - ), - setting: crate::settings::SettingVariant::Gpu, - }) - }, - ); + + Self::set_confirm().unwrap_or_else(|e| errors.push(e)); + } else { + POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT + .enforce_level() + .unwrap_or_else(|mut e| errors.append(&mut e)); } - POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.set_gpu(self.slow_memory); - POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT - .enforce_level() - .unwrap_or_else(|mut e| errors.append(&mut e)); } if errors.is_empty() { Ok(()) @@ -148,6 +131,15 @@ impl Gpu { } } + fn set_slow_memory(slow: bool) -> Result<(), SettingError> { + usdpl_back::api::files::write_single(GPU_MEMORY_DOWNCLOCK_PATH, slow as u8).map_err(|e| { + SettingError { + msg: format!("Failed to write to `{}`: {}", GPU_MEMORY_DOWNCLOCK_PATH, e), + setting: crate::settings::SettingVariant::Gpu, + } + }) + } + fn set_force_performance_related(&mut self) -> Result<(), Vec> { let mut errors = Vec::new(); // enable/disable downclock of GPU memory (to 400Mhz?) @@ -156,21 +148,9 @@ impl Gpu { POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT .enforce_level() .unwrap_or_else(|mut e| errors.append(&mut e)); - usdpl_back::api::files::write_single(GPU_MEMORY_DOWNCLOCK_PATH, self.slow_memory as u8) - .unwrap_or_else(|e| { - errors.push(SettingError { - msg: format!("Failed to write to `{}`: {}", GPU_MEMORY_DOWNCLOCK_PATH, e), - setting: crate::settings::SettingVariant::Gpu, - }); - }); + Self::set_slow_memory(self.slow_memory).unwrap_or_else(|e| errors.push(e)); } else if POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.needs_manual() { - usdpl_back::api::files::write_single(GPU_MEMORY_DOWNCLOCK_PATH, self.slow_memory as u8) - .unwrap_or_else(|e| { - errors.push(SettingError { - msg: format!("Failed to write to `{}`: {}", GPU_MEMORY_DOWNCLOCK_PATH, e), - setting: crate::settings::SettingVariant::Gpu, - }); - }); + Self::set_slow_memory(self.slow_memory).unwrap_or_else(|e| errors.push(e)); POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.set_gpu(self.clock_limits.is_some()); POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT .enforce_level() @@ -181,11 +161,9 @@ impl Gpu { // commit changes (if no errors have already occured) if errors.is_empty() { if self.slow_memory || self.clock_limits.is_some() { - usdpl_back::api::files::write_single(GPU_CLOCK_LIMITS_PATH, "c\n").map_err(|e| { - vec![SettingError { - msg: format!("Failed to write `c` to `{}`: {}", GPU_CLOCK_LIMITS_PATH, e), - setting: crate::settings::SettingVariant::Gpu, - }] + Self::set_confirm().map_err(|e| { + errors.push(e); + errors }) } else { Ok(()) @@ -276,12 +254,14 @@ impl Gpu { *slow_ppt = (*slow_ppt).clamp(self.limits.slow_ppt.min, self.limits.slow_ppt.max); } if let Some(clock_limits) = &mut self.clock_limits { - clock_limits.min = clock_limits - .min - .clamp(self.limits.clock_min.min, self.limits.clock_min.max); - clock_limits.max = clock_limits - .max - .clamp(self.limits.clock_max.min, self.limits.clock_max.max); + if let Some(min) = clock_limits.min { + clock_limits.min = + Some(min.clamp(self.limits.clock_min.min, self.limits.clock_min.max)); + } + if let Some(max) = clock_limits.max { + clock_limits.max = + Some(max.clamp(self.limits.clock_max.min, self.limits.clock_max.max)); + } } } diff --git a/backend/src/settings/steam_deck/oc_limits.rs b/backend/src/settings/steam_deck/oc_limits.rs index 69aa364..74c2bf2 100644 --- a/backend/src/settings/steam_deck/oc_limits.rs +++ b/backend/src/settings/steam_deck/oc_limits.rs @@ -1,4 +1,4 @@ -use crate::settings::MinMax; +use crate::api::RangeLimit as MinMax; use serde::{Deserialize, Serialize}; const OC_LIMITS_FILEPATH: &str = "pt_oc.json"; From 8c77630fb4b7da05a6e3e65d2805cee5c2be2639 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sun, 28 May 2023 10:34:20 -0400 Subject: [PATCH 04/26] Add basic event commands --- backend/src/api/handler.rs | 10 +++++ backend/src/persist/general.rs | 21 +++++++++++ backend/src/persist/mod.rs | 2 +- backend/src/settings/detect/auto_detect.rs | 1 + backend/src/settings/driver.rs | 3 ++ backend/src/settings/general.rs | 43 ++++++++++++++++++++++ backend/src/settings/traits.rs | 2 + 7 files changed, 81 insertions(+), 1 deletion(-) diff --git a/backend/src/api/handler.rs b/backend/src/api/handler.rs index 2ff576a..de717aa 100644 --- a/backend/src/api/handler.rs +++ b/backend/src/api/handler.rs @@ -290,6 +290,16 @@ impl ApiMessageHandler { let settings_clone = settings.json(); let save_json: SettingsJson = settings_clone.into(); unwrap_maybe_fatal(save_json.save(&save_path), "Failed to save settings"); + if let Some(event) = &settings.general.on_event().on_save { + if !event.is_empty() { + unwrap_maybe_fatal( + std::process::Command::new("/bin/bash") + .args(&["-c", event]) + .spawn(), + "Failed to start on_save event command", + ); + } + } log::debug!("Saved settings to {}", save_path.display()); if let Err(e) = crate::utility::chown_settings_dir() { log::error!("Failed to change config dir permissions: {}", e); diff --git a/backend/src/persist/general.rs b/backend/src/persist/general.rs index 9148675..58497ec 100644 --- a/backend/src/persist/general.rs +++ b/backend/src/persist/general.rs @@ -5,6 +5,25 @@ use serde::{Deserialize, Serialize}; use super::JsonError; use super::{BatteryJson, CpuJson, DriverJson, GpuJson}; +#[derive(Serialize, Deserialize, Debug, Clone)] +pub struct OnEventJson { + pub on_save: Option, + pub on_load: Option, + pub on_set: Option, + pub on_resume: Option, +} + +impl Default for OnEventJson { + fn default() -> Self { + Self { + on_save: None, + on_load: None, + on_set: None, + on_resume: None, + } + } +} + #[derive(Serialize, Deserialize)] pub struct SettingsJson { pub version: u64, @@ -14,6 +33,7 @@ pub struct SettingsJson { pub gpu: GpuJson, pub battery: BatteryJson, pub provider: Option, + pub events: Option, } impl Default for SettingsJson { @@ -26,6 +46,7 @@ impl Default for SettingsJson { gpu: GpuJson::default(), battery: BatteryJson::default(), provider: None, + events: None, } } } diff --git a/backend/src/persist/mod.rs b/backend/src/persist/mod.rs index 75c3caf..17dfa35 100644 --- a/backend/src/persist/mod.rs +++ b/backend/src/persist/mod.rs @@ -8,7 +8,7 @@ mod gpu; pub use battery::{BatteryEventJson, BatteryJson}; pub use cpu::CpuJson; pub use driver::DriverJson; -pub use general::{MinMaxJson, SettingsJson}; +pub use general::{MinMaxJson, OnEventJson, SettingsJson}; pub use gpu::GpuJson; pub use error::JsonError; diff --git a/backend/src/settings/detect/auto_detect.rs b/backend/src/settings/detect/auto_detect.rs index 567837b..e66394a 100644 --- a/backend/src/settings/detect/auto_detect.rs +++ b/backend/src/settings/detect/auto_detect.rs @@ -303,6 +303,7 @@ impl DriverBuilder { path: json_path, name: profile_name, driver: DriverJson::AutoDetect, + events: Default::default(), }), cpus: None, gpu: None, diff --git a/backend/src/settings/driver.rs b/backend/src/settings/driver.rs index 5f39258..4192f6f 100644 --- a/backend/src/settings/driver.rs +++ b/backend/src/settings/driver.rs @@ -21,6 +21,7 @@ impl Driver { path: json_path, name: settings.name, driver: DriverJson::SteamDeck, + events: settings.events.unwrap_or_default(), }), cpus: Box::new(super::steam_deck::Cpus::from_json( settings.cpus, @@ -51,6 +52,7 @@ impl Driver { path: json_path, name: settings.name, driver: DriverJson::SteamDeck, + events: settings.events.unwrap_or_default(), }), cpus: Box::new(super::steam_deck::Cpus::from_json( settings.cpus, @@ -72,6 +74,7 @@ impl Driver { path: json_path, name: settings.name, driver: DriverJson::SteamDeckAdvance, + events: settings.events.unwrap_or_default(), }), cpus: Box::new(super::steam_deck::Cpus::from_json( settings.cpus, diff --git a/backend/src/settings/general.rs b/backend/src/settings/general.rs index 5e39694..1f47bc2 100644 --- a/backend/src/settings/general.rs +++ b/backend/src/settings/general.rs @@ -34,16 +34,43 @@ pub struct General { pub path: PathBuf, pub name: String, pub driver: crate::persist::DriverJson, + pub events: crate::persist::OnEventJson, } impl OnSet for General { fn on_set(&mut self) -> Result<(), Vec> { + if let Some(event) = &self.events.on_set { + if !event.is_empty() { + std::process::Command::new("/bin/bash") + .args(&["-c", event]) + .spawn() + .map_err(|e| { + vec![SettingError { + msg: format!("on_set event command error: {}", e), + setting: SettingVariant::General, + }] + })?; + } + } Ok(()) } } impl OnResume for General { fn on_resume(&self) -> Result<(), Vec> { + if let Some(event) = &self.events.on_resume { + if !event.is_empty() { + std::process::Command::new("/bin/bash") + .args(&["-c", event]) + .spawn() + .map_err(|e| { + vec![SettingError { + msg: format!("on_resume event command error: {}", e), + setting: SettingVariant::General, + }] + })?; + } + } Ok(()) } } @@ -82,6 +109,10 @@ impl TGeneral for General { fn provider(&self) -> crate::persist::DriverJson { self.driver.clone() } + + fn on_event(&self) -> &crate::persist::OnEventJson { + &self.events + } } #[derive(Debug)] @@ -214,6 +245,17 @@ impl Settings { *self.general.persistent() = false; } self.general.path(filename); + if let Some(event) = &self.general.on_event().on_load { + if !event.is_empty() { + std::process::Command::new("/bin/bash") + .args(&["-c", event]) + .spawn() + .map_err(|e| SettingError { + msg: format!("on_save event command error: {}", e), + setting: SettingVariant::General, + })?; + } + } Ok(*self.general.persistent()) } @@ -257,6 +299,7 @@ impl Settings { gpu: self.gpu.json(), battery: self.battery.json(), provider: Some(self.general.provider()), + events: Some(self.general.on_event().clone()), } } } diff --git a/backend/src/settings/traits.rs b/backend/src/settings/traits.rs index 1e77c4d..f98c44d 100644 --- a/backend/src/settings/traits.rs +++ b/backend/src/settings/traits.rs @@ -104,6 +104,8 @@ pub trait TGeneral: OnSet + OnResume + OnPowerEvent + Debug + Send { fn name(&mut self, name: String); fn provider(&self) -> crate::persist::DriverJson; + + fn on_event(&self) -> &'_ crate::persist::OnEventJson; } pub trait TBattery: OnSet + OnResume + OnPowerEvent + Debug + Send { From 441a635163672e5028d34d373841283fa58dee88 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 29 May 2023 19:40:57 -0400 Subject: [PATCH 05/26] Add workaround for CPU clocks not being unset by kernel correctly, fixes #107 --- backend/src/settings/steam_deck/cpu.rs | 48 +++++++++++++++++++++----- 1 file changed, 39 insertions(+), 9 deletions(-) diff --git a/backend/src/settings/steam_deck/cpu.rs b/backend/src/settings/steam_deck/cpu.rs index 58c315e..cf4bd74 100644 --- a/backend/src/settings/steam_deck/cpu.rs +++ b/backend/src/settings/steam_deck/cpu.rs @@ -315,7 +315,10 @@ impl Cpu { let mut errors = Vec::new(); self.state.clock_limits_set = false; POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.set_cpu(false, self.index); + POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT + .enforce_level()?; if POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.needs_manual() { + // always set clock speeds, since it doesn't reset correctly (kernel/hardware bug) POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.enforce_level()?; // disable manual clock limits log::debug!("Setting CPU {} to default clockspeed", self.index); @@ -326,9 +329,8 @@ impl Cpu { Self::set_clock_limit(self.index, self.limits.clock_min.min, ClockType::Min) .unwrap_or_else(|e| errors.push(e)); } - POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT - .enforce_level() - .unwrap_or_else(|mut e| errors.append(&mut e)); + // TODO remove this when it's no longer needed + self.clock_unset_workaround().unwrap_or_else(|mut e| errors.append(&mut e)); if errors.is_empty() { Ok(()) } else { @@ -339,6 +341,39 @@ impl Cpu { } } + // https://github.com/NGnius/PowerTools/issues/107 + fn clock_unset_workaround(&self) -> Result<(), Vec> { + let mut errors = Vec::new(); + POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.set_cpu(true, self.index); + // always set clock speeds, since it doesn't reset correctly (kernel/hardware bug) + POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.enforce_level()?; + // disable manual clock limits + log::debug!("Setting CPU {} to default clockspeed", self.index); + // max clock + Self::set_clock_limit(self.index, self.limits.clock_max.max, ClockType::Max) + .unwrap_or_else(|e| errors.push(e)); + // min clock + Self::set_clock_limit(self.index, self.limits.clock_min.min, ClockType::Min) + .unwrap_or_else(|e| errors.push(e)); + + Self::set_confirm().unwrap_or_else(|e| errors.push(e)); + POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.set_cpu(false, self.index); + if errors.is_empty() { + Ok(()) + } else { + Err(errors) + } + } + + fn set_confirm() -> Result<(), SettingError> { + usdpl_back::api::files::write_single(CPU_CLOCK_LIMITS_PATH, "c\n").map_err(|e| { + SettingError { + msg: format!("Failed to write `c` to `{}`: {}", CPU_CLOCK_LIMITS_PATH, e), + setting: crate::settings::SettingVariant::Cpu, + } + }) + } + fn set_force_performance_related(&mut self) -> Result<(), Vec> { let mut errors = Vec::new(); @@ -350,12 +385,7 @@ impl Cpu { // commit changes (if no errors have already occured) if errors.is_empty() { if POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.needs_manual() { - usdpl_back::api::files::write_single(CPU_CLOCK_LIMITS_PATH, "c\n").map_err(|e| { - vec![SettingError { - msg: format!("Failed to write `c` to `{}`: {}", CPU_CLOCK_LIMITS_PATH, e), - setting: crate::settings::SettingVariant::Cpu, - }] - }) + Self::set_confirm().map_err(|e| vec![e]) } else { Ok(()) } From ebf74871ee9664e59f1a1cb7783f18109faa5744 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sat, 10 Jun 2023 16:26:21 -0400 Subject: [PATCH 06/26] Always reapply settings a bit after game start to workaround #99 --- src/index.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 5a7daaa..a342ba5 100755 --- a/src/index.tsx +++ b/src/index.tsx @@ -67,6 +67,7 @@ import { Cpus } from "./components/cpus"; var periodicHook: NodeJS.Timer | null = null; var lifetimeHook: any = null; var startHook: any = null; +var endHook: any = null; var usdplReady = false; type MinMax = { @@ -185,6 +186,12 @@ const reload = function() { ); }); + //@ts-ignore + endHook = SteamClient.Apps.RegisterForGameActionEnd((actionType) => { + backend.log(backend.LogLevel.Info, "RegisterForGameActionEnd callback(" + actionType + ")"); + setTimeout(() => backend.forceApplySettings(), 2000 /* ms */); + }); + backend.log(backend.LogLevel.Debug, "Registered PowerTools callbacks, hello!"); })(); @@ -321,8 +328,9 @@ export default definePlugin((serverApi: ServerAPI) => { backend.log(backend.LogLevel.Debug, "PowerTools shutting down"); clearInterval(periodicHook!); periodicHook = null; - lifetimeHook!.unregister(); - startHook!.unregister(); + lifetimeHook?.unregister(); + startHook?.unregister(); + endHook?.unregister(); //serverApi.routerHook.removeRoute("/decky-plugin-test"); backend.log(backend.LogLevel.Debug, "Unregistered PowerTools callbacks, so long and thanks for all the fish."); }, From 4ac930375472c4214a02601fba13a282bbf72e7d Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sat, 10 Jun 2023 16:27:13 -0400 Subject: [PATCH 07/26] Add battery power API --- backend/build.sh | 8 ++++---- backend/src/settings/generic/battery.rs | 4 ++++ backend/src/settings/steam_deck/battery.rs | 16 ++++++++++++++++ backend/src/settings/traits.rs | 2 ++ backend/src/settings/unknown/battery.rs | 4 ++++ translations/fr-CA.mo | Bin 2697 -> 2943 bytes translations/fr-FR.mo | Bin 2697 -> 2943 bytes 7 files changed, 30 insertions(+), 4 deletions(-) diff --git a/backend/build.sh b/backend/build.sh index d99c6e4..7e408f6 100755 --- a/backend/build.sh +++ b/backend/build.sh @@ -6,7 +6,7 @@ cargo build mkdir -p ../bin -#cp ./target/x86_64-unknown-linux-musl/release/powertools ../bin/backend -#cp ./target/x86_64-unknown-linux-musl/debug/powertools ../bin/backend -#cp ./target/debug/powertools ../bin/backend -cp ./target/debug/powertools ../bin/backend +#cp --preserve=mode ./target/x86_64-unknown-linux-musl/release/powertools ../bin/backend +#cp --preserve=mode ./target/x86_64-unknown-linux-musl/debug/powertools ../bin/backend +#cp --preserve=mode ./target/debug/powertools ../bin/backend +cp --preserve=mode ./target/debug/powertools ../bin/backend diff --git a/backend/src/settings/generic/battery.rs b/backend/src/settings/generic/battery.rs index 1a70c37..3390f1f 100644 --- a/backend/src/settings/generic/battery.rs +++ b/backend/src/settings/generic/battery.rs @@ -129,6 +129,10 @@ impl TBattery for Battery { None } + fn read_charge_power(&self) -> Option { + None + } + fn charge_limit(&mut self, _limit: Option) {} fn get_charge_limit(&self) -> Option { diff --git a/backend/src/settings/steam_deck/battery.rs b/backend/src/settings/steam_deck/battery.rs index 9ea5372..f6481c3 100644 --- a/backend/src/settings/steam_deck/battery.rs +++ b/backend/src/settings/steam_deck/battery.rs @@ -320,6 +320,12 @@ impl Battery { } } + pub fn read_charge_power() -> Result { + let current = Self::read_current_now()? as f64 / 1000.0; // mA -> A + let voltage = Self::read_usb_voltage()?; + Ok(current * voltage) + } + pub fn read_charge_now() -> Result { match usdpl_back::api::files::read_single::<_, u64, _>(BATTERY_CHARGE_NOW_PATH) { Err(e) => Err(SettingError { @@ -552,6 +558,16 @@ impl TBattery for Battery { } } + fn read_charge_power(&self) -> Option { + match Self::read_charge_power() { + Ok(x) => Some(x as f64), + Err(e) => { + log::warn!("read_current_now err: {}", e.msg); + None + } + } + } + fn charge_limit(&mut self, limit: Option) { // upper limit let index = self.find_limit_event(); diff --git a/backend/src/settings/traits.rs b/backend/src/settings/traits.rs index f98c44d..4e96882 100644 --- a/backend/src/settings/traits.rs +++ b/backend/src/settings/traits.rs @@ -129,6 +129,8 @@ pub trait TBattery: OnSet + OnResume + OnPowerEvent + Debug + Send { fn read_current_now(&self) -> Option; + fn read_charge_power(&self) -> Option; + fn charge_limit(&mut self, limit: Option); fn get_charge_limit(&self) -> Option; diff --git a/backend/src/settings/unknown/battery.rs b/backend/src/settings/unknown/battery.rs index c4ba71a..f0c67a3 100644 --- a/backend/src/settings/unknown/battery.rs +++ b/backend/src/settings/unknown/battery.rs @@ -75,6 +75,10 @@ impl TBattery for Battery { None } + fn read_charge_power(&self) -> Option { + None + } + fn charge_limit(&mut self, _limit: Option) {} fn get_charge_limit(&self) -> Option { diff --git a/translations/fr-CA.mo b/translations/fr-CA.mo index d0cc852e6b2fcb053eb825676fa7b028969eac38..673bd8cdbaeff09eddcc21fff3955057543bafee 100644 GIT binary patch delta 1267 zcmZA0OGs2v9LMqFD|0HdF&~-LDIaM%AVP(RkXl5LAx29VSLdXc=H)n}X$u!dAW<7j zf*=Tl5P~8Lp`eXL3tP2l*~1n=xsF=d_czW!bnt&a=iGbefBxs3>s-ZV<;pf&pua{62>)10#lDFR6#?iJaOEG*RuEL zGUFLz7P1c(kvYsWR6#4K1h2E>HB^BgFo+wd0ya@AEaOKSSECAQ#v>R)<>^QLeh^jA zBo;HjnWb})ZNI4-j6ZW}!SARQm2*+TTGSC))I?oaiWjg62T{Mjf!d+lSdRCw8XqH5 zn77!9?{P+*KXg=4Bfo0Lc07s>mEacYj31&3SwX%33fu4(#spWQQOxlxIING&FeCoqcqnME#p@d+xy8`S%2r~=nf@Bcy_O^E9BL7zeu z8snk~r;&{|dk8J4iup4M^pZY!ZC^8?m(}zkX$6|Jp2)RhxegvARE$~!p`FMz6=8`M zLTCSP)51%2{)dU(gtnFiWVXH$)pR^sk^Td;1MG0-tabjmrX8yx_7io4zL8wh2dJ|* z-Qfu@HtfQtI}(Xc+SI7Cz5SQ${L_NYqVs;#Pc45d2;`m2bnTFrO1b2e9Uk?PBhF5a zx|sDQy(`Z2c~@=IX*ceV#F{nmqv@z^YM5^;X_>DpN|g;bFOi5$*>RUj`LU7l<%Ob( z{F+QwXTvU=(e%aXYqv_^fyxf#LW3W|+@9bFGi-qm#(uDIPk=3QGGJ4~& h)kkUfUmY*2%)siBs_@6sj-1XWlJU!aWd3K#gTDt#otppv delta 993 zcmZY8y-!n77{~FarLAo(ir5wuv==J2jW3BE>R<>YBn~7Uj1dMGC2bgt;-CqW4Y7+R z$Z%uSm^c^{hq`rRa6nijp?`q}LRoxCba0RX{QjE5kFBMF@qXs1bgrz zM$Bq9#?1*DuA+yxPy;RCDO_~V8yKU$h8m!S%we0Tf!mnCpV*DNt{!D})l<$a^2jb> zg!!$+jXI8Y8q6k93%Z8Acn3A%Bh-$TP!qqvVSJ71{}I)19kqcS)ce2jI$8be>SY?w z(S8G?%x??aXuzkaBY1{Kuz`78Mt-)x$MFyLV~p*SN*l)WSa43E7V;R2xP&=e zLG}NJHJ#laH(EfF(bb_Jm9jI=B5H@@u3kn>coUV%8Dw)di)p-z3~6;N;UdOy6_eOP z)^6<>`PWK*xEJ-7QhpgP;3R56^QejHNG3a-mFj~~*7RJHAETV49Hl6#No|7F2hk^JYz*U24S&=Ke2+T#I&l5ZaJJ8PzfNQAQ{VkD^TK*p#uHR<3{A zX-b}=FJ2kwq~HJ2HPsvs1q1#}IPDL_J^x+!L9-A^24m&9O4Z{x(VULn4s-ZV<;pf&pua{62>)10#lDFR6#?iJaOEG*RuEL zGUFLz7P1c(kvYsWR6#4K1h2E>HB^BgFo+wd0ya@AEaOKSSECAQ#v>R)<>^QLeh^jA zBo;HjnWb})ZNI4-j6ZW}!SARQm2*+TTGSC))I?oaiWjg62T{Mjf!d+lSdRCw8XqH5 zn77!9?{P+*KXg=4Bfo0Lc07s>mEacYj31&3SwX%33fu4(#spWQQOxlxIING&FeCoqcqnME#p@d+xy8`S%2r~=nf@Bcy_O^E9BL7zeu z8snk~r;&{|dk8J4iup4M^pZY!ZC^8?m(}zkX$6|Jp2)RhxegvARE$~!p`FMz6=8`M zLTCSP)51%2{)dU(gtnFiWVXH$)pR^sk^Td;1MG0-tabjmrX8yx_7io4zL8wh2dJ|* z-Qfu@HtfQtI}(Xc+SI7Cz5SQ${L_NYqVs;#Pc45d2;`m2bnTFrO1b2e9Uk?PBhF5a zx|sDQy(`Z2c~@=IX*ceV#F{nmqv@z^YM5^;X_>DpN|g;bFOi5$*>RUj`LU7l<%Ob( z{F+QwXTvU=(e%aXYqv_^fyxf#LW3W|+@9bFGi-qm#(uDIPk=3QGGJ4~& h)kkUfUmY*2%)siBs_@6sj-1XWlJU!aWd3K#gTDt#otppv delta 993 zcmZY8y-!n77{~FarLAo(ir5wuv==J2jW3BE>R<>YBn~7Uj1dMGC2bgt;-CqW4Y7+R z$Z%uSm^c^{hq`rRa6nijp?`q}LRoxCba0RX{QjE5kFBMF@qXs1bgrz zM$Bq9#?1*DuA+yxPy;RCDO_~V8yKU$h8m!S%we0Tf!mnCpV*DNt{!D})l<$a^2jb> zg!!$+jXI8Y8q6k93%Z8Acn3A%Bh-$TP!qqvVSJ71{}I)19kqcS)ce2jI$8be>SY?w z(S8G?%x??aXuzkaBY1{Kuz`78Mt-)x$MFyLV~p*SN*l)WSa43E7V;R2xP&=e zLG}NJHJ#laH(EfF(bb_Jm9jI=B5H@@u3kn>coUV%8Dw)di)p-z3~6;N;UdOy6_eOP z)^6<>`PWK*xEJ-7QhpgP;3R56^QejHNG3a-mFj~~*7RJHAETV49Hl6#No|7F2hk^JYz*U24S&=Ke2+T#I&l5ZaJJ8PzfNQAQ{VkD^TK*p#uHR<3{A zX-b}=FJ2kwq~HJ2HPsvs1q1#}IPDL_J^x+!L9-A^24m&9O4Z{x(VULn4 Date: Fri, 16 Jun 2023 22:00:57 -0400 Subject: [PATCH 08/26] Add UI elements for battery inrush power --- backend/src/api/battery.rs | 30 +++- backend/src/api/handler.rs | 2 + backend/src/main.rs | 4 + package.json | 6 +- pnpm-lock.yaml | 328 +++++++++++++++++++------------------ src/backend.ts | 4 + src/components/battery.tsx | 11 +- src/consts.ts | 1 + src/index.tsx | 3 + translations/fr-CA.po | 5 + translations/pt.pot | 5 + 11 files changed, 227 insertions(+), 172 deletions(-) diff --git a/backend/src/api/battery.rs b/backend/src/api/battery.rs index b134ff3..2446e75 100644 --- a/backend/src/api/battery.rs +++ b/backend/src/api/battery.rs @@ -30,11 +30,6 @@ pub fn current_now(sender: Sender) -> impl AsyncCallable { } } -/// Current current (ha!) web method -/*pub fn current_now(_: super::ApiParameterType) -> super::ApiParameterType { - super::utility::map_optional_result(crate::settings::driver::read_current_now()) -}*/ - /// Charge now web method pub fn charge_now(sender: Sender) -> impl AsyncCallable { let sender = Arc::new(Mutex::new(sender)); // Sender is not Sync; this is required for safety @@ -110,6 +105,31 @@ pub fn charge_design(sender: Sender) -> impl AsyncCallable { } } +/// Charge wattage web method +pub fn charge_power(sender: Sender) -> impl AsyncCallable { + let sender = Arc::new(Mutex::new(sender)); // Sender is not Sync; this is required for safety + let getter = move || { + let sender2 = sender.clone(); + move || { + let (tx, rx) = mpsc::channel(); + let callback = + move |val: Option| tx.send(val).expect("power_now callback send failed"); + sender2 + .lock() + .unwrap() + .send(ApiMessage::Battery(BatteryMessage::ReadChargePower( + Box::new(callback), + ))) + .expect("power_now send failed"); + rx.recv().expect("power_now callback recv failed") + } + }; + super::async_utils::AsyncIshGetter { + set_get: getter, + trans_getter: |result| super::utility::map_optional_result(Ok(result)), + } +} + /// Generate set battery charge rate web method pub fn set_charge_rate( sender: Sender, diff --git a/backend/src/api/handler.rs b/backend/src/api/handler.rs index de717aa..60316c9 100644 --- a/backend/src/api/handler.rs +++ b/backend/src/api/handler.rs @@ -39,6 +39,7 @@ pub enum BatteryMessage { ReadChargeNow(Callback>), ReadChargeDesign(Callback>), ReadCurrentNow(Callback>), + ReadChargePower(Callback>), SetChargeLimit(Option), GetChargeLimit(Callback>), } @@ -55,6 +56,7 @@ impl BatteryMessage { Self::ReadChargeNow(cb) => cb(settings.read_charge_now()), Self::ReadChargeDesign(cb) => cb(settings.read_charge_design()), Self::ReadCurrentNow(cb) => cb(settings.read_current_now()), + Self::ReadChargePower(cb) => cb(settings.read_charge_power()), Self::SetChargeLimit(limit) => settings.charge_limit(limit), Self::GetChargeLimit(cb) => cb(settings.get_charge_limit()), } diff --git a/backend/src/main.rs b/backend/src/main.rs index e1ca128..9e50f9e 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -126,6 +126,10 @@ fn main() -> Result<(), ()> { "BATTERY_charge_design", api::battery::charge_design(api_sender.clone()), ) + .register_async( + "BATTERY_charge_power", + api::battery::charge_power(api_sender.clone()), + ) .register( "BATTERY_set_charge_rate", api::battery::set_charge_rate(api_sender.clone()), diff --git a/package.json b/package.json index f789228..4bdafab 100644 --- a/package.json +++ b/package.json @@ -35,12 +35,12 @@ "rollup": "^2.79.1", "rollup-plugin-import-assets": "^1.1.1", "shx": "^0.3.4", - "tslib": "^2.5.0", + "tslib": "^2.5.3", "typescript": "^4.9.5" }, "dependencies": { - "decky-frontend-lib": "~3.20.5", - "react-icons": "^4.8.0", + "decky-frontend-lib": "~3.21.1", + "react-icons": "^4.9.0", "usdpl-front": "file:src/usdpl_front" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7d9fd69..c815130 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,12 +1,16 @@ -lockfileVersion: '6.0' +lockfileVersion: '6.1' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false dependencies: decky-frontend-lib: - specifier: ~3.20.5 - version: 3.20.5 + specifier: ~3.21.1 + version: 3.21.1 react-icons: - specifier: ^4.8.0 - version: 4.8.0(react@18.2.0) + specifier: ^4.9.0 + version: 4.9.0(react@18.2.0) usdpl-front: specifier: file:src/usdpl_front version: file:src/usdpl_front @@ -26,7 +30,7 @@ devDependencies: version: 4.0.0(rollup@2.79.1) '@rollup/plugin-typescript': specifier: ^8.5.0 - version: 8.5.0(rollup@2.79.1)(tslib@2.5.0)(typescript@4.9.5) + version: 8.5.0(rollup@2.79.1)(tslib@2.5.3)(typescript@4.9.5) '@types/react': specifier: 16.14.0 version: 16.14.0 @@ -43,21 +47,21 @@ devDependencies: specifier: ^0.3.4 version: 0.3.4 tslib: - specifier: ^2.5.0 - version: 2.5.0 + specifier: ^2.5.3 + version: 2.5.3 typescript: specifier: ^4.9.5 version: 4.9.5 packages: - /@jridgewell/gen-mapping@0.3.2: - resolution: {integrity: sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==} + /@jridgewell/gen-mapping@0.3.3: + resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} engines: {node: '>=6.0.0'} dependencies: '@jridgewell/set-array': 1.1.2 - '@jridgewell/sourcemap-codec': 1.4.14 - '@jridgewell/trace-mapping': 0.3.17 + '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/trace-mapping': 0.3.18 dev: true /@jridgewell/resolve-uri@3.1.0: @@ -70,19 +74,23 @@ packages: engines: {node: '>=6.0.0'} dev: true - /@jridgewell/source-map@0.3.2: - resolution: {integrity: sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw==} + /@jridgewell/source-map@0.3.3: + resolution: {integrity: sha512-b+fsZXeLYi9fEULmfBrhxn4IrPlINf8fiNarzTof004v3lFdntdwa9PF7vFJqm3mg7s+ScJMxXaE3Acp1irZcg==} dependencies: - '@jridgewell/gen-mapping': 0.3.2 - '@jridgewell/trace-mapping': 0.3.17 + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.18 dev: true /@jridgewell/sourcemap-codec@1.4.14: resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} dev: true - /@jridgewell/trace-mapping@0.3.17: - resolution: {integrity: sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==} + /@jridgewell/sourcemap-codec@1.4.15: + resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} + dev: true + + /@jridgewell/trace-mapping@0.3.18: + resolution: {integrity: sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==} dependencies: '@jridgewell/resolve-uri': 3.1.0 '@jridgewell/sourcemap-codec': 1.4.14 @@ -138,7 +146,7 @@ packages: rollup: 2.79.1 dev: true - /@rollup/plugin-typescript@8.5.0(rollup@2.79.1)(tslib@2.5.0)(typescript@4.9.5): + /@rollup/plugin-typescript@8.5.0(rollup@2.79.1)(tslib@2.5.3)(typescript@4.9.5): resolution: {integrity: sha512-wMv1/scv0m/rXx21wD2IsBbJFba8wGF3ErJIr6IKRfRj49S85Lszbxb4DCo8iILpluTjk2GAAu9CoZt4G3ppgQ==} engines: {node: '>=8.0.0'} peerDependencies: @@ -152,7 +160,7 @@ packages: '@rollup/pluginutils': 3.1.0(rollup@2.79.1) resolve: 1.22.2 rollup: 2.79.1 - tslib: 2.5.0 + tslib: 2.5.3 typescript: 4.9.5 dev: true @@ -171,35 +179,31 @@ packages: /@types/eslint-scope@3.7.4: resolution: {integrity: sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==} dependencies: - '@types/eslint': 8.37.0 - '@types/estree': 0.0.51 + '@types/eslint': 8.40.2 + '@types/estree': 1.0.1 dev: true - /@types/eslint@8.37.0: - resolution: {integrity: sha512-Piet7dG2JBuDIfohBngQ3rCt7MgO9xCO4xIMKxBThCq5PNRB91IjlJ10eJVwfoNtvTErmxLzwBZ7rHZtbOMmFQ==} + /@types/eslint@8.40.2: + resolution: {integrity: sha512-PRVjQ4Eh9z9pmmtaq8nTjZjQwKFk7YIHIud3lRoKRBgUQjgjRmoGxxGEPXQkF+lH7QkHJRNr5F4aBgYCW0lqpQ==} dependencies: - '@types/estree': 0.0.51 - '@types/json-schema': 7.0.11 + '@types/estree': 1.0.1 + '@types/json-schema': 7.0.12 dev: true /@types/estree@0.0.39: resolution: {integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==} dev: true - /@types/estree@0.0.51: - resolution: {integrity: sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==} + /@types/estree@1.0.1: + resolution: {integrity: sha512-LG4opVs2ANWZ1TJoKc937iMmNstM/d0ae1vNbnBvBhqCSezgVUOzcLCqbI5elV8Vy6WKwKjaqR+zO9VKirBBCA==} dev: true - /@types/estree@1.0.0: - resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==} + /@types/json-schema@7.0.12: + resolution: {integrity: sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==} dev: true - /@types/json-schema@7.0.11: - resolution: {integrity: sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==} - dev: true - - /@types/node@18.15.11: - resolution: {integrity: sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==} + /@types/node@20.3.1: + resolution: {integrity: sha512-EhcH/wvidPy1WeML3TtYFGR83UzjxeWRen9V402T8aUGYsCHOmfoisV3ZSg03gAFIbLq8TnWOJ0f4cALtnSEUg==} dev: true /@types/prop-types@15.7.5: @@ -216,15 +220,15 @@ packages: /@types/resolve@1.17.1: resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} dependencies: - '@types/node': 18.15.11 + '@types/node': 20.3.1 dev: true /@types/webpack@5.28.1: resolution: {integrity: sha512-qw1MqGZclCoBrpiSe/hokSgQM/su8Ocpl3L/YHE0L6moyaypg4+5F7Uzq7NgaPKPxUxUbQ4fLPLpDWdR27bCZw==} dependencies: - '@types/node': 18.15.11 + '@types/node': 20.3.1 tapable: 2.2.1 - webpack: 5.78.0 + webpack: 5.87.0 transitivePeerDependencies: - '@swc/core' - esbuild @@ -232,109 +236,109 @@ packages: - webpack-cli dev: true - /@webassemblyjs/ast@1.11.1: - resolution: {integrity: sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==} + /@webassemblyjs/ast@1.11.6: + resolution: {integrity: sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q==} dependencies: - '@webassemblyjs/helper-numbers': 1.11.1 - '@webassemblyjs/helper-wasm-bytecode': 1.11.1 + '@webassemblyjs/helper-numbers': 1.11.6 + '@webassemblyjs/helper-wasm-bytecode': 1.11.6 dev: true - /@webassemblyjs/floating-point-hex-parser@1.11.1: - resolution: {integrity: sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ==} + /@webassemblyjs/floating-point-hex-parser@1.11.6: + resolution: {integrity: sha512-ejAj9hfRJ2XMsNHk/v6Fu2dGS+i4UaXBXGemOfQ/JfQ6mdQg/WXtwleQRLLS4OvfDhv8rYnVwH27YJLMyYsxhw==} dev: true - /@webassemblyjs/helper-api-error@1.11.1: - resolution: {integrity: sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg==} + /@webassemblyjs/helper-api-error@1.11.6: + resolution: {integrity: sha512-o0YkoP4pVu4rN8aTJgAyj9hC2Sv5UlkzCHhxqWj8butaLvnpdc2jOwh4ewE6CX0txSfLn/UYaV/pheS2Txg//Q==} dev: true - /@webassemblyjs/helper-buffer@1.11.1: - resolution: {integrity: sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA==} + /@webassemblyjs/helper-buffer@1.11.6: + resolution: {integrity: sha512-z3nFzdcp1mb8nEOFFk8DrYLpHvhKC3grJD2ardfKOzmbmJvEf/tPIqCY+sNcwZIY8ZD7IkB2l7/pqhUhqm7hLA==} dev: true - /@webassemblyjs/helper-numbers@1.11.1: - resolution: {integrity: sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ==} + /@webassemblyjs/helper-numbers@1.11.6: + resolution: {integrity: sha512-vUIhZ8LZoIWHBohiEObxVm6hwP034jwmc9kuq5GdHZH0wiLVLIPcMCdpJzG4C11cHoQ25TFIQj9kaVADVX7N3g==} dependencies: - '@webassemblyjs/floating-point-hex-parser': 1.11.1 - '@webassemblyjs/helper-api-error': 1.11.1 + '@webassemblyjs/floating-point-hex-parser': 1.11.6 + '@webassemblyjs/helper-api-error': 1.11.6 '@xtuc/long': 4.2.2 dev: true - /@webassemblyjs/helper-wasm-bytecode@1.11.1: - resolution: {integrity: sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q==} + /@webassemblyjs/helper-wasm-bytecode@1.11.6: + resolution: {integrity: sha512-sFFHKwcmBprO9e7Icf0+gddyWYDViL8bpPjJJl0WHxCdETktXdmtWLGVzoHbqUcY4Be1LkNfwTmXOJUFZYSJdA==} dev: true - /@webassemblyjs/helper-wasm-section@1.11.1: - resolution: {integrity: sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg==} + /@webassemblyjs/helper-wasm-section@1.11.6: + resolution: {integrity: sha512-LPpZbSOwTpEC2cgn4hTydySy1Ke+XEu+ETXuoyvuyezHO3Kjdu90KK95Sh9xTbmjrCsUwvWwCOQQNta37VrS9g==} dependencies: - '@webassemblyjs/ast': 1.11.1 - '@webassemblyjs/helper-buffer': 1.11.1 - '@webassemblyjs/helper-wasm-bytecode': 1.11.1 - '@webassemblyjs/wasm-gen': 1.11.1 + '@webassemblyjs/ast': 1.11.6 + '@webassemblyjs/helper-buffer': 1.11.6 + '@webassemblyjs/helper-wasm-bytecode': 1.11.6 + '@webassemblyjs/wasm-gen': 1.11.6 dev: true - /@webassemblyjs/ieee754@1.11.1: - resolution: {integrity: sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ==} + /@webassemblyjs/ieee754@1.11.6: + resolution: {integrity: sha512-LM4p2csPNvbij6U1f19v6WR56QZ8JcHg3QIJTlSwzFcmx6WSORicYj6I63f9yU1kEUtrpG+kjkiIAkevHpDXrg==} dependencies: '@xtuc/ieee754': 1.2.0 dev: true - /@webassemblyjs/leb128@1.11.1: - resolution: {integrity: sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw==} + /@webassemblyjs/leb128@1.11.6: + resolution: {integrity: sha512-m7a0FhE67DQXgouf1tbN5XQcdWoNgaAuoULHIfGFIEVKA6tu/edls6XnIlkmS6FrXAquJRPni3ZZKjw6FSPjPQ==} dependencies: '@xtuc/long': 4.2.2 dev: true - /@webassemblyjs/utf8@1.11.1: - resolution: {integrity: sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ==} + /@webassemblyjs/utf8@1.11.6: + resolution: {integrity: sha512-vtXf2wTQ3+up9Zsg8sa2yWiQpzSsMyXj0qViVP6xKGCUT8p8YJ6HqI7l5eCnWx1T/FYdsv07HQs2wTFbbof/RA==} dev: true - /@webassemblyjs/wasm-edit@1.11.1: - resolution: {integrity: sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA==} + /@webassemblyjs/wasm-edit@1.11.6: + resolution: {integrity: sha512-Ybn2I6fnfIGuCR+Faaz7YcvtBKxvoLV3Lebn1tM4o/IAJzmi9AWYIPWpyBfU8cC+JxAO57bk4+zdsTjJR+VTOw==} dependencies: - '@webassemblyjs/ast': 1.11.1 - '@webassemblyjs/helper-buffer': 1.11.1 - '@webassemblyjs/helper-wasm-bytecode': 1.11.1 - '@webassemblyjs/helper-wasm-section': 1.11.1 - '@webassemblyjs/wasm-gen': 1.11.1 - '@webassemblyjs/wasm-opt': 1.11.1 - '@webassemblyjs/wasm-parser': 1.11.1 - '@webassemblyjs/wast-printer': 1.11.1 + '@webassemblyjs/ast': 1.11.6 + '@webassemblyjs/helper-buffer': 1.11.6 + '@webassemblyjs/helper-wasm-bytecode': 1.11.6 + '@webassemblyjs/helper-wasm-section': 1.11.6 + '@webassemblyjs/wasm-gen': 1.11.6 + '@webassemblyjs/wasm-opt': 1.11.6 + '@webassemblyjs/wasm-parser': 1.11.6 + '@webassemblyjs/wast-printer': 1.11.6 dev: true - /@webassemblyjs/wasm-gen@1.11.1: - resolution: {integrity: sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA==} + /@webassemblyjs/wasm-gen@1.11.6: + resolution: {integrity: sha512-3XOqkZP/y6B4F0PBAXvI1/bky7GryoogUtfwExeP/v7Nzwo1QLcq5oQmpKlftZLbT+ERUOAZVQjuNVak6UXjPA==} dependencies: - '@webassemblyjs/ast': 1.11.1 - '@webassemblyjs/helper-wasm-bytecode': 1.11.1 - '@webassemblyjs/ieee754': 1.11.1 - '@webassemblyjs/leb128': 1.11.1 - '@webassemblyjs/utf8': 1.11.1 + '@webassemblyjs/ast': 1.11.6 + '@webassemblyjs/helper-wasm-bytecode': 1.11.6 + '@webassemblyjs/ieee754': 1.11.6 + '@webassemblyjs/leb128': 1.11.6 + '@webassemblyjs/utf8': 1.11.6 dev: true - /@webassemblyjs/wasm-opt@1.11.1: - resolution: {integrity: sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw==} + /@webassemblyjs/wasm-opt@1.11.6: + resolution: {integrity: sha512-cOrKuLRE7PCe6AsOVl7WasYf3wbSo4CeOk6PkrjS7g57MFfVUF9u6ysQBBODX0LdgSvQqRiGz3CXvIDKcPNy4g==} dependencies: - '@webassemblyjs/ast': 1.11.1 - '@webassemblyjs/helper-buffer': 1.11.1 - '@webassemblyjs/wasm-gen': 1.11.1 - '@webassemblyjs/wasm-parser': 1.11.1 + '@webassemblyjs/ast': 1.11.6 + '@webassemblyjs/helper-buffer': 1.11.6 + '@webassemblyjs/wasm-gen': 1.11.6 + '@webassemblyjs/wasm-parser': 1.11.6 dev: true - /@webassemblyjs/wasm-parser@1.11.1: - resolution: {integrity: sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA==} + /@webassemblyjs/wasm-parser@1.11.6: + resolution: {integrity: sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ==} dependencies: - '@webassemblyjs/ast': 1.11.1 - '@webassemblyjs/helper-api-error': 1.11.1 - '@webassemblyjs/helper-wasm-bytecode': 1.11.1 - '@webassemblyjs/ieee754': 1.11.1 - '@webassemblyjs/leb128': 1.11.1 - '@webassemblyjs/utf8': 1.11.1 + '@webassemblyjs/ast': 1.11.6 + '@webassemblyjs/helper-api-error': 1.11.6 + '@webassemblyjs/helper-wasm-bytecode': 1.11.6 + '@webassemblyjs/ieee754': 1.11.6 + '@webassemblyjs/leb128': 1.11.6 + '@webassemblyjs/utf8': 1.11.6 dev: true - /@webassemblyjs/wast-printer@1.11.1: - resolution: {integrity: sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg==} + /@webassemblyjs/wast-printer@1.11.6: + resolution: {integrity: sha512-JM7AhRcE+yW2GWYaKeHL5vt4xqee5N2WcezptmgyhNS+ScggqcT1OtXykhAb13Sn5Yas0j2uv9tHgrjwvzAP4A==} dependencies: - '@webassemblyjs/ast': 1.11.1 + '@webassemblyjs/ast': 1.11.6 '@xtuc/long': 4.2.2 dev: true @@ -346,16 +350,16 @@ packages: resolution: {integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==} dev: true - /acorn-import-assertions@1.8.0(acorn@8.8.2): - resolution: {integrity: sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw==} + /acorn-import-assertions@1.9.0(acorn@8.9.0): + resolution: {integrity: sha512-cmMwop9x+8KFhxvKrKfPYmN6/pKTYYHBqLa0DfvVZcKMJWNyWLnaqND7dx/qn66R7ewM1UX5XMaDVP5wlVTaVA==} peerDependencies: acorn: ^8 dependencies: - acorn: 8.8.2 + acorn: 8.9.0 dev: true - /acorn@8.8.2: - resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} + /acorn@8.9.0: + resolution: {integrity: sha512-jaVNAFBHNLXspO543WnNNPZFRtavh3skAkITqD0/2aeMkKZTN+254PyhwxFYrk3vQ1xfY+2wbesJMs/JC8/PwQ==} engines: {node: '>=0.4.0'} hasBin: true dev: true @@ -388,15 +392,15 @@ packages: concat-map: 0.0.1 dev: true - /browserslist@4.21.5: - resolution: {integrity: sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==} + /browserslist@4.21.9: + resolution: {integrity: sha512-M0MFoZzbUrRU4KNfCrDLnvyE7gub+peetoTid3TBIqtunaDJyXlwhakT+/VkvSXcfIzFfK/nkCs4nmyTmxdNSg==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001474 - electron-to-chromium: 1.4.353 - node-releases: 2.0.10 - update-browserslist-db: 1.0.10(browserslist@4.21.5) + caniuse-lite: 1.0.30001503 + electron-to-chromium: 1.4.433 + node-releases: 2.0.12 + update-browserslist-db: 1.0.11(browserslist@4.21.9) dev: true /buffer-from@1.1.2: @@ -408,8 +412,8 @@ packages: engines: {node: '>=6'} dev: true - /caniuse-lite@1.0.30001474: - resolution: {integrity: sha512-iaIZ8gVrWfemh5DG3T9/YqarVZoYf0r188IjaGwx68j4Pf0SGY6CQkmJUIE+NZHkkecQGohzXmBGEwWDr9aM3Q==} + /caniuse-lite@1.0.30001503: + resolution: {integrity: sha512-Sf9NiF+wZxPfzv8Z3iS0rXM1Do+iOy2Lxvib38glFX+08TCYYYGR5fRJXk4d77C4AYwhUjgYgMsMudbh2TqCKw==} dev: true /chrome-trace-event@1.0.3: @@ -433,8 +437,8 @@ packages: resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} dev: true - /decky-frontend-lib@3.20.5: - resolution: {integrity: sha512-aXllFYhWovoiyBHNzH8PW9EYgXotY9ysuU9icFNgrOWFotyJV+2KGLnfYEyBlDNiexKvXKVRKPw1gRFX2hP4AQ==} + /decky-frontend-lib@3.21.1: + resolution: {integrity: sha512-30605ET9qqZ6St6I9WmMmLGgSrTIdMwo7xy85+lRaF1miUd2icOGEJjwnbVcZDdkal+1fJ3tNEDXlchVfG4TrA==} dev: false /deepmerge@4.3.1: @@ -442,20 +446,20 @@ packages: engines: {node: '>=0.10.0'} dev: true - /electron-to-chromium@1.4.353: - resolution: {integrity: sha512-IdJVpMHJoBT/nn0GQ02wPfbhogDVpd1ud95lP//FTf5l35wzxKJwibB4HBdY7Q+xKPA1nkZ0UDLOMyRj5U5IAQ==} + /electron-to-chromium@1.4.433: + resolution: {integrity: sha512-MGO1k0w1RgrfdbLVwmXcDhHHuxCn2qRgR7dYsJvWFKDttvYPx6FNzCGG0c/fBBvzK2LDh3UV7Tt9awnHnvAAUQ==} dev: true - /enhanced-resolve@5.12.0: - resolution: {integrity: sha512-QHTXI/sZQmko1cbDoNAa3mJ5qhWUUNAq3vR0/YiD379fWQrcfuoX1+HW2S0MTt7XmoPLapdaDKUtelUSPic7hQ==} + /enhanced-resolve@5.15.0: + resolution: {integrity: sha512-LXYT42KJ7lpIKECr2mAXIaMldcNCh/7E0KBKOu4KSfkHmP+mZmSs+8V5gBAqisWBy0OO4W5Oyys0GO1Y8KtdKg==} engines: {node: '>=10.13.0'} dependencies: graceful-fs: 4.2.11 tapable: 2.2.1 dev: true - /es-module-lexer@0.9.3: - resolution: {integrity: sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ==} + /es-module-lexer@1.3.0: + resolution: {integrity: sha512-vZK7T0N2CBmBOixhmjdqx2gWVbFZ4DXZ/NyRMZVlJXPa7CyFS+/a4QQsDGDQy9ZfEzxFuNEsMLeQJnKP2p5/JA==} dev: true /escalade@3.1.1: @@ -583,8 +587,8 @@ packages: builtin-modules: 3.3.0 dev: true - /is-core-module@2.11.0: - resolution: {integrity: sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==} + /is-core-module@2.12.1: + resolution: {integrity: sha512-Q4ZuBAe2FUsKtyQJoQHlvP8OvBERxO3jEmy1I7hcRXcJBGGHFh/aJBswbXuS9sgrDH2QUO8ilkwNPHvHMd8clg==} dependencies: has: 1.0.3 dev: true @@ -596,14 +600,14 @@ packages: /is-reference@1.2.1: resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} dependencies: - '@types/estree': 1.0.0 + '@types/estree': 1.0.1 dev: true /jest-worker@27.5.1: resolution: {integrity: sha512-7vuh85V5cdDofPyxn58nrPjBktZo0u9x1g8WtjQol+jZDaE+fhN+cIvTj11GndBnMnyfrUOG1sZQxCdjKh+DKg==} engines: {node: '>= 10.13.0'} dependencies: - '@types/node': 18.15.11 + '@types/node': 20.3.1 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true @@ -668,8 +672,8 @@ packages: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} dev: true - /node-releases@2.0.10: - resolution: {integrity: sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==} + /node-releases@2.0.12: + resolution: {integrity: sha512-QzsYKWhXTWx8h1kIvqfnC++o0pEmpRQA/aenALsL2F4pqNVr7YzcdMlDij5WBnwftRbJCNJL/O7zdKaxKPHqgQ==} dev: true /once@1.4.0: @@ -707,8 +711,8 @@ packages: safe-buffer: 5.2.1 dev: true - /react-icons@4.8.0(react@18.2.0): - resolution: {integrity: sha512-N6+kOLcihDiAnj5Czu637waJqSnwlMNROzVZMhfX68V/9bu9qHaMIJC4UdozWoOk57gahFCNHwVvWzm0MTzRjg==} + /react-icons@4.9.0(react@18.2.0): + resolution: {integrity: sha512-ijUnFr//ycebOqujtqtV9PFS7JjhWg0QU6ykURVHuL4cbofvRCf3f6GMn9+fBktEFQOIVZnuAYLZdiyadRQRFg==} peerDependencies: react: '*' dependencies: @@ -733,7 +737,7 @@ packages: resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==} hasBin: true dependencies: - is-core-module: 2.11.0 + is-core-module: 2.12.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 dev: true @@ -766,11 +770,11 @@ packages: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} dev: true - /schema-utils@3.1.1: - resolution: {integrity: sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw==} + /schema-utils@3.3.0: + resolution: {integrity: sha512-pN/yOAvcC+5rQ5nERGuwrjLlYvLTbCibnZ1I7B1LaiAz9BRBlE9GMgE/eqV30P7aJQUf7Ddimy/RsbYO/GrVGg==} engines: {node: '>= 10.13.0'} dependencies: - '@types/json-schema': 7.0.11 + '@types/json-schema': 7.0.12 ajv: 6.12.6 ajv-keywords: 3.5.2(ajv@6.12.6) dev: true @@ -834,8 +838,8 @@ packages: engines: {node: '>=6'} dev: true - /terser-webpack-plugin@5.3.7(webpack@5.78.0): - resolution: {integrity: sha512-AfKwIktyP7Cu50xNjXF/6Qb5lBNzYaWpU6YfoX3uZicTx0zTy0stDDCsvjDapKsSDvOeWo5MEq4TmdBy2cNoHw==} + /terser-webpack-plugin@5.3.9(webpack@5.87.0): + resolution: {integrity: sha512-ZuXsqE07EcggTWQjXUj+Aot/OMcD0bMKGgF63f7UxYcu5/AJF53aIpK1YoP5xR9l6s/Hy2b+t1AM0bLNPRuhwA==} engines: {node: '>= 10.13.0'} peerDependencies: '@swc/core': '*' @@ -850,27 +854,27 @@ packages: uglify-js: optional: true dependencies: - '@jridgewell/trace-mapping': 0.3.17 + '@jridgewell/trace-mapping': 0.3.18 jest-worker: 27.5.1 - schema-utils: 3.1.1 + schema-utils: 3.3.0 serialize-javascript: 6.0.1 - terser: 5.16.8 - webpack: 5.78.0 + terser: 5.18.0 + webpack: 5.87.0 dev: true - /terser@5.16.8: - resolution: {integrity: sha512-QI5g1E/ef7d+PsDifb+a6nnVgC4F22Bg6T0xrBrz6iloVB4PUkkunp6V8nzoOOZJIzjWVdAGqCdlKlhLq/TbIA==} + /terser@5.18.0: + resolution: {integrity: sha512-pdL757Ig5a0I+owA42l6tIuEycRuM7FPY4n62h44mRLRfnOxJkkOHd6i89dOpwZlpF6JXBwaAHF6yWzFrt+QyA==} engines: {node: '>=10'} hasBin: true dependencies: - '@jridgewell/source-map': 0.3.2 - acorn: 8.8.2 + '@jridgewell/source-map': 0.3.3 + acorn: 8.9.0 commander: 2.20.3 source-map-support: 0.5.21 dev: true - /tslib@2.5.0: - resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==} + /tslib@2.5.3: + resolution: {integrity: sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w==} dev: true /typescript@4.9.5: @@ -879,13 +883,13 @@ packages: hasBin: true dev: true - /update-browserslist-db@1.0.10(browserslist@4.21.5): - resolution: {integrity: sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==} + /update-browserslist-db@1.0.11(browserslist@4.21.9): + resolution: {integrity: sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' dependencies: - browserslist: 4.21.5 + browserslist: 4.21.9 escalade: 3.1.1 picocolors: 1.0.0 dev: true @@ -913,8 +917,8 @@ packages: engines: {node: '>=10.13.0'} dev: true - /webpack@5.78.0: - resolution: {integrity: sha512-gT5DP72KInmE/3azEaQrISjTvLYlSM0j1Ezhht/KLVkrqtv10JoP/RXhwmX/frrutOPuSq3o5Vq0ehR/4Vmd1g==} + /webpack@5.87.0: + resolution: {integrity: sha512-GOu1tNbQ7p1bDEoFRs2YPcfyGs8xq52yyPBZ3m2VGnXGtV9MxjrkABHm4V9Ia280OefsSLzvbVoXcfLxjKY/Iw==} engines: {node: '>=10.13.0'} hasBin: true peerDependencies: @@ -924,16 +928,16 @@ packages: optional: true dependencies: '@types/eslint-scope': 3.7.4 - '@types/estree': 0.0.51 - '@webassemblyjs/ast': 1.11.1 - '@webassemblyjs/wasm-edit': 1.11.1 - '@webassemblyjs/wasm-parser': 1.11.1 - acorn: 8.8.2 - acorn-import-assertions: 1.8.0(acorn@8.8.2) - browserslist: 4.21.5 + '@types/estree': 1.0.1 + '@webassemblyjs/ast': 1.11.6 + '@webassemblyjs/wasm-edit': 1.11.6 + '@webassemblyjs/wasm-parser': 1.11.6 + acorn: 8.9.0 + acorn-import-assertions: 1.9.0(acorn@8.9.0) + browserslist: 4.21.9 chrome-trace-event: 1.0.3 - enhanced-resolve: 5.12.0 - es-module-lexer: 0.9.3 + enhanced-resolve: 5.15.0 + es-module-lexer: 1.3.0 eslint-scope: 5.1.1 events: 3.3.0 glob-to-regexp: 0.4.1 @@ -942,9 +946,9 @@ packages: loader-runner: 4.3.0 mime-types: 2.1.35 neo-async: 2.6.2 - schema-utils: 3.1.1 + schema-utils: 3.3.0 tapable: 2.2.1 - terser-webpack-plugin: 5.3.7(webpack@5.78.0) + terser-webpack-plugin: 5.3.9(webpack@5.87.0) watchpack: 2.4.0 webpack-sources: 3.2.3 transitivePeerDependencies: diff --git a/src/backend.ts b/src/backend.ts index 8bc6761..126cb82 100644 --- a/src/backend.ts +++ b/src/backend.ts @@ -117,6 +117,10 @@ export async function getBatteryChargeDesign(): Promise { return (await call_backend("BATTERY_charge_design", []))[0]; } +export async function getBatteryChargePower(): Promise { + return (await call_backend("BATTERY_charge_power", []))[0]; +} + export async function getBatteryChargeRate(): Promise { return (await call_backend("BATTERY_get_charge_rate", []))[0]; } diff --git a/src/components/battery.tsx b/src/components/battery.tsx index 14b86ee..0199e1b 100644 --- a/src/components/battery.tsx +++ b/src/components/battery.tsx @@ -20,6 +20,7 @@ import { CHARGE_MODE_BATT, CURRENT_BATT, CHARGE_LIMIT_BATT, + CHARGE_POWER_BATT, } from "../consts"; import { set_value, get_value} from "usdpl-front"; @@ -54,12 +55,18 @@ export class Battery extends Component { {get_value(CHARGE_FULL_BATT).toFixed(1)} Wh ({(100 * get_value(CHARGE_FULL_BATT) / get_value(CHARGE_DESIGN_BATT)).toFixed(1)}%) } - + {get_value(CHARGE_POWER_BATT) != null && get_value(CHARGE_POWER_BATT) > 0 && + + {get_value(CHARGE_POWER_BATT).toFixed(2)} W + + } + {get_value(CURRENT_BATT) != null && {get_value(CURRENT_BATT)} mA - + } {(get_value(LIMITS_INFO) as backend.SettingsLimits).battery.charge_current != null && { set_value(CHARGE_NOW_BATT, rate) }); backend.resolve(backend.getBatteryChargeFull(), (rate: number) => { set_value(CHARGE_FULL_BATT, rate) }); backend.resolve(backend.getBatteryChargeDesign(), (rate: number) => { set_value(CHARGE_DESIGN_BATT, rate) }); + backend.resolve(backend.getBatteryChargePower(), (rate: number) => { set_value(CHARGE_POWER_BATT, rate) }); //backend.resolve(backend.getCpuCount(), (count: number) => { set_value(TOTAL_CPUS, count)}); backend.resolve(backend.getCpusOnline(), (statii: boolean[]) => { @@ -199,6 +201,7 @@ const periodicals = function() { backend.resolve(backend.getBatteryCurrent(), (rate: number) => { set_value(CURRENT_BATT, rate) }); backend.resolve(backend.getBatteryChargeNow(), (rate: number) => { set_value(CHARGE_NOW_BATT, rate) }); backend.resolve(backend.getBatteryChargeFull(), (rate: number) => { set_value(CHARGE_FULL_BATT, rate) }); + backend.resolve(backend.getBatteryChargePower(), (rate: number) => { set_value(CHARGE_POWER_BATT, rate) }); backend.resolve(backend.getGeneralSettingsPath(), (path: string) => { const oldValue = get_value(PATH_GEN); diff --git a/translations/fr-CA.po b/translations/fr-CA.po index d7e8c2a..fbb09fb 100644 --- a/translations/fr-CA.po +++ b/translations/fr-CA.po @@ -65,6 +65,11 @@ msgstr "Présentement (Charge)" msgid "Max (Design)" msgstr "Max (Conçue)" +#: components/battery.tsx:60 +# (Wattage of battery charging input) +msgid "Charge Power" +msgstr "Puissance de charge" + # (Charge current limit override toggle) #: components/battery.tsx:59 msgid "Charge Current Limits" diff --git a/translations/pt.pot b/translations/pt.pot index 79fe733..1c15573 100644 --- a/translations/pt.pot +++ b/translations/pt.pot @@ -64,6 +64,11 @@ msgstr "" msgid "Max (Design)" msgstr "" +#: components/battery.tsx:60 +# (Wattage of battery charging input) +msgid "Charge Power" +msgstr "" + #: components/battery.tsx:59 # (Charge current limit override toggle) msgid "Charge Current Limits" From 907594fade987a04eac634844f1a9b6ef5810362 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sat, 17 Jun 2023 12:34:52 -0400 Subject: [PATCH 09/26] Make current and charge power hidden by default --- backend/src/settings/steam_deck/battery.rs | 41 ++++++++++++++------ backend/src/settings/steam_deck/oc_limits.rs | 2 + pt_oc.json | 3 +- 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/backend/src/settings/steam_deck/battery.rs b/backend/src/settings/steam_deck/battery.rs index f6481c3..2405380 100644 --- a/backend/src/settings/steam_deck/battery.rs +++ b/backend/src/settings/steam_deck/battery.rs @@ -179,6 +179,7 @@ const BATTERY_CHARGE_NOW_PATH: &str = "/sys/class/power_supply/BAT1/charge_now"; const BATTERY_CHARGE_FULL_PATH: &str = "/sys/class/power_supply/BAT1/charge_full"; // read-only const BATTERY_CHARGE_DESIGN_PATH: &str = "/sys/class/power_supply/BAT1/charge_full_design"; // read-only const USB_PD_IN_MVOLTAGE_PATH: &str = "/sys/class/hwmon/hwmon5/in0_input"; // read-only +const USB_PD_IN_CURRENT_PATH: &str = "/sys/class/hwmon/hwmon5/curr1_input"; // read-only impl Battery { #[inline] @@ -321,7 +322,7 @@ impl Battery { } pub fn read_charge_power() -> Result { - let current = Self::read_current_now()? as f64 / 1000.0; // mA -> A + let current = Self::read_usb_current()?; let voltage = Self::read_usb_voltage()?; Ok(current * voltage) } @@ -373,6 +374,16 @@ impl Battery { } } + pub fn read_usb_current() -> Result { + match usdpl_back::api::files::read_single::<_, u64, _>(USB_PD_IN_CURRENT_PATH) { + Err(e) => Err(SettingError { + msg: format!("Failed to read from `{}`: {}", USB_PD_IN_CURRENT_PATH, e), + setting: crate::settings::SettingVariant::Battery, + }), + Ok(val) => Ok((val as f64) / 1000.0), // mA -> A + } + } + pub fn system_default() -> Self { let (oc_limits, is_default) = OverclockLimits::load_or_default(); let oc_limits = oc_limits.battery; @@ -549,22 +560,30 @@ impl TBattery for Battery { } fn read_current_now(&self) -> Option { - match Self::read_current_now() { - Ok(x) => Some(x as f64), - Err(e) => { - log::warn!("read_current_now err: {}", e.msg); - None + if self.limits.extra_readouts { + match Self::read_current_now() { + Ok(x) => Some(x as f64), + Err(e) => { + log::warn!("read_current_now err: {}", e.msg); + None + } } + } else { + None } } fn read_charge_power(&self) -> Option { - match Self::read_charge_power() { - Ok(x) => Some(x as f64), - Err(e) => { - log::warn!("read_current_now err: {}", e.msg); - None + if self.limits.extra_readouts { + match Self::read_charge_power() { + Ok(x) => Some(x as f64), + Err(e) => { + log::warn!("read_current_now err: {}", e.msg); + None + } } + } else { + None } } diff --git a/backend/src/settings/steam_deck/oc_limits.rs b/backend/src/settings/steam_deck/oc_limits.rs index 74c2bf2..f229a0c 100644 --- a/backend/src/settings/steam_deck/oc_limits.rs +++ b/backend/src/settings/steam_deck/oc_limits.rs @@ -67,6 +67,7 @@ impl OverclockLimits { #[derive(Serialize, Deserialize, Clone, Debug)] pub(super) struct BatteryLimits { pub charge_rate: MinMax, + pub extra_readouts: bool, } impl Default for BatteryLimits { @@ -76,6 +77,7 @@ impl Default for BatteryLimits { min: 250, max: 2500, }, + extra_readouts: false, } } } diff --git a/pt_oc.json b/pt_oc.json index 79d3c37..4ebd7c1 100644 --- a/pt_oc.json +++ b/pt_oc.json @@ -3,7 +3,8 @@ "charge_rate": { "min": 250, "max": 2500 - } + }, + "extra_readouts": false }, "cpus": { "cpus": [ From b565fd8ad8221a76bc26d0c40e31be4dcc3e5732 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sat, 17 Jun 2023 12:36:52 -0400 Subject: [PATCH 10/26] Remove unused test translations --- translations/test.mo | Bin 2116 -> 0 bytes translations/test.po | 227 ------------------------------------------- 2 files changed, 227 deletions(-) delete mode 100644 translations/test.mo delete mode 100644 translations/test.po diff --git a/translations/test.mo b/translations/test.mo deleted file mode 100644 index 4def730745ac4dfbb3945202a0761a45d5dfc204..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2116 zcmeH`KWrRD6vhW|_;Z*5!2tpW1~6btS>K(Lpy)6N$7h=epMA2A&{#-wyW{oX-I>eG z>|Jb8LPv!{gCYuqs3K87LE(ae0whW#8bp;62?-(5fW$Yu&xu6^J)?W~+qW}s=FR)w z{(NHWLxwR8n}luM#@IRV+U@wm7~H|w-QZ>LDR3XW3;YPgk9~r_li+9Iz2E`(Joqgb z*8K_|1OEUY0RIB-1dop~b_zTRaX%!I0M%;5c{y z-Uoh1{*UC}ApQp8S0)qAKZc}2+&CEgQ((x4gEg=PhVz!daF0u1IQK2^8L$tA`1imN z_W>C4zYd1=UxBZqmS2-Uj+f#61aXo$MLbPBOPnXRiL1mOaf_G`GomNHLwuL`KJhB? z8u3%&b>f%A1L8Nt?}{zCkn_$P4;BH@vZ6DNq1#3|xw;#uN6i1L+v`8fC( zEcDrN7>5Oo!gv<;AT0D|7ziszsWqO0RzasnVUVKCCFmM@CFmB$!xhRtdj!uRk`x+@NLH=k}VqTt;u-5isEq9|RfNEdluTA73_-OZVS zv=OBo8@;X40w*b>*|KoH+wJk`H)q(gv9aVE3mvXBE{5wy12dAA=ON>2_8<9HGgjoX ztiiICmkX)my~8W7pcpF#Icj5BM_l34ZRu31XM&^hBInbc*Y=Ni`2rlJk4`BU%PbRG zn!>TNcx%XgDA^kHn664a!`5}Cv}Efz%c?~31&GvZce#_^E1f#lmDVZep$F@RTXi#W zGtI6w+bWZ6v(sanVkr5bdclQGPzMODJlFDy=U(MlCNmlPs>X0U@0&s=sK4fwJZ>P- zF`KC1VQqV5zaR^1-bQS6F^MjPgp6+SVRN=w+mHieebjNON}>xz>Y|=$@g466u2rw6 z%I_5Y+1TXuwH2)jS1<3-GbVF&, 2023. -msgid "" -msgstr "" -"Project-Id-Version: v1.1\n" -"Report-Msgid-Bugs-To: https://github.com/NGnius/PowerTools/issues\n" -"POT-Creation-Date: 2023-01-10 20:06-0500\n" -"PO-Revision-Date: 2023-01-10 20:06-0500\n" -"Last-Translator: NGnius \n" -"Language-Team: NGnius \n" -"Language: conlang\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=utf-8\n" -"Content-Transfer-Encoding: 8bit\n" - -# -- index.tsx -- - -#: index.tsx:226 -# (Section title) -msgid "Miscellaneous" -msgstr "test123" - -#: index.tsx:226 -# (Profile persistence toggle) -msgid "Persistent" -msgstr "test123" - -#: index.tsx:227 -# (Profile persistence toggle description) -msgid "Save profile and load it next time" -msgstr "test123" - -#: index.tsx:239 -# (Profile display) -msgid "Profile" -msgstr "test123" - -# -- components/battery.tsx -- - -#: components/battery.tsx:42 -# (Battery section title) -msgid "Battery" -msgstr "test123" - -#: components/battery.tsx:46 -# (Charge of battery at this moment, with percentage of expected full charge in brackets) -msgid "Now (Charge)" -msgstr "test123" - -#: components/battery.tsx:52 -# (Maximum capacity of battery, with percentage of design capacity in brackets) -msgid "Max (Design)" -msgstr "test123" - -#: components/battery.tsx:59 -# (Charge current limit override toggle) -msgid "Charge Current Limits" -msgstr "test123" - -#: components/battery.tsx:60 -# (Charge current limit override toggle description) -msgid "Control battery charge rate when awake" -msgstr "test123" - -#: components/battery.tsx:74 -# (Battery maximum input current with unit) -msgid "Maximum (mA)" -msgstr "test123" - -#: components/battery.tsx:97,115 -# (Battery charge mode override toggle) -msgid "Charge Mode" -msgstr "test123" - -#: components/battery.tsx:98 -# (Battery charge mode override toggle description) -msgid "Force battery charge mode" -msgstr "test123" - -#: components/battery.tsx:112 -# (Battery charge mode dropdown) -msgid "Mode" -msgstr "test123" - -#: components/battery.tsx:133 -# (Battery current display) -msgid "Current" -msgstr "test123" - -# -- components/cpus.tsx -- - -#: components/cpus.tsx:64 -# (CPU section title) -msgid "CPU" -msgstr "test123" - -#: components/cpus.tsx:70 -# (CPU advanced mode toggle) -msgid "Advanced" -msgstr "test123" - -#: components/cpus.tsx:71 -# (CPU advanced mode toggle description) -msgid "Enables per-thread configuration" -msgstr "test123" - -#: components/cpus.tsx:88 -# (CPU Simultaneous MultiThreading toggle) -msgid "SMT" -msgstr "test123" - -#: components/cpus.tsx:89 -# (CPU SMT toggle description) -msgid "Enables odd-numbered CPUs" -msgstr "test123" - -#: components/cpus.tsx:106 -# (CPU thread count slider) -msgid "Threads" -msgstr "test123" - -#: components/cpus.tsx:137 -#: components/gpu.tsx:112 -# (Clock speed override toggle) -msgid "Frequency Limits" -msgstr "test123" - -#: components/cpus.tsx:138 -#: components/gpu.tsx:113 -# (Clock speed override toggle description) -msgid "Set bounds on clock speed" -msgstr "test123" - -#: components/cpus.tsx:165 -#: components/gpu.tsx:137 -# (Minimum clock speed with unit) -msgid "Minimum (MHz)" -msgstr "test123" - -#: components/cpus.tsx:195 -#: components/gpu.tsx:160 -# (Maximum clock speed with unit) -msgid "Maximum (MHz)" -msgstr "test123" - -# advanced mode - -#: components/cpus.tsx:226 -# (CPU selection slider) -msgid "Selected CPU" -msgstr "test123" - -#: components/cpus.tsx:246 -# (CPU Online toggle) -msgid "Online" -msgstr "test123" - -#: components/cpus.tsx:247 -# (CPU Online description) -msgid "Allow the CPU thread to do work" -msgstr "test123" - -#: components/cpus.tsx:342 -# (CPU scheduling governor dropdown -- governor names are not translated) -msgid "Governor" -msgstr "test123" - -# -- components/debug.tsx -- - -#: components/debug.tsx:29 -# (Debug section title) -msgid "Debug" -msgstr "test123" - -#: components/debug.tsx:33 -# (Version display for native back-end of PowerTools) -msgid "Native" -msgstr "test123" - -#: components/debug.tsx:47 -# (Mode display for framework of USDPL API) -msgid "Framework" -msgstr "test123" - -#: components/debug.tsx:54 -# (Display for software implementation in PowerTools which applies settings) -msgid "Driver" -msgstr "test123" - -# -- components/gpu.tsx -- - -#: components/gpu.tsx:34 -# (GPU section title) -msgid "GPU" -msgstr "test123" - -#: components/gpu.tsx:39 -# (PPT Limits override toggle) -msgid "PowerPlay Limits" -msgstr "test123" - -#: components/gpu.tsx:40 -# (PPT Limits override toggle description) -msgid "Override APU TDP settings" -msgstr "test123" - -#: components/gpu.tsx:63 -# (SlowPPT slider with unit) -msgid "SlowPPT (W)" -msgstr "test123" - -#: components/gpu.tsx:87 -# (FastPPT slider with unit) -msgid "FastPPT (W)" -msgstr "test123" - -#: components/gpu.tsx:112 -# (Reduce memory clock speed toggle) -msgid "Downclock Memory" -msgstr "test123" - -#: components/gpu.tsx:112 -# (Reduce memory clock speed toggle description) -msgid "Force RAM into low-power mode" -msgstr "test123" From 1669991a01c6049e7fcb2d99bffa01936a6598a6 Mon Sep 17 00:00:00 2001 From: OlegEnot <121382147+OlegEnot@users.noreply.github.com> Date: Thu, 29 Jun 2023 03:04:03 +0300 Subject: [PATCH 11/26] ru-RU translation (#112) * Add files via upload * Update ru-RU.po * Update ru-RU.po Error correction * Update ru-RU.po SlowPPT and FastPPT term adaptation according to functionality * Update ru-RU.po --- translations/ru-RU.po | 257 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 257 insertions(+) create mode 100644 translations/ru-RU.po diff --git a/translations/ru-RU.po b/translations/ru-RU.po new file mode 100644 index 0000000..9b0f711 --- /dev/null +++ b/translations/ru-RU.po @@ -0,0 +1,257 @@ +# TEMPLATE TITLE. +# Copyright (C) 2023 NGnius +# This file is distributed under the same license as the PowerTools package. +# NGnius (Graham) , 2023. +msgid "" +msgstr "" +"Project-Id-Version: v1.1\n" +"Report-Msgid-Bugs-To: https://github.com/NGnius/PowerTools/issues\n" +"POT-Creation-Date: 2023-06-27 16:30-0300\n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: ru-RU\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +# -- index.tsx -- + +#: index.tsx:226 +# (Section title) +msgid "Miscellaneous" +msgstr "Разное" + +#: index.tsx:226 +# (Profile persistence toggle, a bit like SteamOS's "Use per-game profile") +msgid "Persistent Profile" +msgstr "Использовать профиль игры" + +#: index.tsx:227 +# (Profile persistence toggle description) +msgid "Save profile and load it next time" +msgstr "Сохраните профиль и загрузите его в следующий раз" + +#: index.tsx:239 +# (Profile display) +msgid "Profile" +msgstr "Профиль" + +#: index.tsx:276 +# (Button to reset everything to system defaults) +msgid "Reapply settings" +msgstr "Повторно применить настройки" + +#: index.tsx:297 +# (Button to reset everything to system defaults) +msgid "Defaults" +msgstr "По умолчанию" + +# -- components/battery.tsx -- + +#: components/battery.tsx:42 +# (Battery section title) +msgid "Battery" +msgstr "Батарея" + +#: components/battery.tsx:46 +# (Charge of battery at this moment, with percentage of expected full charge in brackets) +msgid "Now (Charge)" +msgstr "Текущий заряд батареи" + +#: components/battery.tsx:52 +# (Maximum capacity of battery, with percentage of design capacity in brackets) +msgid "Max (Design)" +msgstr "Максимальная емкость батареи" + +#: components/battery.tsx:60 +# (Wattage of battery charging input) +msgid "Charge Power" +msgstr "Мощность зарядки" + +#: components/battery.tsx:59 +# (Charge current limit override toggle) +msgid "Charge Current Limits" +msgstr "Предел тока зарядки" + +#: components/battery.tsx:60 +# (Charge current limit override toggle description) +msgid "Control battery charge rate when awake" +msgstr "Контролируйте уровень тока заряда батареи во время бодрствования" + +#: components/battery.tsx:74 +# (Battery maximum input current with unit) +msgid "Maximum (mA)" +msgstr "Максимум (mA)" + +#: components/battery.tsx:97,115 +# (Battery charge mode override toggle) +msgid "Charge Mode" +msgstr "Режим зарядки" + +#: components/battery.tsx:98 +# (Battery charge mode override toggle description) +msgid "Force battery charge mode" +msgstr "Принудительный режим зарядки батареи" + +#: components/battery.tsx:112 +# (Battery charge mode dropdown) +msgid "Mode" +msgstr "Режим" + +#: components/battery.tsx:133 +# (Battery electrical current display) +msgid "Current" +msgstr "Ток потребления с батареи" + +#: components/battery.tsx:141 +# (Battery charging maximum) +msgid "Charge Limit" +msgstr "Лимит заряда" + +#: components/battery.tsx:142 +# (Battery charging maximum description) +msgid "Limit battery charge when awake" +msgstr "Ограничьте заряд батареи во время бодрствования" + +#: components/battery.tsx:156 +# (Battery charging maximum slider) +msgid "Maximum (%)" +msgstr "Максимум (%)" + +# -- components/cpus.tsx -- + +#: components/cpus.tsx:64 +# (CPU section title) +msgid "CPU" +msgstr "CPU" + +#: components/cpus.tsx:70 +# (CPU advanced mode toggle) +msgid "Advanced" +msgstr "Продвинутый" + +#: components/cpus.tsx:71 +# (CPU advanced mode toggle description) +msgid "Enables per-thread configuration" +msgstr "Включает настройку для каждого потока" + +#: components/cpus.tsx:88 +# (CPU Simultaneous MultiThreading toggle) +msgid "SMT" +msgstr "SMT" + +#: components/cpus.tsx:89 +# (CPU SMT toggle description) +msgid "Enables odd-numbered CPUs" +msgstr "Активация одновременной многопоточности" + +#: components/cpus.tsx:106 +# (CPU thread count slider) +msgid "Threads" +msgstr "Потоки" + +#: components/cpus.tsx:137 +#: components/gpu.tsx:112 +# (Clock speed override toggle) +msgid "Frequency Limits" +msgstr "Ограничения частоты" + +#: components/cpus.tsx:138 +#: components/gpu.tsx:113 +# (Clock speed override toggle description) +msgid "Set bounds on clock speed" +msgstr "Установите ограничения на тактовую частоту" + +#: components/cpus.tsx:165 +#: components/gpu.tsx:137 +# (Minimum clock speed with unit) +msgid "Minimum (MHz)" +msgstr "Минимум (MHz)" + +#: components/cpus.tsx:195 +#: components/gpu.tsx:160 +# (Maximum clock speed with unit) +msgid "Maximum (MHz)" +msgstr "Максимум (MHz)" + +# advanced mode + +#: components/cpus.tsx:226 +# (CPU selection slider) +msgid "Selected CPU" +msgstr "Выбранный поток CPU" + +#: components/cpus.tsx:246 +# (CPU Online toggle) +msgid "Online" +msgstr "Online" + +#: components/cpus.tsx:247 +# (CPU Online description) +msgid "Allow the CPU thread to do work" +msgstr "Разрешить потоку CPU выполнять работу" + +#: components/cpus.tsx:342 +# (CPU scheduling governor dropdown -- governor names are not translated) +msgid "Governor" +msgstr "Governor" + +# -- components/debug.tsx -- + +#: components/debug.tsx:29 +# (Debug section title) +msgid "Debug" +msgstr "Debug" + +#: components/debug.tsx:33 +# (Version display for native back-end of PowerTools) +msgid "Native" +msgstr "Native" + +#: components/debug.tsx:47 +# (Mode display for framework of USDPL API) +msgid "Framework" +msgstr "Framework" + +#: components/debug.tsx:54 +# (Display for software implementation in PowerTools which applies settings) +msgid "Driver" +msgstr "Driver" + +# -- components/gpu.tsx -- + +#: components/gpu.tsx:34 +# (GPU section title) +msgid "GPU" +msgstr "GPU" + +#: components/gpu.tsx:39 +# (PPT Limits override toggle) +msgid "PowerPlay Limits" +msgstr "PowerPlay Лимиты" + +#: components/gpu.tsx:40 +# (PPT Limits override toggle description) +msgid "Override APU TDP settings" +msgstr "Переопределить настройки TDP APU" + +#: components/gpu.tsx:63 +# (SlowPPT slider with unit) +msgid "SlowPPT (W)" +msgstr "Средний PPT (W)" + +#: components/gpu.tsx:87 +# (FastPPT slider with unit) +msgid "FastPPT (W)" +msgstr "Фактический PPT (W)" + +#: components/gpu.tsx:112 +# (Reduce memory clock speed toggle) +msgid "Downclock Memory" +msgstr "Понижение частоты памяти" + +#: components/gpu.tsx:112 +# (Reduce memory clock speed toggle description) +msgid "Force RAM into low-power mode" +msgstr "Перевести ОЗУ в режим пониженного энергопотребления" From 4909ccf5e779499c0545ad55ccd54305575d5d5e Mon Sep 17 00:00:00 2001 From: OlegEnot <121382147+OlegEnot@users.noreply.github.com> Date: Sat, 1 Jul 2023 04:06:06 +0300 Subject: [PATCH 12/26] uk-UA translation (#113) * Add files via upload * Update ru-RU.po * Update ru-RU.po Error correction * Update ru-RU.po SlowPPT and FastPPT term adaptation according to functionality * Update ru-RU.po * Added Ukrainian translation --- translations/uk-UA.po | 257 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 257 insertions(+) create mode 100644 translations/uk-UA.po diff --git a/translations/uk-UA.po b/translations/uk-UA.po new file mode 100644 index 0000000..d5ce0c4 --- /dev/null +++ b/translations/uk-UA.po @@ -0,0 +1,257 @@ +# TEMPLATE TITLE. +# Copyright (C) 2023 NGnius +# This file is distributed under the same license as the PowerTools package. +# NGnius (Graham) , 2023. +msgid "" +msgstr "" +"Project-Id-Version: v1.1\n" +"Report-Msgid-Bugs-To: https://github.com/NGnius/PowerTools/issues\n" +"POT-Creation-Date: 2023-06-30 20:15-0300\n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: uk-UA\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" + +# -- index.tsx -- + +#: index.tsx:226 +# (Section title) +msgid "Miscellaneous" +msgstr "Різне" + +#: index.tsx:226 +# (Profile persistence toggle, a bit like SteamOS's "Use per-game profile") +msgid "Persistent Profile" +msgstr "Використовувати профіль гри" + +#: index.tsx:227 +# (Profile persistence toggle description) +msgid "Save profile and load it next time" +msgstr "Збережіть профіль та завантажте його наступного разу" + +#: index.tsx:239 +# (Profile display) +msgid "Profile" +msgstr "Профіль" + +#: index.tsx:276 +# (Button to reset everything to system defaults) +msgid "Reapply settings" +msgstr "Повторно застосувати налаштування" + +#: index.tsx:297 +# (Button to reset everything to system defaults) +msgid "Defaults" +msgstr "За замовчуванням" + +# -- components/battery.tsx -- + +#: components/battery.tsx:42 +# (Battery section title) +msgid "Battery" +msgstr "Батарея" + +#: components/battery.tsx:46 +# (Charge of battery at this moment, with percentage of expected full charge in brackets) +msgid "Now (Charge)" +msgstr "Поточний заряд батареї" + +#: components/battery.tsx:52 +# (Maximum capacity of battery, with percentage of design capacity in brackets) +msgid "Max (Design)" +msgstr "Максимальна ємність батареї" + +#: components/battery.tsx:60 +# (Wattage of battery charging input) +msgid "Charge Power" +msgstr "Потужність заряджання" + +#: components/battery.tsx:59 +# (Charge current limit override toggle) +msgid "Charge Current Limits" +msgstr "Ліміт струму заряджання" + +#: components/battery.tsx:60 +# (Charge current limit override toggle description) +msgid "Control battery charge rate when awake" +msgstr "Контролюйте рівень струму заряджання батареї під час активності" + +#: components/battery.tsx:74 +# (Battery maximum input current with unit) +msgid "Maximum (mA)" +msgstr "Максимум (mA)" + +#: components/battery.tsx:97,115 +# (Battery charge mode override toggle) +msgid "Charge Mode" +msgstr "Режим заряджання" + +#: components/battery.tsx:98 +# (Battery charge mode override toggle description) +msgid "Force battery charge mode" +msgstr "Примусовий режим заряджання батареї" + +#: components/battery.tsx:112 +# (Battery charge mode dropdown) +msgid "Mode" +msgstr "Режим" + +#: components/battery.tsx:133 +# (Battery electrical current display) +msgid "Current" +msgstr "Струм споживання з батареї" + +#: components/battery.tsx:141 +# (Battery charging maximum) +msgid "Charge Limit" +msgstr "Ліміт заряджання" + +#: components/battery.tsx:142 +# (Battery charging maximum description) +msgid "Limit battery charge when awake" +msgstr "Обмежити заряджання батареї під час активності" + +#: components/battery.tsx:156 +# (Battery charging maximum slider) +msgid "Maximum (%)" +msgstr "Максимум (%)" + +# -- components/cpus.tsx -- + +#: components/cpus.tsx:64 +# (CPU section title) +msgid "CPU" +msgstr "CPU" + +#: components/cpus.tsx:70 +# (CPU advanced mode toggle) +msgid "Advanced" +msgstr "Розширений" + +#: components/cpus.tsx:71 +# (CPU advanced mode toggle description) +msgid "Enables per-thread configuration" +msgstr "Вмикає налаштування для кожного потоку" + +#: components/cpus.tsx:88 +# (CPU Simultaneous MultiThreading toggle) +msgid "SMT" +msgstr "SMT" + +#: components/cpus.tsx:89 +# (CPU SMT toggle description) +msgid "Enables odd-numbered CPUs" +msgstr "Активація одночасної багатопоточності" + +#: components/cpus.tsx:106 +# (CPU thread count slider) +msgid "Threads" +msgstr "Потоки" + +#: components/cpus.tsx:137 +#: components/gpu.tsx:112 +# (Clock speed override toggle) +msgid "Frequency Limits" +msgstr "Обмеження частоти" + +#: components/cpus.tsx:138 +#: components/gpu.tsx:113 +# (Clock speed override toggle description) +msgid "Set bounds on clock speed" +msgstr "Встановіть обмеження на тактову частоту" + +#: components/cpus.tsx:165 +#: components/gpu.tsx:137 +# (Minimum clock speed with unit) +msgid "Minimum (MHz)" +msgstr "Мінімум (MHz)" + +#: components/cpus.tsx:195 +#: components/gpu.tsx:160 +# (Maximum clock speed with unit) +msgid "Maximum (MHz)" +msgstr "Максимум (MHz)" + +# advanced mode + +#: components/cpus.tsx:226 +# (CPU selection slider) +msgid "Selected CPU" +msgstr "Обраний поток CPU" + +#: components/cpus.tsx:246 +# (CPU Online toggle) +msgid "Online" +msgstr "Online" + +#: components/cpus.tsx:247 +# (CPU Online description) +msgid "Allow the CPU thread to do work" +msgstr "Дозволити потоку CPU виконувати роботу" + +#: components/cpus.tsx:342 +# (CPU scheduling governor dropdown -- governor names are not translated) +msgid "Governor" +msgstr "Governor" + +# -- components/debug.tsx -- + +#: components/debug.tsx:29 +# (Debug section title) +msgid "Debug" +msgstr "Debug" + +#: components/debug.tsx:33 +# (Version display for native back-end of PowerTools) +msgid "Native" +msgstr "Native" + +#: components/debug.tsx:47 +# (Mode display for framework of USDPL API) +msgid "Framework" +msgstr "Framework" + +#: components/debug.tsx:54 +# (Display for software implementation in PowerTools which applies settings) +msgid "Driver" +msgstr "Driver" + +# -- components/gpu.tsx -- + +#: components/gpu.tsx:34 +# (GPU section title) +msgid "GPU" +msgstr "GPU" + +#: components/gpu.tsx:39 +# (PPT Limits override toggle) +msgid "PowerPlay Limits" +msgstr "PowerPlay Ліміти" + +#: components/gpu.tsx:40 +# (PPT Limits override toggle description) +msgid "Override APU TDP settings" +msgstr "Перевизначити налаштування TDP APU" + +#: components/gpu.tsx:63 +# (SlowPPT slider with unit) +msgid "SlowPPT (W)" +msgstr "Середній PPT (W)" + +#: components/gpu.tsx:87 +# (FastPPT slider with unit) +msgid "FastPPT (W)" +msgstr "Фактичний PPT (W)" + +#: components/gpu.tsx:112 +# (Reduce memory clock speed toggle) +msgid "Downclock Memory" +msgstr "Зниження частоти пам'яті" + +#: components/gpu.tsx:112 +# (Reduce memory clock speed toggle description) +msgid "Force RAM into low-power mode" +msgstr "Перевести ОЗП у режим зниженого енергоспоживання" From 33e8c7ccc564114c0c3abc7fc695ff8ba3ae9d10 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 3 Jul 2023 22:00:18 -0400 Subject: [PATCH 13/26] Add dev messages functionality --- backend/Cargo.lock | 545 +++++++++++-------------- backend/Cargo.toml | 2 +- backend/limits_core/Cargo.lock | 38 +- backend/limits_core/Cargo.toml | 2 +- backend/limits_core/src/json/base.rs | 9 +- backend/limits_srv/Cargo.lock | 524 ++++++++++-------------- backend/limits_srv/Cargo.toml | 4 +- backend/limits_srv/pt_limits.json | 9 +- backend/src/api/message.rs | 141 +++++++ backend/src/api/mod.rs | 1 + backend/src/consts.rs | 2 + backend/src/main.rs | 6 +- backend/src/settings/detect/mod.rs | 1 + backend/src/settings/detect/utility.rs | 16 + backend/src/settings/mod.rs | 2 +- src/backend.ts | 19 + src/components/message.tsx | 56 +++ src/consts.ts | 2 + src/index.tsx | 7 + 19 files changed, 740 insertions(+), 646 deletions(-) create mode 100644 backend/src/api/message.rs create mode 100644 src/components/message.tsx diff --git a/backend/Cargo.lock b/backend/Cargo.lock index 3c098c3..107ceca 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -2,6 +2,15 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +dependencies = [ + "gimli", +] + [[package]] name = "adler" version = "1.0.2" @@ -46,9 +55,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" dependencies = [ "memchr", ] @@ -68,6 +77,12 @@ dependencies = [ "alloc-no-stdlib", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -85,18 +100,18 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.23", ] [[package]] name = "async-trait" -version = "0.1.68" +version = "0.1.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "7b2d0f03b3640e3a630367e40c468cb7f309529c708ed1d88597047b0e7c6ef7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.23", ] [[package]] @@ -105,6 +120,21 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "backtrace" +version = "0.3.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + [[package]] name = "base64" version = "0.13.1" @@ -113,9 +143,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "bindgen" @@ -166,9 +196,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.12.1" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "bytecount" @@ -211,13 +241,13 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.24" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" dependencies = [ + "android-tzdata", "iana-time-zone", "js-sys", - "num-integer", "num-traits", "time 0.1.45", "wasm-bindgen", @@ -253,16 +283,6 @@ dependencies = [ "cc", ] -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] - [[package]] name = "core-foundation-sys" version = "0.8.4" @@ -271,9 +291,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c" dependencies = [ "libc", ] @@ -306,55 +326,11 @@ dependencies = [ "cipher", ] -[[package]] -name = "cxx" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93" -dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b" -dependencies = [ - "cc", - "codespan-reporting", - "once_cell", - "proc-macro2", - "quote", - "scratch", - "syn 2.0.15", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.15", -] - [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", @@ -439,6 +415,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "equivalent" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" + [[package]] name = "errno" version = "0.2.8" @@ -462,9 +444,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" dependencies = [ "crc32fast", "miniz_oxide", @@ -478,9 +460,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] @@ -539,9 +521,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", "libc", @@ -558,6 +540,12 @@ dependencies = [ "encoding", ] +[[package]] +name = "gimli" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" + [[package]] name = "glob" version = "0.3.1" @@ -566,9 +554,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "h2" -version = "0.3.18" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21" +checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" dependencies = [ "bytes", "fnv", @@ -576,7 +564,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.3", "slab", "tokio", "tokio-util", @@ -589,6 +577,12 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + [[package]] name = "headers" version = "0.3.8" @@ -616,12 +610,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.2.6" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" [[package]] name = "hex" @@ -665,9 +656,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.26" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -689,9 +680,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.56" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -703,19 +694,18 @@ dependencies = [ [[package]] name = "iana-time-zone-haiku" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "cxx", - "cxx-build", + "cc", ] [[package]] name = "idna" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -728,20 +718,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", ] [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" [[package]] name = "js-sys" -version = "0.3.61" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] @@ -760,9 +760,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.142" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libloading" @@ -799,29 +799,17 @@ dependencies = [ [[package]] name = "limits_core" -version = "2.0.0" +version = "2.0.1" dependencies = [ "serde", "serde_json", ] -[[package]] -name = "link-cplusplus" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" -dependencies = [ - "cc", -] - [[package]] name = "log" -version = "0.4.17" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" [[package]] name = "memchr" @@ -853,37 +841,40 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", - "log", "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys", ] [[package]] -name = "multiparty" -version = "0.1.0" +name = "multer" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed1ec6589a6d4a1e0b33b4c0a3f6ee96dfba88ebdb3da51403fd7cf0a24a4b04" +checksum = "01acbdc23469fd8fe07ab135923371d5f5a422fbf9c522158677c8eb15bc51c2" dependencies = [ "bytes", - "futures-core", + "encoding_rs", + "futures-util", + "http", "httparse", + "log", "memchr", - "pin-project-lite", - "try-lock", + "mime", + "spin", + "version_check", ] [[package]] @@ -907,16 +898,6 @@ dependencies = [ "nom", ] -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.15" @@ -928,9 +909,9 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ "hermit-abi", "libc", @@ -973,10 +954,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b2b2cbbfd8defa51ff24450a61d73b3ff3e158484ddd274a883e886e6fbaa78" [[package]] -name = "once_cell" -version = "1.17.1" +name = "object" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "opaque-debug" @@ -1003,35 +993,35 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pin-project" -version = "1.0.12" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.23", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" [[package]] name = "pin-utils" @@ -1086,18 +1076,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.26" +version = "1.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" dependencies = [ "proc-macro2", ] @@ -1134,9 +1124,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.8.1" +version = "1.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" +checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" dependencies = [ "aho-corasick", "memchr", @@ -1145,9 +1135,15 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustc-hash" @@ -1157,18 +1153,18 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustls-pemfile" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.0", + "base64 0.21.2", ] [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" [[package]] name = "scoped-tls" @@ -1176,37 +1172,31 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" -[[package]] -name = "scratch" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" - [[package]] name = "serde" -version = "1.0.160" +version = "1.0.166" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" +checksum = "d01b7404f9d441d3ad40e6a636a7782c377d2abdbe4fa2440e2edcc2f4f10db8" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.160" +version = "1.0.166" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" +checksum = "5dd83d6dde2b6b2d466e14d9d1acce8816dedee94f735eac6395808b3483c6d6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.23", ] [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "46266871c240a00b8f503b877622fe33430b3c7d963bdc0f2adc511e54a1eae3" dependencies = [ "itoa", "ryu", @@ -1250,7 +1240,7 @@ checksum = "acee08041c5de3d5048c8b3f6f13fafb3026b24ba43c6a695a0c76179b844369" dependencies = [ "log", "termcolor", - "time 0.3.20", + "time 0.3.22", ] [[package]] @@ -1272,6 +1262,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "subtle" version = "2.4.1" @@ -1291,9 +1287,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.15" +version = "2.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" dependencies = [ "proc-macro2", "quote", @@ -1326,7 +1322,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.23", ] [[package]] @@ -1342,9 +1338,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.20" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" +checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd" dependencies = [ "itoa", "libc", @@ -1356,15 +1352,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36" +checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" dependencies = [ "time-core", ] @@ -1386,11 +1382,12 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.27.0" +version = "1.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" +checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" dependencies = [ "autocfg", + "backtrace", "bytes", "libc", "mio", @@ -1402,9 +1399,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.12" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", "pin-project-lite", @@ -1425,9 +1422,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ "bytes", "futures-core", @@ -1439,17 +1436,17 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.1" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" [[package]] name = "toml_edit" -version = "0.19.8" +version = "0.19.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" +checksum = "266f016b7f039eec8a1a80dfe6156b633d208b9fccca5e4db1d6775b0c4e34a7" dependencies = [ - "indexmap", + "indexmap 2.0.0", "toml_datetime", "winnow", ] @@ -1474,9 +1471,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", ] @@ -1529,9 +1526,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" [[package]] name = "unicode-normalization" @@ -1542,12 +1539,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-width" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" - [[package]] name = "universal-hash" version = "0.4.1" @@ -1560,11 +1551,11 @@ dependencies = [ [[package]] name = "ureq" -version = "2.6.2" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "338b31dd1314f68f3aabf3ed57ab922df95ffcd902476ca7ba3c4ce7b908c46d" +checksum = "0b11c96ac7ee530603dcdf68ed1557050f374ce55a5a07193ebf8cbc9f8927e9" dependencies = [ - "base64 0.13.1", + "base64 0.21.2", "brotli-decompressor", "encoding_rs", "flate2", @@ -1577,9 +1568,9 @@ dependencies = [ [[package]] name = "url" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" dependencies = [ "form_urlencoded", "idna", @@ -1628,19 +1619,18 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] [[package]] name = "warp" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27e1a710288f0f91a98dd8a74f05b76a10768db245ce183edf64dc1afdc3016c" +checksum = "ba431ef570df1287f7f8b07e376491ad54f84d26ac473489427231e1718e1f69" dependencies = [ "bytes", "futures-channel", @@ -1651,7 +1641,7 @@ dependencies = [ "log", "mime", "mime_guess", - "multiparty", + "multer", "percent-encoding", "pin-project", "rustls-pemfile", @@ -1681,9 +1671,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1691,24 +1681,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.23", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1716,22 +1706,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.23", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "which" @@ -1781,53 +1771,32 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.48.0", + "windows-targets", ] [[package]] name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", -] - -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] - -[[package]] -name = "windows-targets" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows-targets", ] [[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" +name = "windows-targets" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] [[package]] name = "windows_aarch64_gnullvm" @@ -1835,72 +1804,36 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.48.0" @@ -1909,9 +1842,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.1" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8970b36c66498d8ff1d66685dc86b91b29db0c7739899012f63a63814b4b28" +checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" dependencies = [ "memchr", ] diff --git a/backend/Cargo.toml b/backend/Cargo.toml index b6d2e47..042454a 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -29,7 +29,7 @@ limits_core = { version = "2", path = "./limits_core" } regex = "1" libryzenadj = { version = "0.12" } # ureq's tls feature does not like musl targets -ureq = { version = "2.5", features = ["json", "gzip", "brotli", "charset"], default-features = false, optional = true } +ureq = { version = "2", features = ["json", "gzip", "brotli", "charset"], default-features = false, optional = true } [features] default = ["online", "decky"] diff --git a/backend/limits_core/Cargo.lock b/backend/limits_core/Cargo.lock index ac3e0ed..a3d5955 100644 --- a/backend/limits_core/Cargo.lock +++ b/backend/limits_core/Cargo.lock @@ -4,13 +4,13 @@ version = 3 [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" [[package]] name = "limits_core" -version = "2.0.0" +version = "2.0.1" dependencies = [ "serde", "serde_json", @@ -18,42 +18,42 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.26" +version = "1.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" dependencies = [ "proc-macro2", ] [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" [[package]] name = "serde" -version = "1.0.160" +version = "1.0.166" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" +checksum = "d01b7404f9d441d3ad40e6a636a7782c377d2abdbe4fa2440e2edcc2f4f10db8" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.160" +version = "1.0.166" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" +checksum = "5dd83d6dde2b6b2d466e14d9d1acce8816dedee94f735eac6395808b3483c6d6" dependencies = [ "proc-macro2", "quote", @@ -62,9 +62,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "46266871c240a00b8f503b877622fe33430b3c7d963bdc0f2adc511e54a1eae3" dependencies = [ "itoa", "ryu", @@ -73,9 +73,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.15" +version = "2.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" dependencies = [ "proc-macro2", "quote", @@ -84,6 +84,6 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" diff --git a/backend/limits_core/Cargo.toml b/backend/limits_core/Cargo.toml index 7dd5c63..7d2f721 100644 --- a/backend/limits_core/Cargo.toml +++ b/backend/limits_core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "limits_core" -version = "2.0.0" +version = "2.0.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/backend/limits_core/src/json/base.rs b/backend/limits_core/src/json/base.rs index 41e9801..cbb77fc 100644 --- a/backend/limits_core/src/json/base.rs +++ b/backend/limits_core/src/json/base.rs @@ -170,7 +170,14 @@ impl Default for Base { ] } ], - messages: Vec::new(), + messages: vec![ + super::DeveloperMessage { + id: 1, + title: "Welcome".to_owned(), + body: "Thanks for installing PowerTools! For more information, please check the wiki. For bugs and requests, please create an issue on GitHub.".to_owned(), + url: Some("https://github.com/NGnius/PowerTools/wiki".to_owned()), + } + ], refresh: Some("http://limits.ngni.us:45000/powertools/v1".to_owned()) } } diff --git a/backend/limits_srv/Cargo.lock b/backend/limits_srv/Cargo.lock index 5f1434c..1b8b3ee 100644 --- a/backend/limits_srv/Cargo.lock +++ b/backend/limits_srv/Cargo.lock @@ -2,6 +2,27 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -17,6 +38,21 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "backtrace" +version = "0.3.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + [[package]] name = "base64" version = "0.13.1" @@ -25,9 +61,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "bitflags" @@ -46,9 +82,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.12.1" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "byteorder" @@ -76,29 +112,19 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.24" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" dependencies = [ + "android-tzdata", "iana-time-zone", "js-sys", - "num-integer", "num-traits", "time", "wasm-bindgen", "winapi", ] -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] - [[package]] name = "core-foundation-sys" version = "0.8.4" @@ -107,9 +133,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c" dependencies = [ "libc", ] @@ -124,60 +150,25 @@ dependencies = [ "typenum", ] -[[package]] -name = "cxx" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61f1b6389c3fe1c316bf8a4dccc90a38208354b330925bce1f74a6c4756eb93" -dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cee708e8962df2aeb38f594aae5d827c022b6460ac71a7a3e2c3c2aae5a07b" -dependencies = [ - "cc", - "codespan-reporting", - "once_cell", - "proc-macro2", - "quote", - "scratch", - "syn 2.0.15", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7944172ae7e4068c533afbb984114a56c46e9ccddda550499caa222902c7f7bb" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.94" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2345488264226bf682893e25de0769f3360aac9957980ec49361b083ddaa5bc5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.15", -] - [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", ] +[[package]] +name = "encoding_rs" +version = "0.8.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +dependencies = [ + "cfg-if", +] + [[package]] name = "fnv" version = "1.0.7" @@ -186,9 +177,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] @@ -247,9 +238,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", "libc", @@ -257,10 +248,16 @@ dependencies = [ ] [[package]] -name = "h2" -version = "0.3.18" +name = "gimli" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" + +[[package]] +name = "h2" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" dependencies = [ "bytes", "fnv", @@ -308,12 +305,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.2.6" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" [[package]] name = "http" @@ -351,9 +345,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.26" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -375,9 +369,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.56" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0722cd7114b7de04316e7ea5456a0bbb20e4adb46fd27a3697adb812cff0f37c" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -389,19 +383,18 @@ dependencies = [ [[package]] name = "iana-time-zone-haiku" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "cxx", - "cxx-build", + "cc", ] [[package]] name = "idna" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -419,28 +412,28 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" [[package]] name = "js-sys" -version = "0.3.61" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] [[package]] name = "libc" -version = "0.2.142" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "limits_core" -version = "1.0.0" +version = "2.0.1" dependencies = [ "serde", "serde_json", @@ -448,7 +441,7 @@ dependencies = [ [[package]] name = "limits_srv" -version = "1.0.0" +version = "2.0.1" dependencies = [ "chrono", "limits_core", @@ -458,23 +451,11 @@ dependencies = [ "warp", ] -[[package]] -name = "link-cplusplus" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" -dependencies = [ - "cc", -] - [[package]] name = "log" -version = "0.4.17" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" [[package]] name = "memchr" @@ -499,39 +480,41 @@ dependencies = [ ] [[package]] -name = "mio" -version = "0.8.6" +name = "miniz_oxide" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", - "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.45.0", + "windows-sys", ] [[package]] -name = "multiparty" -version = "0.1.0" +name = "multer" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed1ec6589a6d4a1e0b33b4c0a3f6ee96dfba88ebdb3da51403fd7cf0a24a4b04" +checksum = "01acbdc23469fd8fe07ab135923371d5f5a422fbf9c522158677c8eb15bc51c2" dependencies = [ "bytes", - "futures-core", + "encoding_rs", + "futures-util", + "http", "httparse", + "log", "memchr", - "pin-project-lite", - "try-lock", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", + "mime", + "spin", + "version_check", ] [[package]] @@ -545,51 +528,60 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ "hermit-abi", "libc", ] [[package]] -name = "once_cell" -version = "1.17.1" +name = "object" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pin-project" -version = "1.0.12" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" [[package]] name = "pin-utils" @@ -605,18 +597,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.26" +version = "1.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" dependencies = [ "proc-macro2", ] @@ -652,19 +644,25 @@ dependencies = [ ] [[package]] -name = "rustls-pemfile" -version = "1.0.2" +name = "rustc-demangle" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustls-pemfile" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.0", + "base64 0.21.2", ] [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" [[package]] name = "scoped-tls" @@ -672,37 +670,31 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" -[[package]] -name = "scratch" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" - [[package]] name = "serde" -version = "1.0.160" +version = "1.0.166" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" +checksum = "d01b7404f9d441d3ad40e6a636a7782c377d2abdbe4fa2440e2edcc2f4f10db8" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.160" +version = "1.0.166" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" +checksum = "5dd83d6dde2b6b2d466e14d9d1acce8816dedee94f735eac6395808b3483c6d6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn", ] [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "46266871c240a00b8f503b877622fe33430b3c7d963bdc0f2adc511e54a1eae3" dependencies = [ "itoa", "ryu", @@ -752,36 +744,22 @@ dependencies = [ ] [[package]] -name = "syn" -version = "1.0.109" +name = "spin" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "syn" +version = "2.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] -[[package]] -name = "syn" -version = "2.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "termcolor" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" -dependencies = [ - "winapi-util", -] - [[package]] name = "thiserror" version = "1.0.40" @@ -799,7 +777,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn", ] [[package]] @@ -830,11 +808,12 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.28.0" +version = "1.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c786bf8134e5a3a166db9b29ab8f48134739014a3eca7bc6bfa95d673b136f" +checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" dependencies = [ "autocfg", + "backtrace", "bytes", "libc", "mio", @@ -842,7 +821,7 @@ dependencies = [ "pin-project-lite", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -853,7 +832,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn", ] [[package]] @@ -901,10 +880,11 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.38" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9cf6a813d3f40c88b0b6b6f29a5c95c6cdbf97c1f9cc53fb820200f5ad814d" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ + "cfg-if", "log", "pin-project-lite", "tracing-core", @@ -912,9 +892,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", ] @@ -967,9 +947,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" [[package]] name = "unicode-normalization" @@ -980,17 +960,11 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-width" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" - [[package]] name = "url" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" dependencies = [ "form_urlencoded", "idna", @@ -1011,19 +985,18 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] [[package]] name = "warp" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27e1a710288f0f91a98dd8a74f05b76a10768db245ce183edf64dc1afdc3016c" +checksum = "ba431ef570df1287f7f8b07e376491ad54f84d26ac473489427231e1718e1f69" dependencies = [ "bytes", "futures-channel", @@ -1034,7 +1007,7 @@ dependencies = [ "log", "mime", "mime_guess", - "multiparty", + "multer", "percent-encoding", "pin-project", "rustls-pemfile", @@ -1064,9 +1037,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1074,24 +1047,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 1.0.109", + "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1099,22 +1072,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "winapi" @@ -1132,15 +1105,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -1153,16 +1117,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.48.0", -] - -[[package]] -name = "windows-sys" -version = "0.45.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" -dependencies = [ - "windows-targets 0.42.2", + "windows-targets", ] [[package]] @@ -1171,117 +1126,60 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.0", + "windows-targets", ] [[package]] name = "windows-targets" -version = "0.42.2" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows-targets" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" -dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.48.0" diff --git a/backend/limits_srv/Cargo.toml b/backend/limits_srv/Cargo.toml index 11cd344..2d529a8 100644 --- a/backend/limits_srv/Cargo.toml +++ b/backend/limits_srv/Cargo.toml @@ -1,12 +1,12 @@ [package] name = "limits_srv" -version = "2.0.0" +version = "2.0.1" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -limits_core = { version = "2.0.0", path = "../limits_core" } +limits_core = { version = "2.0.1", path = "../limits_core" } chrono = { version = "0.4" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" diff --git a/backend/limits_srv/pt_limits.json b/backend/limits_srv/pt_limits.json index c7797f6..2b34975 100644 --- a/backend/limits_srv/pt_limits.json +++ b/backend/limits_srv/pt_limits.json @@ -289,6 +289,13 @@ ] } ], - "messages": [], + "messages": [ + { + "id": 1, + "title": "Welcome", + "body": "Thanks for installing PowerTools! For more information, please check the wiki. For bugs and requests, please create an issue on GitHub.", + "url": "https://github.com/NGnius/PowerTools/wiki" + } + ], "refresh": "http://limits.ngni.us:45000/powertools/v1" } \ No newline at end of file diff --git a/backend/src/api/message.rs b/backend/src/api/message.rs new file mode 100644 index 0000000..d273930 --- /dev/null +++ b/backend/src/api/message.rs @@ -0,0 +1,141 @@ +use std::sync::{atomic::{AtomicU64, Ordering}, Arc}; + +use serde::{Deserialize, Serialize}; + +use usdpl_back::AsyncCallable; +use usdpl_back::core::serdes::Primitive; + +use limits_core::json::DeveloperMessage; + +use crate::MESSAGE_SEEN_ID_FILE; +use crate::utility::settings_dir; + +#[derive(Serialize, Deserialize)] +pub struct ApiMessage { + /// Message identifier + pub id: Option, + /// Message title + pub title: String, + /// Message content + pub body: String, + /// Link for further information + pub url: Option, +} + +impl std::convert::From for ApiMessage { + fn from(other: DeveloperMessage) -> Self { + Self { + id: Some(other.id), + title: other.title, + body: other.body, + url: other.url, + } + } +} + +fn get_dev_messages() -> Vec { + crate::settings::get_dev_messages().drain(..).map(|msg| ApiMessage::from(msg)).collect() +} + +pub struct MessageHandler { + seen: Arc, +} + +impl MessageHandler { + pub fn new() -> Self { + let last_seen_id = if let Ok(last_seen_id_bytes) = std::fs::read(settings_dir().join(MESSAGE_SEEN_ID_FILE)) { + if last_seen_id_bytes.len() >= 8 /* bytes in u64 */ { + u64::from_le_bytes([ + last_seen_id_bytes[0], + last_seen_id_bytes[1], + last_seen_id_bytes[2], + last_seen_id_bytes[3], + last_seen_id_bytes[4], + last_seen_id_bytes[5], + last_seen_id_bytes[6], + last_seen_id_bytes[7], + ]) + } else { + u64::MAX + } + } else { + u64::MIN + }; + Self { + seen: Arc::new(AtomicU64::new(last_seen_id)), + } + } + + pub fn to_callables(self) -> (AsyncMessageGetter, AsyncMessageDismisser) { + ( + AsyncMessageGetter { + seen: self.seen.clone(), + }, + AsyncMessageDismisser { + seen: self.seen.clone(), + } + ) + } +} + +pub struct AsyncMessageGetter { + seen: Arc, +} + +impl AsyncMessageGetter { + fn remove_before_id(id: u64, messages: impl Iterator) -> impl Iterator { + messages.skip_while(move |msg| if let Some(msg_id) = msg.id { msg_id <= id } else { true }) + } +} + +#[async_trait::async_trait] +impl AsyncCallable for AsyncMessageGetter { + async fn call(&self, params: super::ApiParameterType) -> super::ApiParameterType { + let since = if let Some(param0) = params.get(0) { + if let Primitive::Empty = param0 { + self.seen.load(Ordering::Relaxed) + } else if let Primitive::U64(since) = param0 { + *since + } else { + return vec!["get message invalid parameter 0".into()]; + } + } else { + self.seen.load(Ordering::Relaxed) + }; + let mut messages = get_dev_messages(); + Self::remove_before_id(since, messages.drain(..)) + .filter_map(|msg| serde_json::to_string(&msg).ok().map(|x| Primitive::Json(x))) + .collect() + } +} + +pub struct AsyncMessageDismisser { + seen: Arc, +} + +#[async_trait::async_trait] +impl AsyncCallable for AsyncMessageDismisser { + async fn call(&self, params: super::ApiParameterType) -> super::ApiParameterType { + let id = if let Some(param0) = params.get(0) { + if let Primitive::Empty = param0 { + None + } else if let Primitive::U64(since) = param0 { + Some(*since) + } else { + return vec!["dismiss message invalid parameter 0".into()]; + } + } else { + None + }; + if let Some(id) = id { + self.seen.store(id, Ordering::Relaxed); + let filename = settings_dir().join(MESSAGE_SEEN_ID_FILE); + if let Err(e) = std::fs::write(&filename, id.to_le_bytes()) { + log::error!("Failed to write seen id to {}: {}", filename.display(), e); + } + } else { + // TODO clear non-dev messages in cache + } + vec![true.into()] + } +} diff --git a/backend/src/api/mod.rs b/backend/src/api/mod.rs index 8c7a4aa..8dc8add 100644 --- a/backend/src/api/mod.rs +++ b/backend/src/api/mod.rs @@ -5,6 +5,7 @@ pub mod cpu; pub mod general; pub mod gpu; pub mod handler; +pub mod message; mod utility; pub(super) type ApiParameterType = Vec; diff --git a/backend/src/consts.rs b/backend/src/consts.rs index 842051a..e296cbe 100644 --- a/backend/src/consts.rs +++ b/backend/src/consts.rs @@ -7,3 +7,5 @@ pub const DEFAULT_SETTINGS_FILE: &str = "default_settings.json"; pub const DEFAULT_SETTINGS_NAME: &str = "Main"; pub const LIMITS_FILE: &str = "limits_cache.json"; + +pub const MESSAGE_SEEN_ID_FILE: &str = "seen_message.bin"; diff --git a/backend/src/main.rs b/backend/src/main.rs index 9e50f9e..9a97973 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -96,6 +96,8 @@ fn main() -> Result<(), ()> { let _resume_handle = resume_worker::spawn(api_sender.clone()); let _power_handle = power_worker::spawn(api_sender.clone()); + let (message_getter, message_dismisser) = api::message::MessageHandler::new().to_callables(); + let instance = Instance::new(PORT) .register("V_INFO", |_: Vec| { #[cfg(debug_assertions)] @@ -283,7 +285,9 @@ fn main() -> Result<(), ()> { .register( "GENERAL_on_unplugged", api::battery::on_unplugged(api_sender.clone()), - ); + ) + .register_async("MESSAGE_get", message_getter) + .register_async("MESSAGE_dismiss", message_dismisser); if let Err(e) = loaded_settings.on_set() { e.iter() diff --git a/backend/src/settings/detect/mod.rs b/backend/src/settings/detect/mod.rs index a514eb9..bb46e2c 100644 --- a/backend/src/settings/detect/mod.rs +++ b/backend/src/settings/detect/mod.rs @@ -3,3 +3,4 @@ pub mod limits_worker; mod utility; pub use auto_detect::{auto_detect0, auto_detect_provider}; +pub use utility::get_dev_messages; diff --git a/backend/src/settings/detect/utility.rs b/backend/src/settings/detect/utility.rs index 16aec42..c278e66 100644 --- a/backend/src/settings/detect/utility.rs +++ b/backend/src/settings/detect/utility.rs @@ -1,3 +1,19 @@ +use limits_core::json::{DeveloperMessage, Base}; + pub fn limits_path() -> std::path::PathBuf { crate::utility::settings_dir().join(crate::consts::LIMITS_FILE) } + +// NOTE: eats errors +pub fn get_dev_messages() -> Vec { + let limits_path = limits_path(); + if let Ok(file) = std::fs::File::open(&limits_path) { + if let Ok(base) = serde_json::from_reader::<_, Base>(file) { + base.messages + } else { + vec![] + } + } else { + vec![] + } +} diff --git a/backend/src/settings/mod.rs b/backend/src/settings/mod.rs index ca459e6..c3a0044 100644 --- a/backend/src/settings/mod.rs +++ b/backend/src/settings/mod.rs @@ -11,7 +11,7 @@ pub mod generic_amd; pub mod steam_deck; pub mod unknown; -pub use detect::{auto_detect0, auto_detect_provider, limits_worker::spawn as limits_worker_spawn}; +pub use detect::{auto_detect0, auto_detect_provider, limits_worker::spawn as limits_worker_spawn, get_dev_messages}; pub use driver::Driver; pub use general::{General, SettingVariant, Settings}; pub use min_max::{min_max_from_json, MinMax}; diff --git a/src/backend.ts b/src/backend.ts index 126cb82..17dac52 100644 --- a/src/backend.ts +++ b/src/backend.ts @@ -306,3 +306,22 @@ export async function onPluggedIn(): Promise { export async function onUnplugged(): Promise { return (await call_backend("GENERAL_on_unplugged", []))[0]; } + +export type Message = { + /// Message identifier + id: number | null, + /// Message title + title: string, + /// Message content + body: string, + /// Link for further information + url: string | null, +}; + +export async function getMessages(since: number | null): Promise { + return (await call_backend("MESSAGE_get", [since])); +} + +export async function dismissMessage(id: number): Promise { + return (await call_backend("MESSAGE_dismiss", [id]))[0]; +} diff --git a/src/components/message.tsx b/src/components/message.tsx new file mode 100644 index 0000000..f343a41 --- /dev/null +++ b/src/components/message.tsx @@ -0,0 +1,56 @@ +import { Component, Fragment } from "react"; +import * as backend from "../backend"; + +import { + Field, + staticClasses, + PanelSectionRow, + ButtonItem, +} from "decky-frontend-lib"; + +import { MESSAGE_LIST } from "../consts"; + +import { set_value, get_value, tr } from "usdpl-front"; + +export class DevMessages extends Component { + constructor(props: backend.IdcProps) { + super(props); + this.state = { + reloadThingy: "/shrug", + }; + } + + render() { + const reloadGUI = (x: string) => this.setState({reloadThingy: x}); + const messages: backend.Message[] = get_value(MESSAGE_LIST) as backend.Message[]; + if (messages.length != 0) { + const message = messages[0]; + return ( +
+ {message.title} +
+ + + {message.body} + + { + if (message.id) { + backend.dismissMessage(message.id); + } + messages.shift(); + set_value(MESSAGE_LIST, messages); + reloadGUI("MessageDismissed"); + }} + > + {tr("Dismiss")} + + +
+ ) + } else { + return + } + } +} diff --git a/src/consts.ts b/src/consts.ts index 6b6a71a..86a3fd3 100644 --- a/src/consts.ts +++ b/src/consts.ts @@ -31,3 +31,5 @@ export const PERSISTENT_GEN = "GENERAL_persistent"; export const NAME_GEN = "GENERAL_name"; export const PATH_GEN = "GENERAL_path"; +export const MESSAGE_LIST = "MESSAGE_messages"; + diff --git a/src/index.tsx b/src/index.tsx index f69def9..01c98a7 100755 --- a/src/index.tsx +++ b/src/index.tsx @@ -58,12 +58,15 @@ import { PERSISTENT_GEN, NAME_GEN, PATH_GEN, + + MESSAGE_LIST, } from "./consts"; import { set_value, get_value } from "usdpl-front"; import { Debug } from "./components/debug"; import { Gpu } from "./components/gpu"; import { Battery } from "./components/battery"; import { Cpus } from "./components/cpus"; +import { DevMessages } from "./components/message"; var periodicHook: NodeJS.Timer | null = null; var lifetimeHook: any = null; @@ -153,6 +156,8 @@ const reload = function() { backend.resolve(backend.getInfo(), (info: string) => { set_value(BACKEND_INFO, info) }); backend.resolve(backend.getDriverProviderName("gpu"), (driver: string) => { set_value(DRIVER_INFO, driver) }); + + backend.resolve(backend.getMessages(null), (messages: backend.Message[]) => { set_value(MESSAGE_LIST, messages) }); }; // init USDPL WASM and connection to back-end @@ -247,6 +252,8 @@ const Content: VFC<{ serverAPI: ServerAPI }> = ({}) => { return ( + + From 52f01ad7f399731b5ed80e22794de6631e4b913d Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sun, 23 Jul 2023 21:16:36 -0400 Subject: [PATCH 14/26] Update logo --- assets/icon.svg | 260 ++++++++++++++++++++++++++---- assets/logo.png | Bin 10864 -> 18705 bytes assets/sticker.svg | 384 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 615 insertions(+), 29 deletions(-) create mode 100644 assets/sticker.svg diff --git a/assets/icon.svg b/assets/icon.svg index 93a7902..6758ab3 100644 --- a/assets/icon.svg +++ b/assets/icon.svg @@ -7,9 +7,9 @@ viewBox="0 0 483.77954 483.77954" version="1.1" id="svg5" - inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)" + inkscape:version="1.2.2 (b0a8486541, 2022-12-01)" sodipodi:docname="icon.svg" - inkscape:export-filename="/home/ngnius/Documents/git-repos/PowerTools/extras/icon.png" + inkscape:export-filename="logo.png" inkscape:export-xdpi="203.2" inkscape:export-ydpi="203.2" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" @@ -30,16 +30,18 @@ width="241.88977px" inkscape:snap-object-midpoints="false" inkscape:zoom="1.4142136" - inkscape:cx="250.66935" - inkscape:cy="188.0904" - inkscape:window-width="1280" - inkscape:window-height="1007" - inkscape:window-x="1280" + inkscape:cx="199.05056" + inkscape:cy="246.07316" + inkscape:window-width="2560" + inkscape:window-height="998" + inkscape:window-x="0" inkscape:window-y="0" - inkscape:window-maximized="0" + inkscape:window-maximized="1" inkscape:current-layer="layer1" inkscape:snap-intersection-paths="true" - inkscape:snap-midpoints="true" /> + inkscape:snap-midpoints="true" + inkscape:showpageshadow="2" + inkscape:deskcolor="#d1d1d1" /> + + cx="59.355446" + cy="88.752792" + r="25" /> + - + y="339" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/logo.png b/assets/logo.png index 94c719c53f7a6f934f484307d640801d202a985a..25a89b49b209a62a68ae96d2da91f2ea177dbeed 100644 GIT binary patch literal 18705 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 diff --git a/assets/sticker.svg b/assets/sticker.svg new file mode 100644 index 0000000..b9cf569 --- /dev/null +++ b/assets/sticker.svg @@ -0,0 +1,384 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Power + Tools + + From 64cb4193f9cf997e61075a2c24ba40d27bac37cb Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sun, 6 Aug 2023 14:49:19 -0400 Subject: [PATCH 15/26] Improve sysfs calls from providers to intelligently find the correct entry to fix #114 --- backend/Cargo.lock | 5 + backend/Cargo.toml | 1 + backend/src/main.rs | 9 +- backend/src/persist/battery.rs | 3 + backend/src/persist/cpu.rs | 3 + backend/src/persist/gpu.rs | 3 + backend/src/settings/generic/battery.rs | 32 +++- backend/src/settings/generic/cpu.rs | 5 + backend/src/settings/generic/gpu.rs | 22 +++ backend/src/settings/steam_deck/battery.rs | 180 +++++++++++++----- backend/src/settings/steam_deck/cpu.rs | 67 +++++-- backend/src/settings/steam_deck/gpu.rs | 139 +++++++++----- backend/src/settings/steam_deck/mod.rs | 2 +- .../settings/steam_deck/power_dpm_force.rs | 34 ++-- backend/src/settings/steam_deck/util.rs | 3 + backend/src/settings/unknown/battery.rs | 1 + backend/src/settings/unknown/cpu.rs | 5 + backend/src/settings/unknown/gpu.rs | 1 + backend/src/settings/util.rs | 12 ++ backend/src/utility.rs | 3 + src/components/message.tsx | 4 +- 21 files changed, 387 insertions(+), 147 deletions(-) diff --git a/backend/Cargo.lock b/backend/Cargo.lock index 107ceca..4d5882f 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -1053,6 +1053,7 @@ dependencies = [ "serde", "serde_json", "simplelog", + "sysfuss", "tokio", "ureq", "usdpl-back", @@ -1296,6 +1297,10 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "sysfuss" +version = "0.1.0" + [[package]] name = "termcolor" version = "1.1.3" diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 042454a..43d4a7b 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -15,6 +15,7 @@ readme = "../README.md" usdpl-back = { version = "0.10.1", features = ["blocking"] }#, path = "../../usdpl-rs/usdpl-back"} serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" +sysfuss = { version = "0.1", path = "../../sysfs-nav", features = ["derive"] } # async tokio = { version = "*", features = ["time"] } diff --git a/backend/src/main.rs b/backend/src/main.rs index 9a97973..41989d3 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -73,10 +73,6 @@ fn main() -> Result<(), ()> { } let _limits_handle = crate::settings::limits_worker_spawn(); - log::info!( - "Detected device automatically, starting with driver: {:?} (This can be overriden)", - crate::settings::auto_detect_provider() - ); let mut loaded_settings = persist::SettingsJson::open(utility::settings_dir().join(DEFAULT_SETTINGS_FILE)) @@ -88,6 +84,11 @@ fn main() -> Result<(), ()> { ) }); + log::info!( + "Detected device automatically {:?}, using driver: {:?} (This can be overriden)", + crate::settings::auto_detect_provider(), loaded_settings.cpus.provider() + ); + log::debug!("Settings: {:?}", loaded_settings); let (api_handler, api_sender) = crate::api::handler::ApiMessageHandler::new(); diff --git a/backend/src/persist/battery.rs b/backend/src/persist/battery.rs index 1e8ed57..57d33bb 100644 --- a/backend/src/persist/battery.rs +++ b/backend/src/persist/battery.rs @@ -9,6 +9,8 @@ pub struct BatteryJson { pub charge_mode: Option, #[serde(default)] pub events: Vec, + #[serde(skip_serializing_if = "Option::is_none")] + pub root: Option, } #[derive(Serialize, Deserialize, Clone)] @@ -24,6 +26,7 @@ impl Default for BatteryJson { charge_rate: None, charge_mode: None, events: Vec::new(), + root: None, } } } diff --git a/backend/src/persist/cpu.rs b/backend/src/persist/cpu.rs index 442206a..e515311 100644 --- a/backend/src/persist/cpu.rs +++ b/backend/src/persist/cpu.rs @@ -12,6 +12,8 @@ pub struct CpuJson { pub online: bool, pub clock_limits: Option>, pub governor: String, + #[serde(skip_serializing_if = "Option::is_none")] + pub root: Option, } impl Default for CpuJson { @@ -20,6 +22,7 @@ impl Default for CpuJson { online: true, clock_limits: None, governor: "schedutil".to_owned(), + root: None, } } } diff --git a/backend/src/persist/gpu.rs b/backend/src/persist/gpu.rs index 933f2c4..7755847 100644 --- a/backend/src/persist/gpu.rs +++ b/backend/src/persist/gpu.rs @@ -10,6 +10,8 @@ pub struct GpuJson { pub slow_ppt: Option, pub clock_limits: Option>, pub slow_memory: bool, + #[serde(skip_serializing_if = "Option::is_none")] + pub root: Option, } impl Default for GpuJson { @@ -19,6 +21,7 @@ impl Default for GpuJson { slow_ppt: None, clock_limits: None, slow_memory: false, + root: None, } } } diff --git a/backend/src/settings/generic/battery.rs b/backend/src/settings/generic/battery.rs index 3390f1f..81464dd 100644 --- a/backend/src/settings/generic/battery.rs +++ b/backend/src/settings/generic/battery.rs @@ -1,6 +1,7 @@ use std::convert::Into; use limits_core::json::GenericBatteryLimit; +use sysfuss::SysEntity; use crate::persist::BatteryJson; use crate::settings::TBattery; @@ -10,6 +11,7 @@ use crate::settings::{OnResume, OnSet, SettingError}; pub struct Battery { #[allow(dead_code)] limits: GenericBatteryLimit, + sysfs: sysfuss::PowerSupplyPath, } impl Into for Battery { @@ -19,6 +21,7 @@ impl Into for Battery { charge_rate: None, charge_mode: None, events: Vec::default(), + root: self.sysfs.root().and_then(|p| p.as_ref().to_str().map(|s| s.to_owned())), } } } @@ -37,18 +40,41 @@ impl Battery { } } + fn find_psu_sysfs(root: Option>) -> sysfuss::PowerSupplyPath { + let root = crate::settings::util::root_or_default_sysfs(root); + match root.power_supply(crate::settings::util::always_satisfied) { + Ok(mut iter) => { + iter.next() + .unwrap_or_else(|| { + log::error!("Failed to find generic battery power_supply in sysfs (no results), using naive fallback"); + root.power_supply_by_name("BAT0") + }) + }, + Err(e) => { + log::error!("Failed to find generic battery power_supply in sysfs ({}), using naive fallback", e); + root.power_supply_by_name("BAT0") + } + } + } + pub fn from_limits(limits: limits_core::json::GenericBatteryLimit) -> Self { // TODO - Self { limits } + Self { + limits, + sysfs: Self::find_psu_sysfs(None::<&'static str>), + } } pub fn from_json_and_limits( - _other: BatteryJson, + other: BatteryJson, _version: u64, limits: limits_core::json::GenericBatteryLimit, ) -> Self { // TODO - Self { limits } + Self { + limits, + sysfs: Self::find_psu_sysfs(other.root) + } } } diff --git a/backend/src/settings/generic/cpu.rs b/backend/src/settings/generic/cpu.rs index b821053..00f7dbe 100644 --- a/backend/src/settings/generic/cpu.rs +++ b/backend/src/settings/generic/cpu.rs @@ -202,6 +202,7 @@ pub struct Cpu { limits: GenericCpuLimit, index: usize, state: crate::state::steam_deck::Cpu, + root: std::path::PathBuf, } /*impl Cpu { @@ -235,6 +236,7 @@ impl FromGenericCpuInfo for Cpu { limits, index: cpu_index, state: crate::state::steam_deck::Cpu::default(), + root: "/".into(), } } @@ -258,6 +260,7 @@ impl FromGenericCpuInfo for Cpu { limits, index: i, state: crate::state::steam_deck::Cpu::default(), + root: other.root.unwrap_or_else(|| "/".to_string()).into(), }, _ => Self { online: other.online, @@ -266,6 +269,7 @@ impl FromGenericCpuInfo for Cpu { limits, index: i, state: crate::state::steam_deck::Cpu::default(), + root: other.root.unwrap_or_else(|| "/".to_string()).into(), }, } } @@ -354,6 +358,7 @@ impl Into for Cpu { online: self.online, clock_limits: self.clock_limits.map(|x| x.into()), governor: self.governor, + root: self.root.to_str().map(|s| s.to_owned()), } } } diff --git a/backend/src/settings/generic/gpu.rs b/backend/src/settings/generic/gpu.rs index b388df1..b8fcb6c 100644 --- a/backend/src/settings/generic/gpu.rs +++ b/backend/src/settings/generic/gpu.rs @@ -1,6 +1,7 @@ use std::convert::Into; use limits_core::json::GenericGpuLimit; +use sysfuss::{BasicEntityPath, SysEntity}; use crate::api::RangeLimit; use crate::persist::GpuJson; @@ -15,6 +16,7 @@ pub struct Gpu { pub slow_ppt: Option, pub clock_limits: Option>, limits: GenericGpuLimit, + sysfs: BasicEntityPath, } impl Gpu { @@ -31,6 +33,23 @@ impl Gpu { } }*/ + fn find_card_sysfs(root: Option>) -> BasicEntityPath { + let root = crate::settings::util::root_or_default_sysfs(root); + match root.class("drm", crate::settings::util::always_satisfied) { + Ok(mut iter) => { + iter.next() + .unwrap_or_else(|| { + log::error!("Failed to find generic gpu drm in sysfs (no results), using naive fallback"); + BasicEntityPath::new(root.as_ref().join("sys/class/drm/card0")) + }) + }, + Err(e) => { + log::error!("Failed to find generic gpu drm in sysfs ({}), using naive fallback", e); + BasicEntityPath::new(root.as_ref().join("sys/class/drm/card0")) + } + } + } + pub fn from_limits(limits: limits_core::json::GenericGpuLimit) -> Self { Self { slow_memory: false, @@ -38,6 +57,7 @@ impl Gpu { slow_ppt: None, clock_limits: None, limits, + sysfs: Self::find_card_sysfs(None::<&'static str>), } } @@ -65,6 +85,7 @@ impl Gpu { }, clock_limits: clock_lims, limits, + sysfs: Self::find_card_sysfs(other.root) } } } @@ -77,6 +98,7 @@ impl Into for Gpu { slow_ppt: self.slow_ppt, clock_limits: self.clock_limits.map(|x| x.into()), slow_memory: false, + root: self.sysfs.root().and_then(|p| p.as_ref().to_str().map(|s| s.to_owned())) } } } diff --git a/backend/src/settings/steam_deck/battery.rs b/backend/src/settings/steam_deck/battery.rs index 2405380..a4327fc 100644 --- a/backend/src/settings/steam_deck/battery.rs +++ b/backend/src/settings/steam_deck/battery.rs @@ -1,4 +1,8 @@ use std::convert::Into; +use std::sync::Arc; + +use sysfuss::{PowerSupplyAttribute, PowerSupplyPath, HwMonAttribute, HwMonAttributeItem, HwMonAttributeType, HwMonPath, SysEntity, SysEntityAttributesExt, SysAttribute}; +use sysfuss::capability::attributes; use super::oc_limits::{BatteryLimits, OverclockLimits}; use super::util::ChargeMode; @@ -15,6 +19,8 @@ pub struct Battery { limits: BatteryLimits, state: crate::state::steam_deck::Battery, driver_mode: crate::persist::DriverJson, + sysfs_bat: PowerSupplyPath, + sysfs_hwmon: Arc, } #[derive(Debug, Clone)] @@ -32,6 +38,7 @@ struct EventInstruction { charge_rate: Option, charge_mode: Option, is_triggered: bool, + sysfs_hwmon: Arc, } impl OnPowerEvent for EventInstruction { @@ -109,7 +116,7 @@ impl EventInstruction { } } - fn from_json(other: BatteryEventJson, _version: u64) -> Self { + fn from_json(other: BatteryEventJson, _version: u64, hwmon: Arc) -> Self { Self { trigger: Self::str_to_trigger(&other.trigger).unwrap_or(EventTrigger::Ignored), charge_rate: other.charge_rate, @@ -118,6 +125,7 @@ impl EventInstruction { .map(|x| Battery::str_to_charge_mode(&x)) .flatten(), is_triggered: false, + sysfs_hwmon: hwmon, } } @@ -136,12 +144,13 @@ impl EventInstruction { fn set_charge_rate(&self) -> Result<(), SettingError> { if let Some(charge_rate) = self.charge_rate { - usdpl_back::api::files::write_single(BATTERY_CHARGE_RATE_PATH, charge_rate) - .map_err(|e| SettingError { - msg: format!("Failed to write to `{}`: {}", BATTERY_CHARGE_RATE_PATH, e), + let attr = HwMonAttribute::custom("maximum_battery_charge_rate"); + self.sysfs_hwmon.set(attr, charge_rate).map_err( + |e| SettingError { + msg: format!("Failed to write to `{:?}`: {}", attr, e), setting: crate::settings::SettingVariant::Battery, - }) - .map(|_| ()) + }, + ) } else { Ok(()) } @@ -173,13 +182,32 @@ impl Into for EventInstruction { const BATTERY_VOLTAGE: f64 = 7.7; -const BATTERY_CHARGE_RATE_PATH: &str = "/sys/class/hwmon/hwmon5/maximum_battery_charge_rate"; // write-only +/*const BATTERY_CHARGE_RATE_PATH: &str = "/sys/class/hwmon/hwmon5/maximum_battery_charge_rate"; // write-only const BATTERY_CURRENT_NOW_PATH: &str = "/sys/class/power_supply/BAT1/current_now"; // read-only const BATTERY_CHARGE_NOW_PATH: &str = "/sys/class/power_supply/BAT1/charge_now"; // read-only const BATTERY_CHARGE_FULL_PATH: &str = "/sys/class/power_supply/BAT1/charge_full"; // read-only const BATTERY_CHARGE_DESIGN_PATH: &str = "/sys/class/power_supply/BAT1/charge_full_design"; // read-only const USB_PD_IN_MVOLTAGE_PATH: &str = "/sys/class/hwmon/hwmon5/in0_input"; // read-only -const USB_PD_IN_CURRENT_PATH: &str = "/sys/class/hwmon/hwmon5/curr1_input"; // read-only +const USB_PD_IN_CURRENT_PATH: &str = "/sys/class/hwmon/hwmon5/curr1_input"; // read-only*/ + + +const BATTERY_NEEDS: &[PowerSupplyAttribute] = &[ + PowerSupplyAttribute::Type, + PowerSupplyAttribute::CurrentNow, + PowerSupplyAttribute::ChargeNow, + PowerSupplyAttribute::ChargeFull, + PowerSupplyAttribute::ChargeFullDesign, + PowerSupplyAttribute::CycleCount, + PowerSupplyAttribute::Capacity, + PowerSupplyAttribute::CapacityLevel, +]; + +const HWMON_NEEDS: &[HwMonAttribute] = &[ + HwMonAttribute::name(), + HwMonAttribute::new(HwMonAttributeType::In, 0, HwMonAttributeItem::Input), + HwMonAttribute::new(HwMonAttributeType::Curr, 1, HwMonAttributeItem::Input), + //HwMonAttribute::custom("maximum_battery_charge_rate"), // NOTE: Cannot filter by custom capabilities +]; impl Battery { #[inline] @@ -191,6 +219,7 @@ impl Battery { } else { crate::persist::DriverJson::SteamDeckAdvance }; + let hwmon_sys = Arc::new(Self::find_hwmon_sysfs(None::<&'static str>)); match version { 0 => Self { charge_rate: other.charge_rate, @@ -201,11 +230,13 @@ impl Battery { events: other .events .into_iter() - .map(|x| EventInstruction::from_json(x, version)) + .map(|x| EventInstruction::from_json(x, version, hwmon_sys.clone())) .collect(), limits: oc_limits, state: crate::state::steam_deck::Battery::default(), driver_mode: driver, + sysfs_bat: Self::find_battery_sysfs(None::<&'static str>), + sysfs_hwmon: hwmon_sys, }, _ => Self { charge_rate: other.charge_rate, @@ -216,15 +247,52 @@ impl Battery { events: other .events .into_iter() - .map(|x| EventInstruction::from_json(x, version)) + .map(|x| EventInstruction::from_json(x, version, hwmon_sys.clone())) .collect(), limits: oc_limits, state: crate::state::steam_deck::Battery::default(), driver_mode: driver, + sysfs_bat: Self::find_battery_sysfs(None::<&'static str>), + sysfs_hwmon: hwmon_sys, }, } } + fn find_battery_sysfs(root: Option>) -> PowerSupplyPath { + let root = crate::settings::util::root_or_default_sysfs(root); + match root.power_supply(attributes(BATTERY_NEEDS.into_iter().copied())) { + Ok(mut iter) => { + iter.next() + .unwrap_or_else(|| { + log::error!("Failed to find SteamDeck battery power_supply in sysfs (no results), using naive fallback"); + root.power_supply_by_name("BAT1") + }) + }, + Err(e) => { + log::error!("Failed to find SteamDeck battery power_supply in sysfs ({}), using naive fallback", e); + root.power_supply_by_name("BAT1") + } + } + } + + fn find_hwmon_sysfs(root: Option>) -> HwMonPath { + let root = crate::settings::util::root_or_default_sysfs(root); + match root.hwmon_by_name(super::util::JUPITER_HWMON_NAME) { + Ok(hwmon) => { + if hwmon.capable(attributes(HWMON_NEEDS.into_iter().copied())) { + hwmon + } else { + log::error!("Failed to find SteamDeck battery hwmon in sysfs (hwmon by name {} exists but missing attributes), using naive fallback", super::util::JUPITER_HWMON_NAME); + root.hwmon_by_index(5) + } + }, + Err(e) => { + log::error!("Failed to find SteamDeck battery hwmon in sysfs ({}), using naive fallback", e); + root.hwmon_by_index(5) + } + } + } + #[inline] fn charge_mode_to_str(mode: ChargeMode) -> String { match mode { @@ -248,22 +316,24 @@ impl Battery { fn set_charge_rate(&mut self) -> Result<(), SettingError> { if let Some(charge_rate) = self.charge_rate { self.state.charge_rate_set = true; - usdpl_back::api::files::write_single(BATTERY_CHARGE_RATE_PATH, charge_rate).map_err( + let attr = HwMonAttribute::custom("maximum_battery_charge_rate"); + let path = attr.path(&*self.sysfs_hwmon); + self.sysfs_hwmon.set(attr, charge_rate).map_err( |e| SettingError { - msg: format!("Failed to write to `{}`: {}", BATTERY_CHARGE_RATE_PATH, e), + msg: format!("Failed to write to `{}`: {}", path.display(), e), setting: crate::settings::SettingVariant::Battery, }, ) } else if self.state.charge_rate_set { self.state.charge_rate_set = false; - usdpl_back::api::files::write_single( - BATTERY_CHARGE_RATE_PATH, - self.limits.charge_rate.max, + let attr = HwMonAttribute::custom("maximum_battery_charge_rate"); + let path = attr.path(&*self.sysfs_hwmon); + self.sysfs_hwmon.set(attr, self.limits.charge_rate.max,).map_err( + |e| SettingError { + msg: format!("Failed to write to `{}`: {}", path.display(), e), + setting: crate::settings::SettingVariant::Battery, + }, ) - .map_err(|e| SettingError { - msg: format!("Failed to write to `{}`: {}", BATTERY_CHARGE_RATE_PATH, e), - setting: crate::settings::SettingVariant::Battery, - }) } else { Ok(()) } @@ -309,10 +379,11 @@ impl Battery { } } - pub fn read_current_now() -> Result { - match usdpl_back::api::files::read_single::<_, u64, _>(BATTERY_CURRENT_NOW_PATH) { + pub fn read_current_now(&self) -> Result { + let attr = PowerSupplyAttribute::CurrentNow; + match self.sysfs_bat.attribute::(attr) { Err(e) => Err(SettingError { - msg: format!("Failed to read from `{}`: {}", BATTERY_CURRENT_NOW_PATH, e), + msg: format!("Failed to read from `{:?}`: {}", attr, e), setting: crate::settings::SettingVariant::Battery, }), // this value is in uA, while it's set in mA @@ -321,16 +392,17 @@ impl Battery { } } - pub fn read_charge_power() -> Result { - let current = Self::read_usb_current()?; - let voltage = Self::read_usb_voltage()?; + pub fn read_charge_power(&self) -> Result { + let current = self.read_usb_current()?; + let voltage = self.read_usb_voltage()?; Ok(current * voltage) } - pub fn read_charge_now() -> Result { - match usdpl_back::api::files::read_single::<_, u64, _>(BATTERY_CHARGE_NOW_PATH) { + pub fn read_charge_now(&self) -> Result { + let attr = PowerSupplyAttribute::ChargeNow; + match self.sysfs_bat.attribute::(attr) { Err(e) => Err(SettingError { - msg: format!("Failed to read from `{}`: {}", BATTERY_CHARGE_NOW_PATH, e), + msg: format!("Failed to read from `{:?}`: {}", attr, e), setting: crate::settings::SettingVariant::Battery, }), // convert to Wh @@ -338,10 +410,11 @@ impl Battery { } } - pub fn read_charge_full() -> Result { - match usdpl_back::api::files::read_single::<_, u64, _>(BATTERY_CHARGE_FULL_PATH) { + pub fn read_charge_full(&self) -> Result { + let attr = PowerSupplyAttribute::ChargeFull; + match self.sysfs_bat.attribute::(attr) { Err(e) => Err(SettingError { - msg: format!("Failed to read from `{}`: {}", BATTERY_CHARGE_FULL_PATH, e), + msg: format!("Failed to read from `{:?}`: {}", attr, e), setting: crate::settings::SettingVariant::Battery, }), // convert to Wh @@ -349,13 +422,11 @@ impl Battery { } } - pub fn read_charge_design() -> Result { - match usdpl_back::api::files::read_single::<_, u64, _>(BATTERY_CHARGE_DESIGN_PATH) { + pub fn read_charge_design(&self) -> Result { + let attr = PowerSupplyAttribute::ChargeFullDesign; + match self.sysfs_bat.attribute::(attr) { Err(e) => Err(SettingError { - msg: format!( - "Failed to read from `{}`: {}", - BATTERY_CHARGE_DESIGN_PATH, e - ), + msg: format!("Failed to read from `{:?}`: {}", attr, e), setting: crate::settings::SettingVariant::Battery, }), // convert to Wh @@ -363,10 +434,11 @@ impl Battery { } } - pub fn read_usb_voltage() -> Result { - match usdpl_back::api::files::read_single::<_, u64, _>(USB_PD_IN_MVOLTAGE_PATH) { + pub fn read_usb_voltage(&self) -> Result { + let attr = HwMonAttribute::new(HwMonAttributeType::In, 0, HwMonAttributeItem::Input); + match self.sysfs_hwmon.attribute::(attr) { Err(e) => Err(SettingError { - msg: format!("Failed to read from `{}`: {}", USB_PD_IN_MVOLTAGE_PATH, e), + msg: format!("Failed to read from `{:?}`: {}", attr, e), setting: crate::settings::SettingVariant::Battery, }), // convert to V (from mV) @@ -374,10 +446,11 @@ impl Battery { } } - pub fn read_usb_current() -> Result { - match usdpl_back::api::files::read_single::<_, u64, _>(USB_PD_IN_CURRENT_PATH) { + pub fn read_usb_current(&self) -> Result { + let attr = HwMonAttribute::new(HwMonAttributeType::Curr, 1, HwMonAttributeItem::Input); + match self.sysfs_hwmon.attribute::(attr) { Err(e) => Err(SettingError { - msg: format!("Failed to read from `{}`: {}", USB_PD_IN_CURRENT_PATH, e), + msg: format!("Failed to read `{:?}`: {}", attr, e), setting: crate::settings::SettingVariant::Battery, }), Ok(val) => Ok((val as f64) / 1000.0), // mA -> A @@ -399,6 +472,8 @@ impl Battery { limits: oc_limits, state: crate::state::steam_deck::Battery::default(), driver_mode: driver, + sysfs_bat: Self::find_battery_sysfs(None::<&'static str>), + sysfs_hwmon: Arc::new(Self::find_hwmon_sysfs(None::<&'static str>)), } } @@ -438,6 +513,7 @@ impl Into for Battery { charge_rate: self.charge_rate, charge_mode: self.charge_mode.map(Self::charge_mode_to_str), events: self.events.into_iter().map(|x| x.into()).collect(), + root: self.sysfs_bat.root().or(self.sysfs_hwmon.root()).and_then(|p| p.as_ref().to_str().map(|x| x.to_owned())) } } } @@ -530,7 +606,7 @@ impl TBattery for Battery { } fn read_charge_full(&self) -> Option { - match Self::read_charge_full() { + match self.read_charge_full() { Ok(x) => Some(x), Err(e) => { log::warn!("read_charge_full err: {}", e.msg); @@ -540,7 +616,7 @@ impl TBattery for Battery { } fn read_charge_now(&self) -> Option { - match Self::read_charge_now() { + match self.read_charge_now() { Ok(x) => Some(x), Err(e) => { log::warn!("read_charge_now err: {}", e.msg); @@ -550,7 +626,7 @@ impl TBattery for Battery { } fn read_charge_design(&self) -> Option { - match Self::read_charge_design() { + match self.read_charge_design() { Ok(x) => Some(x), Err(e) => { log::warn!("read_charge_design err: {}", e.msg); @@ -561,7 +637,7 @@ impl TBattery for Battery { fn read_current_now(&self) -> Option { if self.limits.extra_readouts { - match Self::read_current_now() { + match self.read_current_now() { Ok(x) => Some(x as f64), Err(e) => { log::warn!("read_current_now err: {}", e.msg); @@ -575,7 +651,7 @@ impl TBattery for Battery { fn read_charge_power(&self) -> Option { if self.limits.extra_readouts { - match Self::read_charge_power() { + match self.read_charge_power() { Ok(x) => Some(x as f64), Err(e) => { log::warn!("read_current_now err: {}", e.msg); @@ -601,6 +677,7 @@ impl TBattery for Battery { charge_rate: None, charge_mode: Some(ChargeMode::Idle), is_triggered: false, + sysfs_hwmon: self.sysfs_hwmon.clone(), }; } else { self.events.remove(index); @@ -615,6 +692,7 @@ impl TBattery for Battery { charge_rate: None, charge_mode: Some(ChargeMode::Idle), is_triggered: false, + sysfs_hwmon: self.sysfs_hwmon.clone(), }); } // lower limit @@ -631,6 +709,7 @@ impl TBattery for Battery { charge_rate: None, charge_mode: Some(ChargeMode::Normal), is_triggered: false, + sysfs_hwmon: self.sysfs_hwmon.clone(), }; } else { self.events.remove(index); @@ -646,6 +725,7 @@ impl TBattery for Battery { charge_rate: None, charge_mode: Some(ChargeMode::Normal), is_triggered: false, + sysfs_hwmon: self.sysfs_hwmon.clone(), }); } } @@ -668,7 +748,7 @@ impl TBattery for Battery { log::debug!("Steam Deck power vibe check"); let mut errors = Vec::new(); let mut events = Vec::new(); - match (Self::read_charge_full(), Self::read_charge_now()) { + match (self.read_charge_full(), self.read_charge_now()) { (Ok(full), Ok(now)) => events.push(PowerMode::BatteryCharge(now / full)), (Err(e1), Err(e2)) => { errors.push(e1); @@ -677,7 +757,7 @@ impl TBattery for Battery { (Err(e), _) => errors.push(e), (_, Err(e)) => errors.push(e), } - match Self::read_usb_voltage() { + match self.read_usb_voltage() { Ok(voltage) => { if voltage > 0.0 && self.state.charger_state != crate::state::steam_deck::ChargeState::PluggedIn diff --git a/backend/src/settings/steam_deck/cpu.rs b/backend/src/settings/steam_deck/cpu.rs index cf4bd74..36f24c4 100644 --- a/backend/src/settings/steam_deck/cpu.rs +++ b/backend/src/settings/steam_deck/cpu.rs @@ -1,5 +1,7 @@ use std::convert::Into; +use sysfuss::{BasicEntityPath, SysEntity, SysEntityAttributesExt}; + use super::oc_limits::{CpuLimits, CpusLimits, OverclockLimits}; use super::POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT; use crate::api::RangeLimit; @@ -11,6 +13,10 @@ use crate::settings::{TCpu, TCpus}; const CPU_PRESENT_PATH: &str = "/sys/devices/system/cpu/present"; const CPU_SMT_PATH: &str = "/sys/devices/system/cpu/smt/control"; +const CARD_NEEDS: &[&'static str] = &[ + super::DPM_FORCE_LIMITS_ATTRIBUTE +]; + #[derive(Debug, Clone)] pub struct Cpus { pub cpus: Vec, @@ -230,9 +236,11 @@ pub struct Cpu { limits: CpuLimits, index: usize, state: crate::state::steam_deck::Cpu, + sysfs: BasicEntityPath, } -const CPU_CLOCK_LIMITS_PATH: &str = "/sys/class/drm/card0/device/pp_od_clk_voltage"; +//const CPU_CLOCK_LIMITS_PATH: &str = "/sys/class/drm/card0/device/pp_od_clk_voltage"; +const CPU_CLOCK_LIMITS_ATTRIBUTE: &str = "device/pp_od_clk_voltage"; enum ClockType { Min = 0, @@ -250,6 +258,7 @@ impl Cpu { limits: oc_limits, index: i, state: crate::state::steam_deck::Cpu::default(), + sysfs: Self::find_card_sysfs(other.root), }, _ => Self { online: other.online, @@ -258,17 +267,35 @@ impl Cpu { limits: oc_limits, index: i, state: crate::state::steam_deck::Cpu::default(), + sysfs: Self::find_card_sysfs(other.root), }, } } - fn set_clock_limit(index: usize, speed: u64, mode: ClockType) -> Result<(), SettingError> { + fn find_card_sysfs(root: Option>) -> BasicEntityPath { + let root = crate::settings::util::root_or_default_sysfs(root); + match root.class("drm", sysfuss::capability::attributes(CARD_NEEDS.into_iter().map(|s| s.to_string()))) { + Ok(mut iter) => { + iter.next() + .unwrap_or_else(|| { + log::error!("Failed to find SteamDeck drm in sysfs (no results), trying naive fallback"); + BasicEntityPath::new(root.as_ref().join("sys/class/drm/card0")) + }) + }, + Err(e) => { + log::error!("Failed to find SteamDeck drm in sysfs ({}), using naive fallback", e); + BasicEntityPath::new(root.as_ref().join("sys/class/drm/card0")) + } + } + } + + fn set_clock_limit(&self, index: usize, speed: u64, mode: ClockType) -> Result<(), SettingError> { let payload = format!("p {} {} {}\n", index / 2, mode as u8, speed); - usdpl_back::api::files::write_single(CPU_CLOCK_LIMITS_PATH, &payload).map_err(|e| { + self.sysfs.set(CPU_CLOCK_LIMITS_ATTRIBUTE.to_owned(), &payload).map_err(|e| { SettingError { msg: format!( "Failed to write `{}` to `{}`: {}", - &payload, CPU_CLOCK_LIMITS_PATH, e + &payload, CPU_CLOCK_LIMITS_ATTRIBUTE, e ), setting: crate::settings::SettingVariant::Cpu, } @@ -279,7 +306,7 @@ impl Cpu { let mut errors = Vec::new(); if let Some(clock_limits) = &self.clock_limits { POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.set_cpu(true, self.index); - POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.enforce_level()?; + POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.enforce_level(&self.sysfs)?; log::debug!( "Setting CPU {} (min, max) clockspeed to ({:?}, {:?})", self.index, @@ -289,7 +316,7 @@ impl Cpu { self.state.clock_limits_set = true; // max clock if let Some(max) = clock_limits.max { - Self::set_clock_limit(self.index, max, ClockType::Max) + self.set_clock_limit(self.index, max, ClockType::Max) .unwrap_or_else(|e| errors.push(e)); } // min clock @@ -299,7 +326,7 @@ impl Cpu { } else { min }; - Self::set_clock_limit(self.index, valid_min, ClockType::Min) + self.set_clock_limit(self.index, valid_min, ClockType::Min) .unwrap_or_else(|e| errors.push(e)); } @@ -316,17 +343,17 @@ impl Cpu { self.state.clock_limits_set = false; POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.set_cpu(false, self.index); POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT - .enforce_level()?; + .enforce_level(&self.sysfs)?; if POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.needs_manual() { // always set clock speeds, since it doesn't reset correctly (kernel/hardware bug) - POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.enforce_level()?; + POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.enforce_level(&self.sysfs)?; // disable manual clock limits log::debug!("Setting CPU {} to default clockspeed", self.index); // max clock - Self::set_clock_limit(self.index, self.limits.clock_max.max, ClockType::Max) + self.set_clock_limit(self.index, self.limits.clock_max.max, ClockType::Max) .unwrap_or_else(|e| errors.push(e)); // min clock - Self::set_clock_limit(self.index, self.limits.clock_min.min, ClockType::Min) + self.set_clock_limit(self.index, self.limits.clock_min.min, ClockType::Min) .unwrap_or_else(|e| errors.push(e)); } // TODO remove this when it's no longer needed @@ -346,17 +373,17 @@ impl Cpu { let mut errors = Vec::new(); POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.set_cpu(true, self.index); // always set clock speeds, since it doesn't reset correctly (kernel/hardware bug) - POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.enforce_level()?; + POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.enforce_level(&self.sysfs)?; // disable manual clock limits log::debug!("Setting CPU {} to default clockspeed", self.index); // max clock - Self::set_clock_limit(self.index, self.limits.clock_max.max, ClockType::Max) + self.set_clock_limit(self.index, self.limits.clock_max.max, ClockType::Max) .unwrap_or_else(|e| errors.push(e)); // min clock - Self::set_clock_limit(self.index, self.limits.clock_min.min, ClockType::Min) + self.set_clock_limit(self.index, self.limits.clock_min.min, ClockType::Min) .unwrap_or_else(|e| errors.push(e)); - Self::set_confirm().unwrap_or_else(|e| errors.push(e)); + self.set_confirm().unwrap_or_else(|e| errors.push(e)); POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.set_cpu(false, self.index); if errors.is_empty() { Ok(()) @@ -365,10 +392,10 @@ impl Cpu { } } - fn set_confirm() -> Result<(), SettingError> { - usdpl_back::api::files::write_single(CPU_CLOCK_LIMITS_PATH, "c\n").map_err(|e| { + fn set_confirm(&self) -> Result<(), SettingError> { + self.sysfs.set(CPU_CLOCK_LIMITS_ATTRIBUTE.to_owned(), "c\n").map_err(|e| { SettingError { - msg: format!("Failed to write `c` to `{}`: {}", CPU_CLOCK_LIMITS_PATH, e), + msg: format!("Failed to write `c` to `{}`: {}", CPU_CLOCK_LIMITS_ATTRIBUTE, e), setting: crate::settings::SettingVariant::Cpu, } }) @@ -385,7 +412,7 @@ impl Cpu { // commit changes (if no errors have already occured) if errors.is_empty() { if POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.needs_manual() { - Self::set_confirm().map_err(|e| vec![e]) + self.set_confirm().map_err(|e| vec![e]) } else { Ok(()) } @@ -470,6 +497,7 @@ impl Cpu { limits: oc_limits, index: cpu_index, state: crate::state::steam_deck::Cpu::default(), + sysfs: Self::find_card_sysfs(None::<&'static str>) } } @@ -509,6 +537,7 @@ impl Into for Cpu { online: self.online, clock_limits: self.clock_limits.map(|x| x.into()), governor: self.governor, + root: self.sysfs.root().and_then(|p| p.as_ref().to_str().map(|r| r.to_owned())) } } } diff --git a/backend/src/settings/steam_deck/gpu.rs b/backend/src/settings/steam_deck/gpu.rs index c44f3af..5c36faf 100644 --- a/backend/src/settings/steam_deck/gpu.rs +++ b/backend/src/settings/steam_deck/gpu.rs @@ -1,5 +1,7 @@ use std::convert::Into; +use sysfuss::{BasicEntityPath, HwMonPath, SysEntity, capability::attributes, SysEntityAttributesExt, SysAttribute}; + use super::oc_limits::{GpuLimits, OverclockLimits}; use super::POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT; use crate::api::RangeLimit; @@ -8,8 +10,9 @@ use crate::settings::TGpu; use crate::settings::{min_max_from_json, MinMax}; use crate::settings::{OnResume, OnSet, SettingError}; -const SLOW_PPT: u8 = 1; -const FAST_PPT: u8 = 2; +// usually in /sys/class/hwmon/hwmon4/ +const SLOW_PPT_ATTRIBUTE: sysfuss::HwMonAttribute = sysfuss::HwMonAttribute::custom("power1_cap"); +const FAST_PPT_ATTRIBUTE: sysfuss::HwMonAttribute = sysfuss::HwMonAttribute::custom("power2_cap"); #[derive(Debug, Clone)] pub struct Gpu { @@ -20,11 +23,22 @@ pub struct Gpu { limits: GpuLimits, state: crate::state::steam_deck::Gpu, driver_mode: crate::persist::DriverJson, + sysfs_card: BasicEntityPath, + sysfs_hwmon: HwMonPath } // same as CPU -const GPU_CLOCK_LIMITS_PATH: &str = "/sys/class/drm/card0/device/pp_od_clk_voltage"; -const GPU_MEMORY_DOWNCLOCK_PATH: &str = "/sys/class/drm/card0/device/pp_dpm_fclk"; +//const GPU_CLOCK_LIMITS_PATH: &str = "/sys/class/drm/card0/device/pp_od_clk_voltage"; +//const GPU_MEMORY_DOWNCLOCK_PATH: &str = "/sys/class/drm/card0/device/pp_dpm_fclk"; + +const GPU_CLOCK_LIMITS_ATTRIBUTE: &str = "device/pp_od_clk_voltage"; +const GPU_MEMORY_DOWNCLOCK_ATTRIBUTE: &str = "device/pp_dpm_fclk"; + +const CARD_NEEDS: &[&'static str] = &[ + GPU_CLOCK_LIMITS_ATTRIBUTE, + GPU_MEMORY_DOWNCLOCK_ATTRIBUTE, + super::DPM_FORCE_LIMITS_ATTRIBUTE, +]; enum ClockType { Min = 0, @@ -49,6 +63,8 @@ impl Gpu { limits: oc_limits.gpu, state: crate::state::steam_deck::Gpu::default(), driver_mode: driver, + sysfs_card: Self::find_card_sysfs(other.root.clone()), + sysfs_hwmon: Self::find_hwmon_sysfs(other.root), }, _ => Self { fast_ppt: other.fast_ppt, @@ -58,27 +74,53 @@ impl Gpu { limits: oc_limits.gpu, state: crate::state::steam_deck::Gpu::default(), driver_mode: driver, + sysfs_card: Self::find_card_sysfs(other.root.clone()), + sysfs_hwmon: Self::find_hwmon_sysfs(other.root), }, } } - fn set_clock_limit(speed: u64, mode: ClockType) -> Result<(), SettingError> { + fn find_card_sysfs(root: Option>) -> BasicEntityPath { + let root = crate::settings::util::root_or_default_sysfs(root); + match root.class("drm", attributes(CARD_NEEDS.into_iter().map(|s| s.to_string()))) { + Ok(mut iter) => { + iter.next() + .unwrap_or_else(|| { + log::error!("Failed to find SteamDeck gpu drm in sysfs (no results), trying naive fallback"); + BasicEntityPath::new(root.as_ref().join("sys/class/drm/card0")) + }) + }, + Err(e) => { + log::error!("Failed to find SteamDeck gpu drm in sysfs ({}), using naive fallback", e); + BasicEntityPath::new(root.as_ref().join("sys/class/drm/card0")) + } + } + } + + fn find_hwmon_sysfs(root: Option>) -> HwMonPath { + let root = crate::settings::util::root_or_default_sysfs(root); + root.hwmon_by_name(super::util::GPU_HWMON_NAME).unwrap_or_else(|e| { + log::error!("Failed to find SteamDeck gpu hwmon in sysfs ({}), using naive fallback", e); + root.hwmon_by_index(4) + }) + } + + fn set_clock_limit(&self, speed: u64, mode: ClockType) -> Result<(), SettingError> { let payload = format!("s {} {}\n", mode as u8, speed); - usdpl_back::api::files::write_single(GPU_CLOCK_LIMITS_PATH, &payload).map_err(|e| { + let path = GPU_CLOCK_LIMITS_ATTRIBUTE.path(&self.sysfs_card); + self.sysfs_card.set(GPU_CLOCK_LIMITS_ATTRIBUTE.to_owned(), &payload).map_err(|e| { SettingError { - msg: format!( - "Failed to write `{}` to `{}`: {}", - &payload, GPU_CLOCK_LIMITS_PATH, e - ), + msg: format!("Failed to write `{}` to `{}`: {}", &payload, path.display(), e), setting: crate::settings::SettingVariant::Gpu, } }) } - fn set_confirm() -> Result<(), SettingError> { - usdpl_back::api::files::write_single(GPU_CLOCK_LIMITS_PATH, "c\n").map_err(|e| { + fn set_confirm(&self) -> Result<(), SettingError> { + let path = GPU_CLOCK_LIMITS_ATTRIBUTE.path(&self.sysfs_card); + self.sysfs_card.set(GPU_CLOCK_LIMITS_ATTRIBUTE.to_owned(), "c\n").map_err(|e| { SettingError { - msg: format!("Failed to write `c` to `{}`: {}", GPU_CLOCK_LIMITS_PATH, e), + msg: format!("Failed to write `c` to `{}`: {}", path.display(), e), setting: crate::settings::SettingVariant::Gpu, } }) @@ -88,19 +130,19 @@ impl Gpu { let mut errors = Vec::new(); if let Some(clock_limits) = &self.clock_limits { POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.set_gpu(true); - POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.enforce_level()?; + POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.enforce_level(&self.sysfs_card)?; // set clock limits self.state.clock_limits_set = true; // max clock if let Some(max) = clock_limits.max { - Self::set_clock_limit(max, ClockType::Max).unwrap_or_else(|e| errors.push(e)); + self.set_clock_limit(max, ClockType::Max).unwrap_or_else(|e| errors.push(e)); } // min clock if let Some(min) = clock_limits.min { - Self::set_clock_limit(min, ClockType::Min).unwrap_or_else(|e| errors.push(e)); + self.set_clock_limit(min, ClockType::Min).unwrap_or_else(|e| errors.push(e)); } - Self::set_confirm().unwrap_or_else(|e| errors.push(e)); + self.set_confirm().unwrap_or_else(|e| errors.push(e)); } else if self.state.clock_limits_set || (self.state.is_resuming && !self.limits.skip_resume_reclock) || POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.needs_manual() @@ -108,19 +150,19 @@ impl Gpu { self.state.clock_limits_set = false; POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.set_gpu(self.slow_memory); if POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.needs_manual() { - POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.enforce_level()?; + POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.enforce_level(&self.sysfs_card)?; // disable manual clock limits // max clock - Self::set_clock_limit(self.limits.clock_max.max, ClockType::Max) + self.set_clock_limit(self.limits.clock_max.max, ClockType::Max) .unwrap_or_else(|e| errors.push(e)); // min clock - Self::set_clock_limit(self.limits.clock_min.min, ClockType::Min) + self.set_clock_limit(self.limits.clock_min.min, ClockType::Min) .unwrap_or_else(|e| errors.push(e)); - Self::set_confirm().unwrap_or_else(|e| errors.push(e)); + self.set_confirm().unwrap_or_else(|e| errors.push(e)); } else { POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT - .enforce_level() + .enforce_level(&self.sysfs_card) .unwrap_or_else(|mut e| errors.append(&mut e)); } } @@ -131,10 +173,11 @@ impl Gpu { } } - fn set_slow_memory(slow: bool) -> Result<(), SettingError> { - usdpl_back::api::files::write_single(GPU_MEMORY_DOWNCLOCK_PATH, slow as u8).map_err(|e| { + fn set_slow_memory(&self, slow: bool) -> Result<(), SettingError> { + let path = GPU_MEMORY_DOWNCLOCK_ATTRIBUTE.path(&self.sysfs_card); + self.sysfs_card.set(GPU_MEMORY_DOWNCLOCK_ATTRIBUTE.to_owned(), slow as u8).map_err(|e| { SettingError { - msg: format!("Failed to write to `{}`: {}", GPU_MEMORY_DOWNCLOCK_PATH, e), + msg: format!("Failed to write to `{}`: {}", path.display(), e), setting: crate::settings::SettingVariant::Gpu, } }) @@ -146,14 +189,14 @@ impl Gpu { if self.slow_memory { POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.set_gpu(true); POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT - .enforce_level() + .enforce_level(&self.sysfs_card) .unwrap_or_else(|mut e| errors.append(&mut e)); - Self::set_slow_memory(self.slow_memory).unwrap_or_else(|e| errors.push(e)); + self.set_slow_memory(self.slow_memory).unwrap_or_else(|e| errors.push(e)); } else if POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.needs_manual() { - Self::set_slow_memory(self.slow_memory).unwrap_or_else(|e| errors.push(e)); + self.set_slow_memory(self.slow_memory).unwrap_or_else(|e| errors.push(e)); POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.set_gpu(self.clock_limits.is_some()); POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT - .enforce_level() + .enforce_level(&self.sysfs_card) .unwrap_or_else(|mut e| errors.append(&mut e)); } self.set_clocks() @@ -161,7 +204,7 @@ impl Gpu { // commit changes (if no errors have already occured) if errors.is_empty() { if self.slow_memory || self.clock_limits.is_some() { - Self::set_confirm().map_err(|e| { + self.set_confirm().map_err(|e| { errors.push(e); errors }) @@ -178,12 +221,11 @@ impl Gpu { // set fast PPT if let Some(fast_ppt) = &self.fast_ppt { self.state.fast_ppt_set = true; - let fast_ppt_path = gpu_power_path(FAST_PPT); - usdpl_back::api::files::write_single(&fast_ppt_path, fast_ppt) + self.sysfs_hwmon.set(FAST_PPT_ATTRIBUTE, fast_ppt) .map_err(|e| SettingError { msg: format!( - "Failed to write `{}` to `{}`: {}", - fast_ppt, &fast_ppt_path, e + "Failed to write `{}` to `{:?}`: {}", + fast_ppt, FAST_PPT_ATTRIBUTE, e ), setting: crate::settings::SettingVariant::Gpu, }) @@ -193,12 +235,11 @@ impl Gpu { } else if self.state.fast_ppt_set { self.state.fast_ppt_set = false; let fast_ppt = self.limits.fast_ppt_default; - let fast_ppt_path = gpu_power_path(FAST_PPT); - usdpl_back::api::files::write_single(&fast_ppt_path, fast_ppt) + self.sysfs_hwmon.set(FAST_PPT_ATTRIBUTE, fast_ppt) .map_err(|e| SettingError { msg: format!( - "Failed to write `{}` to `{}`: {}", - fast_ppt, &fast_ppt_path, e + "Failed to write `{}` to `{:?}`: {}", + fast_ppt, FAST_PPT_ATTRIBUTE, e ), setting: crate::settings::SettingVariant::Gpu, }) @@ -209,12 +250,11 @@ impl Gpu { // set slow PPT if let Some(slow_ppt) = &self.slow_ppt { self.state.slow_ppt_set = true; - let slow_ppt_path = gpu_power_path(SLOW_PPT); - usdpl_back::api::files::write_single(&slow_ppt_path, slow_ppt) + self.sysfs_hwmon.set(SLOW_PPT_ATTRIBUTE, slow_ppt) .map_err(|e| SettingError { msg: format!( - "Failed to write `{}` to `{}`: {}", - slow_ppt, &slow_ppt_path, e + "Failed to write `{}` to `{:?}`: {}", + slow_ppt, SLOW_PPT_ATTRIBUTE, e ), setting: crate::settings::SettingVariant::Gpu, }) @@ -224,12 +264,11 @@ impl Gpu { } else if self.state.slow_ppt_set { self.state.slow_ppt_set = false; let slow_ppt = self.limits.slow_ppt_default; - let slow_ppt_path = gpu_power_path(SLOW_PPT); - usdpl_back::api::files::write_single(&slow_ppt_path, slow_ppt) + self.sysfs_hwmon.set(SLOW_PPT_ATTRIBUTE, slow_ppt) .map_err(|e| SettingError { msg: format!( - "Failed to write `{}` to `{}`: {}", - slow_ppt, &slow_ppt_path, e + "Failed to write `{}` to `{:?}`: {}", + slow_ppt, SLOW_PPT_ATTRIBUTE, e ), setting: crate::settings::SettingVariant::Gpu, }) @@ -279,6 +318,8 @@ impl Gpu { } else { crate::persist::DriverJson::SteamDeckAdvance }, + sysfs_card: Self::find_card_sysfs(None::<&'static str>), + sysfs_hwmon: Self::find_hwmon_sysfs(None::<&'static str>), } } } @@ -291,6 +332,7 @@ impl Into for Gpu { slow_ppt: self.slow_ppt, clock_limits: self.clock_limits.map(|x| x.into()), slow_memory: self.slow_memory, + root: self.sysfs_card.root().or(self.sysfs_hwmon.root()).and_then(|p| p.as_ref().to_str().map(|r| r.to_owned())) } } } @@ -372,8 +414,3 @@ impl TGpu for Gpu { self.driver_mode.clone() } } - -#[inline] -fn gpu_power_path(power_number: u8) -> String { - format!("/sys/class/hwmon/hwmon4/power{}_cap", power_number) -} diff --git a/backend/src/settings/steam_deck/mod.rs b/backend/src/settings/steam_deck/mod.rs index 49481f7..268fa90 100644 --- a/backend/src/settings/steam_deck/mod.rs +++ b/backend/src/settings/steam_deck/mod.rs @@ -8,6 +8,6 @@ mod util; pub use battery::Battery; pub use cpu::{Cpu, Cpus}; pub use gpu::Gpu; -pub(self) use power_dpm_force::POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT; +pub(self) use power_dpm_force::{POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT, DPM_FORCE_LIMITS_ATTRIBUTE}; pub use util::flash_led; diff --git a/backend/src/settings/steam_deck/power_dpm_force.rs b/backend/src/settings/steam_deck/power_dpm_force.rs index 06c820a..72404cc 100644 --- a/backend/src/settings/steam_deck/power_dpm_force.rs +++ b/backend/src/settings/steam_deck/power_dpm_force.rs @@ -5,6 +5,8 @@ use std::sync::atomic::{AtomicU64, Ordering}; +use sysfuss::{BasicEntityPath, SysEntityAttributesExt, SysAttribute}; + use crate::settings::SettingError; const DEFAULT_BITS: u64 = 0; @@ -19,7 +21,8 @@ pub struct PDFPLManager(AtomicU64); const GPU_BIT: usize = 1; const CPU_BITS_START: usize = 2; -const DPM_FORCE_LIMITS_PATH: &str = "/sys/class/drm/card0/device/power_dpm_force_performance_level"; +//const DPM_FORCE_LIMITS_PATH: &str = "/sys/class/drm/card0/device/power_dpm_force_performance_level"; +pub const DPM_FORCE_LIMITS_ATTRIBUTE: &str = "device/power_dpm_force_performance_level"; impl PDFPLManager { #[inline] @@ -56,49 +59,44 @@ impl PDFPLManager { self.set(DEFAULT_BITS); } - pub fn enforce_level(&self) -> Result<(), Vec> { + pub fn enforce_level(&self, entity: &BasicEntityPath) -> Result<(), Vec> { let needs = self.needs_manual(); let mut errors = Vec::new(); - let mode: String = usdpl_back::api::files::read_single(DPM_FORCE_LIMITS_PATH.to_owned()) + let path = DPM_FORCE_LIMITS_ATTRIBUTE.path(entity); + let mode: String = entity.attribute(DPM_FORCE_LIMITS_ATTRIBUTE.to_owned()) .map_err(|e| { vec![SettingError { - msg: format!("Failed to read `{}`: {}", DPM_FORCE_LIMITS_PATH, e), + msg: format!("Failed to read `{}`: {}", path.display(), e), setting: crate::settings::SettingVariant::General, }] })?; if mode != "manual" && needs { - log::info!("Setting `{}` to manual", DPM_FORCE_LIMITS_PATH); + log::info!("Setting `{}` to manual", path.display()); // set manual control - usdpl_back::api::files::write_single(DPM_FORCE_LIMITS_PATH, "manual") + entity.set(DPM_FORCE_LIMITS_ATTRIBUTE.to_owned(), "manual") .map_err(|e| { errors.push(SettingError { - msg: format!( - "Failed to write `manual` to `{}`: {}", - DPM_FORCE_LIMITS_PATH, e - ), + msg: format!("Failed to write `manual` to `{}`: {}", path.display(), e), setting: crate::settings::SettingVariant::General, }) }) .unwrap_or(()); } else if mode != "auto" && !needs { - log::info!("Setting `{}` to auto", DPM_FORCE_LIMITS_PATH); + log::info!("Setting `{}` to auto", path.display()); // unset manual control - usdpl_back::api::files::write_single(DPM_FORCE_LIMITS_PATH, "auto") + entity.set(DPM_FORCE_LIMITS_ATTRIBUTE.to_owned(), "auto") .map_err(|e| { errors.push(SettingError { - msg: format!( - "Failed to write `auto` to `{}`: {}", - DPM_FORCE_LIMITS_PATH, e - ), + msg: format!("Failed to write `auto` to `{}`: {}", path.display(), e), setting: crate::settings::SettingVariant::General, }) }) .unwrap_or(()); } if let Ok(mode_now) = - usdpl_back::api::files::read_single::<_, String, _>(DPM_FORCE_LIMITS_PATH.to_owned()) + entity.attribute::(DPM_FORCE_LIMITS_ATTRIBUTE.to_owned()) { - log::debug!("Mode for `{}` is now `{}`", DPM_FORCE_LIMITS_PATH, mode_now); + log::debug!("Mode for `{}` is now `{}`", path.display(), mode_now); } else { log::debug!("Error getting new mode for debugging purposes"); } diff --git a/backend/src/settings/steam_deck/util.rs b/backend/src/settings/steam_deck/util.rs index 525d414..84dfd9c 100644 --- a/backend/src/settings/steam_deck/util.rs +++ b/backend/src/settings/steam_deck/util.rs @@ -8,6 +8,9 @@ use std::fs::OpenOptions; use std::io::{Error, Read, Seek, SeekFrom, Write}; +pub const JUPITER_HWMON_NAME: &'static str = "jupiter"; +pub const GPU_HWMON_NAME: &'static str = "amdgpu"; + #[inline] fn write2(p0: u8, p1: u8) -> Result { write_to(0x6c, 0x81)?; diff --git a/backend/src/settings/unknown/battery.rs b/backend/src/settings/unknown/battery.rs index f0c67a3..ab76959 100644 --- a/backend/src/settings/unknown/battery.rs +++ b/backend/src/settings/unknown/battery.rs @@ -14,6 +14,7 @@ impl Into for Battery { charge_rate: None, charge_mode: None, events: Vec::default(), + root: None, } } } diff --git a/backend/src/settings/unknown/cpu.rs b/backend/src/settings/unknown/cpu.rs index bc5f1c4..c3985cf 100644 --- a/backend/src/settings/unknown/cpu.rs +++ b/backend/src/settings/unknown/cpu.rs @@ -180,6 +180,7 @@ pub struct Cpu { pub governor: String, index: usize, state: crate::state::steam_deck::Cpu, + root: std::path::PathBuf, } impl Cpu { @@ -191,12 +192,14 @@ impl Cpu { governor: other.governor, index: i, state: crate::state::steam_deck::Cpu::default(), + root: other.root.unwrap_or_else(|| "/".to_owned()).into(), }, _ => Self { online: other.online, governor: other.governor, index: i, state: crate::state::steam_deck::Cpu::default(), + root: other.root.unwrap_or_else(|| "/".to_owned()).into(), }, } } @@ -243,6 +246,7 @@ impl Cpu { .unwrap_or("schedutil".to_owned()), index: cpu_index, state: crate::state::steam_deck::Cpu::default(), + root: "/".into() } } @@ -263,6 +267,7 @@ impl Into for Cpu { online: self.online, clock_limits: None, governor: self.governor, + root: self.root.to_str().map(|s| s.to_owned()), } } } diff --git a/backend/src/settings/unknown/gpu.rs b/backend/src/settings/unknown/gpu.rs index 150fad7..0b4b73e 100644 --- a/backend/src/settings/unknown/gpu.rs +++ b/backend/src/settings/unknown/gpu.rs @@ -29,6 +29,7 @@ impl Into for Gpu { slow_ppt: None, clock_limits: None, slow_memory: false, + root: None, } } } diff --git a/backend/src/settings/util.rs b/backend/src/settings/util.rs index 725de0a..ec9189e 100644 --- a/backend/src/settings/util.rs +++ b/backend/src/settings/util.rs @@ -6,6 +6,18 @@ pub fn guess_smt(cpus: &Vec) -> bool { guess } +pub fn root_or_default_sysfs(root: Option>) -> sysfuss::SysPath { + if let Some(root) = root { + sysfuss::SysPath::path(root) + } else { + sysfuss::SysPath::default() + } +} + +pub fn always_satisfied<'a, X>(_: &'a X) -> bool { + true +} + #[cfg(test)] mod test { use super::*; diff --git a/backend/src/utility.rs b/backend/src/utility.rs index 75430f1..742cd32 100644 --- a/backend/src/utility.rs +++ b/backend/src/utility.rs @@ -76,6 +76,9 @@ fn version_filepath() -> std::path::PathBuf { pub fn save_version_file() -> std::io::Result { let path = version_filepath(); + if let Some(parent_dir) = path.parent() { + std::fs::create_dir_all(parent_dir)?; + } std::fs::File::create(path)?.write(crate::consts::PACKAGE_VERSION.as_bytes()) } diff --git a/src/components/message.tsx b/src/components/message.tsx index f343a41..c7954ee 100644 --- a/src/components/message.tsx +++ b/src/components/message.tsx @@ -6,6 +6,7 @@ import { staticClasses, PanelSectionRow, ButtonItem, + Navigation, } from "decky-frontend-lib"; import { MESSAGE_LIST } from "../consts"; @@ -30,7 +31,8 @@ export class DevMessages extends Component { {message.title} - + { if (message.url) { Navigation.NavigateToExternalWeb(message.url); } }}> {message.body} Date: Mon, 7 Aug 2023 15:57:08 -0400 Subject: [PATCH 16/26] Use incompatible hwmon for battery in the unlikely event the hwmon still has the correct name. version to alpha2 --- backend/Cargo.lock | 2 +- backend/Cargo.toml | 2 +- backend/src/settings/steam_deck/battery.rs | 8 +++----- package.json | 2 +- translations/fr-CA.mo | Bin 2943 -> 2992 bytes translations/fr-FR.mo | Bin 2943 -> 2992 bytes translations/ru-RU.mo | Bin 0 -> 3602 bytes translations/uk-UA.mo | Bin 0 -> 3636 bytes 8 files changed, 6 insertions(+), 8 deletions(-) create mode 100644 translations/ru-RU.mo create mode 100644 translations/uk-UA.mo diff --git a/backend/Cargo.lock b/backend/Cargo.lock index 4d5882f..b39eac7 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -1043,7 +1043,7 @@ dependencies = [ [[package]] name = "powertools" -version = "1.4.0-alpha" +version = "1.4.0-alpha2" dependencies = [ "async-trait", "libryzenadj", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 43d4a7b..cdf6af4 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "powertools" -version = "1.4.0-alpha" +version = "1.4.0-alpha2" edition = "2021" authors = ["NGnius (Graham) "] description = "Backend (superuser) functionality for PowerTools" diff --git a/backend/src/settings/steam_deck/battery.rs b/backend/src/settings/steam_deck/battery.rs index a4327fc..e57662f 100644 --- a/backend/src/settings/steam_deck/battery.rs +++ b/backend/src/settings/steam_deck/battery.rs @@ -279,12 +279,10 @@ impl Battery { let root = crate::settings::util::root_or_default_sysfs(root); match root.hwmon_by_name(super::util::JUPITER_HWMON_NAME) { Ok(hwmon) => { - if hwmon.capable(attributes(HWMON_NEEDS.into_iter().copied())) { - hwmon - } else { - log::error!("Failed to find SteamDeck battery hwmon in sysfs (hwmon by name {} exists but missing attributes), using naive fallback", super::util::JUPITER_HWMON_NAME); - root.hwmon_by_index(5) + if !hwmon.capable(attributes(HWMON_NEEDS.into_iter().copied())) { + log::warn!("Found incapable SteamDeck battery hwmon in sysfs (hwmon by name {} exists but missing attributes), persevering because ignorance is bliss", super::util::JUPITER_HWMON_NAME); } + hwmon }, Err(e) => { log::error!("Failed to find SteamDeck battery hwmon in sysfs ({}), using naive fallback", e); diff --git a/package.json b/package.json index 4bdafab..fde69b5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "PowerTools", - "version": "1.4.0-alpha", + "version": "1.4.0-alpha2", "description": "Power tweaks for power users", "scripts": { "build": "shx rm -rf dist && rollup -c", diff --git a/translations/fr-CA.mo b/translations/fr-CA.mo index 673bd8cdbaeff09eddcc21fff3955057543bafee..f25dd7832c35a2ff9df0d0ab6e5f18b7cd98ff0b 100644 GIT binary patch delta 1063 zcmXxjOGs2v9LMp0&8xK}Ep+ICi|#s*K+JTd zt|D+#%%WCG%T|KqDvFk~5Go=OnXvC~I`=T=e(pJQ?m7SSKldJ&ye;*=6?)4?X{AJn@(C$Dz--QaO9~JN*D&P@RU_NS|1iIvY@flQrMMR_V^{69?V++nAKU?Rb z^){7%GM*iz36vI1tSI#XD1A*-4OWR#wG%CRg&LIR;0E>5mAZBebu>ZIS9Y1IY*(mL z=N}a9JfEtUMdzy2D%u9B(yyXjXonZ6Is!Iqjnwm0vYsu8t delta 1015 zcmYk*O-NKx6u|LgGpS8!I@Zi&R+H(J9|Iy3NC+WBDDpB z5HX6ohv;bEGZD@B1JB_vY{FbNg3HL`Ni5(o9K@qIf)%`uKK}p@;}dkgDQt_V#WWX< z+<1+ra1qP6hEDVa&)`n-yR#f&+=)yOJ!m4A(TPXUM90vC?x6EL#uj{*+<#sl*COVV zAC{0cVg*fT9i8AqGTufL{ET_rMHARZci6^Dj!S4leb|jvbe>!2`x9tFPqB&hW15TG zl>LP_7=NQ1z@O-jI_R9R3q7JTy3i=L;!V7S6X^T1Xocpm0~fG_?~o;869@4V*1Y)3 zg&9?NYZ!;|BHlwMc!{3zTQre%^!W`O!Y#D4d&&LA+`n-i-FZ0~SJ4EnqLm)YasE^< zZg8W3<47(siC6F;@)t{VC-6Nw!AJD@Z8X6h^!Y#N(NxLK5BeIK=p#B8oI(m6?SvaD zvVMI6AM%5@e0_uu+x(E+fs6JKY3olf@GN06wqC+Yq|GGC!~o&h|KHqr>m=QI;y7Vx z*+9MY6|{Lg?#TZDD?o+oXYKi?&5Csrr-=)M-$>g0086iaXYQ}w%@(t(bIskE1K+wu AHUIzs diff --git a/translations/fr-FR.mo b/translations/fr-FR.mo index 673bd8cdbaeff09eddcc21fff3955057543bafee..f25dd7832c35a2ff9df0d0ab6e5f18b7cd98ff0b 100644 GIT binary patch delta 1063 zcmXxjOGs2v9LMp0&8xK}Ep+ICi|#s*K+JTd zt|D+#%%WCG%T|KqDvFk~5Go=OnXvC~I`=T=e(pJQ?m7SSKldJ&ye;*=6?)4?X{AJn@(C$Dz--QaO9~JN*D&P@RU_NS|1iIvY@flQrMMR_V^{69?V++nAKU?Rb z^){7%GM*iz36vI1tSI#XD1A*-4OWR#wG%CRg&LIR;0E>5mAZBebu>ZIS9Y1IY*(mL z=N}a9JfEtUMdzy2D%u9B(yyXjXonZ6Is!Iqjnwm0vYsu8t delta 1015 zcmYk*O-NKx6u|LgGpS8!I@Zi&R+H(J9|Iy3NC+WBDDpB z5HX6ohv;bEGZD@B1JB_vY{FbNg3HL`Ni5(o9K@qIf)%`uKK}p@;}dkgDQt_V#WWX< z+<1+ra1qP6hEDVa&)`n-yR#f&+=)yOJ!m4A(TPXUM90vC?x6EL#uj{*+<#sl*COVV zAC{0cVg*fT9i8AqGTufL{ET_rMHARZci6^Dj!S4leb|jvbe>!2`x9tFPqB&hW15TG zl>LP_7=NQ1z@O-jI_R9R3q7JTy3i=L;!V7S6X^T1Xocpm0~fG_?~o;869@4V*1Y)3 zg&9?NYZ!;|BHlwMc!{3zTQre%^!W`O!Y#D4d&&LA+`n-i-FZ0~SJ4EnqLm)YasE^< zZg8W3<47(siC6F;@)t{VC-6Nw!AJD@Z8X6h^!Y#N(NxLK5BeIK=p#B8oI(m6?SvaD zvVMI6AM%5@e0_uu+x(E+fs6JKY3olf@GN06wqC+Yq|GGC!~o&h|KHqr>m=QI;y7Vx z*+9MY6|{Lg?#TZDD?o+oXYKi?&5Csrr-=)M-$>g0086iaXYQ}w%@(t(bIskE1K+wu AHUIzs diff --git a/translations/ru-RU.mo b/translations/ru-RU.mo new file mode 100644 index 0000000000000000000000000000000000000000..30e36e28468a6053f367bf29768c6dc983f53ec6 GIT binary patch literal 3602 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 literal 0 HcmV?d00001 From cb3ec8d3a2bfd31511777425037ba8db3fde0b62 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 7 Aug 2023 16:12:22 -0400 Subject: [PATCH 17/26] Fix message dismissing not saving --- backend/src/api/message.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/api/message.rs b/backend/src/api/message.rs index d273930..3ac093e 100644 --- a/backend/src/api/message.rs +++ b/backend/src/api/message.rs @@ -119,8 +119,8 @@ impl AsyncCallable for AsyncMessageDismisser { let id = if let Some(param0) = params.get(0) { if let Primitive::Empty = param0 { None - } else if let Primitive::U64(since) = param0 { - Some(*since) + } else if let Primitive::F64(since) = param0 { + Some(*since as u64) } else { return vec!["dismiss message invalid parameter 0".into()]; } From 324b290d35f06bb26c4ef5fac893e2a53cdb3b84 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 7 Aug 2023 16:21:30 -0400 Subject: [PATCH 18/26] Move wait periods to const file, increase period of periodic backend updates --- src/consts.ts | 3 +++ src/index.tsx | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/consts.ts b/src/consts.ts index 86a3fd3..4364cb6 100644 --- a/src/consts.ts +++ b/src/consts.ts @@ -33,3 +33,6 @@ export const PATH_GEN = "GENERAL_path"; export const MESSAGE_LIST = "MESSAGE_messages"; +export const PERIODICAL_BACKEND_PERIOD = 5000; // milliseconds +export const AUTOMATIC_REAPPLY_WAIT = 2000; // milliseconds + diff --git a/src/index.tsx b/src/index.tsx index 01c98a7..f13a69a 100755 --- a/src/index.tsx +++ b/src/index.tsx @@ -60,6 +60,9 @@ import { PATH_GEN, MESSAGE_LIST, + + PERIODICAL_BACKEND_PERIOD, + AUTOMATIC_REAPPLY_WAIT, } from "./consts"; import { set_value, get_value } from "usdpl-front"; import { Debug } from "./components/debug"; @@ -196,7 +199,7 @@ const reload = function() { //@ts-ignore endHook = SteamClient.Apps.RegisterForGameActionEnd((actionType) => { backend.log(backend.LogLevel.Info, "RegisterForGameActionEnd callback(" + actionType + ")"); - setTimeout(() => backend.forceApplySettings(), 2000 /* ms */); + setTimeout(() => backend.forceApplySettings(), AUTOMATIC_REAPPLY_WAIT); }); backend.log(backend.LogLevel.Debug, "Registered PowerTools callbacks, hello!"); @@ -230,7 +233,7 @@ const Content: VFC<{ serverAPI: ServerAPI }> = ({}) => { periodicHook = setInterval(function() { periodicals(); reloadGUI("periodic" + (new Date()).getTime().toString()); - }, 1000); + }, PERIODICAL_BACKEND_PERIOD); if (!usdplReady || !get_value(LIMITS_INFO)) { // Not translated on purpose (to avoid USDPL issues) From 3cbde30e095c8a4d23707d5fb26d111844b5b9e4 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 7 Aug 2023 17:08:24 -0400 Subject: [PATCH 19/26] Reduce periodic network activity to 1 request instead of 5 --- backend/src/api/general.rs | 54 ++++++++++++++++++++++++++++++++++++++ backend/src/main.rs | 4 +++ src/backend.ts | 19 ++++++++++++++ src/index.tsx | 13 ++++----- 4 files changed, 84 insertions(+), 6 deletions(-) diff --git a/backend/src/api/general.rs b/backend/src/api/general.rs index fd032d8..9cda1c2 100644 --- a/backend/src/api/general.rs +++ b/backend/src/api/general.rs @@ -321,3 +321,57 @@ pub fn force_apply( vec![true.into()] } } + +/// Generate get periodicals aggregate method +pub fn get_periodicals(sender: Sender) -> impl AsyncCallable { + let sender = Arc::new(Mutex::new(sender)); // Sender is not Sync; this is required for safety + let getter = move || { + let sender2 = sender.clone(); + move || { + let (rx_curr, callback_curr) = build_comms("battery current callback send failed"); + let (rx_charge_now, callback_charge_now) = build_comms("battery charge now callback send failed"); + let (rx_charge_full, callback_charge_full) = build_comms("battery charge full callback send failed"); + let (rx_charge_power, callback_charge_power) = build_comms("battery charge power callback send failed"); + + let (rx_path, callback_path) = build_comms("general get path (periodical) send failed"); + + let sender_locked = sender2 + .lock() + .unwrap(); + let curr = wait_for_response(&*sender_locked, rx_curr, + ApiMessage::Battery(super::handler::BatteryMessage::ReadCurrentNow(callback_curr)), "battery current"); + let charge_now = wait_for_response(&*sender_locked, rx_charge_now, + ApiMessage::Battery(super::handler::BatteryMessage::ReadChargeNow(callback_charge_now)), "battery charge now"); + let charge_full = wait_for_response(&*sender_locked, rx_charge_full, + ApiMessage::Battery(super::handler::BatteryMessage::ReadChargeFull(callback_charge_full)), "battery charge full"); + let charge_power = wait_for_response(&*sender_locked, rx_charge_power, + ApiMessage::Battery(super::handler::BatteryMessage::ReadChargePower(callback_charge_power)), "battery charge power"); + + let settings_path = wait_for_response(&*sender_locked, rx_path, + ApiMessage::General(GeneralMessage::GetPath(callback_path)), "general get path"); + vec![ + super::utility::map_optional(curr), + super::utility::map_optional(charge_now), + super::utility::map_optional(charge_full), + super::utility::map_optional(charge_power), + + super::utility::map_optional(settings_path.to_str()), + ] + } + }; + super::async_utils::AsyncIshGetter { + set_get: getter, + trans_getter: |result| result, + } +} + +fn build_comms<'a, T: Send + 'a>(msg: &'static str) -> (mpsc::Receiver, Box) { + let (tx, rx) = mpsc::channel(); + let callback = move |t: T| tx.send(t).expect(msg); + (rx, Box::new(callback)) +} + +fn wait_for_response(sender: &Sender, rx: mpsc::Receiver, api_msg: ApiMessage, op: &str) -> T { + sender.send(api_msg).expect(&format!("{} send failed", op)); + rx.recv().expect(&format!("{} callback recv failed", op)) +} diff --git a/backend/src/main.rs b/backend/src/main.rs index 41989d3..6eb6d99 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -287,6 +287,10 @@ fn main() -> Result<(), ()> { "GENERAL_on_unplugged", api::battery::on_unplugged(api_sender.clone()), ) + .register_async( + "GENERAL_get_periodicals", + api::general::get_periodicals(api_sender.clone()) + ) .register_async("MESSAGE_get", message_getter) .register_async("MESSAGE_dismiss", message_dismisser); diff --git a/src/backend.ts b/src/backend.ts index 17dac52..07fe9d8 100644 --- a/src/backend.ts +++ b/src/backend.ts @@ -325,3 +325,22 @@ export async function getMessages(since: number | null): Promise { export async function dismissMessage(id: number): Promise { return (await call_backend("MESSAGE_dismiss", [id]))[0]; } + +export type Periodicals = { + battery_current: number | null, + battery_charge_now: number | null, + battery_charge_full: number | null, + battery_charge_power: number | null, + settings_path: string | null, +}; + +export async function getPeriodicals(): Promise { + const result: any[] = await call_backend("GENERAL_get_periodicals", []); + return { + battery_current: result[0], + battery_charge_now: result[1], + battery_charge_full: result[2], + battery_charge_power: result[3], + settings_path: result[4], + }; +} diff --git a/src/index.tsx b/src/index.tsx index f13a69a..8d82d1d 100755 --- a/src/index.tsx +++ b/src/index.tsx @@ -206,19 +206,20 @@ const reload = function() { })(); const periodicals = function() { - backend.resolve(backend.getBatteryCurrent(), (rate: number) => { set_value(CURRENT_BATT, rate) }); - backend.resolve(backend.getBatteryChargeNow(), (rate: number) => { set_value(CHARGE_NOW_BATT, rate) }); - backend.resolve(backend.getBatteryChargeFull(), (rate: number) => { set_value(CHARGE_FULL_BATT, rate) }); - backend.resolve(backend.getBatteryChargePower(), (rate: number) => { set_value(CHARGE_POWER_BATT, rate) }); + backend.resolve(backend.getPeriodicals(), (periodicals) => { + set_value(CURRENT_BATT, periodicals.battery_current); + set_value(CHARGE_NOW_BATT, periodicals.battery_charge_now); + set_value(CHARGE_FULL_BATT, periodicals.battery_charge_full); + set_value(CHARGE_POWER_BATT, periodicals.battery_charge_power); - backend.resolve(backend.getGeneralSettingsPath(), (path: string) => { + const path = periodicals.settings_path; const oldValue = get_value(PATH_GEN); set_value(PATH_GEN, path); if (path != oldValue) { backend.log(backend.LogLevel.Info, "Frontend values reload triggered by path change: " + oldValue + " -> " + path); reload(); } - }); + }) }; const Content: VFC<{ serverAPI: ServerAPI }> = ({}) => { From 91d8eee96dc733365170abe620e43162521dadf3 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 7 Aug 2023 17:09:36 -0400 Subject: [PATCH 20/26] Update version to beta1 --- backend/Cargo.toml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/Cargo.toml b/backend/Cargo.toml index cdf6af4..ca4b1c3 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "powertools" -version = "1.4.0-alpha2" +version = "1.4.0-beta1" edition = "2021" authors = ["NGnius (Graham) "] description = "Backend (superuser) functionality for PowerTools" diff --git a/package.json b/package.json index fde69b5..365ca31 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "PowerTools", - "version": "1.4.0-alpha2", + "version": "1.4.0-beta1", "description": "Power tweaks for power users", "scripts": { "build": "shx rm -rf dist && rollup -c", From 594f69b24c4424049ce3e7bac54a23d112495be2 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 7 Aug 2023 20:08:49 -0400 Subject: [PATCH 21/26] Improve battery hwmon searching for newer kernels --- backend/Cargo.lock | 2 +- backend/src/settings/steam_deck/battery.rs | 31 ++++++++++++++++++++-- backend/src/settings/steam_deck/util.rs | 1 + 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/backend/Cargo.lock b/backend/Cargo.lock index b39eac7..85199ce 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -1043,7 +1043,7 @@ dependencies = [ [[package]] name = "powertools" -version = "1.4.0-alpha2" +version = "1.4.0-beta1" dependencies = [ "async-trait", "libryzenadj", diff --git a/backend/src/settings/steam_deck/battery.rs b/backend/src/settings/steam_deck/battery.rs index e57662f..4d521cc 100644 --- a/backend/src/settings/steam_deck/battery.rs +++ b/backend/src/settings/steam_deck/battery.rs @@ -285,8 +285,19 @@ impl Battery { hwmon }, Err(e) => { - log::error!("Failed to find SteamDeck battery hwmon in sysfs ({}), using naive fallback", e); - root.hwmon_by_index(5) + log::warn!("Failed to find SteamDeck battery hwmon {} in sysfs ({}), trying alternate name", + super::util::JUPITER_HWMON_NAME, e); + match root.hwmon_by_name(super::util::STEAMDECK_HWMON_NAME) { + Ok(hwmon) => { + if !hwmon.capable(attributes(HWMON_NEEDS.into_iter().copied())) { + log::warn!("Found incapable SteamDeck battery hwmon in sysfs (hwmon by name {} exists but missing attributes), persevering because ignorance is bliss", super::util::STEAMDECK_HWMON_NAME); + } + hwmon + }, + Err(e) => { + log::error!("Failed to find SteamDeck battery hwmon in sysfs ({}), using naive fallback", e); + root.hwmon_by_index(5) + } } } } @@ -550,7 +561,23 @@ impl OnPowerEvent for Battery { PowerMode::BatteryCharge(_) => Ok(()), } .unwrap_or_else(|mut e| errors.append(&mut e)); + let new_charge_control_attr = HwMonAttribute::custom("max_battery_charge_level"); + let attr_exists = new_charge_control_attr.exists(&*self.sysfs_hwmon); + log::info!("Does battery limit attribute (max_battery_charge_level) exist? {}", attr_exists); for ev in &mut self.events { + if attr_exists { + if let EventTrigger::BatteryAbove(level) = ev.trigger { + if let Some(ChargeMode::Idle) = ev.charge_mode { + self.sysfs_hwmon.set(new_charge_control_attr, (level * 100.0).round() as u64) + .unwrap_or_else(|e| errors.push( + SettingError { + msg: format!("Failed to write to {:?}: {}", new_charge_control_attr, e), + setting: crate::settings::SettingVariant::Battery, + } + )); + } + } + } ev.on_power_event(new_mode) .unwrap_or_else(|mut e| errors.append(&mut e)); } diff --git a/backend/src/settings/steam_deck/util.rs b/backend/src/settings/steam_deck/util.rs index 84dfd9c..471e2be 100644 --- a/backend/src/settings/steam_deck/util.rs +++ b/backend/src/settings/steam_deck/util.rs @@ -9,6 +9,7 @@ use std::fs::OpenOptions; use std::io::{Error, Read, Seek, SeekFrom, Write}; pub const JUPITER_HWMON_NAME: &'static str = "jupiter"; +pub const STEAMDECK_HWMON_NAME: &'static str = "steamdeck_hwmon"; pub const GPU_HWMON_NAME: &'static str = "amdgpu"; #[inline] From 79484e15a2eeff515a6d73053317cf735c8078a6 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Mon, 7 Aug 2023 20:17:47 -0400 Subject: [PATCH 22/26] Improve current limits settings for newer kernels --- backend/src/settings/steam_deck/battery.rs | 30 +++++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/backend/src/settings/steam_deck/battery.rs b/backend/src/settings/steam_deck/battery.rs index 4d521cc..2aed891 100644 --- a/backend/src/settings/steam_deck/battery.rs +++ b/backend/src/settings/steam_deck/battery.rs @@ -144,7 +144,11 @@ impl EventInstruction { fn set_charge_rate(&self) -> Result<(), SettingError> { if let Some(charge_rate) = self.charge_rate { - let attr = HwMonAttribute::custom("maximum_battery_charge_rate"); + let attr = if MAX_BATTERY_CHARGE_RATE_ATTR.exists(&*self.sysfs_hwmon) { + MAX_BATTERY_CHARGE_RATE_ATTR + } else { + MAXIMUM_BATTERY_CHARGE_RATE_ATTR + }; self.sysfs_hwmon.set(attr, charge_rate).map_err( |e| SettingError { msg: format!("Failed to write to `{:?}`: {}", attr, e), @@ -209,6 +213,10 @@ const HWMON_NEEDS: &[HwMonAttribute] = &[ //HwMonAttribute::custom("maximum_battery_charge_rate"), // NOTE: Cannot filter by custom capabilities ]; +const MAXIMUM_BATTERY_CHARGE_RATE_ATTR: HwMonAttribute = HwMonAttribute::custom("maximum_battery_charge_rate"); +const MAX_BATTERY_CHARGE_RATE_ATTR: HwMonAttribute = HwMonAttribute::custom("maximum_battery_charge_rate"); +const MAX_BATTERY_CHARGE_LEVEL_ATTR: HwMonAttribute = HwMonAttribute::custom("max_battery_charge_level"); + impl Battery { #[inline] pub fn from_json(other: BatteryJson, version: u64) -> Self { @@ -298,6 +306,7 @@ impl Battery { log::error!("Failed to find SteamDeck battery hwmon in sysfs ({}), using naive fallback", e); root.hwmon_by_index(5) } + } } } } @@ -325,7 +334,11 @@ impl Battery { fn set_charge_rate(&mut self) -> Result<(), SettingError> { if let Some(charge_rate) = self.charge_rate { self.state.charge_rate_set = true; - let attr = HwMonAttribute::custom("maximum_battery_charge_rate"); + let attr = if MAX_BATTERY_CHARGE_RATE_ATTR.exists(&*self.sysfs_hwmon) { + MAX_BATTERY_CHARGE_RATE_ATTR + } else { + MAXIMUM_BATTERY_CHARGE_RATE_ATTR + }; let path = attr.path(&*self.sysfs_hwmon); self.sysfs_hwmon.set(attr, charge_rate).map_err( |e| SettingError { @@ -335,7 +348,11 @@ impl Battery { ) } else if self.state.charge_rate_set { self.state.charge_rate_set = false; - let attr = HwMonAttribute::custom("maximum_battery_charge_rate"); + let attr = if MAX_BATTERY_CHARGE_RATE_ATTR.exists(&*self.sysfs_hwmon) { + MAX_BATTERY_CHARGE_RATE_ATTR + } else { + MAXIMUM_BATTERY_CHARGE_RATE_ATTR + }; let path = attr.path(&*self.sysfs_hwmon); self.sysfs_hwmon.set(attr, self.limits.charge_rate.max,).map_err( |e| SettingError { @@ -561,17 +578,16 @@ impl OnPowerEvent for Battery { PowerMode::BatteryCharge(_) => Ok(()), } .unwrap_or_else(|mut e| errors.append(&mut e)); - let new_charge_control_attr = HwMonAttribute::custom("max_battery_charge_level"); - let attr_exists = new_charge_control_attr.exists(&*self.sysfs_hwmon); + let attr_exists = MAX_BATTERY_CHARGE_LEVEL_ATTR.exists(&*self.sysfs_hwmon); log::info!("Does battery limit attribute (max_battery_charge_level) exist? {}", attr_exists); for ev in &mut self.events { if attr_exists { if let EventTrigger::BatteryAbove(level) = ev.trigger { if let Some(ChargeMode::Idle) = ev.charge_mode { - self.sysfs_hwmon.set(new_charge_control_attr, (level * 100.0).round() as u64) + self.sysfs_hwmon.set(MAX_BATTERY_CHARGE_LEVEL_ATTR, (level * 100.0).round() as u64) .unwrap_or_else(|e| errors.push( SettingError { - msg: format!("Failed to write to {:?}: {}", new_charge_control_attr, e), + msg: format!("Failed to write to {:?}: {}", MAX_BATTERY_CHARGE_LEVEL_ATTR, e), setting: crate::settings::SettingVariant::Battery, } )); From 5eceb7e4b7b13bfe6a1a316681949674c490db94 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Tue, 8 Aug 2023 20:55:19 -0400 Subject: [PATCH 23/26] Fix sysfs class/entity searching by capabilities so that everything no longer just fallbacks to stable-only defaults --- backend/Cargo.lock | 150 ++++++++++++--------- backend/Cargo.toml | 4 +- backend/src/resume_worker.rs | 2 +- backend/src/settings/steam_deck/battery.rs | 12 +- backend/src/settings/steam_deck/cpu.rs | 17 ++- backend/src/settings/steam_deck/gpu.rs | 23 ++-- backend/src/settings/steam_deck/util.rs | 5 + backend/src/settings/util.rs | 5 + package.json | 2 +- 9 files changed, 135 insertions(+), 85 deletions(-) diff --git a/backend/Cargo.lock b/backend/Cargo.lock index 85199ce..c108f06 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -100,18 +100,18 @@ checksum = "0e97ce7de6cf12de5d7226c73f5ba9811622f4db3a5b91b55c53e987e5f91cba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.28", ] [[package]] name = "async-trait" -version = "0.1.69" +version = "0.1.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b2d0f03b3640e3a630367e40c468cb7f309529c708ed1d88597047b0e7c6ef7" +checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.28", ] [[package]] @@ -220,9 +220,12 @@ checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "cc" -version = "1.0.79" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" +dependencies = [ + "libc", +] [[package]] name = "cexpr" @@ -291,9 +294,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] @@ -326,6 +329,12 @@ dependencies = [ "cipher", ] +[[package]] +name = "deranged" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7684a49fb1af197853ef7b2ee694bc1f5b4179556f1e5710e1760c5db6f5e929" + [[package]] name = "digest" version = "0.10.7" @@ -338,9 +347,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "encoding" @@ -417,9 +426,9 @@ dependencies = [ [[package]] name = "equivalent" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" @@ -610,9 +619,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] name = "hex" @@ -733,9 +742,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" @@ -900,9 +909,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", ] @@ -999,29 +1008,29 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pin-project" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.28", ] [[package]] name = "pin-project-lite" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" +checksum = "2c516611246607d0c04186886dbb3a754368ef82c79e9827a802c6d836dd111c" [[package]] name = "pin-utils" @@ -1043,7 +1052,7 @@ dependencies = [ [[package]] name = "powertools" -version = "1.4.0-beta1" +version = "1.4.0-beta2" dependencies = [ "async-trait", "libryzenadj", @@ -1077,18 +1086,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.63" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.29" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" dependencies = [ "proc-macro2", ] @@ -1125,9 +1134,21 @@ dependencies = [ [[package]] name = "regex" -version = "1.8.4" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" dependencies = [ "aho-corasick", "memchr", @@ -1136,9 +1157,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "rustc-demangle" @@ -1163,9 +1184,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "scoped-tls" @@ -1175,29 +1196,29 @@ checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "serde" -version = "1.0.166" +version = "1.0.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01b7404f9d441d3ad40e6a636a7782c377d2abdbe4fa2440e2edcc2f4f10db8" +checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.166" +version = "1.0.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dd83d6dde2b6b2d466e14d9d1acce8816dedee94f735eac6395808b3483c6d6" +checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.28", ] [[package]] name = "serde_json" -version = "1.0.99" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46266871c240a00b8f503b877622fe33430b3c7d963bdc0f2adc511e54a1eae3" +checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" dependencies = [ "itoa", "ryu", @@ -1241,7 +1262,7 @@ checksum = "acee08041c5de3d5048c8b3f6f13fafb3026b24ba43c6a695a0c76179b844369" dependencies = [ "log", "termcolor", - "time 0.3.22", + "time 0.3.25", ] [[package]] @@ -1288,9 +1309,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.23" +version = "2.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" +checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" dependencies = [ "proc-macro2", "quote", @@ -1299,7 +1320,7 @@ dependencies = [ [[package]] name = "sysfuss" -version = "0.1.0" +version = "0.2.0" [[package]] name = "termcolor" @@ -1312,22 +1333,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.28", ] [[package]] @@ -1343,10 +1364,11 @@ dependencies = [ [[package]] name = "time" -version = "0.3.22" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd" +checksum = "b0fdd63d58b18d663fbdf70e049f00a22c8e42be082203be7f26589213cd75ea" dependencies = [ + "deranged", "itoa", "libc", "num_threads", @@ -1363,9 +1385,9 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" +checksum = "eb71511c991639bb078fd5bf97757e03914361c48100d52878b8e52b46fb92cd" dependencies = [ "time-core", ] @@ -1447,9 +1469,9 @@ checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" [[package]] name = "toml_edit" -version = "0.19.11" +version = "0.19.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266f016b7f039eec8a1a80dfe6156b633d208b9fccca5e4db1d6775b0c4e34a7" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" dependencies = [ "indexmap 2.0.0", "toml_datetime", @@ -1531,9 +1553,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-normalization" @@ -1695,7 +1717,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.28", "wasm-bindgen-shared", ] @@ -1717,7 +1739,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.28", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1847,9 +1869,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.7" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" +checksum = "acaaa1190073b2b101e15083c38ee8ec891b5e05cbee516521e94ec008f61e64" dependencies = [ "memchr", ] diff --git a/backend/Cargo.toml b/backend/Cargo.toml index ca4b1c3..9a9b81a 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "powertools" -version = "1.4.0-beta1" +version = "1.4.0-beta2" edition = "2021" authors = ["NGnius (Graham) "] description = "Backend (superuser) functionality for PowerTools" @@ -15,7 +15,7 @@ readme = "../README.md" usdpl-back = { version = "0.10.1", features = ["blocking"] }#, path = "../../usdpl-rs/usdpl-back"} serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" -sysfuss = { version = "0.1", path = "../../sysfs-nav", features = ["derive"] } +sysfuss = { version = "0.2", path = "../../sysfs-nav", features = ["derive"] } # async tokio = { version = "*", features = ["time"] } diff --git a/backend/src/resume_worker.rs b/backend/src/resume_worker.rs index dfa4d8f..1f49ad5 100644 --- a/backend/src/resume_worker.rs +++ b/backend/src/resume_worker.rs @@ -5,7 +5,7 @@ use std::time::{Duration, Instant}; use crate::api::handler::ApiMessage; //use crate::utility::unwrap_maybe_fatal; -const ALLOWED_ERROR: f64 = 100.0; // period of 10ms with 100x means sleep has to be >= 1s to be detected +const ALLOWED_ERROR: f64 = 20.0; // period of 50ms with 20x means sleep has to be >= 1s to be detected pub fn spawn(sender: Sender) -> JoinHandle<()> { thread::spawn(move || { diff --git a/backend/src/settings/steam_deck/battery.rs b/backend/src/settings/steam_deck/battery.rs index 2aed891..d03bfd6 100644 --- a/backend/src/settings/steam_deck/battery.rs +++ b/backend/src/settings/steam_deck/battery.rs @@ -270,11 +270,13 @@ impl Battery { let root = crate::settings::util::root_or_default_sysfs(root); match root.power_supply(attributes(BATTERY_NEEDS.into_iter().copied())) { Ok(mut iter) => { - iter.next() + let psu = iter.next() .unwrap_or_else(|| { log::error!("Failed to find SteamDeck battery power_supply in sysfs (no results), using naive fallback"); root.power_supply_by_name("BAT1") - }) + }); + log::info!("Found SteamDeck battery power_supply in sysfs: {}", psu.as_ref().display()); + psu }, Err(e) => { log::error!("Failed to find SteamDeck battery power_supply in sysfs ({}), using naive fallback", e); @@ -289,6 +291,8 @@ impl Battery { Ok(hwmon) => { if !hwmon.capable(attributes(HWMON_NEEDS.into_iter().copied())) { log::warn!("Found incapable SteamDeck battery hwmon in sysfs (hwmon by name {} exists but missing attributes), persevering because ignorance is bliss", super::util::JUPITER_HWMON_NAME); + } else { + log::info!("Found SteamDeck battery hwmon {} in sysfs: {}", super::util::JUPITER_HWMON_NAME, hwmon.as_ref().display()); } hwmon }, @@ -299,11 +303,13 @@ impl Battery { Ok(hwmon) => { if !hwmon.capable(attributes(HWMON_NEEDS.into_iter().copied())) { log::warn!("Found incapable SteamDeck battery hwmon in sysfs (hwmon by name {} exists but missing attributes), persevering because ignorance is bliss", super::util::STEAMDECK_HWMON_NAME); + } else { + log::info!("Found SteamDeck battery hwmon {} in sysfs: {}", super::util::STEAMDECK_HWMON_NAME, hwmon.as_ref().display()); } hwmon }, Err(e) => { - log::error!("Failed to find SteamDeck battery hwmon in sysfs ({}), using naive fallback", e); + log::error!("Failed to find SteamDeck battery hwmon {} in sysfs ({}), using naive fallback", super::util::STEAMDECK_HWMON_NAME, e); root.hwmon_by_index(5) } } diff --git a/backend/src/settings/steam_deck/cpu.rs b/backend/src/settings/steam_deck/cpu.rs index 36f24c4..9a85f26 100644 --- a/backend/src/settings/steam_deck/cpu.rs +++ b/backend/src/settings/steam_deck/cpu.rs @@ -13,7 +13,7 @@ use crate::settings::{TCpu, TCpus}; const CPU_PRESENT_PATH: &str = "/sys/devices/system/cpu/present"; const CPU_SMT_PATH: &str = "/sys/devices/system/cpu/smt/control"; -const CARD_NEEDS: &[&'static str] = &[ +const CARD_EXTENSIONS: &[&'static str] = &[ super::DPM_FORCE_LIMITS_ATTRIBUTE ]; @@ -274,13 +274,18 @@ impl Cpu { fn find_card_sysfs(root: Option>) -> BasicEntityPath { let root = crate::settings::util::root_or_default_sysfs(root); - match root.class("drm", sysfuss::capability::attributes(CARD_NEEDS.into_iter().map(|s| s.to_string()))) { - Ok(mut iter) => { - iter.next() + match root.class("drm", sysfuss::capability::attributes(crate::settings::util::CARD_NEEDS.into_iter().map(|s| s.to_string()))) { + Ok(iter) => { + let card = iter + .filter(|ent| if let Ok(name) = ent.name() { name.starts_with("card")} else { false }) + .filter(|ent| super::util::card_also_has(ent, CARD_EXTENSIONS)) + .next() .unwrap_or_else(|| { - log::error!("Failed to find SteamDeck drm in sysfs (no results), trying naive fallback"); + log::error!("Failed to find SteamDeck drm in sysfs (no results), using naive fallback"); BasicEntityPath::new(root.as_ref().join("sys/class/drm/card0")) - }) + }); + log::info!("Found SteamDeck drm in sysfs: {}", card.as_ref().display()); + card }, Err(e) => { log::error!("Failed to find SteamDeck drm in sysfs ({}), using naive fallback", e); diff --git a/backend/src/settings/steam_deck/gpu.rs b/backend/src/settings/steam_deck/gpu.rs index 5c36faf..de68403 100644 --- a/backend/src/settings/steam_deck/gpu.rs +++ b/backend/src/settings/steam_deck/gpu.rs @@ -34,7 +34,7 @@ pub struct Gpu { const GPU_CLOCK_LIMITS_ATTRIBUTE: &str = "device/pp_od_clk_voltage"; const GPU_MEMORY_DOWNCLOCK_ATTRIBUTE: &str = "device/pp_dpm_fclk"; -const CARD_NEEDS: &[&'static str] = &[ +const CARD_EXTENSIONS: &[&'static str] = &[ GPU_CLOCK_LIMITS_ATTRIBUTE, GPU_MEMORY_DOWNCLOCK_ATTRIBUTE, super::DPM_FORCE_LIMITS_ATTRIBUTE, @@ -82,13 +82,18 @@ impl Gpu { fn find_card_sysfs(root: Option>) -> BasicEntityPath { let root = crate::settings::util::root_or_default_sysfs(root); - match root.class("drm", attributes(CARD_NEEDS.into_iter().map(|s| s.to_string()))) { - Ok(mut iter) => { - iter.next() + match root.class("drm", attributes(crate::settings::util::CARD_NEEDS.into_iter().map(|s| s.to_string()))) { + Ok(iter) => { + let card = iter + .filter(|ent| if let Ok(name) = ent.name() { name.starts_with("card")} else { false }) + .filter(|ent| super::util::card_also_has(ent, CARD_EXTENSIONS)) + .next() .unwrap_or_else(|| { - log::error!("Failed to find SteamDeck gpu drm in sysfs (no results), trying naive fallback"); + log::error!("Failed to find SteamDeck gpu drm in sysfs (no results), using naive fallback"); BasicEntityPath::new(root.as_ref().join("sys/class/drm/card0")) - }) + }); + log::info!("Found SteamDeck gpu drm in sysfs: {}", card.as_ref().display()); + card }, Err(e) => { log::error!("Failed to find SteamDeck gpu drm in sysfs ({}), using naive fallback", e); @@ -99,10 +104,12 @@ impl Gpu { fn find_hwmon_sysfs(root: Option>) -> HwMonPath { let root = crate::settings::util::root_or_default_sysfs(root); - root.hwmon_by_name(super::util::GPU_HWMON_NAME).unwrap_or_else(|e| { + let hwmon = root.hwmon_by_name(super::util::GPU_HWMON_NAME).unwrap_or_else(|e| { log::error!("Failed to find SteamDeck gpu hwmon in sysfs ({}), using naive fallback", e); root.hwmon_by_index(4) - }) + }); + log::info!("Found SteamDeck gpu hwmon {} in sysfs: {}", super::util::GPU_HWMON_NAME, hwmon.as_ref().display()); + hwmon } fn set_clock_limit(&self, speed: u64, mode: ClockType) -> Result<(), SettingError> { diff --git a/backend/src/settings/steam_deck/util.rs b/backend/src/settings/steam_deck/util.rs index 471e2be..52eb3e9 100644 --- a/backend/src/settings/steam_deck/util.rs +++ b/backend/src/settings/steam_deck/util.rs @@ -12,6 +12,11 @@ pub const JUPITER_HWMON_NAME: &'static str = "jupiter"; pub const STEAMDECK_HWMON_NAME: &'static str = "steamdeck_hwmon"; pub const GPU_HWMON_NAME: &'static str = "amdgpu"; +pub fn card_also_has(card: &dyn sysfuss::SysEntity, extensions: &'static [&'static str]) -> bool { + extensions.iter() + .all(|ext| card.as_ref().join(ext).exists()) +} + #[inline] fn write2(p0: u8, p1: u8) -> Result { write_to(0x6c, 0x81)?; diff --git a/backend/src/settings/util.rs b/backend/src/settings/util.rs index ec9189e..cede8f6 100644 --- a/backend/src/settings/util.rs +++ b/backend/src/settings/util.rs @@ -18,6 +18,11 @@ pub fn always_satisfied<'a, X>(_: &'a X) -> bool { true } +pub const CARD_NEEDS: &[&'static str] = &[ + "dev", + "uevent" +]; + #[cfg(test)] mod test { use super::*; diff --git a/package.json b/package.json index 365ca31..673391e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "PowerTools", - "version": "1.4.0-beta1", + "version": "1.4.0-beta2", "description": "Power tweaks for power users", "scripts": { "build": "shx rm -rf dist && rollup -c", From b1d53ab038d5425488c320ad0d1de4c75a39dbc8 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Thu, 24 Aug 2023 19:26:36 -0400 Subject: [PATCH 24/26] Migrate to git.ngni.us --- README.md | 20 +++++++++++--------- package.json | 6 +++--- plugin.json | 2 +- src/index.tsx | 2 +- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index a1398a3..f4d47b9 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ # PowerTools - + [![Decky store](https://img.shields.io/badge/dynamic/json?color=blue&label=release&query=%24%5B%3F%28%40.name%3D%3D%27PowerTools%27%29%5D.versions%5B0%5D.name&url=https%3A%2F%2Fplugins.deckbrew.xyz%2Fplugins&style=flat-square)](https://plugins.deckbrew.xyz/) [![Custom store](https://img.shields.io/badge/dynamic/json?color=blue&label=preview&query=%24%5B%3F%28%40.name%3D%3D%27PowerTools%27%29%5D.versions%5B0%5D.name&url=https%3A%2F%2Fnot-decky-alpha.ngni.us%2Fplugins&style=flat-square)](https://github.com/NGnius/PowerTools/wiki) +[![GitHub package.json version](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgit.ngni.us%2FNG-SD-Plugins%2FPowerTools%2Fraw%2Fbranch%2Fmain%2Fpackage.json&query=%24.version&style=flat-square&label=local&cacheSeconds=600)](https://git.ngni.us/NG-SD-Plugins/PowerTools/src/branch/main/package.json) [![Liberapay](https://img.shields.io/liberapay/patrons/NGnius?style=flat-square)](https://liberapay.com/NGnius) -[![GitHub](https://img.shields.io/github/license/NGnius/PowerTools?style=flat-square)](https://github.com/NGnius/PowerTools/blob/main/LICENSE) -[![GitHub package.json version](https://img.shields.io/github/package-json/v/NGnius/PowerTools?style=flat-square)](https://github.com/NGnius/PowerTools/blob/main/package.json) -[![GitHub package.json dependency version (prod)](https://img.shields.io/github/package-json/dependency-version/NGnius/PowerTools/decky-frontend-lib?style=flat-square)](https://github.com/NGnius/PowerTools/blob/main/pnpm-lock.yaml) +[![GitHub](https://img.shields.io/badge/GPL--3.0-orange?style=flat-square&label=license&cacheSeconds=600)](https://github.com/NGnius/PowerTools/blob/main/LICENSE) +[![GitHub package.json dependency version (local)](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fgit.ngni.us%2FNG-SD-Plugins%2FPowerTools%2Fraw%2Fbranch%2Fmain%2Fpackage.json&query=%24..%5B'decky-frontend-lib'%5D&style=flat-square&label=decky-frontend-lib&cacheSeconds=600)](https://github.com/NGnius/PowerTools/blob/main/pnpm-lock.yaml) ![plugin_demo](./assets/ui.png) @@ -24,17 +24,19 @@ You will need that installed for this plugin to work. - Display supplementary battery info - Keep settings between restarts (stored in `~/.config/powertools/.json`) +This plugin is tested on Steam Deck, but is designed to work on other Linux devices as well. Unfortunately I am currently unable to test on other devices. + ## Install -Please use Decky's [built-in store](https://beta.deckbrew.xyz/) to install official releases. -If you're an advanced user, and/or would like to use an in-development version, feel free to build PowerTools yourself. +Please use Decky's [built-in store](https://plugins.deckbrew.xyz/) to install official releases. +If you want to test unstable versions, use [my custom store](https://not-decky-alpha.ngni.us/plugins). If you would like to use an in-development version, feel free to build PowerTools yourself. ## Build -0. Requirements: a functioning Rust toolchain for x86_64-unknown-linux-musl, npm, and some tech literacy +0. Requirements: a functioning Rust toolchain for x86_64-unknown-linux-gnu (or -musl), pnpm, and some tech literacy 1. In a terminal, navigate to the backend directory of this project and run `./build.sh` -2. In the root of this project, run `npm run build` -3. Transfer the project (especially dist/ and bin/) to a folder in your Steam Deck's homebrew plugins directory +2. In the root of this project, run `pnpm run build` +3. Transfer the project (especially dist/ and bin/) to a folder in your Steam Deck's `~/homebrew/plugins` directory ## License diff --git a/package.json b/package.json index 673391e..18b50b0 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/NGnius/PowerTools.git" + "url": "git+https://git.ngni.us/NG-SD-Plugins/PowerTools.git" }, "keywords": [ "plugin", @@ -21,9 +21,9 @@ "author": "NGnius (Graham) ", "license": "GPL-3.0", "bugs": { - "url": "https://github.com/NGnius/PowerTools/issues" + "url": "https://git.ngni.us/NG-SD-Plugins/PowerTools/issues" }, - "homepage": "https://github.com/NGnius/PowerTools#readme", + "homepage": "https://git.ngni.us/NG-SD-Plugins/PowerTools#readme", "devDependencies": { "@rollup/plugin-commonjs": "^21.1.0", "@rollup/plugin-json": "^4.1.0", diff --git a/plugin.json b/plugin.json index f1e4d84..fdcb585 100644 --- a/plugin.json +++ b/plugin.json @@ -6,6 +6,6 @@ "discord_id": "106537989684887552", "description": "Power tweaks for power users", "tags": [ "utility", "power-management", "root" ], - "image": "https://raw.githubusercontent.com/NGnius/PowerTools/main/assets/thumbnail.png" + "image": "https://git.ngni.us/NG-SD-Plugins/PowerTools/raw/branch/main/assets/thumbnail.png" } } diff --git a/src/index.tsx b/src/index.tsx index 8d82d1d..df1407d 100755 --- a/src/index.tsx +++ b/src/index.tsx @@ -335,7 +335,7 @@ export default definePlugin((serverApi: ServerAPI) => { ico = ; } return { - title:
I'm a tool
, + title:
PowerTools
, content: , icon: ico, onDismount() { From 5f6370e7780aa96c71c2769a4641db23b8451e53 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Thu, 24 Aug 2023 20:02:31 -0400 Subject: [PATCH 25/26] Make CPU reset workaround skip resume from sleep --- backend/Cargo.lock | 2 +- backend/Cargo.toml | 2 +- backend/src/settings/steam_deck/cpu.rs | 38 ++++++++++++++------------ package.json | 2 +- 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/backend/Cargo.lock b/backend/Cargo.lock index c108f06..b36860c 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -1052,7 +1052,7 @@ dependencies = [ [[package]] name = "powertools" -version = "1.4.0-beta2" +version = "1.4.0-beta3" dependencies = [ "async-trait", "libryzenadj", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 9a9b81a..c12933c 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "powertools" -version = "1.4.0-beta2" +version = "1.4.0-beta3" edition = "2021" authors = ["NGnius (Graham) "] description = "Backend (superuser) functionality for PowerTools" diff --git a/backend/src/settings/steam_deck/cpu.rs b/backend/src/settings/steam_deck/cpu.rs index 9a85f26..a6e4d10 100644 --- a/backend/src/settings/steam_deck/cpu.rs +++ b/backend/src/settings/steam_deck/cpu.rs @@ -375,25 +375,29 @@ impl Cpu { // https://github.com/NGnius/PowerTools/issues/107 fn clock_unset_workaround(&self) -> Result<(), Vec> { - let mut errors = Vec::new(); - POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.set_cpu(true, self.index); - // always set clock speeds, since it doesn't reset correctly (kernel/hardware bug) - POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.enforce_level(&self.sysfs)?; - // disable manual clock limits - log::debug!("Setting CPU {} to default clockspeed", self.index); - // max clock - self.set_clock_limit(self.index, self.limits.clock_max.max, ClockType::Max) - .unwrap_or_else(|e| errors.push(e)); - // min clock - self.set_clock_limit(self.index, self.limits.clock_min.min, ClockType::Min) - .unwrap_or_else(|e| errors.push(e)); + if !self.state.is_resuming { + let mut errors = Vec::new(); + POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.set_cpu(true, self.index); + // always set clock speeds, since it doesn't reset correctly (kernel/hardware bug) + POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.enforce_level(&self.sysfs)?; + // disable manual clock limits + log::debug!("Setting CPU {} to default clockspeed", self.index); + // max clock + self.set_clock_limit(self.index, self.limits.clock_max.max, ClockType::Max) + .unwrap_or_else(|e| errors.push(e)); + // min clock + self.set_clock_limit(self.index, self.limits.clock_min.min, ClockType::Min) + .unwrap_or_else(|e| errors.push(e)); - self.set_confirm().unwrap_or_else(|e| errors.push(e)); - POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.set_cpu(false, self.index); - if errors.is_empty() { - Ok(()) + self.set_confirm().unwrap_or_else(|e| errors.push(e)); + POWER_DPM_FORCE_PERFORMANCE_LEVEL_MGMT.set_cpu(false, self.index); + if errors.is_empty() { + Ok(()) + } else { + Err(errors) + } } else { - Err(errors) + Ok(()) } } diff --git a/package.json b/package.json index 18b50b0..02e97a5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "PowerTools", - "version": "1.4.0-beta2", + "version": "1.4.0-beta3", "description": "Power tweaks for power users", "scripts": { "build": "shx rm -rf dist && rollup -c", From 33c41c3e3da7ad3f5a0e5cbfd737332db70eec18 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Thu, 24 Aug 2023 21:22:43 -0400 Subject: [PATCH 26/26] Unset slow memory properly, if the kernel behaved as documented --- backend/src/settings/steam_deck/gpu.rs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/backend/src/settings/steam_deck/gpu.rs b/backend/src/settings/steam_deck/gpu.rs index de68403..f1f428b 100644 --- a/backend/src/settings/steam_deck/gpu.rs +++ b/backend/src/settings/steam_deck/gpu.rs @@ -182,12 +182,22 @@ impl Gpu { fn set_slow_memory(&self, slow: bool) -> Result<(), SettingError> { let path = GPU_MEMORY_DOWNCLOCK_ATTRIBUTE.path(&self.sysfs_card); - self.sysfs_card.set(GPU_MEMORY_DOWNCLOCK_ATTRIBUTE.to_owned(), slow as u8).map_err(|e| { - SettingError { - msg: format!("Failed to write to `{}`: {}", path.display(), e), - setting: crate::settings::SettingVariant::Gpu, - } - }) + if slow { + self.sysfs_card.set(GPU_MEMORY_DOWNCLOCK_ATTRIBUTE.to_owned(), slow as u8).map_err(|e| { + SettingError { + msg: format!("Failed to write to `{}`: {}", path.display(), e), + setting: crate::settings::SettingVariant::Gpu, + } + }) + } else { + // NOTE: there is a GPU driver/hardware bug that prevents this from working + self.sysfs_card.set(GPU_MEMORY_DOWNCLOCK_ATTRIBUTE.to_owned(), "0 1\n").map_err(|e| { + SettingError { + msg: format!("Failed to write to `{}`: {}", path.display(), e), + setting: crate::settings::SettingVariant::Gpu, + } + }) + } } fn set_force_performance_related(&mut self) -> Result<(), Vec> {