diff --git a/firmware/Makefile b/firmware/Makefile index 0e8db324b7..61ecf5ef05 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -48,6 +48,11 @@ CFLAGS += -DUNROLL_LOOPS # Way to do things. See chrome-os-partner:7689, and the commit message # that made this change. CFLAGS += -DRANDOM_POWER_OFF + +# On x86 we don't actually read the GBB data into RAM until it is needed. +# Therefore it makes sense to cache it rather than reading it each time. +# Enable this feature. +CFLAGS += -DCOPY_BMP_DATA endif INCLUDES = \ diff --git a/firmware/lib/vboot_display.c b/firmware/lib/vboot_display.c index 88adc4642a..ca3360b3ea 100644 --- a/firmware/lib/vboot_display.c +++ b/firmware/lib/vboot_display.c @@ -188,8 +188,12 @@ VbError_t VbDisplayScreenFromGBB(VbCommonParams* cparams, uint32_t screen, /* Copy bitmap data from GBB into RAM for speed */ if (!bmpfv) { +#ifdef COPY_BMP_DATA bmpfv = (uint8_t*)VbExMalloc(gbb->bmpfv_size); Memcpy(bmpfv, ((uint8_t*)gbb) + gbb->bmpfv_offset, gbb->bmpfv_size); +#else + bmpfv = ((uint8_t *)gbb) + gbb->bmpfv_offset; +#endif } /* Sanity-check the bitmap block header */