From patchwork Tue Jan 20 23:17:56 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1702 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768951249; bh=Dn+bquUkHOZuJO7OnCgn46sRMHqjlZxqFOKe3kgfUlE=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=hQxokMsQzKVtDsLezCuR1TknutJhvXtz/qwKLaAfiXgaG4eQYGqrExmWI52WuC0dk 2OzwG4TzXlPgKqO/W3FQl3gOQ8l1/18I6UpZriUyWLTPPiSlvhvhnJf2N19+m/rUI8 ef2dpKkl6JJ/lH67DaULP0u8b6C+7GiYTgRBk+ZTfIU7VqlgoAMF+KnjeYoefPHySf Ab9L1AG0VZxGZfVrNFHpGr+s9Hq+BoV8A3Egu6dUn1cdfRa3/WsBOiIB4zl1l6ecKc Zq4BjGEEIg5n6BqTEJYn3+HHHOG/krEsxEi6lfGbhG/fDRulo6tFvuTAZBUXsgnrx8 oaP1JBvyQzNYg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 27A726959F for ; Tue, 20 Jan 2026 16:20:49 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id SACvWyyrN24m for ; Tue, 20 Jan 2026 16:20:49 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768951249; bh=Dn+bquUkHOZuJO7OnCgn46sRMHqjlZxqFOKe3kgfUlE=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=hQxokMsQzKVtDsLezCuR1TknutJhvXtz/qwKLaAfiXgaG4eQYGqrExmWI52WuC0dk 2OzwG4TzXlPgKqO/W3FQl3gOQ8l1/18I6UpZriUyWLTPPiSlvhvhnJf2N19+m/rUI8 ef2dpKkl6JJ/lH67DaULP0u8b6C+7GiYTgRBk+ZTfIU7VqlgoAMF+KnjeYoefPHySf Ab9L1AG0VZxGZfVrNFHpGr+s9Hq+BoV8A3Egu6dUn1cdfRa3/WsBOiIB4zl1l6ecKc Zq4BjGEEIg5n6BqTEJYn3+HHHOG/krEsxEi6lfGbhG/fDRulo6tFvuTAZBUXsgnrx8 oaP1JBvyQzNYg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 15D9C6959D for ; Tue, 20 Jan 2026 16:20:49 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768951246; bh=dYAz81otcuT2uQEMXYyF5gBodduTkPj/VSi156YO0Yc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DU7h68cXgA9fHeeYF66CtobGx3aedbUiOnG1HiU9O6XgB7lePyXGvbvpx68LX5VCD PWkprhVcnOkb30/NEqUVQ5N3N9uWqY+FsxDw3jYnLAbB1I2RpLng0mdvpsKSw4NHCx aLybflDyv5X9eJCzd7L9j7q54lUrJE0NiMUEDg4umvSnJm44ieqZ6uI3S/pWkXfeX6 XY9lJrFhBKBxX/aR5GR814TfL9ZlQv9iWG7xb0T/mTGtnfffUqIaBy+0C9Yxa8IQOp X2sF4nua4pGZbGtUdOi9NpxUAQxw2Utjj6auNeWCdqPLqREcw7zjP0FCoW+2hmshxJ Y1sBc7o6foHNA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 45BD36913F; Tue, 20 Jan 2026 16:20:46 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id tGW8dwgZrhN6; Tue, 20 Jan 2026 16:20:46 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768951242; bh=U/oHIbhIUeThaxL6NUYDqwpupirQlr1jHC41R2iQ4qg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QkkK5PYS6e2Nq1h1TNoekQBwnRKr6DRGVWP7rLtUv7bib866It/Nx+2j72o5axmZE jXQB0FM4oShOoYD1D1ZjndCcc65i/vlklMPdD4uKEQQzyASzByyljEr0/2xR82MyKU HeQge9LzHSFphsv28hr+Z6NTVcxUheSoMI5vCim8aGY4FzvI7/rYMLCSNxlR7kbpMb PDLmtrJ11xDr2T3EbGsH2J/pJ7GlaRaC8iGVyK0Q93Epq0lYOA2+XTcKIE7cZHmuaJ XyldiI0ixw3bbZr2iuoqb4W/Kxol4zHLYOErpLrJu5/S217kyekJxXTOByJMpssGi/ jYcdSJkDJ/3sw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id EE4B369597; Tue, 20 Jan 2026 16:20:41 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 20 Jan 2026 16:17:56 -0700 Message-ID: <20260120231814.2033069-30-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260120231814.2033069-1-sjg@u-boot.org> References: <20260120231814.2033069-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: HBJ7NCN7D4XQ2MYYKOPYWQHU3T2J34CM X-Message-ID-Hash: HBJ7NCN7D4XQ2MYYKOPYWQHU3T2J34CM X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 29/36] expo: Pass context to scene_txt_render() List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add a ctx parameter to scene_txt_render() 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 Signed-off-by: Simon Glass --- boot/scene.c | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/boot/scene.c b/boot/scene.c index 6c70bd9038c..b6879315563 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -638,8 +638,23 @@ static void draw_string(struct udevice *cons, void *ctx, const char *str, } } +/** + * scene_txt_render() - Render text to the vidconsole + * + * @exp: Expo to use + * @dev: Video device + * @cons: Vidconsole device + * @ctx: Vidconsole context, or NULL to use default + * @obj: Object to render + * @gen: Generic text info + * @x: X position in pixels + * @y: Y position in pixels + * @menu_inset: Inset for menu items + * Return: 0 if OK, -ve on error + */ static int scene_txt_render(struct expo *exp, struct udevice *dev, - struct udevice *cons, struct scene_obj *obj, + struct udevice *cons, void *ctx, + struct scene_obj *obj, struct scene_txt_generic *gen, int x, int y, int menu_inset) { @@ -656,10 +671,10 @@ static int scene_txt_render(struct expo *exp, struct udevice *dev, return -ENOTSUPP; if (gen->font_name || gen->font_size) { - ret = vidconsole_select_font(cons, NULL, gen->font_name, + ret = vidconsole_select_font(cons, ctx, gen->font_name, gen->font_size); } else { - ret = vidconsole_select_font(cons, NULL, NULL, 0); + ret = vidconsole_select_font(cons, ctx, NULL, 0); } if (ret && ret != -ENOSYS) return log_msg_ret("font", ret); @@ -694,8 +709,8 @@ static int scene_txt_render(struct expo *exp, struct udevice *dev, bbox.y1 = obj->bbox.y1; if (!mline) { - vidconsole_set_cursor_pos(cons, NULL, x, y); - draw_string(cons, NULL, str, strlen(str), + vidconsole_set_cursor_pos(cons, ctx, x, y); + draw_string(cons, ctx, str, strlen(str), obj->flags & SCENEOF_PASSWORD); } @@ -713,8 +728,8 @@ static int scene_txt_render(struct expo *exp, struct udevice *dev, y = obj->bbox.y0 + offset.yofs + mline->bbox.y0; if (y > bbox.y1) break; /* clip this line and any following */ - vidconsole_set_cursor_pos(cons, NULL, x, y); - draw_string(cons, NULL, str + mline->start, mline->len, + vidconsole_set_cursor_pos(cons, ctx, x, y); + draw_string(cons, ctx, str + mline->start, mline->len, obj->flags & SCENEOF_PASSWORD); } if (obj->flags & SCENEOF_POINT) @@ -761,8 +776,8 @@ static int scene_obj_render(struct scene_obj *obj, bool text_mode) case SCENEOBJT_TEXT: { struct scene_obj_txt *txt = (struct scene_obj_txt *)obj; - ret = scene_txt_render(exp, dev, cons, obj, &txt->gen, x, y, - theme->menu_inset); + ret = scene_txt_render(exp, dev, cons, NULL, obj, &txt->gen, + x, y, theme->menu_inset); break; } case SCENEOBJT_MENU: {