summaryrefslogtreecommitdiff
path: root/payloads
diff options
context:
space:
mode:
Diffstat (limited to 'payloads')
-rw-r--r--payloads/libpayload/drivers/video/graphics.c6
-rw-r--r--payloads/libpayload/include/cbgfx.h6
2 files changed, 9 insertions, 3 deletions
diff --git a/payloads/libpayload/drivers/video/graphics.c b/payloads/libpayload/drivers/video/graphics.c
index c8d0d4da4d..01e3565996 100644
--- a/payloads/libpayload/drivers/video/graphics.c
+++ b/payloads/libpayload/drivers/video/graphics.c
@@ -143,11 +143,11 @@ static int cbgfx_init(void)
fbinfo = lib_sysinfo.framebuffer;
if (!fbinfo)
- return -1;
+ return CBGFX_ERROR_FRAMEBUFFER_INFO;
fbaddr = phys_to_virt((uint8_t *)(uintptr_t)(fbinfo->physical_address));
if (!fbaddr)
- return -1;
+ return CBGFX_ERROR_FRAMEBUFFER_ADDR;
screen.size.width = fbinfo->x_resolution;
screen.size.height = fbinfo->y_resolution;
@@ -157,7 +157,7 @@ static int cbgfx_init(void)
/* Calculate canvas size & offset, assuming the screen is landscape */
if (screen.size.height > screen.size.width) {
LOG("Portrait screen not supported\n");
- return -1;
+ return CBGFX_ERROR_PORTRAIT_SCREEN;
}
canvas.size.height = screen.size.height;
canvas.size.width = canvas.size.height;
diff --git a/payloads/libpayload/include/cbgfx.h b/payloads/libpayload/include/cbgfx.h
index 61b9b49fc1..dca1be0acd 100644
--- a/payloads/libpayload/include/cbgfx.h
+++ b/payloads/libpayload/include/cbgfx.h
@@ -51,6 +51,12 @@
#define CBGFX_ERROR_BITMAP_DATA 0x12
/* bitmap error: scaling out of range */
#define CBGFX_ERROR_SCALE_OUT_OF_RANGE 0x13
+/* invalid framebuffer info */
+#define CBGFX_ERROR_FRAMEBUFFER_INFO 0x14
+/* invalid framebuffer address */
+#define CBGFX_ERROR_FRAMEBUFFER_ADDR 0x15
+/* portrait screen not supported */
+#define CBGFX_ERROR_PORTRAIT_SCREEN 0x16
struct fraction {
int32_t n;