From patchwork Tue Jan 20 23:17:55 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1701 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=1768951243; bh=kcllm0gHdWIU5L1qCl/84WYKYfmw65nVBzLBUUm0ZJA=; 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=YrtBJAdGmSwd0zKV7CsKEytpvx1iI2ToEWqpUlVxx9javmec7JYhZqgU4EJ4Xglsb vAP19lw00ljrZecgW0KqmonXbcuPIW3xSbldwSmhEfVVt+8n4K6pafEDrESHgwUt9t wu4UgIWoylzQivgYYZGbeCloqEimXFYETc9P20ihfskPfv0DcTcWP7Ml74HXNxlTLD VyVdG321MO/727kG6+1GhQi7Xk9jP1//KeMbqBHWInc9Y5Rd8WYjSns3hEZtrAxkaV MtP4qVbJg1KciAvR4jF7t6icjnAxYWAydX9iGO3J8s8TJFNoymY30yS5uMX5YUhAgR jvDew+bAp7AJw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B6F0B6959F for ; Tue, 20 Jan 2026 16:20:43 -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 Mv0Ulg4dN_fu for ; Tue, 20 Jan 2026 16:20:43 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768951243; bh=kcllm0gHdWIU5L1qCl/84WYKYfmw65nVBzLBUUm0ZJA=; 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=YrtBJAdGmSwd0zKV7CsKEytpvx1iI2ToEWqpUlVxx9javmec7JYhZqgU4EJ4Xglsb vAP19lw00ljrZecgW0KqmonXbcuPIW3xSbldwSmhEfVVt+8n4K6pafEDrESHgwUt9t wu4UgIWoylzQivgYYZGbeCloqEimXFYETc9P20ihfskPfv0DcTcWP7Ml74HXNxlTLD VyVdG321MO/727kG6+1GhQi7Xk9jP1//KeMbqBHWInc9Y5Rd8WYjSns3hEZtrAxkaV MtP4qVbJg1KciAvR4jF7t6icjnAxYWAydX9iGO3J8s8TJFNoymY30yS5uMX5YUhAgR jvDew+bAp7AJw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A70946959D for ; Tue, 20 Jan 2026 16:20:43 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768951241; bh=MHHHIZHbNS1afvChQ0wc1Z5NiHqC6KjuKTbHjv9BhV4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jhHnrn1oapNoZrbFTn79fzkzYP/oru2o9PvCcX6Ljt8fHTIrCmZN0LdlVybPcXJ+r LGfewa3wyIm7Sumb29P/OeNC+GgJjvnr+I9FoLgBUxQpaABRE/VGGemjA1wKq/eCxT aHdNuxgggPobr7OgsMfZbMsXODHJ76TkWVzWuq0q2ZsTz71Mo6nCNXjWEKuV+7Qx9j /4RaLHla+EHae9sHW49xQT910Uu9vP7nTcZpCcz6m5fxy1OXOSmRyp2V2kqZjIuS6d UN7K7u19uSMvlk+Sm1IihDXh8QlkkH8DUnr27n76Lf68eKmNWhy5DO1wSD8w9Ym7hY /1S4k3vICWFvw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AEA166913F; Tue, 20 Jan 2026 16:20:41 -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 hV4i_Yw7wuCr; Tue, 20 Jan 2026 16:20:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768951237; bh=3i0pc+GTkSRCw66zEuBQksnbiK3lZVal/nt9QpPk4BE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A9n16om7EFFE2PYIA+iXijzTaG1g+z+3g0i+BjX4zQPKK9cAkz0mcUDWRiD93rnJ9 xumeMQFSQ+5NQ9i9nBDPS932EdaYzynvabwYGG0Jk9Kvkl617AJnq/i28MsdbOLWzR qptvQS6C5ruk4nfdqClyKwlmOYkrogIY5tpxOdRpGKxuI6OeLInEt3Oddqd5LwImXh kFLFMGladefV5AGZuRrIGFT50mJErwb4GJzQBIICEHzGfOpACsM71C+EBOhRibnyBA mY3xNNgCYzBg8fVcjYYYPHSf1YatN3dgoEl+xLgEapXq3QDzFbp6CBifpDAx6LFqyn eOCCl8a6P8d0Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 36B5969597; Tue, 20 Jan 2026 16:20:37 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 20 Jan 2026 16:17:55 -0700 Message-ID: <20260120231814.2033069-29-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: L2UQ63QYR2JBYVG7Y2RD2BEUDAR25YA7 X-Message-ID-Hash: L2UQ63QYR2JBYVG7Y2RD2BEUDAR25YA7 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 28/36] expo: Pass context to draw_string() 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 draw_string() to allow passing in a specific vidconsole context. If NULL, the default context is used. Update all callers accordingly. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/scene.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/boot/scene.c b/boot/scene.c index 58be46cb7ee..6c70bd9038c 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -616,16 +616,25 @@ static void scene_render_background(struct scene_obj *obj, bool box_only, } } -static void draw_string(struct udevice *cons, const char *str, int len, - bool password) +/** + * draw_string() - Draw a string to the vidconsole + * + * @cons: Vidconsole device to draw to + * @ctx: Vidconsole context, or NULL to use default + * @str: String to draw + * @len: Length of string to draw + * @password: true to draw asterisks instead of actual characters + */ +static void draw_string(struct udevice *cons, void *ctx, const char *str, + int len, bool password) { if (password) { int i; for (i = 0; i < len; i++) - vidconsole_put_char(cons, NULL, '*'); + vidconsole_put_char(cons, ctx, '*'); } else { - vidconsole_put_stringn(cons, NULL, str, len); + vidconsole_put_stringn(cons, ctx, str, len); } } @@ -686,7 +695,7 @@ static int scene_txt_render(struct expo *exp, struct udevice *dev, if (!mline) { vidconsole_set_cursor_pos(cons, NULL, x, y); - draw_string(cons, str, strlen(str), + draw_string(cons, NULL, str, strlen(str), obj->flags & SCENEOF_PASSWORD); } @@ -705,7 +714,7 @@ static int scene_txt_render(struct expo *exp, struct udevice *dev, if (y > bbox.y1) break; /* clip this line and any following */ vidconsole_set_cursor_pos(cons, NULL, x, y); - draw_string(cons, str + mline->start, mline->len, + draw_string(cons, NULL, str + mline->start, mline->len, obj->flags & SCENEOF_PASSWORD); } if (obj->flags & SCENEOF_POINT)