summaryrefslogtreecommitdiff
path: root/firmware/lib/vboot_display.c
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2019-04-01 15:04:21 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-04-04 15:10:16 -0700
commit70ba5afd959e0c3d40c6d6d651302be18f19ebd9 (patch)
treea698498f8733572eec9e772c0f6eb8d23e2e57a6 /firmware/lib/vboot_display.c
parentcec5844155be07ef37316d3e085fb996803214fd (diff)
downloadvboot-70ba5afd959e0c3d40c6d6d651302be18f19ebd9.tar.gz
ui: Allow dismissing debug output with Esc, fix detachable issues
The new debug output using the HWID font looks pretty, but it does bring a few new UX issues since it often completely overlays the main firmware screen. This patch adds the ability to force redrawing the screen (i.e. dismissing any debug text that might be on there) by pressing Esc (which is probably the most natural thing a user would press to try to get rid of the text). This check for Esc happens after any other key checks, so pressing it at the TO_DEV screen will still return you to the recovery screen (as it has before). I also noticed some problems when dismissing debug info by selecting a different menu option in the detachable UI: we don't normally redraw the whole screen when switching between options, so this will still leave the debug output in the background (which is usable but ugly). With this patch the detachable UI will always redraw the screen on the first draw request after displaying debug info. BRANCH=None BUG=None TEST=Manually went through affected transitions on Kevin (both clamshell and detachable). Change-Id: Ifadbc1a258bb7a7f8029e0f1f1786230aa724ae5 Signed-off-by: Julius Werner <jwerner@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1548301 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Shelley Chen <shchen@chromium.org>
Diffstat (limited to 'firmware/lib/vboot_display.c')
-rw-r--r--firmware/lib/vboot_display.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/firmware/lib/vboot_display.c b/firmware/lib/vboot_display.c
index 6ed5ad6c..f9c520da 100644
--- a/firmware/lib/vboot_display.c
+++ b/firmware/lib/vboot_display.c
@@ -72,7 +72,7 @@ VbError_t VbDisplayMenu(struct vb2_context *ctx, uint32_t screen, int force,
* 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)
+ if (disp_current_screen != screen || force)
redraw_base_screen = 1;
/*
@@ -415,6 +415,8 @@ static uint8_t MagicBuffer[MAGIC_WORD_LEN];
VbError_t VbCheckDisplayKey(struct vb2_context *ctx, uint32_t key,
const VbScreenData *data)
{
+ uint32_t loc = 0;
+ uint32_t count = 0;
int i;
/* Update key buffer */
@@ -423,15 +425,18 @@ VbError_t VbCheckDisplayKey(struct vb2_context *ctx, uint32_t key,
/* Save as lower-case ASCII */
MagicBuffer[MAGIC_WORD_LEN - 1] = (key | 0x20) & 0xFF;
- if ('\t' == key) {
+ switch (key) {
+ case '\t':
/* Tab = display debug info */
return VbDisplayDebugInfo(ctx);
- } else if (VB_KEY_LEFT == key || VB_KEY_RIGHT == key ||
- VB_KEY_DOWN == key || VB_KEY_UP == key) {
+ case VB_KEY_ESC:
+ /* Force redraw current screen (to clear Tab debug output) */
+ return VbDisplayScreen(ctx, disp_current_screen, 1, data);
+ case VB_KEY_LEFT:
+ case VB_KEY_RIGHT:
+ case VB_KEY_UP:
+ case VB_KEY_DOWN:
/* Arrow keys = change localization */
- uint32_t loc = 0;
- uint32_t count = 0;
-
loc = vb2_nv_get(ctx, VB2_NV_LOCALIZATION_INDEX);
if (VBERROR_SUCCESS != VbExGetLocalizationCount(&count))
loc = 0; /* No localization count (bad GBB?) */