mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-24 02:05:01 +00:00
Decompress images in vboot wrapper, not in BIOS.
The vboot library needs to decompress the images so that it can handle those that are special cases (like rendering the HWID). This means that 1) it needs access to the BIOS' native decompression routine, and 2) that VbExDisplayImage() only needs to handle the uncompressed native-format image and doesn't need to know about how the image is packed in the GBB. BUG=chromium-os:19134 TEST=manual This requires a change to vboot_api.h, which requires a (simultaneous) matching change to the BIOS, at least for U-Boot, which builds separately. I've made that change and run the "vbexport_test display" command from the modified U-Boot, but that also requires a change to the way U-Boot is built so that I can get at the U-Boot commandline. Change-Id: I449fb467cd3a68e742f27ec41b95d52685459d89 Reviewed-on: http://gerrit.chromium.org/gerrit/6129 Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org> Tested-by: Bill Richardson <wfrichar@chromium.org>
This commit is contained in:
@@ -71,13 +71,14 @@ static VbError_t VbDisplayScreenFromGBB(VbCommonParams* cparams,
|
||||
uint32_t screen) {
|
||||
GoogleBinaryBlockHeader* gbb = (GoogleBinaryBlockHeader*)cparams->gbb_data;
|
||||
uint8_t* bmpfv = NULL;
|
||||
uint8_t* fullimage = NULL;
|
||||
BmpBlockHeader* hdr;
|
||||
ScreenLayout* layout;
|
||||
ImageInfo* image_info;
|
||||
uint32_t screen_index;
|
||||
uint32_t localization = 0;
|
||||
VbError_t retval = VBERROR_UNKNOWN; /* Assume error until proven
|
||||
* successful */
|
||||
VbError_t retval = VBERROR_UNKNOWN; /* Assume error until proven ok */
|
||||
uint32_t inoutsize;
|
||||
uint32_t offset;
|
||||
uint32_t i;
|
||||
|
||||
@@ -165,9 +166,25 @@ static VbError_t VbDisplayScreenFromGBB(VbCommonParams* cparams,
|
||||
layout->images[i].x, layout->images[i].y,
|
||||
image_info->compressed_size, image_info->original_size,
|
||||
image_info->tag, offset));
|
||||
|
||||
retval = VbExDisplayImage(layout->images[i].x, layout->images[i].y,
|
||||
image_info, bmpfv + offset + sizeof(ImageInfo));
|
||||
if (COMPRESS_NONE != image_info->compression) {
|
||||
inoutsize = image_info->original_size;
|
||||
fullimage = (uint8_t*)VbExMalloc(inoutsize);
|
||||
retval = VbExDecompress(bmpfv + offset + sizeof(ImageInfo),
|
||||
image_info->compressed_size,
|
||||
image_info->compression,
|
||||
fullimage, &inoutsize);
|
||||
if (VBERROR_SUCCESS != retval) {
|
||||
VbExFree(fullimage);
|
||||
goto VbDisplayScreenFromGBB_exit;
|
||||
}
|
||||
retval = VbExDisplayImage(layout->images[i].x, layout->images[i].y,
|
||||
fullimage, inoutsize);
|
||||
VbExFree(fullimage);
|
||||
} else {
|
||||
retval = VbExDisplayImage(layout->images[i].x, layout->images[i].y,
|
||||
bmpfv + offset + sizeof(ImageInfo),
|
||||
image_info->original_size);
|
||||
}
|
||||
if (VBERROR_SUCCESS != retval)
|
||||
goto VbDisplayScreenFromGBB_exit;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user