summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--firmware/include/vboot_api.h9
-rw-r--r--firmware/lib/vboot_display.c16
-rw-r--r--firmware/stub/vboot_api_stub.c5
3 files changed, 30 insertions, 0 deletions
diff --git a/firmware/include/vboot_api.h b/firmware/include/vboot_api.h
index 92b9411d..1561defe 100644
--- a/firmware/include/vboot_api.h
+++ b/firmware/include/vboot_api.h
@@ -658,6 +658,15 @@ VbError_t VbExDisplayInit(uint32_t *width, uint32_t *height);
VbError_t VbExDisplayBacklight(uint8_t enable);
/**
+ * Sets the logical dimension to display.
+ *
+ * If the physical display is larger or smaller than given dimension, display
+ * provider may decide to scale or shift images (from VbExDisplayImage)to proper
+ * location.
+ */
+VbError_t VbExDisplaySetDimension(uint32_t width, uint32_t height);
+
+/**
* Display a predefined screen; see VB_SCREEN_* for valid screens.
*
* This is a backup method of screen display, intended for use if the GBB does
diff --git a/firmware/lib/vboot_display.c b/firmware/lib/vboot_display.c
index 910c60a0..669c4e8d 100644
--- a/firmware/lib/vboot_display.c
+++ b/firmware/lib/vboot_display.c
@@ -231,6 +231,22 @@ VbError_t VbDisplayScreenFromGBB(VbCommonParams *cparams, uint32_t screen,
switch(image_info.format) {
case FORMAT_BMP:
+ if (i == 0) {
+ /**
+ * In current version GBB bitmaps, first image
+ * is always the background.
+ */
+ ret = VbExDisplaySetDimension(
+ image_info.width,
+ image_info.height);
+ if (!ret) {
+ VBDEBUG(("VbExDisplaySetDimension"
+ "(%d,%d): failed.\n",
+ image_info.width,
+ image_info.height));
+ }
+ }
+
retval = VbExDisplayImage(layout.images[i].x,
layout.images[i].y,
fullimage, inoutsize);
diff --git a/firmware/stub/vboot_api_stub.c b/firmware/stub/vboot_api_stub.c
index 913cac15..b11a7fe1 100644
--- a/firmware/stub/vboot_api_stub.c
+++ b/firmware/stub/vboot_api_stub.c
@@ -36,6 +36,11 @@ VbError_t VbExDisplayBacklight(uint8_t enable)
return VBERROR_SUCCESS;
}
+VbError_t VbExDisplaySetDimension(uint32_t width, uint32_t height)
+{
+ return VBERROR_SUCCESS;
+}
+
VbError_t VbExDisplayScreen(uint32_t screen_type)
{
return VBERROR_SUCCESS;