diff options
author | Shelley Chen <shchen@chromium.org> | 2017-03-13 17:39:38 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-05-25 22:51:14 -0700 |
commit | 2ed9ca605c7ad48b4a2821c5d90c0b569a0afbfe (patch) | |
tree | ba17db3163c7d38f0b70e0597803b8154605b399 /firmware/lib/vboot_display.c | |
parent | 05f6675acd42006421d73f44f67b679e2c57909a (diff) | |
download | vboot-release-R60-9592.B.tar.gz |
detachables: New code path for displaying detachable menusstabilize-9592.82.Bstabilize-9592.67.Bstabilize-9592.55.Bstabilize-9592.15.Brelease-R60-9592.B
BUG=b:35585623
BRANCH=None
TEST=None
CQ-DEPEND=CL:457863
Change-Id: Ib2f8d93334cecfd80169842994ea7561baf41378
Signed-off-by: Shelley Chen <shchen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/457839
Diffstat (limited to 'firmware/lib/vboot_display.c')
-rw-r--r-- | firmware/lib/vboot_display.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/firmware/lib/vboot_display.c b/firmware/lib/vboot_display.c index 18aaf783..abf2d698 100644 --- a/firmware/lib/vboot_display.c +++ b/firmware/lib/vboot_display.c @@ -22,6 +22,7 @@ #include "vboot_nvstorage.h" static uint32_t disp_current_screen = VB_SCREEN_BLANK; +static uint32_t disp_current_index = 0; static uint32_t disp_width = 0, disp_height = 0; __attribute__((weak)) @@ -372,6 +373,47 @@ VbError_t VbDisplayScreen(struct vb2_context *ctx, return rv; } +VbError_t VbDisplayMenu(struct vb2_context *ctx, + VbCommonParams *cparams, uint32_t screen, int force, + uint32_t selected_index) +{ + uint32_t locale; + VbError_t rv; + uint32_t redraw_base_screen = 0; + + /* + * If requested screen/selected_index is the same as the current one, + * we're done. + */ + if (disp_current_screen == screen && + disp_current_index == selected_index && + !force) + return VBERROR_SUCCESS; + + /* + * If current screen is not the same, make sure we redraw the base + * screen as well to avoid having artifacts from the menu. + */ + if (disp_current_screen != screen) + redraw_base_screen = 1; + + /* Read the locale last saved */ + locale = vb2_nv_get(ctx, VB2_NV_LOCALIZATION_INDEX); + + rv = VbExDisplayMenu(screen, locale, selected_index, redraw_base_screen); + + if (rv == VBERROR_SUCCESS) { + /* + * Keep track of the currently displayed screen and + * selected_index + */ + disp_current_screen = screen; + disp_current_index = selected_index; + } + + return rv; +} + static void Uint8ToString(char *buf, uint8_t val) { const char *trans = "0123456789abcdef"; |