aboutsummaryrefslogtreecommitdiff
path: root/drivers/video/vidconsole-uclass.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-10-01 19:13:21 -0600
committerTom Rini <trini@konsulko.com>2023-10-11 15:43:55 -0400
commit37db20d0a64132a7ae3d0223de6b93167d60bea4 (patch)
treebf99fa1818795e3cc56c1eb9fb72c8a333161569 /drivers/video/vidconsole-uclass.c
parent617d7b545b6fa555f47944a10b1a1b261491e3b9 (diff)
downloadu-boot-37db20d0a64132a7ae3d0223de6b93167d60bea4.zip
u-boot-37db20d0a64132a7ae3d0223de6b93167d60bea4.tar.gz
u-boot-37db20d0a64132a7ae3d0223de6b93167d60bea4.tar.bz2
video: Support showing a cursor
Add rudimentary support for displaying a cursor on a vidconsole. This helps the user to see where text is being entered. The implementation so far is very simple: the cursor is just a vertical bar of fixed width and cannot be erased. To erase the cursor, the text must be redrawn over it. This is good enough for expo but will need enhancement to be useful for the command-line console. For example, it could save and restore the area behind the cursor. For now, enable this only for expo, to reduce code size. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/video/vidconsole-uclass.c')
-rw-r--r--drivers/video/vidconsole-uclass.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c
index 2f3f685..22d55df 100644
--- a/drivers/video/vidconsole-uclass.c
+++ b/drivers/video/vidconsole-uclass.c
@@ -672,6 +672,21 @@ int vidconsole_entry_restore(struct udevice *dev, struct abuf *buf)
return 0;
}
+int vidconsole_set_cursor_visible(struct udevice *dev, bool visible,
+ uint x, uint y, uint index)
+{
+ struct vidconsole_ops *ops = vidconsole_get_ops(dev);
+ int ret;
+
+ if (ops->set_cursor_visible) {
+ ret = ops->set_cursor_visible(dev, visible, x, y, index);
+ if (ret != -ENOSYS)
+ return ret;
+ }
+
+ return 0;
+}
+
void vidconsole_push_colour(struct udevice *dev, enum colour_idx fg,
enum colour_idx bg, struct vidconsole_colour *old)
{