summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHung-Te Lin <hungte@chromium.org>2014-05-09 20:40:15 +0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-05-13 18:46:11 +0000
commit5e8f1db9d4a483678c376a0a276b8f774f91d0ac (patch)
treee2bc7751c5d228d5bc215267329bf8e01bd3f592
parent850b74fa19f6eadd1d3221f484c738f41f993653 (diff)
downloadvboot-5e8f1db9d4a483678c376a0a276b8f774f91d0ac.tar.gz
lib: Add VbExDisplaySetDimension.
For displaying GBB images on panels with different dimension, X86 has VESA mode and VBIOS to scale automatically but ARM does not have such mode settings. If we install a larger panel on ARM platforms, current firmware will render the screens in left-top corner and leave black borders in right-bottom corner. To render images correctly, vboot library has to send out the expected dimension (similar to the VESA mode) so display provider can scale or shift images. BUG=chrome-os-partner:28494 TEST=emerge-nyan vboot_reference CQ-DEPEND=CL:199051,CL:199045 BRANCH=none Change-Id: I6d60f755ca2bcbd3135631d7624a8a4a4cff68b1 Reviewed-on: https://chromium-review.googlesource.com/199043 Reviewed-by: Bill Richardson <wfrichar@chromium.org> Tested-by: Hung-Te Lin <hungte@chromium.org> Commit-Queue: Hung-Te Lin <hungte@chromium.org>
-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;