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:
Bill Richardson
2011-08-16 17:38:58 -07:00
parent 49446d8489
commit b1c85a8442
3 changed files with 49 additions and 16 deletions

View File

@@ -506,14 +506,14 @@ VbError_t VbExDisplayBacklight(uint8_t enable);
VbError_t VbExDisplayScreen(uint32_t screen_type);
/* Write an image to the display, with the upper left corner at the
* specified pixel coordinates. The bitmap buffer is a
* platform-dependent binary blob with size specified by
* info->compressed_size. */
// TODO: I don't like passing an ImageInfo directly to the underlying firmware;
// should pass a struct defined in THIS header file, or individual params.
VbError_t VbExDisplayImage(uint32_t x, uint32_t y, const ImageInfo* info,
const void* buffer);
/* Write an image to the display, with the upper left corner at the specified
* pixel coordinates. The bitmap buffer is a pointer to the platform-dependent
* uncompressed binary blob with dimensions and format specified internally
* (for example, a raw BMP, GIF, PNG, whatever). We pass the size just for
* convenience.
*/
VbError_t VbExDisplayImage(uint32_t x, uint32_t y,
void* buffer, uint32_t buffersize);
/* Display a string containing debug information on the screen,
* rendered in a platform-dependent font. Should be able to handle
@@ -527,7 +527,7 @@ VbError_t VbExDisplayDebugInfo(const char* info_str);
* (CMOS breadcrumbs) is platform-specific. If we decide to
* soft-render the HWID string (chrome-os-partner:3693), we'll need to
* maintain our own fonts, so we'll likely display it via
* VbExDisplayBitmap() above. */
* VbExDisplayImage() above. */
/*****************************************************************************/
@@ -580,4 +580,14 @@ uint32_t VbExKeyboardRead(void);
* control loop so this can occur cleanly. */
uint32_t VbExIsShutdownRequested(void);
/* Expose the BIOS' built-in decompression routine to the vboot wrapper. The
* caller must know how large the uncompressed data will be and must manage
* that memory. The decompression routine just puts the uncompressed data into
* the specified buffer. We pass in the size of the outbuf, and get back the
* actual size used.
*/
VbError_t VbExDecompress(void *inbuf, uint32_t in_size,
uint32_t compression_type,
void *outbuf, uint32_t *out_size);
#endif /* VBOOT_REFERENCE_VBOOT_API_H_ */