From a76b60f8205eb7f02e17e10c13ad05e46a69c1fd Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 10 Mar 2023 12:47:21 -0800 Subject: video: Clear the vidconsole rather than the video It is better to clear the console device rather than the video device, since the console has the text display. We also need to reset the cursor position with the console, but not with the video device. Add a new function to handle this and update the 'cls' command to use it. Signed-off-by: Simon Glass --- drivers/video/vidconsole-uclass.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers/video') diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 627db82..61f4216 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -643,3 +643,15 @@ int vidconsole_memmove(struct udevice *dev, void *dst, const void *src, return vidconsole_sync_copy(dev, dst, dst + size); } #endif + +int vidconsole_clear_and_reset(struct udevice *dev) +{ + int ret; + + ret = video_clear(dev_get_parent(dev)); + if (ret) + return ret; + vidconsole_position_cursor(dev, 0, 0); + + return 0; +} -- cgit v1.1