From 6b6dc0d2fbf8b036d7ee278071036c7479074b32 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 6 Oct 2022 08:36:04 -0600 Subject: video: Provide a function to set the cursor position Add an exported function which allows the cursor position to be set to pixel granularity. Make use of this in the existing code. Signed-off-by: Simon Glass --- include/video_console.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/video_console.h b/include/video_console.h index 72edd419191..76c4b10acf6 100644 --- a/include/video_console.h +++ b/include/video_console.h @@ -219,6 +219,18 @@ int vidconsole_put_string(struct udevice *dev, const char *str); void vidconsole_position_cursor(struct udevice *dev, unsigned col, unsigned row); +/** + * vidconsole_set_cursor_pos() - set cursor position + * + * The cursor is set to the new position and the start-of-line information is + * updated to the same position, so that a newline will return to @x + * + * @dev: video console device to update + * @x: x position from left in pixels + * @y: y position from top in pixels + */ +void vidconsole_set_cursor_pos(struct udevice *dev, int x, int y); + #ifdef CONFIG_VIDEO_COPY /** * vidconsole_sync_copy() - Sync back to the copy framebuffer -- cgit v1.3.1