[Concept,01/16] video: Update vidconsole_idle() to process all contexts

Message ID 20260122041155.174721-2-sjg@u-boot.org
State New
Headers
Series expo: Add multiline editing support for textedit |

Commit Message

Simon Glass Jan. 22, 2026, 4:11 a.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Update vidconsole_idle() to handle cursor display for all contexts,
not just the default one. This ensures that cursors in client-allocated
contexts (such as expo text-input objects) are properly shown during
idle time.

Co-developed-by: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

 drivers/video/vidconsole-uclass.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)
  

Patch

diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c
index b6bd3133037..513c8f3bacb 100644
--- a/drivers/video/vidconsole-uclass.c
+++ b/drivers/video/vidconsole-uclass.c
@@ -1064,9 +1064,8 @@  void vidconsole_set_bitmap_font(struct udevice *dev, struct vidconsole_ctx *ctx,
 	ctx->xstart_frac = 0;
 }
 
-void vidconsole_idle(struct udevice *dev)
+static void vidconsole_idle_ctx(struct udevice *dev, struct vidconsole_ctx *ctx)
 {
-	struct vidconsole_ctx *ctx = vidconsole_ctx(dev);
 	struct vidconsole_cursor *curs = &ctx->curs;
 
 	/* Only handle cursor if it's enabled */
@@ -1080,6 +1079,15 @@  void vidconsole_idle(struct udevice *dev)
 	}
 }
 
+void vidconsole_idle(struct udevice *dev)
+{
+	struct vidconsole_priv *priv = dev_get_uclass_priv(dev);
+	struct vidconsole_ctx **ctxp;
+
+	alist_for_each(ctxp, &priv->ctx_list)
+		vidconsole_idle_ctx(dev, *ctxp);
+}
+
 #ifdef CONFIG_CURSOR
 void vidconsole_readline_start(struct udevice *dev, void *vctx, bool indent)
 {