feat(core): make frame buffer count board-configurable
What changed, and why it matters
This is a small, safe code organization change for the Trezor hardware wallet's display code. It allows different Trezor device models to configure how many screen frame buffers they use, defaulting to two. There is no security bug or fix here.
No security action needed. Review as normal build configurability change.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit modifies core/embed/io/display/fb_queue/fb_queue.h to include trezor_bsp.h so that board-specific headers can optionally define FRAME_BUFFER_COUNT, and wraps the default #define FRAME_BUFFER_COUNT 2 in an #ifndef guard. This is a build-time configurability refactor; it does not change runtime behavior for existing boards and introduces no new security-relevant logic.
Changed components
core/embed/io/display/fb_queue/fb_queue.hInspect captured patch +8 / −0
diff --git a/core/embed/io/display/fb_queue/fb_queue.h b/core/embed/io/display/fb_queue/fb_queue.h
index 5558eeb8..7edcb051 100644
--- a/core/embed/io/display/fb_queue/fb_queue.h
+++ b/core/embed/io/display/fb_queue/fb_queue.h
@@ -19,12 +19,20 @@
#pragma once
+// Pulled in for the board-provided FRAME_BUFFER_COUNT (via TREZOR_BOARD).
+// `fb_queue_t` embeds an array sized by FRAME_BUFFER_COUNT and is part of the
+// shared display driver state, so every translation unit must see the same
+// value - resolve it here rather than relying on include order.
+#include <trezor_bsp.h>
#include <trezor_types.h>
// Number of frame buffers used (1 or 2)
// If 1 buffer is selected, some animations may not
// be so smooth but the memory usage is lower.
+// Can be overridden per board/model in the board header.
+#ifndef FRAME_BUFFER_COUNT
#define FRAME_BUFFER_COUNT 2
+#endif
// Each frame buffer can be in one of the following states:
typedef struct {
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.