[coreboot-gerrit] New patch to review for coreboot: cbgfx: add clear_screen
Patrick Georgi (pgeorgi@google.com)
gerrit at coreboot.org
Fri Oct 16 16:46:27 CEST 2015
Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/11924
-gerrit
commit 98cd11c09ebdcca1dd7b03b5f82d7e9922ba60e3
Author: Daisuke Nojiri <dnojiri at chromium.org>
Date: Mon Sep 21 17:17:25 2015 -0700
cbgfx: add clear_screen
clear_screen clears the screen with the specified color.
BUG=none
BRANCH=tot
TEST=Tested on Samus
Change-Id: I45e61c67485dbdbe15e2b602718232bc6382ad00
Signed-off-by: Patrick Georgi <pgeorgi at google.com>
Original-Commit-Id: 1ab04e2cc8d3c3e36e4eb41d9e7b0fdc25595200
Original-Change-Id: I1b3890b9e8ca52e796f417b5f41d4fa02a97a255
Original-Signed-off-by: Daisuke Nojiri <dnojiri at chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/301451
Original-Reviewed-by: Randall Spangler <rspangler at chromium.org>
---
payloads/libpayload/drivers/video/graphics.c | 16 ++++++++++++++++
payloads/libpayload/include/cbgfx.h | 5 +++++
2 files changed, 21 insertions(+)
diff --git a/payloads/libpayload/drivers/video/graphics.c b/payloads/libpayload/drivers/video/graphics.c
index d9c731b..d4d08f8 100644
--- a/payloads/libpayload/drivers/video/graphics.c
+++ b/payloads/libpayload/drivers/video/graphics.c
@@ -194,6 +194,22 @@ int clear_canvas(struct rgb_color *rgb)
return draw_box(&box, rgb);
}
+int clear_screen(struct rgb_color *rgb)
+{
+ uint32_t color;
+ struct vector p;
+
+ if (cbgfx_init())
+ return CBGFX_ERROR_INIT;
+
+ color = calculate_color(rgb);
+ for (p.y = 0; p.y < screen.size.height; p.y++)
+ for (p.x = 0; p.x < screen.size.width; p.x++)
+ set_pixel(&p, color);
+
+ return CBGFX_SUCCESS;
+}
+
/*
* This check guarantees we will not try to read outside pixel data.
*/
diff --git a/payloads/libpayload/include/cbgfx.h b/payloads/libpayload/include/cbgfx.h
index 2d6b6e9..3c28a13 100644
--- a/payloads/libpayload/include/cbgfx.h
+++ b/payloads/libpayload/include/cbgfx.h
@@ -91,6 +91,11 @@ int draw_box(const struct rect *box, const struct rgb_color *rgb);
int clear_canvas(struct rgb_color *rgb);
/*
+ * Clear the screen
+ */
+int clear_screen(struct rgb_color *rgb);
+
+/*
* Draw a bitmap image on screen.
*
* top_left_rel: coordinate of the top left corner of the image relative to the
More information about the coreboot-gerrit
mailing list