summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2019-03-01 14:51:25 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-03-08 21:21:13 -0800
commite20d92ab46a9a60925ede8892c59eba10b34c4d1 (patch)
treec44ee79df421b35392d626d3a97f5e6477bfaad5
parent9c064133217de36332d184e92d20f467967e4e76 (diff)
downloadvboot-e20d92ab46a9a60925ede8892c59eba10b34c4d1.tar.gz
vboot_display: Record screen change even on error
VbExDisplayScreen/Menu() can fail for many reasons... most often because some asset that was part of the intended screen couldn't be found. Most of the errors are permanent and will not get better by trying again. The respective vboot wrapper functions track the last screen change that was requested so that we don't keep drawing the same screen over and over again for every keyboard poll. The current code does not update this tracking when there was an error during drawing, but the benefit of this is questionable... those errors usually mean that some part wasn't drawn correctly, but they don't mean "please keep trying". This problem is currently worked around in depthcharge by just always passing VBERROR_SUCCESS even if the underlying screen drawing calls failed, but it seems cleaner not to hide this error from vboot and instead make vboot deal with it better. BRANCH=None BUG=None TEST=Navigated through some menus both with and without bitmaps in CBFS. Change-Id: I3d86a5150fddce9fab18189b2b706960d429b2b7 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1497037 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Mathew King <mathewk@chromium.org>
-rw-r--r--firmware/lib/vboot_display.c37
1 files changed, 14 insertions, 23 deletions
diff --git a/firmware/lib/vboot_display.c b/firmware/lib/vboot_display.c
index ad23ebf8..49c5331d 100644
--- a/firmware/lib/vboot_display.c
+++ b/firmware/lib/vboot_display.c
@@ -39,29 +39,24 @@ VbError_t VbDisplayScreen(struct vb2_context *ctx, uint32_t screen, int force,
const VbScreenData *data)
{
uint32_t locale;
- VbError_t rv;
/* If requested screen is the same as the current one, we're done. */
if (disp_current_screen == screen && !force)
return VBERROR_SUCCESS;
+ /* Keep track of the currently displayed screen */
+ disp_current_screen = screen;
+
/* Read the locale last saved */
locale = vb2_nv_get(ctx, VB2_NV_LOCALIZATION_INDEX);
- rv = VbExDisplayScreen(screen, locale, data);
-
- if (rv == VBERROR_SUCCESS)
- /* Keep track of the currently displayed screen */
- disp_current_screen = screen;
-
- return rv;
+ return VbExDisplayScreen(screen, locale, data);
}
VbError_t VbDisplayMenu(struct vb2_context *ctx, uint32_t screen, int force,
uint32_t selected_index, uint32_t disabled_idx_mask)
{
uint32_t locale;
- VbError_t rv;
uint32_t redraw_base_screen = 0;
/*
@@ -80,23 +75,19 @@ VbError_t VbDisplayMenu(struct vb2_context *ctx, uint32_t screen, int force,
if (disp_current_screen != screen)
redraw_base_screen = 1;
+ /*
+ * Keep track of the currently displayed screen and
+ * selected_index
+ */
+ disp_current_screen = screen;
+ disp_current_index = selected_index;
+ disp_disabled_idx_mask = disabled_idx_mask;
+
/* Read the locale last saved */
locale = vb2_nv_get(ctx, VB2_NV_LOCALIZATION_INDEX);
- rv = VbExDisplayMenu(screen, locale, selected_index,
- disabled_idx_mask, 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;
- disp_disabled_idx_mask = disabled_idx_mask;
- }
-
- return rv;
+ return VbExDisplayMenu(screen, locale, selected_index,
+ disabled_idx_mask, redraw_base_screen);
}
static void Uint8ToString(char *buf, uint8_t val)