From 12891d6af1304c031a17f48c5e28cc83d19e9ff5 Mon Sep 17 00:00:00 2001 From: bunnie Date: Fri, 10 May 2024 00:08:04 +0800 Subject: [PATCH 1/6] cleanup dangling server reference i think this actually didn't break hosted mode because sha2 emulation doesn't use hardware, but this cleans up a warning at least --- xtask/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 6c7d25ab9..1a6d9ee7b 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -98,7 +98,7 @@ fn main() -> Result<(), Box> { // security "root-keys", "trng", - "sha2@0.10.8", + "sha2", // "engine-25519", "jtag", // GUI front end From 52e5d21e6ff686352c0a45fe7c98cc6a3e067b9a Mon Sep 17 00:00:00 2001 From: bunnie Date: Fri, 10 May 2024 00:33:59 +0800 Subject: [PATCH 2/6] work around white screen issue on Windows 11 (#538) This is the work-around suggested at https://github.com/emoon/rust_minifb/issues/351 until a new release is tagged. --- services/graphics-server/Cargo.toml | 2 +- services/graphics-server/src/backend/minifb.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/services/graphics-server/Cargo.toml b/services/graphics-server/Cargo.toml index eeeacad23..25fc23e83 100644 --- a/services/graphics-server/Cargo.toml +++ b/services/graphics-server/Cargo.toml @@ -33,7 +33,7 @@ cramium-hal = { path = "../../libs/cramium-hal", optional = true, features = [ ] } [target.'cfg(any(windows,unix))'.dependencies] -minifb = "0.23.0" +minifb = { git = "https://github.com/emoon/rust_minifb.git", rev = "633e6cd4f8f55fd9cbedc461976dde0f408bea35" } [features] cramium-soc = [ diff --git a/services/graphics-server/src/backend/minifb.rs b/services/graphics-server/src/backend/minifb.rs index e30f7e07f..a472eca1d 100644 --- a/services/graphics-server/src/backend/minifb.rs +++ b/services/graphics-server/src/backend/minifb.rs @@ -16,7 +16,7 @@ pub const FB_WIDTH_PIXELS: usize = WIDTH as usize; pub const FB_LINES: usize = HEIGHT as usize; pub const FB_SIZE: usize = WIDTH_WORDS * HEIGHT as usize; // 44 bytes by 536 lines -const MAX_FPS: u64 = 60; +const MAX_FPS: usize = 60; const DARK_COLOUR: u32 = 0xB5B5AD; const LIGHT_COLOUR: u32 = 0x1B1B19; @@ -166,7 +166,7 @@ impl MinifbThread { }); // Limit the maximum update rate - window.limit_update_rate(Some(std::time::Duration::from_micros(1000 * 1000 / MAX_FPS))); + window.set_target_fps(MAX_FPS); let xns = xous_names::XousNames::new().unwrap(); let kbd = keyboard::Keyboard::new(&xns).expect("GFX|hosted can't connect to KBD for emulation"); From d4a306172f43601805160e68617bdf73755c42dc Mon Sep 17 00:00:00 2001 From: bunnie Date: Fri, 10 May 2024 00:35:16 +0800 Subject: [PATCH 3/6] reflect minifb version change in lockfile --- Cargo.lock | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dd3d216a2..2341db235 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1143,12 +1143,6 @@ dependencies = [ "cipher", ] -[[package]] -name = "cty" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" - [[package]] name = "curve25519-dalek" version = "4.1.2" @@ -2884,9 +2878,8 @@ checksum = "c3c8dda44ff03a2f238717214da50f65d5a53b45cd213a7370424ffdb6fae815" [[package]] name = "minifb" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9e21c5f89bb820c7878c300c5b944e65de0f1b2a75e0be92ce670b95943740e" +version = "0.25.0" +source = "git+https://github.com/emoon/rust_minifb.git?rev=633e6cd4f8f55fd9cbedc461976dde0f408bea35#633e6cd4f8f55fd9cbedc461976dde0f408bea35" dependencies = [ "cc", "dlib", @@ -4010,12 +4003,9 @@ dependencies = [ [[package]] name = "raw-window-handle" -version = "0.4.3" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b800beb9b6e7d2df1fe337c9e3d04e3af22a124460fb4c30fcc22c9117cefb41" -dependencies = [ - "cty", -] +checksum = "8cc3bcbdb1ddfc11e700e62968e6b4cc9c75bb466464ad28fb61c5b2c964418b" [[package]] name = "rayon" From f1ee38cf6a3177ea6a9a4ab7fd71a34f4bb54e3d Mon Sep 17 00:00:00 2001 From: bunnie Date: Fri, 10 May 2024 00:38:29 +0800 Subject: [PATCH 4/6] remove unused feature flag that is triggering a warning --- xtask/src/main.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 1a6d9ee7b..929ec9685 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -305,7 +305,6 @@ fn main() -> Result<(), Box> { .add_services(&user_pkgs) .add_feature("pddbtest") .add_feature("ditherpunk") - .add_feature("tracking-alloc") .add_feature("tls") // .add_feature("test-rekey") .add_apps(&get_cratespecs()); From 90108f266e96c9b3ed513db60601fe18f7b48871 Mon Sep 17 00:00:00 2001 From: bunnie Date: Fri, 10 May 2024 00:38:41 +0800 Subject: [PATCH 5/6] allow this trait to be unused it's not used in all configs but it's not a bad thing to have it around. --- kernel/src/io.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/src/io.rs b/kernel/src/io.rs index 9caa56b9e..53e653a2b 100644 --- a/kernel/src/io.rs +++ b/kernel/src/io.rs @@ -2,12 +2,14 @@ // SPDX-License-Identifier: Apache-2.0 /// A trait for serial like drivers which are byte-oriented sinks. +#[allow(dead_code)] pub trait SerialWrite { /// Write a single byte. fn putc(&mut self, b: u8); } /// A trait for serial like drivers which allows reading from a source. +#[allow(dead_code)] pub trait SerialRead { /// Read a single byte. fn getc(&mut self) -> Option; From 65caa55407f8bf5c8d081e4510a4378bb0433eb4 Mon Sep 17 00:00:00 2001 From: bunnie Date: Sun, 12 May 2024 12:32:45 +0800 Subject: [PATCH 6/6] bump to minifb 0.26.0 solves #538 --- Cargo.lock | 5 +++-- services/graphics-server/Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2341db235..bb400b1f7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2878,8 +2878,9 @@ checksum = "c3c8dda44ff03a2f238717214da50f65d5a53b45cd213a7370424ffdb6fae815" [[package]] name = "minifb" -version = "0.25.0" -source = "git+https://github.com/emoon/rust_minifb.git?rev=633e6cd4f8f55fd9cbedc461976dde0f408bea35#633e6cd4f8f55fd9cbedc461976dde0f408bea35" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36eac3001258de903d8e8f79b91b6c03cb19214f823c01db1505ef250cb980f9" dependencies = [ "cc", "dlib", diff --git a/services/graphics-server/Cargo.toml b/services/graphics-server/Cargo.toml index 25fc23e83..59291a9ac 100644 --- a/services/graphics-server/Cargo.toml +++ b/services/graphics-server/Cargo.toml @@ -33,7 +33,7 @@ cramium-hal = { path = "../../libs/cramium-hal", optional = true, features = [ ] } [target.'cfg(any(windows,unix))'.dependencies] -minifb = { git = "https://github.com/emoon/rust_minifb.git", rev = "633e6cd4f8f55fd9cbedc461976dde0f408bea35" } +minifb = "0.26.0" [features] cramium-soc = [