diff options
author | Janne Grunau <j@jannau.net> | 2024-01-17 23:27:34 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-01-29 14:53:06 -0500 |
commit | 3883c9add00bd0413ff98b542fce0a29029ff172 (patch) | |
tree | c8d922677a0312c9a5475554a75693cb1d1199cd | |
parent | 04add62e8cf1209ca21ddfa13346d9ddcc6126fb (diff) |
video: Support VIDEO_X2R10G10B10 in truetype console
Without explicit support for VIDEO_X2R10G10B10 VIDEO_X8R8G8B8 white
will be rendered as cyan-ish. The conversion leaves to lowest 2 bits
unset for more compact code.
Signed-off-by: Janne Grunau <j@jannau.net>
-rw-r--r-- | drivers/video/console_truetype.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c index 14fb81e956..547e5a8d9c 100644 --- a/drivers/video/console_truetype.c +++ b/drivers/video/console_truetype.c @@ -397,7 +397,10 @@ static int console_truetype_putc_xy(struct udevice *dev, uint x, uint y, if (vid_priv->colour_bg) val = 255 - val; - out = val | val << 8 | val << 16; + if (vid_priv->format == VIDEO_X2R10G10B10) + out = val << 2 | val << 12 | val << 22; + else + out = val | val << 8 | val << 16; if (vid_priv->colour_fg) *dst++ |= out; else @@ -911,7 +914,10 @@ static int truetype_set_cursor_visible(struct udevice *dev, bool visible, for (i = 0; i < width; i++) { int out; - out = val | val << 8 | val << 16; + if (vid_priv->format == VIDEO_X2R10G10B10) + out = val << 2 | val << 12 | val << 22; + else + out = val | val << 8 | val << 16; if (vid_priv->colour_fg) *dst++ |= out; else |