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>
This commit is contained in:
Simon Glass 2020-02-03 07:35:48 -07:00
parent 4209be3eae
commit 51973ccc41
1 changed files with 21 additions and 0 deletions

View File

@ -286,6 +286,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);