summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2012-09-06 16:57:07 -0700
committerGerrit <chrome-bot@google.com>2012-09-07 00:21:35 -0700
commitcf67ca4eb3ddbfc1699de1810478f765ac9575b7 (patch)
tree04d3c60ac75e76c04d9d3740571132004e407144 /firmware
parent2607e39f0eb9fde26297894b646c65d59990bb7b (diff)
downloadvboot-cf67ca4eb3ddbfc1699de1810478f765ac9575b7.tar.gz
Cache GBB images to speed up display
Rather than read the images from slow flash every time we need them, cache them the first time and use that cache thereafter. BUG=none BRANCH=snow,link TEST=manual Go into recovery mode on link See that we can display a new screen in roughly 20ms instead of the 250ms it previously took on link. Also tested on snow and shown to have no ill effects. Change-Id: Ieb39c44bddeb6315da8983669f19f550888659bd Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/32462 Commit-Ready: Tom Wai-Hong Tam <waihong@chromium.org> Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org> Tested-by: Tom Wai-Hong Tam <waihong@chromium.org>
Diffstat (limited to 'firmware')
-rw-r--r--firmware/lib/vboot_display.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/firmware/lib/vboot_display.c b/firmware/lib/vboot_display.c
index 16b1ea1a..b15b5183 100644
--- a/firmware/lib/vboot_display.c
+++ b/firmware/lib/vboot_display.c
@@ -161,7 +161,7 @@ static void VbRenderTextAtPos(char *text, int right_to_left,
VbError_t VbDisplayScreenFromGBB(VbCommonParams* cparams, uint32_t screen,
VbNvContext *vncptr) {
GoogleBinaryBlockHeader* gbb = (GoogleBinaryBlockHeader*)cparams->gbb_data;
- uint8_t* bmpfv = NULL;
+ static uint8_t* bmpfv;
void* fullimage = NULL;
BmpBlockHeader* hdr;
ScreenLayout* layout;
@@ -187,8 +187,10 @@ VbError_t VbDisplayScreenFromGBB(VbCommonParams* cparams, uint32_t screen,
}
/* Copy bitmap data from GBB into RAM for speed */
- bmpfv = (uint8_t*)VbExMalloc(gbb->bmpfv_size);
- Memcpy(bmpfv, ((uint8_t*)gbb) + gbb->bmpfv_offset, gbb->bmpfv_size);
+ if (!bmpfv) {
+ bmpfv = (uint8_t*)VbExMalloc(gbb->bmpfv_size);
+ Memcpy(bmpfv, ((uint8_t*)gbb) + gbb->bmpfv_offset, gbb->bmpfv_size);
+ }
/* Sanity-check the bitmap block header */
hdr = (BmpBlockHeader *)bmpfv;
@@ -341,8 +343,6 @@ VbError_t VbDisplayScreenFromGBB(VbCommonParams* cparams, uint32_t screen,
VbDisplayScreenFromGBB_exit:
VBDEBUG(("leaving VbDisplayScreenFromGBB() with %d\n",retval));
- /* Free the bitmap data copy */
- VbExFree(bmpfv);
return retval;
}