diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2015-10-06 16:50:33 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-10-15 18:08:23 -0700 |
commit | 9354379d64025bbb96a7ae28c3f1a81c1657bc4a (patch) | |
tree | afeda98c6cdfe5b49e62a1bd66fe789ec368b4e5 /firmware/lib/vboot_display.c | |
parent | 7ed261297f7b730e9f545ba59cbe2ed216850e19 (diff) | |
download | vboot-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
Diffstat (limited to 'firmware/lib/vboot_display.c')
-rw-r--r-- | firmware/lib/vboot_display.c | 12 |
1 files changed, 7 insertions, 5 deletions
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) |