summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2015-10-06 16:50:33 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-10-15 18:08:23 -0700
commit9354379d64025bbb96a7ae28c3f1a81c1657bc4a (patch)
treeafeda98c6cdfe5b49e62a1bd66fe789ec368b4e5
parent7ed261297f7b730e9f545ba59cbe2ed216850e19 (diff)
downloadvboot-9354379d64025bbb96a7ae28c3f1a81c1657bc4a.tar.gz
Pass locale to VbExDisplayScreen
This change makes VbDisplayScreen read the last saved locale from nvram and pass it to VbExDisplayScreen so that it can draw locale dependent screens. BUG=chromium:502066 BRANCH=tot TEST=Tested on Samus. make runtests. CQ-DEPEND=CL:304382,CL:306100,CL:306110 Change-Id: I9782ec5a8a9f8393998aa8a0d64e88ad1809233b Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/304375
-rw-r--r--firmware/include/vboot_api.h2
-rw-r--r--firmware/lib/include/vboot_display.h2
-rw-r--r--firmware/lib/vboot_display.c12
-rw-r--r--firmware/stub/vboot_api_stub.c2
-rw-r--r--tests/vboot_api_devmode_tests.c2
5 files changed, 11 insertions, 9 deletions
diff --git a/firmware/include/vboot_api.h b/firmware/include/vboot_api.h
index 4d2d616d..bc90b19e 100644
--- a/firmware/include/vboot_api.h
+++ b/firmware/include/vboot_api.h
@@ -767,7 +767,7 @@ VbError_t VbExDisplaySetDimension(uint32_t width, uint32_t height);
* to be simple ASCII text such as "NO GOOD" or "INSERT"; these screens should
* only be seen during development.
*/
-VbError_t VbExDisplayScreen(uint32_t screen_type);
+VbError_t VbExDisplayScreen(uint32_t screen_type, uint32_t locale);
/**
* Write an image to the display, with the upper left corner at the specified
diff --git a/firmware/lib/include/vboot_display.h b/firmware/lib/include/vboot_display.h
index c35f6697..0ab93f0f 100644
--- a/firmware/lib/include/vboot_display.h
+++ b/firmware/lib/include/vboot_display.h
@@ -13,7 +13,7 @@
#include "vboot_nvstorage.h"
VbError_t VbDisplayScreenFromGBB(VbCommonParams *cparams, uint32_t screen,
- VbNvContext *vncptr);
+ VbNvContext *vncptr, uint32_t locale);
VbError_t VbDisplayScreen(VbCommonParams *cparams, uint32_t screen, int force,
VbNvContext *vncptr);
VbError_t VbDisplayDebugInfo(VbCommonParams *cparams, VbNvContext *vncptr);
diff --git a/firmware/lib/vboot_display.c b/firmware/lib/vboot_display.c
index 1ad3c869..1a127e2d 100644
--- a/firmware/lib/vboot_display.c
+++ b/firmware/lib/vboot_display.c
@@ -138,12 +138,11 @@ void VbRenderTextAtPos(const char *text, int right_to_left,
}
VbError_t VbDisplayScreenFromGBB(VbCommonParams *cparams, uint32_t screen,
- VbNvContext *vncptr)
+ VbNvContext *vncptr, uint32_t localization)
{
char *fullimage = NULL;
BmpBlockHeader hdr;
uint32_t screen_index;
- uint32_t localization = 0;
VbError_t retval = VBERROR_UNKNOWN; /* Assume error until proven ok */
uint32_t inoutsize;
uint32_t i;
@@ -210,7 +209,6 @@ VbError_t VbDisplayScreenFromGBB(VbCommonParams *cparams, uint32_t screen,
}
/* Clip localization to number of localizations present in the GBB */
- VbNvGet(vncptr, VBNV_LOCALIZATION_INDEX, &localization);
if (localization >= hdr.number_of_localizations) {
localization = 0;
VbNvSet(vncptr, VBNV_LOCALIZATION_INDEX, localization);
@@ -308,6 +306,7 @@ VbError_t VbDisplayScreenFromGBB(VbCommonParams *cparams, uint32_t screen,
VbError_t VbDisplayScreen(VbCommonParams *cparams, uint32_t screen,
int force, VbNvContext *vncptr)
{
+ uint32_t locale;
VbError_t retval;
/* Initialize display if necessary */
@@ -327,13 +326,16 @@ VbError_t VbDisplayScreen(VbCommonParams *cparams, uint32_t screen,
/* Request the screen */
disp_current_screen = screen;
+ /* Read the locale last saved */
+ VbNvGet(vncptr, VBNV_LOCALIZATION_INDEX, &locale);
+
/* Look in the GBB first */
if (VBERROR_SUCCESS == VbDisplayScreenFromGBB(cparams, screen,
- vncptr))
+ vncptr, locale))
return VBERROR_SUCCESS;
/* If screen wasn't in the GBB bitmaps, fall back to a default */
- return VbExDisplayScreen(screen);
+ return VbExDisplayScreen(screen, locale);
}
static void Uint8ToString(char *buf, uint8_t val)
diff --git a/firmware/stub/vboot_api_stub.c b/firmware/stub/vboot_api_stub.c
index 7320b6ca..33aee93d 100644
--- a/firmware/stub/vboot_api_stub.c
+++ b/firmware/stub/vboot_api_stub.c
@@ -43,7 +43,7 @@ VbError_t VbExDisplaySetDimension(uint32_t width, uint32_t height)
return VBERROR_SUCCESS;
}
-VbError_t VbExDisplayScreen(uint32_t screen_type)
+VbError_t VbExDisplayScreen(uint32_t screen_type, uint32_t locale)
{
return VBERROR_SUCCESS;
}
diff --git a/tests/vboot_api_devmode_tests.c b/tests/vboot_api_devmode_tests.c
index 62441f75..cd927a88 100644
--- a/tests/vboot_api_devmode_tests.c
+++ b/tests/vboot_api_devmode_tests.c
@@ -265,7 +265,7 @@ VbError_t VbExBeep(uint32_t msec, uint32_t frequency) {
return beep_return;
}
-VbError_t VbExDisplayScreen(uint32_t screen_type) {
+VbError_t VbExDisplayScreen(uint32_t screen_type, uint32_t locale) {
switch(screen_type) {
case VB_SCREEN_BLANK:
VBDEBUG(("VbExDisplayScreen(BLANK)\n"));