summaryrefslogtreecommitdiff
path: root/payloads/libpayload/include/cbgfx.h
diff options
context:
space:
mode:
Diffstat (limited to 'payloads/libpayload/include/cbgfx.h')
-rw-r--r--payloads/libpayload/include/cbgfx.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/payloads/libpayload/include/cbgfx.h b/payloads/libpayload/include/cbgfx.h
index 85b61a7b10..72e512267a 100644
--- a/payloads/libpayload/include/cbgfx.h
+++ b/payloads/libpayload/include/cbgfx.h
@@ -56,6 +56,8 @@
#define CBGFX_ERROR_FRAMEBUFFER_ADDR 0x15
/* portrait screen not supported */
#define CBGFX_ERROR_PORTRAIT_SCREEN 0x16
+/* cannot use buffered I/O */
+#define CBGFX_ERROR_GRAPHICS_BUFFER 0x17
struct fraction {
int32_t n;
@@ -272,3 +274,24 @@ void clear_blend(void);
* 0 = min alpha argument, 0% opacity
*/
#define ALPHA(percentage) MIN(255, (256 * percentage / 100))
+
+/**
+ * Enable buffered I/O. All CBGFX operations will be redirected to a working
+ * buffer, and only updated (redrawn) when flush_graphics_buffer() is called.
+ *
+ * @return CBGFX_* error codes
+ */
+int enable_graphics_buffer(void);
+
+/**
+ * Redraw buffered graphics data to real screen if graphics buffer is already
+ * enabled.
+ *
+ * @return CBGFX_* error codes
+ */
+int flush_graphics_buffer(void);
+
+/**
+ * Stop using buffered I/O and release allocated memory.
+ */
+void disable_graphics_buffer(void);