
From: Simon Glass <sjg@chromium.org> Add a way to tell the console that the machine is idle. This will be used (later) to show the cursor. Call the video console sync after that, so that any updates are shown. Keep the video_sync_all() for the case where CONFIG_CURSOR is not enabled, to reduce code size. Signed-off-by: Simon Glass <sjg@chromium.org> --- drivers/video/vidconsole-uclass.c | 4 ++++ drivers/video/video-uclass.c | 15 ++++++++++++++- include/video_console.h | 7 +++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index cb7212e9730..46fd355c05f 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -837,3 +837,7 @@ void vidconsole_set_bitmap_font(struct udevice *dev, } vc_priv->xstart_frac = 0; } + +void vidconsole_idle(struct udevice *dev) +{ +} diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index cd5c8dd8fad..be014a770d0 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -621,7 +621,20 @@ int video_default_font_height(struct udevice *dev) static void video_idle(struct cyclic_info *cyc) { - video_sync_all(); + if (CONFIG_IS_ENABLED(CURSOR)) { + struct udevice *cons; + struct uclass *uc; + + /* Handle cursor display for each video console */ + uclass_id_foreach_dev(UCLASS_VIDEO_CONSOLE, cons, uc) { + if (device_active(cons)) { + vidconsole_idle(cons); + video_sync(cons->parent, true); + } + } + } else { + video_sync_all(); + } } void video_set_white_on_black(struct udevice *dev, bool white_on_black) diff --git a/include/video_console.h b/include/video_console.h index 8cd1ccacb0f..842ead8d6a1 100644 --- a/include/video_console.h +++ b/include/video_console.h @@ -613,4 +613,11 @@ void vidconsole_set_quiet(struct udevice *dev, bool quiet); void vidconsole_set_bitmap_font(struct udevice *dev, struct video_fontdata *fontdata); +/* + * vidconsole_idle() - Handle periodic cursor display during idle time + * + * @dev: vidconsole device + */ +void vidconsole_idle(struct udevice *dev); + #endif -- 2.43.0