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-12 12:40:04 +0000 |
commit | 34e90fe57efa32774f5a5d6073cbc74a126e676c (patch) | |
tree | e1cbbcac04e4ee7a4ab8efed8630b7d0204d4b9b | |
parent | 58894ec1de7fa63948a04f72434931081f0458e4 (diff) | |
download | vboot-34e90fe57efa32774f5a5d6073cbc74a126e676c.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
-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; }; |