Skip to content

Commit

Permalink
fix(core): introduce ui_overlay feature - fixes T3T1 bootloader compi…
Browse files Browse the repository at this point in the history
…lation with new rendering

[no changelog]
  • Loading branch information
TychoVrahe committed Aug 19, 2024
1 parent 77eeabf commit 5417ec1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions core/SConscript.firmware
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,7 @@ def cargo_build():

if NEW_RENDERING and TREZOR_MODEL in ('T3T1', 'DISC2'):
features.append('ui_image_buffer')
features.append('ui_overlay')

features.extend(FEATURES_AVAILABLE)

Expand Down
1 change: 1 addition & 0 deletions core/SConscript.unix
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,7 @@ def cargo_build():

if NEW_RENDERING and TREZOR_MODEL in ('T3T1', ):
features.append('ui_image_buffer')
features.append('ui_overlay')

if NEW_RENDERING:
features.append('new_rendering')
Expand Down
2 changes: 2 additions & 0 deletions core/embed/rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ ui_blurring = []
ui_jpeg_decoder = ["jpeg"]
ui_image_buffer = []
ui_color_32bit = []
ui_overlay = []
new_rendering = []
bootloader = []
button = []
Expand Down Expand Up @@ -62,6 +63,7 @@ test = [
"ui_jpeg_decoder",
"ui_blurring",
"ui_image_buffer",
"ui_overlay",
"universal_fw",
]
universal_fw = []
Expand Down
4 changes: 4 additions & 0 deletions core/embed/rust/src/ui/model_mercury/cshape/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
mod loader;

#[cfg(feature = "ui_overlay")]
mod unlock_overlay;

#[cfg(feature = "ui_overlay")]
mod keyboard_overlay;

#[cfg(feature = "ui_overlay")]
pub use unlock_overlay::UnlockOverlay;

#[cfg(feature = "ui_overlay")]
pub use keyboard_overlay::KeyboardOverlay;

pub use loader::{render_loader, LoaderRange};
9 changes: 7 additions & 2 deletions core/embed/rust/src/ui/shape/cache/drawing_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,22 @@ const ZLIB_CACHE_SLOTS: usize = 1;
#[cfg(not(feature = "xframebuffer"))]
const ZLIB_CACHE_SLOTS: usize = 3;

#[cfg(not(feature = "xframebuffer"))]
const RENDER_BUFF_SIZE: usize = (240 * 2 * 16) + ALIGN_PAD;

#[cfg(feature = "model_mercury")]
#[cfg(feature = "ui_overlay")]
const IMAGE_BUFF_SIZE: usize = 240 * 240 + ALIGN_PAD;
#[cfg(not(feature = "model_mercury"))]
#[cfg(not(feature = "ui_overlay"))]
const IMAGE_BUFF_SIZE: usize = 2048 + ALIGN_PAD;

pub type ImageBuff = [u8; IMAGE_BUFF_SIZE];

#[cfg(not(feature = "xframebuffer"))]
pub type RenderBuff = [u8; RENDER_BUFF_SIZE];

pub type ImageBuffRef<'a> = RefMut<'a, ImageBuff>;

#[cfg(not(feature = "xframebuffer"))]
pub type RenderBuffRef<'a> = RefMut<'a, RenderBuff>;

pub struct DrawingCache<'a> {
Expand Down

0 comments on commit 5417ec1

Please sign in to comment.