aboutsummaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorHeinrich Schuchardt2018-02-08 21:47:12 +0100
committerAnatolij Gustschin2018-03-06 10:05:49 +0100
commit9ffa4d12a850c6fb8b9b8f7d5fc31ac28633fcdb (patch)
tree2bd9678e22fd01e41edb945d1f7da5ae5fad026b /drivers/video
parent5c30fbb8ec4aa364d5e441c86d7b5776d6c94fb0 (diff)
dm: video: support increased intensity (bold)
Support special rendition code 0 - reset attributes. Support special rendition code 1 - increased intensity (bold). Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/vidconsole-uclass.c32
-rw-r--r--drivers/video/video-uclass.c5
2 files changed, 30 insertions, 7 deletions
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c
index d32b1017581..6f3988d49ea 100644
--- a/drivers/video/vidconsole-uclass.c
+++ b/drivers/video/vidconsole-uclass.c
@@ -119,12 +119,20 @@ static void vidconsole_newline(struct udevice *dev)
static const struct vid_rgb colors[VID_COLOR_COUNT] = {
{ 0x00, 0x00, 0x00 }, /* black */
- { 0xff, 0x00, 0x00 }, /* red */
- { 0x00, 0xff, 0x00 }, /* green */
+ { 0xc0, 0x00, 0x00 }, /* red */
+ { 0x00, 0xc0, 0x00 }, /* green */
+ { 0xc0, 0x60, 0x00 }, /* brown */
+ { 0x00, 0x00, 0xc0 }, /* blue */
+ { 0xc0, 0x00, 0xc0 }, /* magenta */
+ { 0x00, 0xc0, 0xc0 }, /* cyan */
+ { 0xc0, 0xc0, 0xc0 }, /* light gray */
+ { 0x80, 0x80, 0x80 }, /* gray */
+ { 0xff, 0x00, 0x00 }, /* bright red */
+ { 0x00, 0xff, 0x00 }, /* bright green */
{ 0xff, 0xff, 0x00 }, /* yellow */
- { 0x00, 0x00, 0xff }, /* blue */
- { 0xff, 0x00, 0xff }, /* magenta */
- { 0x00, 0xff, 0xff }, /* cyan */
+ { 0x00, 0x00, 0xff }, /* bright blue */
+ { 0xff, 0x00, 0xff }, /* bright magenta */
+ { 0x00, 0xff, 0xff }, /* bright cyan */
{ 0xff, 0xff, 0xff }, /* white */
};
@@ -278,10 +286,22 @@ static void vidconsole_escape_char(struct udevice *dev, char ch)
s++;
switch (val) {
+ case 0:
+ /* all attributes off */
+ video_set_default_colors(vid_priv);
+ break;
+ case 1:
+ /* bold */
+ vid_priv->fg_col_idx |= 8;
+ vid_priv->colour_fg = vid_console_color(
+ vid_priv, vid_priv->fg_col_idx);
+ break;
case 30 ... 37:
/* foreground color */
+ vid_priv->fg_col_idx &= ~7;
+ vid_priv->fg_col_idx |= val - 30;
vid_priv->colour_fg = vid_console_color(
- vid_priv, val - 30);
+ vid_priv, vid_priv->fg_col_idx);
break;
case 40 ... 47:
/* background color */
diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
index 945b20ddfd7..b5bb8e0efde 100644
--- a/drivers/video/video-uclass.c
+++ b/drivers/video/video-uclass.c
@@ -117,9 +117,12 @@ void video_clear(struct udevice *dev)
void video_set_default_colors(struct video_priv *priv)
{
#ifdef CONFIG_SYS_WHITE_ON_BLACK
- priv->colour_fg = vid_console_color(priv, VID_WHITE);
+ /* White is used when switching to bold, use light gray here */
+ priv->fg_col_idx = VID_LIGHT_GRAY;
+ priv->colour_fg = vid_console_color(priv, VID_LIGHT_GRAY);
priv->colour_bg = vid_console_color(priv, VID_BLACK);
#else
+ priv->fg_col_idx = VID_BLACK;
priv->colour_fg = vid_console_color(priv, VID_BLACK);
priv->colour_bg = vid_console_color(priv, VID_WHITE);
#endif