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(-)
@@ -837,3 +837,7 @@ void vidconsole_set_bitmap_font(struct udevice *dev,
}
vc_priv->xstart_frac = 0;
}
+
+void vidconsole_idle(struct udevice *dev)
+{
+}
@@ -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)
@@ -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