diff options
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/include/vboot_api.h | 2 | ||||
-rw-r--r-- | firmware/lib/include/vboot_display.h | 2 | ||||
-rw-r--r-- | firmware/lib/vboot_display.c | 12 | ||||
-rw-r--r-- | firmware/stub/vboot_api_stub.c | 2 |
4 files changed, 10 insertions, 8 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; } |