summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-02-03 07:35:48 -0700
committerSimon Glass <sjg@chromium.org>2020-02-05 19:33:46 -0700
commit51973ccc412b23bf51533858003e3c7e0dd07ae9 (patch)
tree94c91c82f9c20e11095e9273df1071996f079ef6
parent4209be3eaec4484b56c8926ff694979cf1d08823 (diff)
downloadu-boot-51973ccc412b23bf51533858003e3c7e0dd07ae9.tar.gz
video: Support truetype fonts on a 32-bit display
At present only a 16bpp display is supported for Truetype fonts. Add support for 32bpp also since this is quite common. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Anatolij Gustschin <agust@denx.de>
-rw-r--r--drivers/video/console_truetype.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c
index 30086600fb..0a725c5c15 100644
--- a/drivers/video/console_truetype.c
+++ b/drivers/video/console_truetype.c
@@ -287,6 +287,27 @@ static int console_truetype_putc_xy(struct udevice *dev, uint x, uint y,
break;
}
#endif
+#ifdef CONFIG_VIDEO_BPP32
+ case VIDEO_BPP32: {
+ u32 *dst = (u32 *)line + xoff;
+ int i;
+
+ for (i = 0; i < width; i++) {
+ int val = *bits;
+ int out;
+
+ if (vid_priv->colour_bg)
+ val = 255 - val;
+ out = val | val << 8 | val << 16;
+ if (vid_priv->colour_fg)
+ *dst++ |= out;
+ else
+ *dst++ &= out;
+ bits++;
+ }
+ break;
+ }
+#endif
default:
free(data);
return -ENOSYS;