[Concept,31/36] expo: Pass context to scene_render_obj()

Message ID 20260120231814.2033069-32-sjg@u-boot.org
State New
Headers
Series video: Add multiple-context support to vidconsole (part F) |

Commit Message

Simon Glass Jan. 20, 2026, 11:17 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

Add a ctx parameter to scene_render_obj() to allow passing in a specific
vidconsole context. If NULL, the default context is used.

Update the caller accordingly.

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

 boot/scene.c          | 4 ++--
 boot/scene_internal.h | 3 ++-
 boot/scene_txtin.c    | 2 +-
 3 files changed, 5 insertions(+), 4 deletions(-)
  

Patch

diff --git a/boot/scene.c b/boot/scene.c
index 45550326d07..7cef20dbb1b 100644
--- a/boot/scene.c
+++ b/boot/scene.c
@@ -969,7 +969,7 @@  int scene_arrange(struct scene *scn)
 	return 0;
 }
 
-int scene_render_obj(struct scene *scn, uint id)
+int scene_render_obj(struct scene *scn, uint id, void *ctx)
 {
 	struct scene_obj *obj;
 	int ret;
@@ -979,7 +979,7 @@  int scene_render_obj(struct scene *scn, uint id)
 		return log_msg_ret("obj", -ENOENT);
 
 	if (!(obj->flags & SCENEOF_HIDE)) {
-		ret = scene_obj_render(obj, NULL, false);
+		ret = scene_obj_render(obj, ctx, false);
 		if (ret && ret != -ENOTSUPP)
 			return log_msg_ret("ren", ret);
 	}
diff --git a/boot/scene_internal.h b/boot/scene_internal.h
index 733f0c0f6ca..d9ca1fef90e 100644
--- a/boot/scene_internal.h
+++ b/boot/scene_internal.h
@@ -348,9 +348,10 @@  int scene_send_click(struct scene *scn, int x, int y, struct expo_action *event)
  *
  * @scn: Scene containing the object
  * @id: Object ID to render
+ * @ctx: Vidconsole context, or NULL to use default
  * Returns: 0 if OK, -ENOENT if object not found, -ve on other error
  */
-int scene_render_obj(struct scene *scn, uint id);
+int scene_render_obj(struct scene *scn, uint id, void *ctx);
 
 /**
  * scene_render_deps() - Render an object and its dependencies
diff --git a/boot/scene_txtin.c b/boot/scene_txtin.c
index da42f364f39..9b8edcc6439 100644
--- a/boot/scene_txtin.c
+++ b/boot/scene_txtin.c
@@ -75,7 +75,7 @@  int scene_txtin_render_deps(struct scene *scn, struct scene_obj *obj,
 		ret = vidconsole_entry_restore(cons, &scn->entry_save);
 		if (ret)
 			return log_msg_ret("sav", ret);
-		scene_render_obj(scn, tin->edit_id);
+		scene_render_obj(scn, tin->edit_id, NULL);
 
 		/* move cursor back to the correct position */
 		for (i = cls->num; i < cls->eol_num; i++)