diff options
author | Yu-Ping Wu <yupingso@chromium.org> | 2020-11-06 11:24:22 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-11-19 05:06:30 +0000 |
commit | abcd6d24548480c1b3aeb5998c15b8548cea3b76 (patch) | |
tree | 2b639efb536f166de64fc5ac4385362c5e3bab0a /firmware | |
parent | 9a820d73511379877b077fde452c31fede89da23 (diff) | |
download | vboot-abcd6d24548480c1b3aeb5998c15b8548cea3b76.tar.gz |
vboot/ui: Pass screen and locale_id to vb2ex_prepare_log_screen()
To support multi-line title for log screens, we need to support
different size of log box in each screen. Therefore, pass the screen and
locale information to vb2ex_prepare_log_screen() so that the number of
lines per page can be determined.
BUG=b:165187866
TEST=emerge-asurada depthcharge
BRANCH=none
Cq-Depend: chromium:2522156
Change-Id: I652d6261ed559a948e7bd578da3ec81d54374039
Signed-off-by: Yu-Ping Wu <yupingso@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/2522416
Reviewed-by: Hsuan Ting Chen <roccochen@chromium.org>
Reviewed-by: Joel Kitching <kitching@chromium.org>
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/2lib/2stub.c | 3 | ||||
-rw-r--r-- | firmware/2lib/2ui_screens.c | 18 | ||||
-rw-r--r-- | firmware/2lib/include/2api.h | 5 |
3 files changed, 18 insertions, 8 deletions
diff --git a/firmware/2lib/2stub.c b/firmware/2lib/2stub.c index e553c34b..782ad42c 100644 --- a/firmware/2lib/2stub.c +++ b/firmware/2lib/2stub.c @@ -87,7 +87,8 @@ const char *vb2ex_get_firmware_log(int reset) } __attribute__((weak)) -uint32_t vb2ex_prepare_log_screen(const char *str) +uint32_t vb2ex_prepare_log_screen(enum vb2_screen screen, uint32_t locale_id, + const char *str) { return 1; } diff --git a/firmware/2lib/2ui_screens.c b/firmware/2lib/2ui_screens.c index 2ec779c7..9571ab1f 100644 --- a/firmware/2lib/2ui_screens.c +++ b/firmware/2lib/2ui_screens.c @@ -297,7 +297,8 @@ static vb2_error_t debug_info_init(struct vb2_ui_context *ui) ui->error_code = VB2_UI_ERROR_DEBUG_LOG; return vb2_ui_screen_back(ui); } - ui->state->page_count = vb2ex_prepare_log_screen(log_string); + ui->state->page_count = vb2ex_prepare_log_screen( + ui->state->screen->id, ui->locale_id, log_string); if (ui->state->page_count == 0) { VB2_DEBUG("ERROR: Failed to prepare debug info screen\n"); ui->error_code = VB2_UI_ERROR_DEBUG_LOG; @@ -315,7 +316,8 @@ static vb2_error_t debug_info_reinit(struct vb2_ui_context *ui) ui->error_code = VB2_UI_ERROR_DEBUG_LOG; return vb2_ui_screen_back(ui); } - ui->state->page_count = vb2ex_prepare_log_screen(log_string); + ui->state->page_count = vb2ex_prepare_log_screen( + ui->state->screen->id, ui->locale_id, log_string); if (ui->state->page_count == 0) { VB2_DEBUG("ERROR: Failed to prepare debug info screen\n"); ui->error_code = VB2_UI_ERROR_DEBUG_LOG; @@ -359,7 +361,8 @@ static vb2_error_t firmware_log_init(struct vb2_ui_context *ui) ui->error_code = VB2_UI_ERROR_FIRMWARE_LOG; return vb2_ui_screen_back(ui); } - ui->state->page_count = vb2ex_prepare_log_screen(log_string); + ui->state->page_count = vb2ex_prepare_log_screen( + ui->state->screen->id, ui->locale_id, log_string); if (ui->state->page_count == 0) { VB2_DEBUG("ERROR: Failed to prepare firmware log screen\n"); ui->error_code = VB2_UI_ERROR_FIRMWARE_LOG; @@ -377,7 +380,8 @@ static vb2_error_t firmware_log_reinit(struct vb2_ui_context *ui) ui->error_code = VB2_UI_ERROR_FIRMWARE_LOG; return vb2_ui_screen_back(ui); } - ui->state->page_count = vb2ex_prepare_log_screen(log_string); + ui->state->page_count = vb2ex_prepare_log_screen( + ui->state->screen->id, ui->locale_id, log_string); if (ui->state->page_count == 0) { VB2_DEBUG("ERROR: Failed to prepare firmware log screen\n"); ui->error_code = VB2_UI_ERROR_FIRMWARE_LOG; @@ -1082,7 +1086,8 @@ static vb2_error_t diagnostics_storage_init(struct vb2_ui_context *ui) return vb2_ui_screen_back(ui); } - ui->state->page_count = vb2ex_prepare_log_screen(log_string); + ui->state->page_count = vb2ex_prepare_log_screen( + ui->state->screen->id, ui->locale_id, log_string); if (ui->state->page_count == 0) { VB2_DEBUG("ERROR: Failed to prepare storage log screen\n"); ui->error_code = VB2_UI_ERROR_DIAGNOSTICS; @@ -1140,7 +1145,8 @@ static vb2_error_t diagnostics_memory_update_screen(struct vb2_ui_context *ui, return vb2_ui_screen_back(ui); } - ui->state->page_count = vb2ex_prepare_log_screen(log_string); + ui->state->page_count = vb2ex_prepare_log_screen( + ui->state->screen->id, ui->locale_id, log_string); if (ui->state->page_count == 0) { VB2_DEBUG("ERROR: Failed to prepare memory log screen, error: " "%#x\n", rv); diff --git a/firmware/2lib/include/2api.h b/firmware/2lib/include/2api.h index 4c5e1dc6..9448e12a 100644 --- a/firmware/2lib/include/2api.h +++ b/firmware/2lib/include/2api.h @@ -1491,10 +1491,13 @@ const char *vb2ex_get_firmware_log(int reset); * pages in the log string is returned. If the log string ever changes, this * function should be called again before the next vb2ex_display_ui() call. * + * @param screen Screen to display the log. + * @param locale_id Id of current locale. * @param str The log string to display. * @return The number of pages after pagination. 0 if none or error. */ -uint32_t vb2ex_prepare_log_screen(const char *str); +uint32_t vb2ex_prepare_log_screen(enum vb2_screen screen, uint32_t locale_id, + const char *str); /** * Get the full storage diagnostic log. |