summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-10-06 17:36:16 +0300
committerAnatolij Gustschin <agust@denx.de>2022-10-30 22:01:40 +0300
commit430e1676a76bf8b7112c64e19cf64b988c281ee0 (patch)
tree97d40e3ae1f3305177622818c23d7195b3370e22 /drivers/video
parent3f425f9ca75c8d1938579044fde37a6f7d5abe16 (diff)
downloadu-boot-430e1676a76bf8b7112c64e19cf64b988c281ee0.tar.xz
video: Add commands to list and change fonts
Add a new 'font' command which allows the fonts to be listed as well as selecting a different font and size. Allow the test to run on sandbox, where multiple font/size combinations are supported, as well as sandbox_flattree, where they are not. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/console_truetype.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c
index 09421e7a90..6859c9fa11 100644
--- a/drivers/video/console_truetype.c
+++ b/drivers/video/console_truetype.c
@@ -715,6 +715,16 @@ int vidconsole_select_font(struct udevice *dev, const char *name, uint size)
return 0;
}
+const char *vidconsole_get_font(struct udevice *dev, uint *sizep)
+{
+ struct console_tt_priv *priv = dev_get_priv(dev);
+ struct console_tt_metrics *met = priv->cur_met;
+
+ *sizep = met->font_size;
+
+ return met->font_name;
+}
+
static int console_truetype_probe(struct udevice *dev)
{
struct console_tt_priv *priv = dev_get_priv(dev);