mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-24 02:05:01 +00:00
Add VbExGetLocalizationCount
VbExGetLocalizationCount is a callback function which is supposed to return the number of screen locales supported by VbExDisplayScreen. After this change, we still try to get the number of locales from GBB first but when it fails, VbExGetLocalizationCount is called. The error code from VbGbbReadBmpHeader will be masked, similarly to the error from VbDislayScreenFromGBB. BUG=chromium:502066 BRANCH=tot TEST=Tested on Samus. make runtests Change-Id: I04ef8bf1ea02b1aaa05e65673b57bcea1932d8b0 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/304376 Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
committed by
chrome-bot
parent
27c90708e6
commit
be5eca9126
@@ -20,6 +20,11 @@
|
||||
static uint32_t disp_current_screen = VB_SCREEN_BLANK;
|
||||
static uint32_t disp_width = 0, disp_height = 0;
|
||||
|
||||
__attribute__((weak))
|
||||
VbError_t VbExGetLocalizationCount(uint32_t *count) {
|
||||
return VBERROR_UNKNOWN;
|
||||
}
|
||||
|
||||
VbError_t VbGetLocalizationCount(VbCommonParams *cparams, uint32_t *count)
|
||||
{
|
||||
BmpBlockHeader hdr;
|
||||
@@ -28,12 +33,15 @@ VbError_t VbGetLocalizationCount(VbCommonParams *cparams, uint32_t *count)
|
||||
/* Default to 0 on error */
|
||||
*count = 0;
|
||||
|
||||
/* First try to get the count from GBB */
|
||||
ret = VbGbbReadBmpHeader(cparams, &hdr);
|
||||
if (ret)
|
||||
if (ret == VBERROR_SUCCESS) {
|
||||
*count = hdr.number_of_localizations;
|
||||
return ret;
|
||||
}
|
||||
|
||||
*count = hdr.number_of_localizations;
|
||||
return VBERROR_SUCCESS;
|
||||
/* If GBB is broken or missing, fallback to the callback */
|
||||
return VbExGetLocalizationCount(count);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user