diff options
author | Hsuan Ting Chen <roccochen@chromium.org> | 2020-09-22 15:49:29 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-11-16 15:55:53 +0000 |
commit | d1903b2f2cbcb8c614e0c2d0a73392dc06af8979 (patch) | |
tree | 8553f16541be69f10aaf02d3eff073a708b7f485 | |
parent | dd1cf96793c7dbc74ea0cce87524574594210091 (diff) | |
download | vboot-d1903b2f2cbcb8c614e0c2d0a73392dc06af8979.tar.gz |
minidiag/ui: Prevent calling update action if memory test is finished
Skip calling diagnostics_memory_update_screen() action if memory test is
finished to reduce delays in memory diagnostics screens.
BUG=b:168776970, b:171852478
BRANCH=none
TEST=Build locally, boot recovery, select 'run diagnostics',
enter memory test (quick) screen, wait until test is finished,
and observe that the delay reduces while pressing keyboard
Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org>
Change-Id: I4f8dbadc68989112bce418119ff7405ec150a7df
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2423089
Signed-off-by: Martin Roth <martinroth@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2539362
Reviewed-by: Martin Roth <martinroth@google.com>
Commit-Queue: Martin Roth <martinroth@google.com>
Tested-by: Martin Roth <martinroth@google.com>
-rw-r--r-- | firmware/2lib/2ui_screens.c | 6 | ||||
-rw-r--r-- | firmware/2lib/include/2ui.h | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/firmware/2lib/2ui_screens.c b/firmware/2lib/2ui_screens.c index 1b4c5e29..878b4ed7 100644 --- a/firmware/2lib/2ui_screens.c +++ b/firmware/2lib/2ui_screens.c @@ -1123,6 +1123,11 @@ static vb2_error_t diagnostics_memory_update_screen(struct vb2_ui_context *ui, int reset) { const char *log_string = NULL; + + /* Early return if the memory test is done. */ + if (ui->state->test_finished) + return VB2_REQUEST_UI_CONTINUE; + vb2_error_t rv = op(reset, &log_string); if ((rv && rv != VB2_ERROR_EX_DIAG_TEST_RUNNING) || !log_string) { VB2_DEBUG("ERROR: Failed to retrieve memory test status\n"); @@ -1158,6 +1163,7 @@ static vb2_error_t diagnostics_memory_update_screen(struct vb2_ui_context *ui, DIAGNOSTICS_MEMORY_ITEM_CANCEL); if (ui->state->selected_item == DIAGNOSTICS_MEMORY_ITEM_CANCEL) ui->state->selected_item = DIAGNOSTICS_MEMORY_ITEM_BACK; + ui->state->test_finished = 1; } return VB2_REQUEST_UI_CONTINUE; diff --git a/firmware/2lib/include/2ui.h b/firmware/2lib/include/2ui.h index 44e24fdd..77c5acf4 100644 --- a/firmware/2lib/include/2ui.h +++ b/firmware/2lib/include/2ui.h @@ -78,6 +78,9 @@ struct vb2_screen_state { uint32_t page_count; uint32_t current_page; + /* For memory check screen. */ + int test_finished; /* Do not update screen if the content is done */ + struct vb2_screen_state *prev; }; |