summaryrefslogtreecommitdiff
path: root/boot/scene.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2025-04-02 06:29:33 +1300
committerTom Rini <trini@konsulko.com>2025-05-02 13:40:25 -0600
commit3ad5f49b5db4337626004629842d3dea30467c92 (patch)
tree69750f930abdf9a1ea05df347db979eb535c489b /boot/scene.c
parentfe2d4d4cef093d24da389fda29a556b15c84829b (diff)
video: Make white-on-black a video-device property
The CONFIG_WHITE_ON_BLACK setting is hard-coded at build-time. It is useful to be able to control this when showing menus. Create a property to hold this information, using the CONFIG as the initial value. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot/scene.c')
-rw-r--r--boot/scene.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/boot/scene.c b/boot/scene.c
index 3290a40222a..15e7a8b3387 100644
--- a/boot/scene.c
+++ b/boot/scene.c
@@ -330,8 +330,9 @@ static void scene_render_background(struct scene_obj *obj, bool box_only)
enum colour_idx fore, back;
uint inset = theme->menu_inset;
+ vid_priv = dev_get_uclass_priv(dev);
/* draw a background for the object */
- if (CONFIG_IS_ENABLED(SYS_WHITE_ON_BLACK)) {
+ if (vid_priv->white_on_black) {
fore = VID_DARK_GREY;
back = VID_WHITE;
} else {
@@ -344,7 +345,6 @@ static void scene_render_background(struct scene_obj *obj, bool box_only)
return;
vidconsole_push_colour(cons, fore, back, &old);
- vid_priv = dev_get_uclass_priv(dev);
video_fill_part(dev, label_bbox.x0 - inset, label_bbox.y0 - inset,
label_bbox.x1 + inset, label_bbox.y1 + inset,
vid_priv->colour_fg);
@@ -408,7 +408,8 @@ static int scene_obj_render(struct scene_obj *obj, bool text_mode)
struct vidconsole_colour old;
enum colour_idx fore, back;
- if (CONFIG_IS_ENABLED(SYS_WHITE_ON_BLACK)) {
+ vid_priv = dev_get_uclass_priv(dev);
+ if (vid_priv->white_on_black) {
fore = VID_BLACK;
back = VID_WHITE;
} else {
@@ -416,7 +417,6 @@ static int scene_obj_render(struct scene_obj *obj, bool text_mode)
back = VID_BLACK;
}
- vid_priv = dev_get_uclass_priv(dev);
if (obj->flags & SCENEOF_POINT) {
vidconsole_push_colour(cons, fore, back, &old);
video_fill_part(dev, x - theme->menu_inset, y,