From patchwork Sun Dec 7 20:15:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 813 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=1765138626; bh=v7f5TPdgOtVC1pXRz39sPo3k6fxlvU9Z26aBiPA837M=; 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=dZJjXXyZGvB1kCs+MAyNB4+7NZ+0f+yuKbOP2Jgx8vp+HdRmO6Lq2JKoWWnlZMdlo R1xZKSXMiQ0En4mEl+udW1hwIMwiy7S/+qpKHEYNFcP+9Awfw3BHAvJO6huBIKJN/K 5t9OeE38PZe6spBIjYiyd4f3Bg+rmTaHWjb6nw7jabSxxjUdX+wsHNgcwIauxyFneQ AdOY89WEwl6JzbaCdctpXva76/UCtAL4WcgaJ2bMmjGxc8Pf3Yd7qrAI1gy3uzGfH6 R2aUqlv8uPJIgNMkqhtj14ojB07OPmkjqDRGJjyLfDWZPlnFP5W0iR6/ebowtPlETq dSJOsnG0U8qDw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AEBBD6899E for ; Sun, 7 Dec 2025 13:17:06 -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 r_4YIufEqBrI for ; Sun, 7 Dec 2025 13:17:06 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138624; bh=v7f5TPdgOtVC1pXRz39sPo3k6fxlvU9Z26aBiPA837M=; 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=b8n4yYQzhCVSSDPD51h9MVoXltuDvAdGD3K0wt+o2j0i2q7b5tBtBUdo6k6N7BXBG Kh9XxVOxB0Li/OPoLzxhx+ZDTxMRDCgdt8n1NqsKMcs9uu06mBq6IgOq3NEgxrP2En 4Y/GlHV1ZE8zzdrhK8MvSb6z0XVZ03hgVYBVKnvYOFilbbwV2PjOiMyXYm27qD+XiX rA8urZjophYgZYFybze5MzOb4hfhefftzZne8EmPBx2CaXDgRIm4IfySMOmCQGgIbe peNB0yFj07Bgj8ZU5NWJ55jirP7MXeMG6BUIBOiXYCSwUgFS/r8ZBott1OkmUJjMfj CsG/z+MUj63fw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B1FE468995 for ; Sun, 7 Dec 2025 13:17:04 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138622; bh=atBZmHekvSAEBssgeU6vXoAuDUFUGgAmeGwfjmuImhk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fbs6kqqcXLVxbFTHE7VcAGPoJ+3SGVWy5qOdNxLiRv8DMgL+iYW6tOtUl2J0NJrbW siC3+qiG9MvM5PqNW2Gp8MLuyxIiymXcA4pj/JndQQqUvGIHvxhS+oNmVder0OUxs8 aZQ0xAQ1v4pmNH6KbN9dnX7CpBxmbIlszwO315vGJzhADf4R9loeBKvSCIoW6kbcSX 2gjTgzbSucV4chhlQKjyuexU9GcL6B/m/I2vdY4jHYoI3G84qn5kkG6gmRi5Lvczl3 dpSj5rgkv3TqDKkFMoNMMyZbVPpzIsbD3UIKt4iOVEFpZ7E4OwuiyH0xgMTi3iFFfd rp9+Gpa36ayOQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EB3365F6BF; Sun, 7 Dec 2025 13:17:02 -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 N_MeUR6ZEDir; Sun, 7 Dec 2025 13:17:02 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138619; bh=wkXmGXmtL6AXhcrXoleSQRSblxXEPJLPmJWOrNidefg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CLLYzIxS1u+DceaTDl8Fi7LknBNbrTj/TYam012MYBNDmXRn6xedwbjeeqnNVmOPV JUYDk2UvdbqL/BmgmXc+WrXo2N32C4of+7LlhN9+AV8BdkrrBbWSOPX64b6NshWiI1 ZE87smEboIyXny2ShynTMIcQM/3AmTBoPXqvcQsQl2C5GOcoB1dQBwDA5tmZs3ElvU jDbgqglARD2+Kj1dTOuNIbIXG4ecUHBRwZBUZcEKFvxAOMy2d0NRYUQPGJ3aWrwKhm /SLPiyKrvhH4+z3ckdITBiQF3bmxwSn1GqTgVk2pJ44y99TE3xVsFliKPaO5kc88Hs 5dfimQ/JGJJyw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E3F0B68902; Sun, 7 Dec 2025 13:16:58 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:15:58 -0700 Message-ID: <20251207201628.2882382-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 5F342VEYIWEPBA5R3MMT3F2H7GSMJJNC X-Message-ID-Hash: 5F342VEYIWEPBA5R3MMT3F2H7GSMJJNC 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: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 01/22] CLAUDE.md: Update build and coding conventions 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 Fix typo ("now" -> "no") and clarify notes: - Add reminder to avoid in-tree builds - Clarify Co-developed-by usage in commits Signed-off-by: Simon Glass --- CLAUDE.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index a13dd995b68..ca0571ecef8 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -59,7 +59,9 @@ pyt - Always run `make mrproper` if you encounter build issues - The sandbox build creates a test environment for U-Boot that runs on the host system - When using `git diff`, add `--no-ext-diff` to avoid external diff tools that may not work in this environment -- crosfw shows now output if everything was ok! +- crosfw shows no output if everything was ok! +- Remember not to cd into the build directory; run U-Boot directly in the source dir +- Do not run in-tree builds; always use the crosfw script or 'make O=/tmp/...' ## Coding Conventions @@ -69,5 +71,4 @@ pyt - This follows U-Boot's established naming convention for output parameters - Keep commit messages concise - focus on the key change and essential details only - Code should be formatted to 80 columns and not have trailing spaces -- Remember to use Co-developed-by in commits -- Remember not to cd into the build directory; run U-Boot directly in the source dir +- Remember to use Co-developed-by instead of Co-Authored-By in commits From patchwork Sun Dec 7 20:15:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 814 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=1765138630; bh=Pke9+szzOVb2Ps7k+xQ4yqKNwSOx4MHzVymQCZhP5LM=; 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=C416AnPpjj98L0WkHRkP602zFHPeYWAW9QMRcZEc1Z/Kzxz24cges7MgH4htkWiJo 0bt5Q6vleyralberhB+eS1rHV6n/42l5gs2LHMVitlK9kff3C8LDqutaK+bs+KqAGO Va+5V2iK63lyjkBwfGGPlhVXFO0fzLWnlJVhwxh8u/0U+kDFBLfcI9WstycFCDyXPx pBXkCk6kjr4Our8+LyXkD8xUpRPj6vrNP8eOL+Wz9/LJWhem0P1OFi7vtfgWOM7ssZ ryejfaz20PqtQySKAqxtAsNX5gNMUq37S0G0dfqsJnMkymYu0NYMLyW6eMOS6IeSY7 CXvFIQPqkVRww== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6B53C68997 for ; Sun, 7 Dec 2025 13:17:10 -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 uUnMxzoZbw2i for ; Sun, 7 Dec 2025 13:17:10 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138630; bh=Pke9+szzOVb2Ps7k+xQ4yqKNwSOx4MHzVymQCZhP5LM=; 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=C416AnPpjj98L0WkHRkP602zFHPeYWAW9QMRcZEc1Z/Kzxz24cges7MgH4htkWiJo 0bt5Q6vleyralberhB+eS1rHV6n/42l5gs2LHMVitlK9kff3C8LDqutaK+bs+KqAGO Va+5V2iK63lyjkBwfGGPlhVXFO0fzLWnlJVhwxh8u/0U+kDFBLfcI9WstycFCDyXPx pBXkCk6kjr4Our8+LyXkD8xUpRPj6vrNP8eOL+Wz9/LJWhem0P1OFi7vtfgWOM7ssZ ryejfaz20PqtQySKAqxtAsNX5gNMUq37S0G0dfqsJnMkymYu0NYMLyW6eMOS6IeSY7 CXvFIQPqkVRww== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5A7EA68996 for ; Sun, 7 Dec 2025 13:17:10 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138629; bh=eyFwv0Ghu0bBXRkS8U6Cb6jhfJ/5zUy2DOZH1KQNzUg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=twlq+af/XKvSmlsOAweV1Wmi0UXJjg3kLG14NRgFi+rP6t11uT09BG3qxSZktEf+2 1O6uE/7NOxw3WnukkUR8nRgz7y/MQoj4bHR/eHjmoT+j80r9PcJem1HBo7Fa0FE7Ke RCp/f2lIptFItAzF41BetIKrULas3Go7VG7M4e5olsrF7v5+e+pU1YnFOD6mm8sZfB 9eHhKvKO0rYSOkCHdN+5TIZhKhOndtQxhISyXiG0BMPZoisZC+t0HEIA1gxBeNZoFH B0rQbpxIfEYQMX9rmOv75cX+hX7Exy3r5ffx9E/bzeGrFRqtKU1YuaAhnYu2uyLZB9 NDaRrO2vquzjg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 024ED6883E; Sun, 7 Dec 2025 13:17:09 -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 bVq9bwuBysHp; Sun, 7 Dec 2025 13:17:08 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138623; bh=PX1Mdp0EEdDGjcGlxIrKnuqND0L3CXs5wODuKNIjIC4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gNDkx32Jc38XZwxgoPnkG9GE+J9YOXEWN5EbwerJhhMWTtfi2XxE5alR4yn2EK3kl c2iBIiCFUS8W0pOxZx4TW9+Szgg0GgqZbbCgEU71V/EMPXpx+Uj2V5MCsjrC6HSgDi 1yaJRcKwSzLz9KjiASGsD8Da2Es6jfdR6uUjoXXwujSBJAwQSBQooK+s9BIP3LszuJ oT0MWpzBVnl3h5y4BRwMiEW+nRchtDS/EDyLyxF/XpotNxJgwt5idpPnfk93IBmHqo /qI3hDFqEw4fP8Ess5I61XrNW7LeU8ytpe7rHcJaqaC8cl2qqLlKnKEfebei9GHXlo B1mRD1AvnR5LQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 6BCDA68902; Sun, 7 Dec 2025 13:17:03 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:15:59 -0700 Message-ID: <20251207201628.2882382-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 5CLKHGVIT5B6CJEC36P2Y2QNNHNLSP6E X-Message-ID-Hash: 5CLKHGVIT5B6CJEC36P2Y2QNNHNLSP6E 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: Heinrich Schuchardt , Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 02/22] cmd: cedit: Fix CONFIG_CMD_EDIT_DUMP typo 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 The cedit dump command uses CONFIG_CMD_EDIT_DUMP but the Kconfig defines CONFIG_CMD_CEDIT_DUMP. Fix the code to use the correct name. With this, the command is actually enabled on sandbox. Co-developed-by: Claude Signed-off-by: Simon Glass --- cmd/cedit.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/cedit.c b/cmd/cedit.c index e446f61b3ba..fc477291be8 100644 --- a/cmd/cedit.c +++ b/cmd/cedit.c @@ -292,7 +292,7 @@ static int do_cedit_run(struct cmd_tbl *cmdtp, int flag, int argc, return 0; } -#ifdef CONFIG_CMD_EDIT_DUMP +#ifdef CONFIG_CMD_CEDIT_DUMP static int do_cedit_dump(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { @@ -321,7 +321,7 @@ static int do_cedit_dump(struct cmd_tbl *cmdtp, int flag, int argc, return 0; } -#endif /* CONFIG_CMD_EDIT_DUMP */ +#endif /* CONFIG_CMD_CEDIT_DUMP */ U_BOOT_LONGHELP(cedit, "load - load config editor\n" @@ -334,7 +334,7 @@ U_BOOT_LONGHELP(cedit, "cedit write_env [-v] - write settings to env vars\n" "cedit read_cmos [-v] [dev] - read settings from CMOS RAM\n" "cedit write_cmos [-v] [dev] - write settings to CMOS RAM\n" -#ifdef CONFIG_CMD_EDIT_DUMP +#ifdef CONFIG_CMD_CEDIT_DUMP "cedit dump - dump expo structure\n" #endif "cedit run - run config editor"); @@ -350,7 +350,7 @@ U_BOOT_CMD_WITH_SUBCMDS(cedit, "Configuration editor", cedit_help_text, U_BOOT_SUBCMD_MKENT(write_env, 2, 1, do_cedit_write_env), U_BOOT_SUBCMD_MKENT(read_cmos, 2, 1, do_cedit_read_cmos), U_BOOT_SUBCMD_MKENT(write_cmos, 2, 1, do_cedit_write_cmos), -#ifdef CONFIG_CMD_EDIT_DUMP +#ifdef CONFIG_CMD_CEDIT_DUMP U_BOOT_SUBCMD_MKENT(dump, 1, 1, do_cedit_dump), #endif U_BOOT_SUBCMD_MKENT(run, 1, 1, do_cedit_run), From patchwork Sun Dec 7 20:16:00 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 815 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=1765138633; bh=nuOOY8Rrh+NUm5EZfcvq0QxMcmS5per1GJOEFoBqTpg=; 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=CzCRzeCdyjWnfjN+BYSKAiOELTf1irzL4AXdintOaBwE613LeIVwu/g33sQhf7rhm e6363jA2JjVfapHBV5Tfp5/cdwTLnhUJ/OKk9nRH5Fw8MOGxyYzgoNKE6d57emkin5 DcqjDMPvOn7vFL3cuMPUA7wMKIj7Uj0gWaSc9LJsdILjsXquYAF7YdKP7h/BPzIgC2 AdF7tlF1pjmQ3tGW+3urSu7KTpagvM9sgIcMNdq5nrpUDgSmY9LN3RT9jz8w2Fhzs/ XScoKeq9/IOkFXNATeAfoGRRvRtaLxpBp6tZwkuaK0AefrX+HOJqhALUM3qdrdp/Cw YdorAq8DfHXMw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D2FE06899E for ; Sun, 7 Dec 2025 13:17:13 -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 RuTGw7JV7Dcw for ; Sun, 7 Dec 2025 13:17:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138633; bh=nuOOY8Rrh+NUm5EZfcvq0QxMcmS5per1GJOEFoBqTpg=; 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=CzCRzeCdyjWnfjN+BYSKAiOELTf1irzL4AXdintOaBwE613LeIVwu/g33sQhf7rhm e6363jA2JjVfapHBV5Tfp5/cdwTLnhUJ/OKk9nRH5Fw8MOGxyYzgoNKE6d57emkin5 DcqjDMPvOn7vFL3cuMPUA7wMKIj7Uj0gWaSc9LJsdILjsXquYAF7YdKP7h/BPzIgC2 AdF7tlF1pjmQ3tGW+3urSu7KTpagvM9sgIcMNdq5nrpUDgSmY9LN3RT9jz8w2Fhzs/ XScoKeq9/IOkFXNATeAfoGRRvRtaLxpBp6tZwkuaK0AefrX+HOJqhALUM3qdrdp/Cw YdorAq8DfHXMw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C2E4F68997 for ; Sun, 7 Dec 2025 13:17:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138632; bh=6I10PNSN6JOfhjBFXtuSaIM0Zo3HcSthH27oyBSRkGw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MGPeWBDDrC8gZ7pZuxId2ID8Uq/QJl50Nz0xD5KGGMCfkOa1buRmXW9bY/7o/2s+w W42ZJm/++sfkHyEevXHkBE5svslr4JmqAo4lwK2YxdyAqPJhHwjV05YwIluGZ0X5lO FXAmF/cAU/ysjR1Bz/BiaFzn1XhoiiwCh9UNbKp6EgPr665IYJEafgE4vhruEIL4w8 WkHUM01BJ5PSyW26Hhxsm3fM2u32YgOxn+E9rvoVTB0bTOTqdVm7kL4uzFSkAXwhid DqeiqK9wWnqIqUZOt5+ywU6sLZyy+4bDkmtv2X7E5DB9F4vPFFR3mBgdo3tZF38htU 5rUhtrgTuQoIQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C828468950; Sun, 7 Dec 2025 13:17:12 -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 5clBdEhlXCRG; Sun, 7 Dec 2025 13:17:12 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138628; bh=aMB4qLT+c1OxlDUHiqbt5aHDD5TWZHJApIT2P9jECYg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jZiZHJaWWyQ2YGcEBXH9DZmoE2pAqj18fp7ZKoCAVhO8weWUjcwgseICq5rgQpv4x y3ACSUQ1bcQmhWi6tdOiCWxRI9zR3+2JDDihYe9NAPqaYoTeidLIQnYO/H1IMVe2eR 7IK9EfrkmEOHvHGuSkZ9laMEhL8aatOg7ULf+3L26lVKYcDfuuULqozuRa+KnngMJV cBN2HIl3eWcxDD1rjR4xsWsWarA6TOY4tRIdeQfpoa85DfyEsBes+x14maAq71XDIQ 5OiF83Lgfrp/MfSMf+Mdsxwwdm4OjDV/pKWqIAtuYkCU1JEq9MRQSdJy7KPDGUvCiH I/30hWqn7WfjA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 18E995F6BF; Sun, 7 Dec 2025 13:17:08 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:00 -0700 Message-ID: <20251207201628.2882382-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: GJPZDHF4N36K75O2AFLXMFVMXBV3LDLI X-Message-ID-Hash: GJPZDHF4N36K75O2AFLXMFVMXBV3LDLI 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: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 03/22] expo: Use textline consistently in tests 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 The word 'lineedit' has crept into one of the tests, but it is not correct. Use 'textline' instead. Signed-off-by: Simon Glass --- test/boot/cedit.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/boot/cedit.c b/test/boot/cedit.c index 041da445459..7af3dfa2338 100644 --- a/test/boot/cedit.c +++ b/test/boot/cedit.c @@ -348,10 +348,10 @@ static int cedit_render(struct unit_test_state *uts) /* * Send some keypresses. Note that the console must be enabled so that * the characters actually reach the putc_xy() in console_truetype, - * since in scene_textline_send_key(), the lineedit restores the + * since in scene_textline_send_key(), the textline restores the * vidconsole state, outputs the character and then saves the state * again. If the character is never output, then the state won't be - * updated and the lineedit will be inconsistent. + * updated and the textline will be inconsistent. */ ut_unsilence_console(uts); for (i = 'a'; i < 'd'; i++) @@ -368,8 +368,8 @@ static int cedit_render(struct unit_test_state *uts) } BOOTSTD_TEST(cedit_render, UTF_DM | UTF_SCAN_FDT); -/* Check the cedit displays lineedits correctly */ -static int cedit_render_lineedit(struct unit_test_state *uts) +/* Check the cedit displays textlines correctly */ +static int cedit_render_textline(struct unit_test_state *uts) { struct scene_obj_textline *tline; struct video_priv *vid_priv; @@ -446,7 +446,7 @@ static int cedit_render_lineedit(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(cedit_render_lineedit, UTF_DM | UTF_SCAN_FDT); +BOOTSTD_TEST(cedit_render_textline, UTF_DM | UTF_SCAN_FDT); /* Check the cedit is arranged correctly */ static int cedit_position(struct unit_test_state *uts) @@ -654,7 +654,7 @@ static int cedit_mouse(struct unit_test_state *uts) ut_asserteq(SCENEOF_OPEN | SCENEOF_SIZE_VALID | SCENEOF_DIRTY, speed->obj.flags); - /* click on the lineedit */ + /* click on the textline */ ut_assertok(click_check(uts, scn, mach->edit_id, EXPOACT_REPOINT_OPEN, &act)); ut_asserteq(ID_MACHINE_NAME, act.select.id); From patchwork Sun Dec 7 20:16:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 816 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=1765138636; bh=cIp+EA+VclO9ows1rkVF0913xZyAY4n/PsS0ic5ASfU=; 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=mQWI6k4i2eZJHzuPNQVhqOa7UsqIocQLnhEcPmri6bK2gM+A8AHP95U3ZiI3B11TZ /qFVhfCfLlzklvR+WAKAx55q+Coq3cP/rISFokNatiqBkJfe521BClUqqlbJGGeJ12 M9Jy2k93dWELoDMXDl0cZR87LjZ86o/244XqbohgZMektWkV2+fG1fL2AuUdA58sM5 nNWYIMTkUPLWIbw1sxEmrydN2aW1G1953s8mu1dLmkeDC1XAANei0FjhriqWREjbsk r1wd+J/PmDEW4BmncMnZUHSkYhE4a20uGxmbp8NsBPCQ8TSCO45XvQsWiPeOXTgbUe ZCs6P00On8ZWA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3E94668995 for ; Sun, 7 Dec 2025 13:17:16 -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 7_a-RkGzpY0Q for ; Sun, 7 Dec 2025 13:17:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138635; bh=cIp+EA+VclO9ows1rkVF0913xZyAY4n/PsS0ic5ASfU=; 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=rvn19CQcG93oxF3x5y/f1jZcujpvVLxCmCIXeoeLTh8uTQGzXLwSKHhm3jULnHOYf UhHjVuy6D/OHcj+pSckQexTw88hUOiyHGEXOG/OylPJuRiRueVV35rzL1GCPYTU0Ku sz4GpubgT9BLCz3WVXWe+BNq25Z0uEde0Jmibhiz5haFr3uEiRVEsvdKnD3hURqAiv xpP07AWWTB9oklYGY6I85WFms4xzKdOccDcMNeqUxUE9DqRahfpEUNYy0jj8I2HYhq ncy+DvSePTkfSDSqorzVY4RwhtYMirQpwYNL8L8OggH8MzzxSoZd9T6RIWIsRzCfCF C4CsS5uNBTxOQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3AE166899B for ; Sun, 7 Dec 2025 13:17:15 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138633; bh=O0MuOyt7JOdyXjrAyN73ZLmIKUXvhmFLEyA22a6FmSs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GW+gi6aPAHRytYquRVS9JXXNaLnC79UINBT18jJlIXDu8tzEB+dJcv6wQPw9eHnvI uIl1wde95C83R06WL0sWdT7Ry37YYIXKmjBzLXQXEOXZ3zxDcCsAPOZpkPGmnYx1ui hmPq+gyF6qnF2eus/lBTchVipiFoszOlDaKd/19pyRkytMQmBI1pu8lZDFNNKgh2p1 3W+Q5J04bhzYwPa9Zam1h7zj6vMXhvukTYE5BwbhKSLr10AdHCNFMNu1KifXj5Zkdm V2WAIiodM3lG37epospmMf1X0fmdO9qdnG/AyaTgma0bsUnURB2MKnwKsgKuYocB1D 0KY3+qC8NxaYw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5A1F25F6BF; Sun, 7 Dec 2025 13:17:13 -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 dauRNjBI9KuX; Sun, 7 Dec 2025 13:17:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138633; bh=iqlkQUvjLwq3TRscfzQRTijBU7qVRlKDe/IIPIzmHHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jeoTtDGyBWCyfp8ZpWhXOy1f4pCiGDARIyj83qVRBuh8ixrRVK6oEnC8B6GtzPPXP 3st/UPsM7bSlsXvk/ZTXIo8Ih1MmBkxNp9Cn9dPZcuG6/pDvXlt7B79TLUfikrPxxQ h1XIgDlyss/Gh9Ub6XnyBGYaCclVX5tfLQF/ZqvevfkaMo/qROLYzqmsma5B2nHIcI aQI1sUQ4RMf+kz7mf52f9o5J0zO5ZSTRCTiGFc5ydfLPWlKcIKMRvUDiNaDCwQXyLy kvio+5XQRaeyFrFU2AFzPFM42mRb4yoyT7Z5rcsULXgJPqNk1+gwYmpSrn6/Ywgbm9 piLKkD01q8bKw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id BA31C688EF; Sun, 7 Dec 2025 13:17:12 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:01 -0700 Message-ID: <20251207201628.2882382-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: HXMFKAU6K5UCP4UWKIFGBDBXXAVVAC6O X-Message-ID-Hash: HXMFKAU6K5UCP4UWKIFGBDBXXAVVAC6O 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: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 04/22] video: Document the quirk in truetype_get_cursor_info() 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 The current code is written to suggest that the cursor position (priv->pos_ptr) might be respected. In fact a bug means that it never is, since index is set to priv->pos_ptr, so the if() condition always fails. Further, when editing textline objects, the cursor index is always the same as priv->pos_ptr anyway. Fix the bug but keep the current behaviour, adding a comment for future readers. Signed-off-by: Simon Glass --- drivers/video/console_truetype.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c index 4ddf133f2e0..7f5a2262b17 100644 --- a/drivers/video/console_truetype.c +++ b/drivers/video/console_truetype.c @@ -1097,9 +1097,13 @@ static int truetype_get_cursor_info(struct udevice *dev) * figure out where to place the cursor. This driver ignores the * passed-in values, since an entry_restore() must have been done before * calling this function. + * + * A current quirk is that the cursor is always at xcur_frac, since we + * output characters directly to the console as they are typed by the + * user. So we never bother with priv->pos[index] for now. */ index = priv->pos_ptr; - if (index < priv->pos_ptr) + if (0 && index < priv->pos_count) x = VID_TO_PIXEL(priv->pos[index].xpos_frac); else x = VID_TO_PIXEL(vc_priv->xcur_frac); From patchwork Sun Dec 7 20:16:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 817 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=1765138640; bh=wLzNVZ9dUtwnhVA14z8YulRD7KBKBYNHeyEgHwkMzH8=; 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=ZGOyAh4c3EGN64YJFPK8dyTGWxER6NXcum7MCVO1R1JbonjqYfQ1GsCXaqTNiB8mW u0gKisWafKYC+u/p4v7CK/rwR05TethAM1ABP5mEYooNj4lPDKfR71BK4/iaPhyS+g EV8a4tlv2LNwBbpjZTLUiN4RicAfuuplTxhKmuZS3RlrVlADy7+5pwKJuqPK9axHI7 i11RrsXzxCWVI6TsB4qEQHTdCsm3VgnZuk8KyERbJ8fIsGQPGcnRu1hLvKqyLC+RIX hmanoXO/XQn0LAXrlN1Ww3mFv9mHWnWViV7hUR2hZzVohi/PzzN0sUiuRaNvVpoa8u 42ZJ82cttefRA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AFDA768950 for ; Sun, 7 Dec 2025 13:17:20 -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 XLzeQM9ADL1v for ; Sun, 7 Dec 2025 13:17:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138640; bh=wLzNVZ9dUtwnhVA14z8YulRD7KBKBYNHeyEgHwkMzH8=; 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=ZGOyAh4c3EGN64YJFPK8dyTGWxER6NXcum7MCVO1R1JbonjqYfQ1GsCXaqTNiB8mW u0gKisWafKYC+u/p4v7CK/rwR05TethAM1ABP5mEYooNj4lPDKfR71BK4/iaPhyS+g EV8a4tlv2LNwBbpjZTLUiN4RicAfuuplTxhKmuZS3RlrVlADy7+5pwKJuqPK9axHI7 i11RrsXzxCWVI6TsB4qEQHTdCsm3VgnZuk8KyERbJ8fIsGQPGcnRu1hLvKqyLC+RIX hmanoXO/XQn0LAXrlN1Ww3mFv9mHWnWViV7hUR2hZzVohi/PzzN0sUiuRaNvVpoa8u 42ZJ82cttefRA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9E2F3688EF for ; Sun, 7 Dec 2025 13:17:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138638; bh=crnBjiagvGD+IL+niyrLq6TYR5K09lVpVPWfeQtEbus=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=owhmUdMafUnwu1eKbk0thrsogq3swP5OUQdTwlwhBn+b4NI5Bls8QRtRPvFpgZfao ISQDND2k6SNyCd5y7UQJePMkfn7o86uBtFVLyq4LCGqHxzOGTd4pL0wwXM6ZGe/c+/ Rm5uN6qaCjWHhd5T8xY5tRiVPd8Msb3TP2krdSgkxKMoVrT5pvyxftrLfaylnKourC Rmtxx4SfPqjlcqvebnmUJpix5FsRdoxVszmhXFytNIRA84YEsNqGkDlThSIhrHO4di yHE0wDufFD+f2ORl95qHPlbSI88GKJ/ZOagvn0vbgMEtsITWW5rxcYlSJaD775UOvq ZGFENQlg7r81w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8CEA96883E; Sun, 7 Dec 2025 13:17:18 -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 hGmC9D1giVzW; Sun, 7 Dec 2025 13:17:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138633; bh=JHlIsnJIVNqBs35Ahf4rqP8lv8OByCKNTaRif32g06k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UxWxVqRRjnHjFJZWMZtuldITF2rawnmQxLh5jPkRJrYvetiVvMi+oS16TTmn8Y8at wQbwO4sJ8B3xyZuUTuf8fir+0pWuo2jTtOnyjes+txplZRLYAhBnfwfyDhKijxhtNn PdPZjQYcs8EqsCg59gjQrgbUyzaMVayQ6KtjOBGi+tqnzhMkM0kCbshtLzIHbb0Ssx 7e50W3xtzMpxsnb4BH9wsWDO/95zdt8mLwEEQuuzjqvsw6iH7s7q4tiwt6YCkhiBbk N/54Fn9ItQr4QERLf/Ctc6rDh4caFnY3Zlb+MkKbKWALAweRaKRBn0/pi0XxdfDPia QNIoN0zq/SXXQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 97A07688EF; Sun, 7 Dec 2025 13:17:13 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:02 -0700 Message-ID: <20251207201628.2882382-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: X3MJDUWFV5HMB735XACYXAFICQNCV4UC X-Message-ID-Hash: X3MJDUWFV5HMB735XACYXAFICQNCV4UC 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: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 05/22] test: Add a flag for test which need console output 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 Some tests cannot run when the console is silent. An example is an expo test which checks text entry into a textline object. The console must be enabled so that the characters actually reach the putc_xy() in console_truetype, since in scene_textline_send_key(), the lineedit restores the vidconsole state, outputs the character and then saves the state again. If the character is never output, then the state won't be updated and the lineedit will be inconsistent. Rather than having individual tests handle this manually, add an explicit flag, in the hope that this quirk does not trip anyone else up. Put the flag next to the existing UTF_CONSOLE flag, since they are related. Signed-off-by: Simon Glass --- include/test/test.h | 17 +++++++++-------- test/test-main.c | 3 ++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/include/test/test.h b/include/test/test.h index f2d956e913c..086fff1ca26 100644 --- a/include/test/test.h +++ b/include/test/test.h @@ -90,20 +90,21 @@ enum ut_flags { UTF_FLAT_TREE = BIT(3), /* test needs flat DT */ UTF_LIVE_TREE = BIT(4), /* needs live device tree */ UTF_CONSOLE = BIT(5), /* needs console recording */ + UTF_NO_SILENT = BIT(6), /* console cannot be silent */ /* do extra driver model init and uninit */ - UTF_DM = BIT(6), - UTF_OTHER_FDT = BIT(7), /* read in other device tree */ + UTF_DM = BIT(7), + UTF_OTHER_FDT = BIT(8), /* read in other device tree */ /* * Only run if explicitly requested with 'ut -f '. The * test name must end in "_norun" so that pytest detects this also, * since it cannot access the flags. */ - UTF_MANUAL = BIT(8), - UTF_ETH_BOOTDEV = BIT(9), /* enable Ethernet bootdevs */ - UTF_SF_BOOTDEV = BIT(10), /* enable SPI flash bootdevs */ - UFT_BLOBLIST = BIT(11), /* test changes gd->bloblist */ - UTF_INIT = BIT(12), /* test inits a suite */ - UTF_UNINIT = BIT(13), /* test uninits a suite */ + UTF_MANUAL = BIT(9), + UTF_ETH_BOOTDEV = BIT(10), /* enable Ethernet bootdevs */ + UTF_SF_BOOTDEV = BIT(11), /* enable SPI flash bootdevs */ + UFT_BLOBLIST = BIT(12), /* test changes gd->bloblist */ + UTF_INIT = BIT(13), /* test inits a suite */ + UTF_UNINIT = BIT(14), /* test uninits a suite */ }; /** diff --git a/test/test-main.c b/test/test-main.c index b27f892140c..941b883e156 100644 --- a/test/test-main.c +++ b/test/test-main.c @@ -410,7 +410,8 @@ static int test_pre_run(struct unit_test_state *uts, struct unit_test *test) gd_set_bloblist(NULL); } - ut_silence_console(uts); + if (!(test->flags & UTF_NO_SILENT)) + ut_silence_console(uts); return 0; } From patchwork Sun Dec 7 20:16:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 818 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=1765138644; bh=Hb/vPiG123jShUNRbFBaSuiddsRAtjnfewU9aBfiI8M=; 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=GKtHURjEalpTo4rs09VTZPjlusYEWjlMQ8t9LgmRnobQhN6k8eNtZVRE5c6FwkOYz 0z1kpS1ubFoRP8brwhXmzPCJFXxj2A/e7jDBA6PJbVcCODTv9rTO8BHDSkxsHqYjMN FZIgoYAZ2w7Yki/XJdvBVXInJLa6vYjhIOidqYGW70QwSeTLq2IzJEIAiQjxvNGghO iMqYBz61OTrJttkCFg7gN3IaIuMJi06WsA8xyf7WNa0NQU/YAFihPe8+kL+3zafIEA brspxdvBMPcBnXlVQic9mRTLcs6XATSX9hSWclQ260F53EyO24K9aS0Po29/DjMN4h JiM/c8rKNoXPg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2F701689A6 for ; Sun, 7 Dec 2025 13:17:24 -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 fbXNKdrH6jBE for ; Sun, 7 Dec 2025 13:17:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138644; bh=Hb/vPiG123jShUNRbFBaSuiddsRAtjnfewU9aBfiI8M=; 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=GKtHURjEalpTo4rs09VTZPjlusYEWjlMQ8t9LgmRnobQhN6k8eNtZVRE5c6FwkOYz 0z1kpS1ubFoRP8brwhXmzPCJFXxj2A/e7jDBA6PJbVcCODTv9rTO8BHDSkxsHqYjMN FZIgoYAZ2w7Yki/XJdvBVXInJLa6vYjhIOidqYGW70QwSeTLq2IzJEIAiQjxvNGghO iMqYBz61OTrJttkCFg7gN3IaIuMJi06WsA8xyf7WNa0NQU/YAFihPe8+kL+3zafIEA brspxdvBMPcBnXlVQic9mRTLcs6XATSX9hSWclQ260F53EyO24K9aS0Po29/DjMN4h JiM/c8rKNoXPg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1FAEA68995 for ; Sun, 7 Dec 2025 13:17:24 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138642; bh=KL6KFv4vH4SHwc7DaBThCyeYSZ6jAblfKV7epeQx6K4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EUMYBwrMua4Mh3eSuEiQLrhA3nMaYSTa5epfzqgjsCcVIfPowXJYa1i4mHQh1tghE rt1VkO6KUyqqMxViixDl6+Gs/tssgwRdk7a/K1u5bq4zj1VOKOhz7hvFtEazxzs4EO b68OFp7vjhNzw47UYf5y+ZgAw/5Y63ti+8APLpoAYHt7AsbH50jbG4Jwjws8HGrWVz bAbgMD+DZMpFNqZqyTSizbwxhoFebEVIpS1UF0eTjdzcmvqG9H++kx5VhTX/SO4qnM gn7PWX6v/MWVo9PsFtabER9V7gvpF5BxDc7uMjVFpv/Yf59BHIpmOfBPybbvMCdwLI raQTXhrdWdrag== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9BD4E6883E; Sun, 7 Dec 2025 13:17:22 -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 zNs7Q3signR3; Sun, 7 Dec 2025 13:17:22 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138638; bh=bnuFWd5jEw7/QwlkcoXrWqywG0+KXpfuv+wxspY5oBo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cAWagl3wzJRJ8g+f2zi9tIIhGA/C88E3BeZQkFUQegvdj1hbhYza21T8gmCRY3MYd k4SOowOKYWGxsjYdIMGAwK6BNZXkj0b2UxnQ0fDWD6xe2c7/vGWI5+ZAXrByXNhs55 msyQNXrWe8ytkuC7xofjuMQVp+6/JjH26zm4Jf7SRY3AEh42VwNq+Air43ocTQuwnd Rax9q8UHzVE5BXkLiTs4SljpeuGdrnIz41rbseGtcjjaixgt5uw8d/yy/gI5w29woc +uw1YKBL2Fw2CfRrpDw0yIWci7EfTSXLpcfhQNvx1L94dyn9fUgQ8Em108AvTF/92K 5z+JvJAj5dpzw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3DE7E5F6BF; Sun, 7 Dec 2025 13:17:18 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:03 -0700 Message-ID: <20251207201628.2882382-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: VHLLNEMW52DELEV54Q2QV3W2O6565BFB X-Message-ID-Hash: VHLLNEMW52DELEV54Q2QV3W2O6565BFB 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: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 06/22] doc: expo: Move test-mode docs up a little 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 Move the documentation about test mode up above the API documentation, which is quite lengthly. Signed-off-by: Simon Glass --- doc/develop/expo.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/doc/develop/expo.rst b/doc/develop/expo.rst index 9ce00e621e5..84d01b6313b 100644 --- a/doc/develop/expo.rst +++ b/doc/develop/expo.rst @@ -569,14 +569,6 @@ strings are provided inline in the nodes where they are used. }; -API documentation ------------------ - -.. kernel-doc:: include/expo.h - -Future ideas ------------- - Test Mode ~~~~~~~~~ @@ -613,6 +605,14 @@ These metrics help identify performance bottlenecks and verify that expo is operating efficiently. The timing information is particularly useful when optimizing display drivers or debugging slow rendering issues. +API documentation +----------------- + +.. kernel-doc:: include/expo.h + +Future ideas +------------ + Some ideas for future work: - Default menu item and a timeout From patchwork Sun Dec 7 20:16:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 819 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=1765138646; bh=YIXWQwJuggv6x52z5/t8avDKe6z7F/BL8Vqs7vh86iY=; 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=r2yQZN/3AJUtvKyG6njig0RaBbwUy4ZpPFPWvSIQmYv4m1MRI6uf2d0xz6muE65xI bXgb834Dfga+D44y1Ja1gb4Zp1CQCfM9+vrP/susUg4P7jzdDNgXiU2fXIvSaetNkY C0/eJS4g+U1o+XpI2OiY15TCfpdutU0ykB8MvthSB0tDgKma97g34kGs5w8plAIfEQ HpIcAqGE8cF6yBPCVhNpdMd8rDkrWey4ruyJme96Yc02lYnK65R2a2YGb0e2VQgMz8 aQrdilDW8J9RyDV4Vb/AO4/+HXZlHXA8AO8iK+Yk1dXPUNPvDVAYEQLHHjC4RYCO6k x1GA0tytjmO4w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CEB7B689A7 for ; Sun, 7 Dec 2025 13:17:26 -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 mtgB0Rw5IsTg for ; Sun, 7 Dec 2025 13:17:26 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138645; bh=YIXWQwJuggv6x52z5/t8avDKe6z7F/BL8Vqs7vh86iY=; 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=uhdlvWqBfVOhmvjgZ9XnGJ+MlmiKxKauh2LkHjrCBK+/OLKvzYNtjTw29PpTGMsny 6Md864amplbU2Hu/+j7zdSOs85JAOdaAiZfFk9A+XaghMGcRYUp6eEBYqN9JPDbJ9S kLEfsYuEo2HrfbfpwkRv5vGX7FZcEfvtSeF4CdGgm07iCNH2kdh8IdHmV2CEtkZQyN /4p1NqTQh2FnuqP0CHzT/NaqOYaJXAuNbKT2qvxtaLw5QOUdA1zXrWKmr8EMvJNFUx B1EdX+n1JJT94ooU/xZ/jawOmEfBCJ+T5oH94QPmJMPcePmyrHsBY0gLwM5rnkfrL/ jv6RHYDZuFdSA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D201968994 for ; Sun, 7 Dec 2025 13:17:25 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138643; bh=BXxgmDetLgO8mZ5Ax1IOLo81/UTK3npTAkwxguV2npo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LAAfTVY3HIfcKUl4X+idhpptKr+1BR4RI+r6dlYrWEK3+t6Al5Zw7a54l91r3stZ6 wLquzbqjFrpQRJgI6pYGd5hCCw3KNMR7PNaAvndQ5c6hCWnycAmads4fX6bi6qdzSj 64kL9tsMHcWzKIvtohPtqLkp7Y3ys9uMCoQ2HtjWg0cdOnftQf0kvWhpmVhCCJqk9W UVDOg+9iOfPjHYiP55293YySO06F2BYpNIl9W4URh/9SDt157lY51zacI9vn8j7bO/ kW3WTRSkH+J2Kujyorhrjv19woVL/cxbnkfZRvsh6dS35LQHbS+irGwCcOjOEcj/wa oBARUefdX4iRA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 98A9D68994; Sun, 7 Dec 2025 13:17:23 -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 3gEh7FRVGqK9; Sun, 7 Dec 2025 13:17:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138643; bh=nSyb/wfMTUxaRHrzP8d/MG3KTuQ1Zdx1pUwXpQFV3sQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jhih79D6Tq8o0M1XWL/hTEQyryfbielWJwKVpfvDNpTjENQoq/L06uIZ+cbWISEBt HRqNLCxaRpclos2GaYFjPOLUf5+0r+keP+dwCPPuBcYbyfIgLK2vWKlq+Et3MxF5w7 dhgxMNePLcKiF1rHnza3tub9qmmYT8H8w9l1FoyGsN+fBv8XkIfJLc23QeIWP/MhxI 7WRtiIl6ICrh4ZV39karX8zcZQZ935I7ynAg7fJmF4WBHGJu0clLh1GT2fB4T2CTQs 4TAXAoRS7iSijBgK/JsBdWyS0ZZr39Hz0K/GRQS9ydDKrDk2ZjQgWxfEq1wt/KLHML /pKwrvIzOOPbQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id DE3CA5F6BF; Sun, 7 Dec 2025 13:17:22 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:04 -0700 Message-ID: <20251207201628.2882382-8-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: BMSZDMGZJE74VOBTKQJAQ3GFN4IDRLYQ X-Message-ID-Hash: BMSZDMGZJE74VOBTKQJAQ3GFN4IDRLYQ 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: Heinrich Schuchardt , Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 07/22] doc: test: Document assertion macros 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 documentation for all the ut_assert*() macros and memory helpers available in include/test/ut.h. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- doc/develop/tests_writing.rst | 104 ++++++++++++++++++++++++++++++++++ 1 file changed, 104 insertions(+) diff --git a/doc/develop/tests_writing.rst b/doc/develop/tests_writing.rst index f6f852c297d..4b0616376d0 100644 --- a/doc/develop/tests_writing.rst +++ b/doc/develop/tests_writing.rst @@ -373,6 +373,110 @@ existing suite or creating a new one. An example SPL test is spl_test_load(). +Assertions +---------- + +The test framework provides various assertion macros, defined in +``include/test/ut.h``. All of these return from the test function on failure, +unless ``uts->soft_fail`` is set. + +Basic assertions +~~~~~~~~~~~~~~~~ + +ut_assert(cond) + Assert that a condition is non-zero (true) + +ut_assertf(cond, fmt, args...) + Assert that a condition is non-zero, with a printf() message on failure + +ut_assertok(cond) + Assert that an operation succeeds (returns 0) + +ut_reportf(fmt, args...) + Report a failure with a printf() message (always fails) + +Value comparisons +~~~~~~~~~~~~~~~~~ + +ut_asserteq(expr1, expr2) + Assert that two int expressions are equal + +ut_asserteq_64(expr1, expr2) + Assert that two 64-bit expressions are equal + +ut_asserteq_str(expr1, expr2) + Assert that two strings are equal + +ut_asserteq_strn(expr1, expr2) + Assert that two strings are equal, up to the length of the first + +ut_asserteq_mem(expr1, expr2, len) + Assert that two memory areas are equal + +ut_asserteq_ptr(expr1, expr2) + Assert that two pointers are equal + +ut_asserteq_addr(expr1, expr2) + Assert that two addresses (converted from pointers via map_to_sysmem()) + are equal + +Pointer assertions +~~~~~~~~~~~~~~~~~~ + +ut_assertnull(expr) + Assert that a pointer is NULL + +ut_assertnonnull(expr) + Assert that a pointer is not NULL + +ut_assertok_ptr(expr) + Assert that a pointer is not an error pointer (checked with IS_ERR()) + +Console output assertions +~~~~~~~~~~~~~~~~~~~~~~~~~ + +These are used to check console output when ``UTF_CONSOLE`` flag is set. + +ut_assert_nextline(fmt, args...) + Assert that the next console output line matches the format string + +ut_assert_nextlinen(fmt, args...) + Assert that the next console output line matches up to the format + string length + +ut_assert_nextline_empty() + Assert that the next console output line is empty + +ut_assert_skipline() + Assert that there is a next console output line, and skip it + +ut_assert_skip_to_line(fmt, args...) + Skip console output until a matching line is found + +ut_assert_skip_to_linen(fmt, args...) + Skip console output until a partial match is found (compares up to the + format-string length) + +ut_assert_console_end() + Assert that there is no more console output + +ut_assert_nextlines_are_dump(total_bytes) + Assert that the next lines are a print_buffer() hex dump of the specified + size + +Memory helpers +~~~~~~~~~~~~~~ + +These help check for memory leaks: + +ut_check_free() + Return the number of bytes free in the malloc() pool + +ut_check_delta(last) + Return the change in free memory since ``last`` was obtained from + ``ut_check_free()``. A positive value means more memory has been allocated. + + Writing Python tests -------------------- From patchwork Sun Dec 7 20:16:05 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 820 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=1765138650; bh=Iw3b5KDra7mK7jpfGrn2ATwy48xi0oGCR35ufCxWHl0=; 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=LE0Xt9yQ/ony3NphF9QWA/WBsjEXq4ECEYJQdTorLsL667RFhuHeUlLCz/ItPhxIJ 8ErPvv3Sj/eP7w9ormXiVT0mnlpnP+E6xA+3pG8nXbJ+hn0UJxbozBMHxLBuGza97R di4F5U8ZIaA4RJg962pezne+czeGF/REtZqynPDmtTONOXGUj+04Uif2y2hERhJiK8 GT8y7WqC22a4O2NQhERMobiclYVDAoajymUZ8+mWWX4bg1qywdb5b9lU01p44I/6fV l9B0FWWTAoewh/tWFZDCphdj2llYjB4vQbhHzHbh1b6qaewVOi5NxDgLdjmD7ojFb4 HkqviwpbEV2bg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 663E36899E for ; Sun, 7 Dec 2025 13:17:30 -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 ZF5T42nnjPx5 for ; Sun, 7 Dec 2025 13:17:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138650; bh=Iw3b5KDra7mK7jpfGrn2ATwy48xi0oGCR35ufCxWHl0=; 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=LE0Xt9yQ/ony3NphF9QWA/WBsjEXq4ECEYJQdTorLsL667RFhuHeUlLCz/ItPhxIJ 8ErPvv3Sj/eP7w9ormXiVT0mnlpnP+E6xA+3pG8nXbJ+hn0UJxbozBMHxLBuGza97R di4F5U8ZIaA4RJg962pezne+czeGF/REtZqynPDmtTONOXGUj+04Uif2y2hERhJiK8 GT8y7WqC22a4O2NQhERMobiclYVDAoajymUZ8+mWWX4bg1qywdb5b9lU01p44I/6fV l9B0FWWTAoewh/tWFZDCphdj2llYjB4vQbhHzHbh1b6qaewVOi5NxDgLdjmD7ojFb4 HkqviwpbEV2bg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 54CB068994 for ; Sun, 7 Dec 2025 13:17:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138649; bh=Az8RBxGf/JXJxDnoU3thMS1BvoJqJyxD203SiDtYn3Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J+W53phpcoVfYzl7rES/sx5lbgtOW46hxqCNsB0HT1s0LCgSZIzryShsloRzk2Cuq Lk3uTEdInxzFvGEr3qwgB+HfCdXvIC9FWgD3Cm2ouv/xllo1u3k6IOe/Jq579Cxdev zNNRWZxKAd+8Mqv8DjsPSYyoihurjc7G6vSfk9yow6qvrrayvVAoagWAEJx22RtXTu 0lxyCVv5EWsStQ4+P0AA1tyDfHB/vO/WsovqxM0pCKffgR9Hcm6B26XI93Int3ldwZ WJtoSKx2BLUE8lgfuwIB0ubyelH9URQThNsnnJpUH4NVmAQ2zLSEpmhbfQtxiVOFpI GbR8JA7QWy31w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 25C2A688EF; Sun, 7 Dec 2025 13:17:29 -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 zbsbdmzYX8ag; Sun, 7 Dec 2025 13:17:29 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138644; bh=k3u8Olh5Fup1w1C3wJkgn9QEhDVSwpc8ZH7xACKKCCY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VOCf9vAp+BPb/Ur2oB5OfvqECXOsQ+SnTXxx2+BdJMLHhr+/KqF8X1sf0m4T2+De1 N9MrFue3C79S9sX0hAEsvpcs0orB77f5xUDfVH7pA0BODeXK0DYfNt3PZaWWttiVXu sPU1PoyeX16dcAwhSloB7n3WYJAw6vx4jPaCdyvb+We1NQHsJqO6/ZfIfEFLyxHjx/ IA6BO+CqjOyIPpxnUqQV4yIeA7m187+IEtpF6aACQzwKjz9gUBi0vEpNXMjX5uiBJ4 4NwgeF8nkj9smYYGvkMziKKYX+tMxoNe3hZQqDYy2RYQHmuH7f6Z45KzccRGPNlEA/ 5iE28c8foHw7w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 2784B5F6BF; Sun, 7 Dec 2025 13:17:24 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:05 -0700 Message-ID: <20251207201628.2882382-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 7QV7BGSQUZO2VMKI7DGGVWLAOMH25IOS X-Message-ID-Hash: 7QV7BGSQUZO2VMKI7DGGVWLAOMH25IOS 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: Heinrich Schuchardt , Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 08/22] doc: expo: Add documentation for writing and debugging tests 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 new section covering how to write expo tests, including test structure, memory checking, creating test expos, testing rendering and input, building from devicetree, and using IDs. Also add a debugging section with sandbox command-line options useful for expo development. Add a bit more detail for --video_frames Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- doc/arch/sandbox/sandbox.rst | 5 +- doc/develop/expo.rst | 195 ++++++++++++++++++++++++++++++++++ doc/develop/tests_writing.rst | 2 + 3 files changed, 201 insertions(+), 1 deletion(-) diff --git a/doc/arch/sandbox/sandbox.rst b/doc/arch/sandbox/sandbox.rst index 0d94c5a49cf..b2f4d8913d2 100644 --- a/doc/arch/sandbox/sandbox.rst +++ b/doc/arch/sandbox/sandbox.rst @@ -253,7 +253,10 @@ available options. Some of these are described below: Show console output from tests. Normally this is suppressed. --video_frames - Write video frames to the specified directory for debugging purposes. + Write video frames to the specified directory for debugging purposes. Each + time video_compress_fb() is called, this writes a file called 'frame%d.bmp' + to the given directory where %d is the sequence number starting from 0. Note + that sandbox removes all 'frame%d.bmp' files in that directory on startup. -V, --video_test Enable video test mode with a delay (in milliseconds) between assertions. This diff --git a/doc/develop/expo.rst b/doc/develop/expo.rst index 84d01b6313b..ca83b403621 100644 --- a/doc/develop/expo.rst +++ b/doc/develop/expo.rst @@ -605,6 +605,201 @@ These metrics help identify performance bottlenecks and verify that expo is operating efficiently. The timing information is particularly useful when optimizing display drivers or debugging slow rendering issues. +Writing expo tests +------------------ + +Expo has extensive tests in ``test/boot/expo.c`` and ``test/boot/cedit.c``. +These can be run under sandbox like any other test (see :doc:`testing`). + +Test structure +~~~~~~~~~~~~~~ + +Each test function follows a standard pattern:: + + static int expo_my_test(struct unit_test_state *uts) + { + struct expo *exp; + + /* Create expo and perform tests */ + + ut_assertok(expo_new("test", NULL, &exp)); + + /* ... test code ... */ + + expo_destroy(exp); + + return 0; + } + BOOTSTD_TEST(expo_my_test, UTF_DM | UTF_SCAN_FDT); + +The ``BOOTSTD_TEST()`` macro registers the test with the test framework. +Common flags include: + +UTF_DM + Requires driver model to be enabled (most expo tests need this) + +UTF_SCAN_FDT + Scans the device tree for devices (needed for video display) + +UTF_CONSOLE + Test needs to record console output (needed for commands) + +UTF_NO_SILENT + Don't silence console output (needed for tests that check rendering output + with user input) + +Memory checking +~~~~~~~~~~~~~~~ + +Tests should verify that no memory is leaked:: + + ulong start_mem; + + start_mem = ut_check_free(); + + /* ... create expo, test, destroy ... */ + + ut_assertok(ut_check_delta(start_mem)); + +For assertions, see :ref:`tests_writing_assertions`. + +Creating test expos +~~~~~~~~~~~~~~~~~~~ + +A common pattern is to create a helper function that sets up an expo with +scenes and objects for testing. See ``create_test_expo()`` in +``test/boot/expo.c`` for an example:: + + static int create_test_expo(struct unit_test_state *uts, struct expo **expp, + struct scene **scnp, struct scene_obj_menu **menup, + ...) + { + struct expo *exp; + struct scene *scn; + int id; + + ut_assertok(uclass_first_device_err(UCLASS_VIDEO, &dev)); + ut_assertok(expo_new(EXPO_NAME, NULL, &exp)); + + id = scene_new(exp, SCENE_NAME1, SCENE1, &scn); + ut_assert(id > 0); + + ut_assertok(expo_set_display(exp, dev)); + + /* Add objects to the scene */ + id = scene_txt_str(scn, "text", OBJ_TEXT, STR_TEXT, "my string", NULL); + ut_assert(id > 0); + + /* Return pointers */ + *expp = exp; + *scnp = scn; + + return 0; + } + +Testing rendering +~~~~~~~~~~~~~~~~~ + +For graphical rendering tests, use ``video_compress_fb()`` to get a checksum +of the framebuffer:: + + ut_assertok(expo_render(exp)); + ut_asserteq(expected_checksum, video_compress_fb(uts, dev, false)); + +For text-mode rendering, check console output lines:: + + expo_set_text_mode(exp, true); + ut_assertok(expo_render(exp)); + ut_assert_nextline("Expected line"); + ut_assert_console_end(); + +Testing input +~~~~~~~~~~~~~ + +To test keyboard input handling, use ``expo_send_key()``:: + + ut_assertok(expo_send_key(exp, BKEY_DOWN)); + ut_assertok(expo_action_get(exp, &act)); + ut_asserteq(EXPOACT_POINT_ITEM, act.type); + ut_asserteq(ITEM2, act.select.id); + +To test mouse clicks, use ``scene_send_click()``:: + + ut_assertok(scene_send_click(scn, x, y, &act)); + ut_asserteq(EXPOACT_SELECT, act.type); + +Building from devicetree +~~~~~~~~~~~~~~~~~~~~~~~~ + +To test building an expo from a devicetree description:: + + ofnode node; + + node = ofnode_path("/cedit"); + ut_assert(ofnode_valid(node)); + ut_assertok(expo_build(node, &exp)); + +The test devicetree is in ``test/boot/files/expo_layout.dts`` with IDs +defined in ``test/boot/files/expo_ids.h``. See ``setup_cedit_file()`` in +``test/py/img/cedit.py`` for how this is set up. + +Using IDs +~~~~~~~~~ + +Define an enum for all object IDs at the top of the test file:: + + enum { + /* scenes */ + SCENE1 = 7, + + /* objects */ + OBJ_LOGO, + OBJ_TEXT, + OBJ_MENU, + + /* strings */ + STR_TEXT, + STR_MENU_TITLE, + + /* menu items */ + ITEM1, + ITEM2, + }; + +Starting IDs from a value higher than ``EXPOID_BASE_ID`` avoids conflicts +with reserved expo IDs. + +Debugging tests +~~~~~~~~~~~~~~~ + +Running tests directly (without pytest) makes debugging easier. See +:doc:`tests_sandbox` for details on running sandbox tests with gdb. + +For example, to run a single expo test:: + + ./u-boot -T -c "ut bootstd expo_render_image" + +To debug with gdb:: + + gdb --args ./u-boot -T -c "ut bootstd expo_render_image" + (gdb) break expo_render_image + (gdb) run + +IDEs such as Visual Studio Code can also be used. + +Sandbox provides command-line options useful for debugging expo and video +tests, including ``-l`` (show LCD), ``-K`` (double LCD size), ``-V`` (video +test mode with delay), ``--video_frames`` (capture frames), ``-f`` (continue +after failure), and ``-F`` (skip flat-tree tests). See +:doc:`../arch/sandbox/sandbox` for full details. + +For example, to watch an expo test render with a visible display:: + + ./u-boot -T -l -V 500 --video_frames /tmp/good -c "ut bootstd expo_render_image" + +This will write each asserted expo frame to ``/tmp/good/frame0.bmp``, +``/tmp/good/frame1.bmp``, etc. + API documentation ----------------- diff --git a/doc/develop/tests_writing.rst b/doc/develop/tests_writing.rst index 4b0616376d0..31454aa4819 100644 --- a/doc/develop/tests_writing.rst +++ b/doc/develop/tests_writing.rst @@ -373,6 +373,8 @@ existing suite or creating a new one. An example SPL test is spl_test_load(). +.. _tests_writing_assertions: + Assertions ---------- From patchwork Sun Dec 7 20:16:06 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 821 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=1765138652; bh=PUVhxDqlRIagJYDXtF6adzHNpCNPrcvn1fl2OSRiErY=; 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=TR/VQ8NCjtzw78Skg+TPz5uaHeqU33WPOv64Xb3iY6rgPR9+rUA/0W05ZzE+N1wYj tYukN5nKh88uDrALMnobV7EGZpTrZSGRPP0gUsH9WcgDw7dMzkOtwJN+UMBZLSTRJo FaKSGLX/CukNzSAiVL4F2fqoQwbeYd8jaB8vhx3AkNm8Ul4Lt8JwxCYj15FWoVT4eW aAcJY3Zv3WEOoV1EOa/5U3f8PqRpa0IWIkZF49P4jii2HxaWLkyD1QCX15B1QcD7Gd XWbqp+qMp4XF5pZVbGwA0tSvGXGOK6H1IHOfOTgo+ve7EPIWA+C3YshhZKBerrlNJ8 Tgrd1JUkK3usw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D13885F6BF for ; Sun, 7 Dec 2025 13:17:32 -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 9vvWp3TYNdWh for ; Sun, 7 Dec 2025 13:17:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138651; bh=PUVhxDqlRIagJYDXtF6adzHNpCNPrcvn1fl2OSRiErY=; 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=Y4xLzNyuURduIXWPsV4IvI5QcoJb6vhsRPSXs1o4bETorObUABa/uW/tydRyBMfv6 Nfm97eKOE/9TZl1WHNKURAh+xYLwG7qlFWUAx3uhJvRK8EKZqtVHL/WtfLW1qe3GZ5 WIk2E+nwKU9TvZQqyWI1XGQ3o3psw5YqZ17NUOPgIMBQe67AUwvcT/FH4H0KbJ1S1w e5WQah9HGG5b7vdSrL3URTN98DI3YqRUpM203P9hsZveK4iqZSwyQyHP6D+GNHxtMT Jp+lujToCWn5fn+GmBR0iF1bE4g+9UFYYkMshFzZedS7BWrrAaQo/+AaeOZyNN/9vH q40ENjPZ4pwLg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BE22A68950 for ; Sun, 7 Dec 2025 13:17:31 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138649; bh=fi3yhDkKeizDWsfYB8llKL0NJiOP5RQofPcX6ASlvDk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QXvnpiUNO3jlGFHBWR/KCsFoHHNEa+am5+vQEMXAtQidPSMOr2zx/peI3z6MFRTEJ kV91qixgJB6yY+GfXbAIdrPuiYjF2B9b2YPtm/XCmkJ620tHePeFHPqpVBhUWI0jjX hh2u5IJE+UCm85K0amAvE2CR0I/IAObZa75EEr2IxHpDHqXnedWlh3LvekOS8Eo9BY 2/TuDXV+a7P/s4YkhDKd/5bN4Q0IrpHVroJfgUKKA84SkTDQDbPTlAqQgWN0WgaebK NaVe+5l87Z7wG21uE+mVN+wiafxZNhvIZsPXPb6zrFPHVCRq6Hmtx5M1xOmAuamciZ 4UQUAp2tT+4wg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D13CC5F6BF; Sun, 7 Dec 2025 13:17:29 -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 Lk462c84DyBB; Sun, 7 Dec 2025 13:17:29 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138649; bh=URhVKV/IAZ/sCFikqpzk0TMl/f4oqA9htTqdlkRVnj8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F/I/JsJw7kBq4Klvb4jE2TOVkY/Jl/cF4/SHpKkhG9VP1jgfRXsio0yOJI2LgyB/s gJN3YNgwoKJvYd22qVhXLqMYxV+1n2BsRGJoetePc7bTgbqesb4V63A+94Rm0iJoxU cubV7MEv/kh/tWAuOXaD/HjMD6m3Kmcmfl6c55EY/mCWdMLv9pd8clEUsMPSVZNePO WLk1/whm3fkBI9TD48gnpyp12hMM4ZJNHXA9oViIkPWUlpdzmucOqRrTCtYsGORw9i S2jDLgqHImLD9BWNzg6kvtJ+e2tCBnNjBKzVxofOyaTp1022pH8wYKtyngg8WEOEMb 7MrFraVOsFcFw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 10D516883E; Sun, 7 Dec 2025 13:17:28 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:06 -0700 Message-ID: <20251207201628.2882382-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: YPBXHU6LDWXAFDRYHBK5XNMLQB2W2XCA X-Message-ID-Hash: YPBXHU6LDWXAFDRYHBK5XNMLQB2W2XCA 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: Heinrich Schuchardt , Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 09/22] expo: Use hex format when dumping the expo 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 Change expo_dump() to output object IDs in hex format. This matches the normal convention in U-Boot. Also add key_id and preview_id to the menu item dump output while we are here. Co-developed-by: Claude Signed-off-by: Simon Glass --- boot/expo_dump.c | 51 ++++++++++++++++++++++++------------------------ 1 file changed, 26 insertions(+), 25 deletions(-) diff --git a/boot/expo_dump.c b/boot/expo_dump.c index 711b26eb220..eb0c7bce6fc 100644 --- a/boot/expo_dump.c +++ b/boot/expo_dump.c @@ -67,14 +67,15 @@ static void dump_menu(struct dump_ctx *ctx, struct scene_obj_menu *menu) struct scene_obj *obj = &menu->obj; struct scene_menitem *item; - outf(ctx, "Menu: pointer_id %d title_id %d manual %d\n", + outf(ctx, "Menu: pointer_id %x title_id %x manual %d\n", menu->pointer_id, menu->title_id, !!(obj->flags & SCENEOF_MANUAL)); ctx->indent += 2; list_for_each_entry(item, &menu->item_head, sibling) { - outf(ctx, "Item %d: name '%s' label_id %d desc_id %d\n", - item->id, item->name, item->label_id, item->desc_id); + outf(ctx, "Item %x: name '%s' key_id %x label_id %x desc_id %x preview_id %x\n", + item->id, item->name, item->key_id, item->label_id, + item->desc_id, item->preview_id); } ctx->indent -= 2; } @@ -83,7 +84,7 @@ static void dump_text(struct dump_ctx *ctx, struct scene_obj_txt *txt) { const char *str = expo_get_str(ctx->scn->expo, txt->gen.str_id); - outf(ctx, "Text: str_id %d font_name '%s' font_size %d\n", + outf(ctx, "Text: str_id %x font_name '%s' font_size %x\n", txt->gen.str_id, txt->gen.font_name ? txt->gen.font_name : "(default)", txt->gen.font_size); @@ -94,7 +95,7 @@ static void dump_text(struct dump_ctx *ctx, struct scene_obj_txt *txt) static void dump_box(struct dump_ctx *ctx, struct scene_obj_box *box) { - outf(ctx, "Box: fill %d width %d\n", box->fill, box->width); + outf(ctx, "Box: fill %d width %x\n", box->fill, box->width); } static void dump_image(struct dump_ctx *ctx, struct scene_obj_img *img) @@ -105,17 +106,17 @@ static void dump_image(struct dump_ctx *ctx, struct scene_obj_img *img) static void dump_textline(struct dump_ctx *ctx, struct scene_obj_textline *tline) { - outf(ctx, "Textline: label_id %d edit_id %d\n", + outf(ctx, "Textline: label_id %x edit_id %x\n", tline->label_id, tline->edit_id); ctx->indent += 2; - outf(ctx, "max_chars %d pos %d\n", tline->max_chars, tline->pos); + outf(ctx, "max_chars %x pos %x\n", tline->max_chars, tline->pos); ctx->indent -= 2; } static void dump_textedit(struct dump_ctx *ctx, struct scene_obj_txtedit *tedit) { - outf(ctx, "Textedit: str_id %d font_name '%s' font_size %d\n", + outf(ctx, "Textedit: str_id %x font_name '%s' font_size %x\n", tedit->gen.str_id, tedit->gen.font_name ? tedit->gen.font_name : "(default)", tedit->gen.font_size); @@ -128,7 +129,7 @@ static void obj_dump_(struct dump_ctx *ctx, struct scene_obj *obj) int bit; int pos = 0; - outf(ctx, "Object %d (%s): type %s\n", obj->id, obj->name, + outf(ctx, "Object %x (%s): type %s\n", obj->id, obj->name, scene_obj_type_name(obj->type)); ctx->indent += 2; @@ -144,9 +145,9 @@ static void obj_dump_(struct dump_ctx *ctx, struct scene_obj *obj) } } outf(ctx, "flags %s\n", pos > 0 ? flags_buf : ""); - outf(ctx, "bbox: (%d,%d)-(%d,%d)\n", + outf(ctx, "bbox: (%x,%x)-(%x,%x)\n", obj->bbox.x0, obj->bbox.y0, obj->bbox.x1, obj->bbox.y1); - outf(ctx, "dims: %dx%d\n", obj->dims.x, obj->dims.y); + outf(ctx, "dims: %xx%x\n", obj->dims.x, obj->dims.y); switch (obj->type) { case SCENEOBJT_NONE: @@ -177,11 +178,11 @@ static void scene_dump_(struct dump_ctx *ctx) { struct scene_obj *obj; - outf(ctx, "Scene %d: name '%s'\n", ctx->scn->id, ctx->scn->name); + outf(ctx, "Scene %x: name '%s'\n", ctx->scn->id, ctx->scn->name); ctx->indent += 2; - outf(ctx, "title_id %d (%s)\n", + outf(ctx, "title_id %x (%s)\n", ctx->scn->title_id, obj_name(ctx, ctx->scn->title_id)); - outf(ctx, "highlight_id %d (%s)\n", + outf(ctx, "highlight_id %x (%s)\n", ctx->scn->highlight_id, obj_name(ctx, ctx->scn->highlight_id)); list_for_each_entry(obj, &ctx->scn->obj_head, sibling) { @@ -215,20 +216,20 @@ static void expo_dump_(struct dump_ctx *ctx, struct expo *exp) exp->display ? exp->display->name : "(null)"); outf(ctx, "cons %s\n", exp->cons ? exp->cons->name : "(none)"); outf(ctx, "mouse %s\n", exp->mouse ? exp->mouse->name : "(none)"); - outf(ctx, "scene_id %d\n", exp->scene_id); - outf(ctx, "next_id %d\n", exp->next_id); - outf(ctx, "req_width %d\n", exp->req_width); - outf(ctx, "req_height %d\n", exp->req_height); + outf(ctx, "scene_id %x\n", exp->scene_id); + outf(ctx, "next_id %x\n", exp->next_id); + outf(ctx, "req_width %x\n", exp->req_width); + outf(ctx, "req_height %x\n", exp->req_height); outf(ctx, "text_mode %d\n", exp->text_mode); outf(ctx, "popup %d\n", exp->popup); outf(ctx, "show_highlight %d\n", exp->show_highlight); outf(ctx, "mouse_enabled %d\n", exp->mouse_enabled); outf(ctx, "mouse_ptr %p\n", exp->mouse_ptr); - outf(ctx, "mouse_size %dx%d\n", exp->mouse_size.w, + outf(ctx, "mouse_size %xx%x\n", exp->mouse_size.w, exp->mouse_size.h); - outf(ctx, "mouse_pos (%d,%d)\n", exp->mouse_pos.x, + outf(ctx, "mouse_pos (%x,%x)\n", exp->mouse_pos.x, exp->mouse_pos.y); - outf(ctx, "damage (%d,%d)-(%d,%d)\n", exp->damage.x0, exp->damage.y0, + outf(ctx, "damage (%x,%x)-(%x,%x)\n", exp->damage.x0, exp->damage.y0, exp->damage.x1, exp->damage.y1); outf(ctx, "done %d\n", exp->done); outf(ctx, "save %d\n", exp->save); @@ -237,17 +238,17 @@ static void expo_dump_(struct dump_ctx *ctx, struct expo *exp) if (exp->display) { struct video_priv *vid_priv = dev_get_uclass_priv(exp->display); - outf(ctx, "video: %dx%d white_on_black %d\n", + outf(ctx, "video: %xx%x white_on_black %d\n", vid_priv->xsize, vid_priv->ysize, vid_priv->white_on_black); } outf(ctx, "Theme:\n"); ctx->indent = 4; - outf(ctx, "font_size %d\n", theme->font_size); + outf(ctx, "font_size %x\n", theme->font_size); outf(ctx, "white_on_black %d\n", theme->white_on_black); - outf(ctx, "menu_inset %d\n", theme->menu_inset); - outf(ctx, "menuitem_gap_y %d\n", theme->menuitem_gap_y); + outf(ctx, "menu_inset %x\n", theme->menu_inset); + outf(ctx, "menuitem_gap_y %x\n", theme->menuitem_gap_y); ctx->indent = 0; outf(ctx, "\nScenes:\n"); From patchwork Sun Dec 7 20:16:07 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 822 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=1765138655; bh=NfE+L9czRRgdTWswEDeHfgdq/fxi69PpqMFTfp8nO5g=; 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=XHXBPhZI/bk85YY0UbeU2Z1Fc4juBnw970AydsxlCvepOevzHsWe4ow/fdktpkTvg +5+8edCYqpioZrure6hgdkv4VR8XrTPULkOuSKSNrYGg0qfmeAsPfccS9QyGw+hchD YdT6++nHi8EOmeqRTz7RjoywP505bU/M0SrPBblbkYGI0S8SVrHgiC7mI/+FD654+T pqrtrh0P20897QpuZN78bggfLQoHVCCLf3kPHVdV5pBWh33hLd0WK5VGJ+amfkGG44 zxlq684BNkjj5YFB8VeR/FdMKGN1zUYhU9h0yeaPGw/+NAxWUxKU3bUY8tNVZOoVDd Eo95/oR1f6Evw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 16248689A7 for ; Sun, 7 Dec 2025 13:17:35 -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 QkL1GNxVFCIf for ; Sun, 7 Dec 2025 13:17:35 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138654; bh=NfE+L9czRRgdTWswEDeHfgdq/fxi69PpqMFTfp8nO5g=; 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=UH2SEgAbiK75h/uEKaVy2DepcDcdVmmQqlCg6mAY/Zjkml/2bPH/PbNVJ7egxih2q A7iZOHqAgmO7kx84IuaNXJ1JCxQelK+KrRxv0mgvJQMP4R+cgh7/cIRJpGxE2PEoSa yuMJA1Cybw0wmLVTBRZimtgjaWWNbBMvNP5dXMCGZXgzQRmRvKbzTkvn0cDwHYurFp muqaGGQhM6zFTUJ4iKnrYO/kCQqC5FfgtFeFZWAX+5405JiLHpZmrEACVsCcit/k/H f8KNZeaNVhthCofpBM3QJtak4voaNFJr91crMB+bnsWLjUblRCukxm03sTl8L+4Oak 5+jlS0Afj5ECw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9CBC068950 for ; Sun, 7 Dec 2025 13:17:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138652; bh=DfXBfv1zNmCujzoAyy53XKJq7T5qRsdhX1UqdkJMlD4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P6Pmqna8T1P/ANIwivOwJdU1m4lcXv+Ih5T172joypSdt7nnUNK6eDByTLAggv4Wp T2LZkrd5DkNb/4aSz9IDZCinA8mzbDvb9+G5ZqihIOvrVyafwTHBEjPzt5HYkuqNqu 2TIPbXmLn5/NGmbw7bTPo18POQ0oHVPF2YZbj+AfdugAuTUe8SDH3hiofUh8hGLzcd SJPREYBZjM3IuA6yRUSBi41PSDn0K661tCMaQIwNgwfFlIJo4sYjrEc4vwKrJPgnC/ BVtoSJKCrbjIgl2bZPE/JkGhqViaqjyIUWklC2ZKN2eBNebAVSkt/pcDX56ic7lrlY trH2kUtIEWI1g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BE9FD689AC; Sun, 7 Dec 2025 13:17:32 -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 rNNFRiqUn45V; Sun, 7 Dec 2025 13:17:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138650; bh=Pz0Bibsx7a81w0ivqyOhqb5XDoISrdPDhxtYMwjKYAE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pQOgepjqDwS73/mfEM80jpe09FYsOb3zRylR48OqufEAInwENuf6FA9jjUp1swYSu elEelynqNUGDdO6xnfCWZ18AHozsOavjjEtW4jDzoyhsbEHr1wElZouatso6ltz55x UGS3dk6/xN26ZTSFSXRf/aZRJpSDUCxeAMOktrGOvO/EyId4sDGAmn7MUJ+Keg/H1J afQUseXenATUSBlLqGCAWRklrwXUsh3rdktpBJNMU94+uh2+9NenPRzou613uXjDtR upaK7xbPQHFajlzojV+gBhMjpoqx34ETMp8P4R9RjLc/nUNgq3jERHy+tMsFOHhR9X RH+i8cx7H7FqA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 263816883E; Sun, 7 Dec 2025 13:17:30 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:07 -0700 Message-ID: <20251207201628.2882382-11-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: XJVDDDK7T7EJGNYNZT3YKSBYSMR5YORL X-Message-ID-Hash: XJVDDDK7T7EJGNYNZT3YKSBYSMR5YORL 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: Heinrich Schuchardt , Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 10/22] expo: Add prompt_id to struct scene 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 prompt_id field to struct scene to track the prompt text object. Update cedit_arange() to use title_id and prompt_id directly instead of looking up objects by name, which is more robust. Co-developed-by: Claude Signed-off-by: Simon Glass --- boot/cedit.c | 11 ++++------- include/expo.h | 2 ++ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/boot/cedit.c b/boot/cedit.c index c82519a0eb3..d58ae0ba51c 100644 --- a/boot/cedit.c +++ b/boot/cedit.c @@ -54,7 +54,6 @@ int cedit_arange(struct expo *exp, struct video_priv *vpriv, uint scene_id) { struct expo_theme *theme = &exp->theme; struct expo_arrange_info arr; - struct scene_obj_txt *txt; struct scene_obj *obj; struct scene *scn; int y, ret; @@ -63,13 +62,11 @@ int cedit_arange(struct expo *exp, struct video_priv *vpriv, uint scene_id) if (!scn) return log_msg_ret("scn", -ENOENT); - txt = scene_obj_find_by_name(scn, "prompt"); - if (txt) - scene_obj_set_pos(scn, txt->obj.id, 0, vpriv->ysize - 50); + if (scn->prompt_id) + scene_obj_set_pos(scn, scn->prompt_id, 0, vpriv->ysize - 50); - txt = scene_obj_find_by_name(scn, "title"); - if (txt) - scene_obj_set_pos(scn, txt->obj.id, 200, 10); + if (scn->title_id) + scene_obj_set_pos(scn, scn->title_id, 200, 10); memset(&arr, '\0', sizeof(arr)); ret = scene_calc_arrange(scn, &arr); diff --git a/include/expo.h b/include/expo.h index e6093769421..f9f85b38b9c 100644 --- a/include/expo.h +++ b/include/expo.h @@ -204,6 +204,7 @@ struct expo_string { * @name: Name of the scene (allocated) * @id: ID number of the scene * @title_id: String ID of title of the scene (allocated) + * @prompt_id: String ID of prompt of the scene (allocated) * @highlight_id: ID of highlighted object, if any * @cls: cread state to use for input * @buf: Buffer for input @@ -216,6 +217,7 @@ struct scene { char *name; uint id; uint title_id; + uint prompt_id; uint highlight_id; struct cli_line_state cls; struct abuf buf; From patchwork Sun Dec 7 20:16:08 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 823 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=1765138658; bh=9Q68lHe5+hNPRoTkaf2ANYc+cyLHdn2nVl9wAL3SWPY=; 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=uKYejpOkVJNIcbikOjN1qzEOYvGf6f9pfevd6OoZmMzLfRo1eAJy4IZ6JbNQgwHEC LvrehH3/nbstyCjZVpJqzrwDoRlHaojCCHdgw0DN5sfkRhxHKyxmM1IwfJKI0EtKcB 8pmfjulW2msjqbBabE70XXa4Q/RNvn3sCv9CtXasY2sTuHdDhmYmpI27XKyeNLhy0m oMRCZorBq4EopYBCWi5H//JODTnGl3yOCLQ/FP1vjwmfaXRW57yN+/L0HLVZnmbHk4 CROg/Ox6ZD5173SrvlIf7WvQKpfghEDV4s7m9AhUyxtVVOp9BR6vVuzw7il2UDE4ky C63LWxrdsP2Cg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A583268902 for ; Sun, 7 Dec 2025 13:17:38 -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 1zOmMY56OGa1 for ; Sun, 7 Dec 2025 13:17:38 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138658; bh=9Q68lHe5+hNPRoTkaf2ANYc+cyLHdn2nVl9wAL3SWPY=; 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=uKYejpOkVJNIcbikOjN1qzEOYvGf6f9pfevd6OoZmMzLfRo1eAJy4IZ6JbNQgwHEC LvrehH3/nbstyCjZVpJqzrwDoRlHaojCCHdgw0DN5sfkRhxHKyxmM1IwfJKI0EtKcB 8pmfjulW2msjqbBabE70XXa4Q/RNvn3sCv9CtXasY2sTuHdDhmYmpI27XKyeNLhy0m oMRCZorBq4EopYBCWi5H//JODTnGl3yOCLQ/FP1vjwmfaXRW57yN+/L0HLVZnmbHk4 CROg/Ox6ZD5173SrvlIf7WvQKpfghEDV4s7m9AhUyxtVVOp9BR6vVuzw7il2UDE4ky C63LWxrdsP2Cg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8D9D2689A8 for ; Sun, 7 Dec 2025 13:17:38 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138657; bh=SkVFt/YOyiIP3z2NPCe7Umf7qrld7yVAfK+dhCIrKeY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U7XVagr5lLOrpcTBdLMP/Z1O4ZVSkMg0v6oRVdoRD6EdhxfwULuNrcfoR4EhxWADN brmNwKrExFqejAxlGaXGu2jMASfBdKv1CQ9hAOyGdypqmR297gYtvANsOX4+wsHr+v 6783EguQpNPZ77JOhiglIu4pl6em224ggUMUTOY2KWdxM20LMQWstEbk9bySaH2Tqj snm0JQ/0CtBAEYmhQQIxA97X1iX/GEpytPNObzHfr6VO/iB/cGe1Nmxg3ALXn3w8QA m6O5QSNddAdIA+Gdb8L/1Esbk85XJz1KPaHMvMkcbHqVY3SjXOil6Ri3bZXb3vqos6 y08LTV+MaMs5A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5342A68997; Sun, 7 Dec 2025 13:17:37 -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 tIx997YxaPdL; Sun, 7 Dec 2025 13:17:37 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138651; bh=yLOhuOoVNFHye/TV5XF3h5be+v0dFNqsV02bFMtlZ3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eGaP7K/gR/DNISk53sW0KymeLw6Yx6pAWyXbfuG8gGCr+zwgKsEj2RLFkdwUJueRC F8uQNQRGumYL0YM89wbtQ88sGSATC8yneFGEikNcGkpuFsdE+fgBzYmNKz8LyOFIWB QL3ujmRnbnhHiSnF6nRVC1J1pqK+fdN9105+oFQ1iym4ssVzKrzYxIRhCpT7OK1B0p mQx2tsBcv1hMlwcmsLAMCBrXpJLUJhsRnkLs4FlzRV8iCh2yMlRjYrAn91GGDDMpeR mFgtNOefNSr1VE54CE74LUgR9R3NexfxC9WxIImxnp+bqKaARLLODSWVvPP5S8JBcx sLkZtIA4f15RA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3499D688EF; Sun, 7 Dec 2025 13:17:31 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:08 -0700 Message-ID: <20251207201628.2882382-12-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: YSDIYL6WROK7PSADWEO6CZKCUCAFSJ7G X-Message-ID-Hash: YSDIYL6WROK7PSADWEO6CZKCUCAFSJ7G 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: Heinrich Schuchardt , Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 11/22] expo: Use better names for child objects in expo_build 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 Use the parent object name as a prefix for child objects, so they have descriptive names like "cpu-speed.title" instead of generic "title". This makes debugging easier when multiple objects exist. Update add_txt_str() and add_txt_str_list() to take separate property name and object name parameters. Also set the scene's prompt_id when building from devicetree. Co-developed-by: Claude Signed-off-by: Simon Glass --- boot/expo_build.c | 52 +++++++++++++++++++++++++++++++---------------- test/boot/expo.c | 4 ++-- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/boot/expo_build.c b/boot/expo_build.c index f8ae5bcbbf7..60a9cd71b7e 100644 --- a/boot/expo_build.c +++ b/boot/expo_build.c @@ -38,12 +38,13 @@ struct build_info { * @info: Build information * @node: Node describing scene * @scn: Scene to add to - * @find_name: Name to look for (e.g. "title"). This will find a property called - * "title" if it exists, else will look up the string for "title-id" + * @find_name: Property to look for (e.g. "title"). This will find a property + * called "title" if it exists, else will look up the string for "title-id" + * @obj_name: Name for the object (e.g. "cpu-speed.title") * Return: ID of added string, or -ve on error */ int add_txt_str(struct build_info *info, ofnode node, struct scene *scn, - const char *find_name, uint obj_id) + const char *find_name, const char *obj_name, uint obj_id) { const char *text; int ret; @@ -66,7 +67,7 @@ int add_txt_str(struct build_info *info, ofnode node, struct scene *scn, return log_msg_ret("id", -EINVAL); } - ret = scene_txt_str(scn, find_name, obj_id, 0, text, NULL); + ret = scene_txt_str(scn, obj_name, obj_id, 0, text, NULL); if (ret < 0) return log_msg_ret("add", ret); @@ -79,13 +80,15 @@ int add_txt_str(struct build_info *info, ofnode node, struct scene *scn, * @info: Build information * @node: Node describing scene * @scn: Scene to add to - * @find_name: Name to look for (e.g. "title"). This will find a string-list + * @find_name: Property to look for (e.g. "title"). This will find a string-list * property called "title" if it exists, else will look up the string in the * "title-id" string list. + * @obj_name: Name for the object (e.g. "cpu-speed.title") * Return: ID of added string, or -ve on error */ int add_txt_str_list(struct build_info *info, ofnode node, struct scene *scn, - const char *find_name, int index, uint obj_id) + const char *find_name, const char *obj_name, int index, + uint obj_id) { const char *text; int ret; @@ -107,7 +110,7 @@ int add_txt_str_list(struct build_info *info, ofnode node, struct scene *scn, return log_msg_ret("id", -EINVAL); } - ret = scene_txt_str(scn, find_name, obj_id, 0, text, NULL); + ret = scene_txt_str(scn, obj_name, obj_id, 0, text, NULL); if (ret < 0) return log_msg_ret("add", ret); @@ -220,6 +223,7 @@ static int menu_build(struct build_info *info, ofnode node, struct scene *scn, int ret, size, i, num_items; uint title_id, menu_id; const char *name; + char buf[80]; name = ofnode_get_name(node); @@ -229,7 +233,8 @@ static int menu_build(struct build_info *info, ofnode node, struct scene *scn, menu_id = ret; /* Set the title */ - ret = add_txt_str(info, node, scn, "title", 0); + snprintf(buf, sizeof(buf), "%s.title", name); + ret = add_txt_str(info, node, scn, "title", buf, 0); if (ret < 0) return log_msg_ret("tit", ret); title_id = ret; @@ -254,22 +259,28 @@ static int menu_build(struct build_info *info, ofnode node, struct scene *scn, struct scene_menitem *item; uint label, key, desc; - ret = add_txt_str_list(info, node, scn, "item-label", i, 0); + snprintf(buf, sizeof(buf), "%s.item-%x.label", name, i); + ret = add_txt_str_list(info, node, scn, "item-label", buf, i, + 0); if (ret < 0 && ret != -ENOENT) return log_msg_ret("lab", ret); label = max(0, ret); - ret = add_txt_str_list(info, node, scn, "key-label", i, 0); + snprintf(buf, sizeof(buf), "%s.item-%x.key", name, i); + ret = add_txt_str_list(info, node, scn, "key-label", buf, i, 0); if (ret < 0 && ret != -ENOENT) return log_msg_ret("key", ret); key = max(0, ret); - ret = add_txt_str_list(info, node, scn, "desc-label", i, 0); + snprintf(buf, sizeof(buf), "%s.item-%x.desc", name, i); + ret = add_txt_str_list(info, node, scn, "desc-label", buf, i, + 0); if (ret < 0 && ret != -ENOENT) return log_msg_ret("lab", ret); desc = max(0, ret); - ret = scene_menuitem(scn, menu_id, simple_xtoa(i), + snprintf(buf, sizeof(buf), "%s.item-%x", name, i); + ret = scene_menuitem(scn, menu_id, buf, fdt32_to_cpu(item_ids[i]), key, label, desc, 0, 0, &item); if (ret < 0) @@ -316,6 +327,7 @@ static int textline_build(struct build_info *info, ofnode node, struct scene_obj_textline *ted; uint edit_id; const char *name; + char buf[80]; u32 max_chars; int ret; @@ -330,8 +342,9 @@ static int textline_build(struct build_info *info, ofnode node, if (ret < 0) return log_msg_ret("ted", ret); - /* Set the title */ - ret = add_txt_str(info, node, scn, "title", 0); + /* Set the label */ + snprintf(buf, sizeof(buf), "%s.label", name); + ret = add_txt_str(info, node, scn, "title", buf, 0); if (ret < 0) return log_msg_ret("tit", ret); ted->label_id = ret; @@ -342,7 +355,8 @@ static int textline_build(struct build_info *info, ofnode node, if (ret) return log_msg_ret("id", -ENOENT); - ret = scene_txt_str(scn, "edit", edit_id, 0, abuf_data(&ted->buf), + snprintf(buf, sizeof(buf), "%s.edit", name); + ret = scene_txt_str(scn, buf, edit_id, 0, abuf_data(&ted->buf), NULL); if (ret < 0) return log_msg_ret("add", ret); @@ -414,6 +428,7 @@ static int scene_build(struct build_info *info, ofnode scn_node, const char *name; struct scene *scn; uint id, title_id; + char buf[80]; ofnode node; int ret; @@ -428,15 +443,18 @@ static int scene_build(struct build_info *info, ofnode scn_node, if (ret < 0) return log_msg_ret("scn", ret); - ret = add_txt_str(info, scn_node, scn, "title", 0); + snprintf(buf, sizeof(buf), "%s.title", name); + ret = add_txt_str(info, scn_node, scn, "title", buf, 0); if (ret < 0) return log_msg_ret("tit", ret); title_id = ret; scn->title_id = title_id; - ret = add_txt_str(info, scn_node, scn, "prompt", 0); + snprintf(buf, sizeof(buf), "%s.prompt", name); + ret = add_txt_str(info, scn_node, scn, "prompt", buf, 0); if (ret < 0) return log_msg_ret("pr", ret); + scn->prompt_id = ret; ofnode_for_each_subnode(node, scn_node) { info->err_node = node; diff --git a/test/boot/expo.c b/test/boot/expo.c index 66fd5a2873f..f98a1e46854 100644 --- a/test/boot/expo.c +++ b/test/boot/expo.c @@ -888,7 +888,7 @@ static int expo_test_build(struct unit_test_state *uts) ut_assertnonnull(txt); obj = &txt->obj; ut_asserteq_ptr(scn, obj->scene); - ut_asserteq_str("title", obj->name); + ut_asserteq_str("main.title", obj->name); ut_asserteq(scn->title_id, obj->id); ut_asserteq(SCENEOBJT_TEXT, obj->type); ut_asserteq(0, obj->flags); @@ -913,7 +913,7 @@ static int expo_test_build(struct unit_test_state *uts) /* check the items */ item = list_first_entry(&menu->item_head, struct scene_menitem, sibling); - ut_asserteq_str("00", item->name); + ut_asserteq_str("cpu-speed.item-0", item->name); ut_asserteq(ID_CPU_SPEED_1, item->id); ut_asserteq(0, item->key_id); ut_asserteq(0, item->desc_id); From patchwork Sun Dec 7 20:16:09 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 824 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=1765138663; bh=/awkBx2OHYB+TyAsBzPAeuSnCr3f94t07hbI3Dck1qU=; 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=ZSc+i+T0MmUMAhDxNMYf2A9bcYLcU9sFrqxEVkn/6CRMTF8g54h4OKp2Wrzm6nX61 QMfa3yb0RgBocQTBFVHMyGLxO/Q4qbGWvPUnepHXXhdsd02v2Qup+gh5Ve9OBdQjV2 O8WVUOyiTwMIt3KAc4LpDl3TcNZgM4eBnlXM0iYfRMFr+GuKJ1ctsNuYLvvmux1OLN DrmT7YvPTmrR51mTJIAl+drJf8H2il4WVIrcWqrlU8vcuTfnI7xXOrHxNui97yRwJr DDpdsLI4NUt52cBZYeGLRzDr4bG2u4EVDEg38xDt2Qi2juXTRlEzMuuJyvtI4ncSQs y9Xsr4lStla5A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 967DB68950 for ; Sun, 7 Dec 2025 13:17: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 9iQ5d8fr7ZQv for ; Sun, 7 Dec 2025 13:17:43 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138663; bh=/awkBx2OHYB+TyAsBzPAeuSnCr3f94t07hbI3Dck1qU=; 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=ZSc+i+T0MmUMAhDxNMYf2A9bcYLcU9sFrqxEVkn/6CRMTF8g54h4OKp2Wrzm6nX61 QMfa3yb0RgBocQTBFVHMyGLxO/Q4qbGWvPUnepHXXhdsd02v2Qup+gh5Ve9OBdQjV2 O8WVUOyiTwMIt3KAc4LpDl3TcNZgM4eBnlXM0iYfRMFr+GuKJ1ctsNuYLvvmux1OLN DrmT7YvPTmrR51mTJIAl+drJf8H2il4WVIrcWqrlU8vcuTfnI7xXOrHxNui97yRwJr DDpdsLI4NUt52cBZYeGLRzDr4bG2u4EVDEg38xDt2Qi2juXTRlEzMuuJyvtI4ncSQs y9Xsr4lStla5A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8312068997 for ; Sun, 7 Dec 2025 13:17:43 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138661; bh=WUk53fqFf3JCQvruoKayi0DGFFJa/5cwCUVzxgFOdhs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h78Ch/maYusJFhBO790tGI9NkQkDcii8cC2ZjxRiGu6icKudKq6Ys0Tv9+gq6OW1a GOJF55BWHblrDkrIOjbhDL3TgGvAi0kYmxNX7KxF5lOozsl2SQOa2VOBI1OyEXAw+d bJHOfn/z9xywHIaLelOrIRfvO1LZqgg+g1EmIrION8rAVXgtmjgnO3XgqeYSryMJTF bGS02lJIFwfRA+KCbWsn0K+esnd/wILT+s8mq+Sl5k1Vd+2ZnFnmPKumvo3A5BKV9u TmIYMdrF2cE2qn0xoYXqE7RHEzFs+0nRBD0Jzr6uWio9erb+gI9yVAt4HSAflT6mef gVthpAex0PiaQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3EC8D68997; Sun, 7 Dec 2025 13:17: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 wmU6feztPGjm; Sun, 7 Dec 2025 13:17:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138656; bh=kGBvqGwS9yWqeMgGHMoSntThNkC0nZ+yVXc9CAvhjdw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EcWunrLvASyNkr9/PNxdhMpjNd4dgiHfta6LWiYb7aKhFR0LwxygEXawhlqvSLKwU yTqKGxaKBYx+66g8L2ZVYiaB9NubaEDQOQ2YT+pO1ZLsjRVo5TfEfmlWGc/u6gam4a e7d8rzt1Y/sypUS1qKdUCg6LPOWbeguGXi1g9N1dGrj3R7d49ZGV2iA6S8d1j5kANJ YhHzAt/AXfafb+f0cVA8g6k3UU2h5BgmrsieFJN3JqIuit0v7AzPHMXR7dItE7TDe9 y131tdOhmtG7NkZkELA5dHubA5NaIuFS97ua1H/Mwhx9WzEFoEDlzMjrYh6PbCgFdM OlIXRtForpe8w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3239868950; Sun, 7 Dec 2025 13:17:36 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:09 -0700 Message-ID: <20251207201628.2882382-13-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: DBZTT35BXGRIPVXA4UFEUKLDAW6R5YD4 X-Message-ID-Hash: DBZTT35BXGRIPVXA4UFEUKLDAW6R5YD4 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: Heinrich Schuchardt , Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 12/22] expo: Use better names for objects in bootflow_menu_add() 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 Use descriptive names like "item0.label", "item0.desc", "item0.pass" instead of generic "label", "desc", "passphrase". This makes debugging easier when multiple bootflow items exist. Co-developed-by: Claude Signed-off-by: Simon Glass --- boot/bootflow_menu.c | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/boot/bootflow_menu.c b/boot/bootflow_menu.c index 17fab284ef7..84ae0223ba0 100644 --- a/boot/bootflow_menu.c +++ b/boot/bootflow_menu.c @@ -238,6 +238,7 @@ int bootflow_menu_add(struct expo *exp, struct bootflow *bflow, int seq, uint preview_id; uint scene_id; bool add_gap; + char name[40]; int ret; ret = expo_first_scene_id(exp); @@ -259,23 +260,30 @@ int bootflow_menu_add(struct expo *exp, struct bootflow *bflow, int seq, priv->last_bootdev = bflow->dev; ret = expo_str(exp, "prompt", STR_POINTER, ">"); - ret |= scene_txt_str(scn, "label", ITEM_LABEL + seq, + snprintf(name, sizeof(name), "item%d.label", seq); + ret |= scene_txt_str(scn, name, ITEM_LABEL + seq, STR_LABEL + seq, "", NULL); - ret |= scene_txt_str(scn, "desc", ITEM_DESC + seq, STR_DESC + seq, + snprintf(name, sizeof(name), "item%d.desc", seq); + ret |= scene_txt_str(scn, name, ITEM_DESC + seq, STR_DESC + seq, "", NULL); - ret |= scene_txt_str(scn, "key", ITEM_KEY + seq, STR_KEY + seq, key, + snprintf(name, sizeof(name), "item%d.key", seq); + ret |= scene_txt_str(scn, name, ITEM_KEY + seq, STR_KEY + seq, key, NULL); - ret |= scene_box(scn, "item-box", ITEM_BOX + seq, 1, false, NULL); - ret |= scene_txt_str(scn, "version", ITEM_VERSION_NAME + seq, + snprintf(name, sizeof(name), "item%d.box", seq); + ret |= scene_box(scn, name, ITEM_BOX + seq, 1, false, NULL); + snprintf(name, sizeof(name), "item%d.version", seq); + ret |= scene_txt_str(scn, name, ITEM_VERSION_NAME + seq, STR_VERSION_NAME + seq, "", NULL); preview_id = 0; if (bflow->logo) { preview_id = ITEM_PREVIEW + seq; - ret |= scene_img(scn, "preview", preview_id, + snprintf(name, sizeof(name), "item%d.preview", seq); + ret |= scene_img(scn, name, preview_id, bflow->logo, NULL); } - ret |= scene_menuitem(scn, OBJ_MENU, "item", ITEM + seq, + snprintf(name, sizeof(name), "item%d", seq); + ret |= scene_menuitem(scn, OBJ_MENU, name, ITEM + seq, ITEM_KEY + seq, ITEM_LABEL + seq, ITEM_DESC + seq, preview_id, add_gap ? SCENEMIF_GAP_BEFORE : 0, @@ -287,24 +295,27 @@ int bootflow_menu_add(struct expo *exp, struct bootflow *bflow, int seq, * Create passphrase textline with label and edit field (12 chars). Show * characters as asterisks */ - ret = scene_textline(scn, "passphrase", ITEM_PASS + seq, 12, &tline); + snprintf(name, sizeof(name), "item%d.pass", seq); + ret = scene_textline(scn, name, ITEM_PASS + seq, 12, &tline); if (ret < 0) return log_msg_ret("itp", -EINVAL); - tline->obj.flags |= SCENEOF_PASSWORD; - ret = scene_txt_str(scn, "pass_label", ITEM_PASS_LABEL + seq, 0, + snprintf(name, sizeof(name), "item%d.pass.label", seq); + ret = scene_txt_str(scn, name, ITEM_PASS_LABEL + seq, 0, "Passphrase:", NULL); if (ret < 0) return log_msg_ret("itl", -EINVAL); tline->label_id = ret; - ret = scene_txt_str(scn, "pass_edit", ITEM_PASS_EDIT + seq, 0, + snprintf(name, sizeof(name), "item%d.pass.edit", seq); + ret = scene_txt_str(scn, name, ITEM_PASS_EDIT + seq, 0, "", NULL); if (ret < 0) return log_msg_ret("ite", -EINVAL); tline->edit_id = ret; /* Create message text (hidden by default) for success/error feedback */ - ret = scene_txt_str(scn, "pass_msg", ITEM_PASS_MSG + seq, + snprintf(name, sizeof(name), "item%d.pass_msg", seq); + ret = scene_txt_str(scn, name, ITEM_PASS_MSG + seq, STR_PASS_MSG + seq, "", NULL); if (ret < 0) return log_msg_ret("ipm", -EINVAL); From patchwork Sun Dec 7 20:16:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 825 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=1765138666; bh=BcbSbTljHIf9g7YaO3tEqCPHKR2A98MY6Jl2rdlF90E=; 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=v9kik25fLVT6Iu6PH7Sw0VzMMb2U2mszF++zmg0fVVjXGglGky2KMMc+/EJlb2WX+ G6aIgTHilKBwYgplXq2qeSB95Phla4+0WIqEnCJuIDPEb/kJ7Dt/SjGf10BRBgVP1m aDgupBCqKlAENIkK9hIwe+xYr2Ya9S26Aw3sI0loShGxUsgNGkrcKOeapwT3TtEbOn PVo55FAWMqB9R8abzeFRUsO25Bc6gW5mA9ADphMtG12MA7HGZ2uhIb6z+5R9Wmt2a2 8i5Fb3JyYmGQkZOB/q4tnmRCtBbMxSbuEIm6j16msObTBzmp7JGev9ON5G/A62D+OH 29glZ/lkjkq+A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 035E8689BE for ; Sun, 7 Dec 2025 13:17: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 10024) with ESMTP id 5FvnGgZHZIrP for ; Sun, 7 Dec 2025 13:17:45 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138664; bh=BcbSbTljHIf9g7YaO3tEqCPHKR2A98MY6Jl2rdlF90E=; 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=fqAS94xSAOq4o+i/2dNk5pcrzuvXCTCCqXMo54g2kZKCk56dabrxpGdkIgCFMbw+j K5wNciMxFOkjXMY/mp2wNgJefEZx1/PZCcaRp4gi88MLvLA9mulUT0BNqkntkvAvKY fN38Y5g80FVpRrMu4JbUdXnLew5KFo2/PqeT/P8bh9ZHgyro29pEmROazExUJEI+qY oN92PVc6EJ18JCk0C6d+TRYcK/R/ZWy/wdqyqashDWv0NMN/LWf3jHDW7fMDWWt2Kq 3lehMD6RzfihWGzj/CuuI7BIGDoYIseCcUZRk0nd8lVJqtcD2iG/K9YyZi4pOZUXNA 6bvKhJnclqNLw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 00C2668997 for ; Sun, 7 Dec 2025 13:17:44 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138661; bh=0alUt2vli6TUugTyhbiujl7qGmiuWBMbskTpqY7lSAY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZI2TZoJ+MTXFQFM8aDm2zAKR1qN4ndswMck/mzF++Wgray7VifHf0IFz3ILOV/FfO 2I1udTUAjoZ+vM1TdRqvsHRfrsx24HqRxHv6n/yFJ6ChTCxI4l/VpopVIlvzFJIkef 8yjbsXDCcXKKYhXmY1YPWqd9lnmw07br93lUVGSggUTb6mxjWs7HePugGRMp9Uo4Sb hyIp8+rO9APXkq72Vtfnw4eubyQ2Tpl332YvI76O+D7kZmYQImMGhjc1zF2yVJjqaE UjOrO0htsrESvDtixvEoQTBeitrUN8LbetiBz77tG2Kbkw52nI+ODpSFJy55TNJ+c2 cI2cMRG8fP9/w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8687668950; Sun, 7 Dec 2025 13:17: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 CMonrM_o3RGi; Sun, 7 Dec 2025 13:17:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138661; bh=rU1dahAlU1STx9b0ja9OHc6hl3eIgJxNUcmN7DOpshM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X9R8wn568mBwWMKBRQ6rG7r+zNcckaQ1jk/UNLOUPhLBhCteGhDhOZ2SGJ3oScIQa ax+EBkw6NoEa2niiqIwOlGQuABLAM3BQFlxQwN9yYj++knvso5IdhmizEM1k4fsRYV BWxWZ5S3rZDFQ+7cjRA/9BJafbs2vOXsBteqKkCa27HQA0UFxdh13jSMxj4i0Aw560 BxxbAfWCj0yRu3cURFdtjXXzdlQY2P/JQviBuAyGa8nd0tE2hYFpY1VHPSdq6O5kKL 6O1p0sIbbAC1mKqNMS86uMuyGHPHX9poRhAz6QjG+0939ACPYG6bqyilWDN7SV/L0p 6CjXoldT7Qbew== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E7D7268902; Sun, 7 Dec 2025 13:17:40 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:10 -0700 Message-ID: <20251207201628.2882382-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: RWRHWELTWX2STWZYDTQODICATGQL4AZJ X-Message-ID-Hash: RWRHWELTWX2STWZYDTQODICATGQL4AZJ 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: Heinrich Schuchardt , Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 13/22] expo: Fix textline edit text not updating in bootflow menu 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 The edit text object for the passphrase textline is created with an empty string literal "", rather than pointing to the textline's buffer. This means that when the user types, tline->buf is updated but the text object still displays the original empty string. Fix this by creating the edit text object with abuf_data(&tline->buf) so it points to the textline's buffer. This matches how expo_build.c creates textlines for cedit. Co-developed-by: Claude Signed-off-by: Simon Glass --- boot/bootflow_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/boot/bootflow_menu.c b/boot/bootflow_menu.c index 84ae0223ba0..ee3150afef4 100644 --- a/boot/bootflow_menu.c +++ b/boot/bootflow_menu.c @@ -308,7 +308,7 @@ int bootflow_menu_add(struct expo *exp, struct bootflow *bflow, int seq, snprintf(name, sizeof(name), "item%d.pass.edit", seq); ret = scene_txt_str(scn, name, ITEM_PASS_EDIT + seq, 0, - "", NULL); + abuf_data(&tline->buf), NULL); if (ret < 0) return log_msg_ret("ite", -EINVAL); tline->edit_id = ret; From patchwork Sun Dec 7 20:16:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 826 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=1765138666; bh=duSkUvoTSMiFp2mHlGYk9N7wBcA89IGr6vT3v8lESDQ=; 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=OBrEBBzMQK18XrZ61Ve5b4/p8JinI2fYLVwP7AYAj1S0j+fhDQ793Ptg5AiDFIow8 +GJM/m04ixi4vyKAraf8zmTc04vNPkqGJNORP8Dmy1uHQqRmN1dSaXboVnufKWF3vC u94gw7CrJ2nLiiLnV8QkUob3SHGgo7JByBcbJfIvaf0Do0Gd16FM+w1DacuQwRdQ/o HYExGNxnGZud5Eprk5PdHbSMZx/xVcUq6eq6lO/8qGUKz7Dk3f4RpYu1GXJ4BmF7fg leXjiSuqMGNneUv9yiHYmpv0z6a++5//s1FoiMUPc9uUb53TdV8aqjrQtiJIvb+mGz Rrv5rtxfw7XIg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4A4D568950 for ; Sun, 7 Dec 2025 13:17: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 10024) with ESMTP id 6LWbLKV45Oqk for ; Sun, 7 Dec 2025 13:17:46 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138664; bh=duSkUvoTSMiFp2mHlGYk9N7wBcA89IGr6vT3v8lESDQ=; 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=LEaOKVF62tSXle7ANJ55L3AqKCKDTf1Tgort9fiTrQ8DdUj1zQ254iUs4Rj1ML1zJ 15gN0QrRgsWNuEz31jfY91FhN/m4/gHuUmn71ozKSRR0qMrkgp3czVAQu0y8l8/4TX 3p0WKcMt3IKLR9xrqMxgwThR7MU/Hnw0JrRXPm84RQB9ETRecar40X/5r+/VgFCxdP utD1JQ71ru8vkbl8D0M0LANHTGXbCvuOR4TF6do/5mm351c+sN4sBR9Aadv2cmXNtv RU1A5HOT4Hd+oufNCU0+RkCQrsyF9PDVGg2mZyjBsg7UaB22+L6wdKX6g9SP+I1cT+ l9gB7ib6aeZQw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 74E79689B5 for ; Sun, 7 Dec 2025 13:17:44 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138662; bh=CP8HeFGp2x4SSKI4WwBzFATNfT/w56m20KAFJdVFi8w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZO4wlxw6E7lCzFRMhN7a8pNOkRCYyVuKovyCzMcXXzh/juqVdukq4V7J5QBaVX5Ul E/LkearvQvylcEeccU2DGCtfO/IKtF0QJHHNNpw2XqZBAtSJrYHxNEsXEF7k4mAcYf kYw4QSMkyabFmI6tUdAu+eSh9gj6EiKEoCcaUb83T0ZXokw4Ec/4KAzQYaVlFd58Lh lkCL4X24vraxod8HZTe983PsNXcX6ht9sYcSooGgVU6IFGDoB/EWetz55a6MhdLPVS 4CDpRjYU2nJ/Pm0wcIpfadkkx/lvQslME070nkXvHqjt1GOrHFX5xyn6fKYYzAr++f nEi0faDAs6t4A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 749DE689A7; Sun, 7 Dec 2025 13:17:42 -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 qBqaPI7e0ujA; Sun, 7 Dec 2025 13:17:42 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138662; bh=jrblmbrrqGHVqbCZQjYHYUXLFaOxuIHEYZAIOfQWowE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ChpKC6nmvuX7iSuNW0yBRgdMZa0Z3h+XFrGDLDLAXDSClfj0JNu6YAkT57D1oIgxr jSDF2jvqd6pLqb+VNIvx9S54XHa2wGPJEl7vKSIFXPuF0oOoIueVyQwpIhGzXrKn+m crfydsVpEQBB+vIAUgEKafmCf8O/STktu54IFQzqUC77uR5yMM80IxqboKsWdKppjj dEZ3XOUGqaET0CJ15gBCLd23uHE2izc0hB18IQHCvSO7qZ0Kh7pDp3ozEXl1ua9sxj w29k3a+9GCTMXaUCR6Fw0GM6jZeLG+w10iXAjJJPqi6JZZuSswsXcjP6Vvk9T4V7xh STEgqOC1hGwVw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id CF80E68902; Sun, 7 Dec 2025 13:17:41 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:11 -0700 Message-ID: <20251207201628.2882382-15-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: T54OKOQMFWONCV6M7Y77FCHIGINJB3AR X-Message-ID-Hash: T54OKOQMFWONCV6M7Y77FCHIGINJB3AR 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: Heinrich Schuchardt , Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 14/22] test: cedit: Use UTF_NO_SILENT 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 Use the UTF_NO_SILENT flag for cedit_render() instead of manually calling ut_unsilence_console()/ut_silence_console(). This is makes it more obvious that the test needs this handling. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- test/boot/cedit.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/boot/cedit.c b/test/boot/cedit.c index 7af3dfa2338..c4d402343fa 100644 --- a/test/boot/cedit.c +++ b/test/boot/cedit.c @@ -352,11 +352,11 @@ static int cedit_render(struct unit_test_state *uts) * vidconsole state, outputs the character and then saves the state * again. If the character is never output, then the state won't be * updated and the textline will be inconsistent. + * + * This is why this test enables UTF_NO_SILENT */ - ut_unsilence_console(uts); for (i = 'a'; i < 'd'; i++) ut_assertok(scene_send_key(scn, i, &evt)); - ut_silence_console(uts); ut_assertok(cedit_arange(exp, vid_priv, scn->id)); ut_assertok(expo_render(exp)); ut_asserteq(5076, video_compress_fb(uts, dev, false)); @@ -366,7 +366,7 @@ static int cedit_render(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(cedit_render, UTF_DM | UTF_SCAN_FDT); +BOOTSTD_TEST(cedit_render, UTF_DM | UTF_SCAN_FDT | UTF_NO_SILENT); /* Check the cedit displays textlines correctly */ static int cedit_render_textline(struct unit_test_state *uts) From patchwork Sun Dec 7 20:16:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 827 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=1765138670; bh=Kz0ri0oBvzWFt2ov7YN/jaadEm7s98jyPkulxjflrpc=; 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=ENZFrnW212tiv7iRFYHDQWoTLCs2iJBq3tmv30b11izgkEmScxypD9WPKNyWCOsns FWk+gv72hgk0QFMlZ1bVbyAVZa6+Qv3dCGARNqhlCFWzqa+m2QG61Np/VVY2eTMslg byfLQyDzu8XPvAnqcMyjjLn91XvKFxqKJHgFFhxrj+uA8UlO9YGAF/N1KIn83LYPnp AI2AsXTHGTyrXDcTcemVy+B6sRXaTSexDdGenxy/alCaRNmxIMWtbyWjV1U2JXqj5D 8HW7nnHV1HAyZelxtVviDmmevwarjodSN2RjJoRgRvf90yQ8ie+Q0h++DmzOflE6d8 zgxYD1fzH6+MA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4FC1E689A7 for ; Sun, 7 Dec 2025 13:17:50 -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 2eCy-VBOdaWq for ; Sun, 7 Dec 2025 13:17:50 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138670; bh=Kz0ri0oBvzWFt2ov7YN/jaadEm7s98jyPkulxjflrpc=; 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=ENZFrnW212tiv7iRFYHDQWoTLCs2iJBq3tmv30b11izgkEmScxypD9WPKNyWCOsns FWk+gv72hgk0QFMlZ1bVbyAVZa6+Qv3dCGARNqhlCFWzqa+m2QG61Np/VVY2eTMslg byfLQyDzu8XPvAnqcMyjjLn91XvKFxqKJHgFFhxrj+uA8UlO9YGAF/N1KIn83LYPnp AI2AsXTHGTyrXDcTcemVy+B6sRXaTSexDdGenxy/alCaRNmxIMWtbyWjV1U2JXqj5D 8HW7nnHV1HAyZelxtVviDmmevwarjodSN2RjJoRgRvf90yQ8ie+Q0h++DmzOflE6d8 zgxYD1fzH6+MA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3EF3B689A8 for ; Sun, 7 Dec 2025 13:17:50 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138668; bh=FZl8f+orFHwkCCKoEPd3Fwut4aLf54xcwh6y9yVT5Zo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sYZpiPI+ASVtSmgXYkPXTRQqnmpiwBPSUnbnxj/K2klkTH2Rwo8X7m2xjG3Kinj62 sLlEo91GZSZsFwyqjO81xWNq/xxYAN06Fy7SM9Bg1BeN4uEQ7nYyqfDmi6fbevEZeg BQ7odMDg8Lud37WvOT47iHvJTOh8WDNGPuWN2xV4QmUIlM7op3BJdmJqZgY/MrqAXh WKdo/mIQ+cTdqHUGcP6oY131Te0wLJe0xePvA1SJvpZtVx9fYcwk1lL0kW5cnBho5X J/HfAovo1fDZGlsXXheeyRLu6qd8KxBFTOFhKSK4eycvtre2LlKx8Ih25FbMraTWgF RgM6OkYKJG6FA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A025C68950; Sun, 7 Dec 2025 13:17:48 -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 7X-5nwj1ZC91; Sun, 7 Dec 2025 13:17:48 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138663; bh=yrOp2fZZec/HTh7EjfL8ZRIVujjaQ0tyVSTqBjZ22e8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cLASMeCsPVL4G8kLzD3gKUnOa7F6wHzXQsi8qIoX/EdXibxzW1OLWYFwCK+twYriG 8y6jF/TDoOOJGewimp3j0X8Rm0Kam6kqds1BCu/JF3tSZXWaB4OhJa1hvVdvEFx9Ap a3CKg+glnZGxEAwi//HQWOb79K1mk84I0RwPIqztw4zDj2EiPka6WKdzITeFeFfQQP GDgJdwhBYbc6MlJKcuY07PKty85mH2dz2Hx6ofHasltzHxTMDWuQgcXkwxpqB8mvX2 D6EAVvoMhf3unLh96K4oafCT26eiZMnSl3/P4lsNyVIJWDT3MMr1UxSSfpUWOP+oNU i7KjocovF8AmA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id BD9C2689A8; Sun, 7 Dec 2025 13:17:42 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:12 -0700 Message-ID: <20251207201628.2882382-16-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: V6S7XCAHGGYRW4IJISQHYU2Q3XRCXEJ6 X-Message-ID-Hash: V6S7XCAHGGYRW4IJISQHYU2Q3XRCXEJ6 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: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 15/22] test: cedit: Allow cedit_render_lineedit() to run alone 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 This test works as part of the bootstd suite but currently fails if run by itself. The problem is that the console is silenced, so use the new UTF_NO_SILENT flag to fix this. Signed-off-by: Simon Glass --- test/boot/cedit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/boot/cedit.c b/test/boot/cedit.c index c4d402343fa..b8c46f2d50c 100644 --- a/test/boot/cedit.c +++ b/test/boot/cedit.c @@ -446,7 +446,7 @@ static int cedit_render_textline(struct unit_test_state *uts) return 0; } -BOOTSTD_TEST(cedit_render_textline, UTF_DM | UTF_SCAN_FDT); +BOOTSTD_TEST(cedit_render_textline, UTF_DM | UTF_SCAN_FDT | UTF_NO_SILENT); /* Check the cedit is arranged correctly */ static int cedit_position(struct unit_test_state *uts) From patchwork Sun Dec 7 20:16:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 828 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=1765138674; bh=bgEroj+aCScHTZivGfjIOv3K5cK1f48IQ6mI9NbzcQs=; 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=cmdpKyAqnaWm/0XYNZ4osfgmbdWwDkBZhKhQoi18oEt3cDg1dPRJOI6/8phYimqtO rm984epJP/lUKyWXNNTSD62Gqv01SCpiGQoOnRH+qaubPMAa0KiBP6yfDgbFe5134n jC6QzL1fdcaCTKwZiOBvynbWb2MnoMYw8L8JqcAmrhxSnHdWSK1af9qMrBHovhIdeA CXHwImEoMdfUgQbD/aWX75Dqo2en/2ItPGcMP3Nd4ZhOxHf6aqT5iPzZWft4ICILZ2 z1jB4G74ohJiCYV2QdjngiRX2bJJ9xUkHZr3f9IHfuBNnZQpDWd86IzaX40M0vd585 OSVDPVNyOPRrQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B1252689AD for ; Sun, 7 Dec 2025 13:17:54 -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 MAoZSrXaqwsD for ; Sun, 7 Dec 2025 13:17:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138674; bh=bgEroj+aCScHTZivGfjIOv3K5cK1f48IQ6mI9NbzcQs=; 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=cmdpKyAqnaWm/0XYNZ4osfgmbdWwDkBZhKhQoi18oEt3cDg1dPRJOI6/8phYimqtO rm984epJP/lUKyWXNNTSD62Gqv01SCpiGQoOnRH+qaubPMAa0KiBP6yfDgbFe5134n jC6QzL1fdcaCTKwZiOBvynbWb2MnoMYw8L8JqcAmrhxSnHdWSK1af9qMrBHovhIdeA CXHwImEoMdfUgQbD/aWX75Dqo2en/2ItPGcMP3Nd4ZhOxHf6aqT5iPzZWft4ICILZ2 z1jB4G74ohJiCYV2QdjngiRX2bJJ9xUkHZr3f9IHfuBNnZQpDWd86IzaX40M0vd585 OSVDPVNyOPRrQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A0D63688F6 for ; Sun, 7 Dec 2025 13:17:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138672; bh=bQQLIicLuG/Rn1YWMMUdA1dIV0oL9CoROR6ecW3BfbE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sAp1UiUdKHbOJTPHtf1T+W855TFwCgtIBdnlEYOsUWk3pRutheAsbvj6hZoxK3eJi aqpRFLvlaVicZV37nvtb/87g2BirOptc/N2Kt0PjArgFLocY44lJXv8oocOU/9frJJ 1liSAkmA6F7MolftOEtk4J+VsP2PKdwUilPO3xfXf68+aMsaUolp2zfPugg9VP+P3P +1zqEg0A4W0ZitvHQ7J6ts45d0LXwl40Iez7wrjeMePR03qikNwI0Hv5ypNa+mJx8s 32bbHPu5hXIaka4trky2B4c+r6/n5zBKh8exzeCqfk/z6kYolk41QYsuu0sOnnDuyu A2cTTQSayGrjg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A2ABC689A7; Sun, 7 Dec 2025 13:17:52 -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 XJVoSNyzVk8d; Sun, 7 Dec 2025 13:17:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138667; bh=9YW5+1tGvrwaA/zseezveM48mGs7OFeWUvsHok33BG4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vZydV2kbKRl+ZnMsvu3+x5lgqx4ZC58LG09QQJ1Ds5p5gQqaXY/2Aq/u337GneEPq p63taBe7nGWpAk3PYXRaxu6ubcVqgqrKhFdQUDmIddFIXYibY06xFcpy0tFAe+zgUD BZLy6TY1m4E1Cgz1gRt973GQIIqnooqxjxuNPw3XFKztvWSu2DU9w2L/SGBWgqljEy Y+fZsGb9IF7OB318s+RHguG4171r1YXsuEfLadttTZuyQACAvdWcnOiTi+JF/1rfwl EgLzK3l0GO+/xrhMrIExW3Fu1vUDP5pcvB9NR69OvdUa1gFV4bQWL00jmRreue367I AYocrHFkQ+66Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 2DD0D5F6BF; Sun, 7 Dec 2025 13:17:47 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:13 -0700 Message-ID: <20251207201628.2882382-17-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: RTSZJ2MC43NMG3OAL3VN3VJXWEGOWDL6 X-Message-ID-Hash: RTSZJ2MC43NMG3OAL3VN3VJXWEGOWDL6 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: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 16/22] expo: Refactor scene_send_key() to use a current object 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 The highlight_id needs to be considered for non-popup expos as well. As a first step, use the variable 'cur' for the current object, i.e. the one that is highlighted. Signed-off-by: Simon Glass --- boot/scene.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/boot/scene.c b/boot/scene.c index 1392d063c49..1bc4c9c25ac 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -1082,30 +1082,28 @@ static void send_key_obj(struct scene *scn, struct scene_obj *obj, int key, int scene_send_key(struct scene *scn, int key, struct expo_action *event) { - struct scene_obj *obj; + struct scene_obj *cur, *obj; int ret; event->type = EXPOACT_NONE; /* - * In 'popup' mode, arrow keys move betwen objects, unless a menu is - * opened + * In 'popup' mode, arrow keys move betwen objects, unless a menu or + * textline is opened */ + cur = NULL; + if (scn->highlight_id) + cur = scene_obj_find(scn, scn->highlight_id, SCENEOBJT_NONE); if (scn->expo->popup) { - obj = NULL; - if (scn->highlight_id) { - obj = scene_obj_find(scn, scn->highlight_id, - SCENEOBJT_NONE); - } - if (!obj) + if (!cur) return 0; - if (!(obj->flags & SCENEOF_OPEN)) { - send_key_obj(scn, obj, key, event); + if (!(cur->flags & SCENEOF_OPEN)) { + send_key_obj(scn, cur, key, event); return 0; } - switch (obj->type) { + switch (cur->type) { case SCENEOBJT_NONE: case SCENEOBJT_IMAGE: case SCENEOBJT_TEXT: @@ -1114,7 +1112,7 @@ int scene_send_key(struct scene *scn, int key, struct expo_action *event) case SCENEOBJT_MENU: { struct scene_obj_menu *menu; - menu = (struct scene_obj_menu *)obj, + menu = (struct scene_obj_menu *)cur, ret = scene_menu_send_key(scn, menu, key, event); if (ret) return log_msg_ret("key", ret); @@ -1123,7 +1121,7 @@ int scene_send_key(struct scene *scn, int key, struct expo_action *event) case SCENEOBJT_TEXTLINE: { struct scene_obj_textline *tline; - tline = (struct scene_obj_textline *)obj, + tline = (struct scene_obj_textline *)cur, ret = scene_textline_send_key(scn, tline, key, event); if (ret) return log_msg_ret("key", ret); From patchwork Sun Dec 7 20:16:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 829 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=1765138678; bh=tOWH1+Icg+/eVMTEV5TeYgAK7Aw/IHUMAVH3CYcYCJ8=; 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=MSEAYGOlA/kMSYK0Lnn3ZScVMN4uxt701jRD2uhP2vw/MeAgI4NbCn2mpa5E2NcZa E1wLd7DBfMk9IyHo5zO4QGC4LOnGEA06fImzJaIaJHHJ7RR/qO4fgLkAoGVgKCswqK WrRXjfatMz3AM9NgdCNqduqHjum2vTeJQuODawe10ErvavDbUr7zjhthTqBPqubaSU +Iki/0OzBTJcMAVSvXsi775BnqYx54+6M5aedMbCxlOgFyRCSY87RkGjjhI21tmkjj RlxqJorqZjd4s10F4n8AzmorFVZ6ipPT02x3AoVrCv2DJFwnj35lyQR6H1c1yKPj6x 37Xg0T1W6qAzw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 32EE7689B1 for ; Sun, 7 Dec 2025 13:17:58 -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 HaS73Y8Q6gvt for ; Sun, 7 Dec 2025 13:17:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138678; bh=tOWH1+Icg+/eVMTEV5TeYgAK7Aw/IHUMAVH3CYcYCJ8=; 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=MSEAYGOlA/kMSYK0Lnn3ZScVMN4uxt701jRD2uhP2vw/MeAgI4NbCn2mpa5E2NcZa E1wLd7DBfMk9IyHo5zO4QGC4LOnGEA06fImzJaIaJHHJ7RR/qO4fgLkAoGVgKCswqK WrRXjfatMz3AM9NgdCNqduqHjum2vTeJQuODawe10ErvavDbUr7zjhthTqBPqubaSU +Iki/0OzBTJcMAVSvXsi775BnqYx54+6M5aedMbCxlOgFyRCSY87RkGjjhI21tmkjj RlxqJorqZjd4s10F4n8AzmorFVZ6ipPT02x3AoVrCv2DJFwnj35lyQR6H1c1yKPj6x 37Xg0T1W6qAzw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1D91768908 for ; Sun, 7 Dec 2025 13:17:58 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138676; bh=dbSbkwAJPdgtn9PDTSYwo7tV8iWQSjvNiE9O0ti1NdE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bp56c6LivW58Kaq1rS4KIRcMCGtojf9DJqayGohBexIEGiWHdnH9fv6ZWGPMM80Nm qxMqk2mhgAt+rXjPWaee3pXsSlvJHg5UX6bF8iriYTi10zWCRlHCwo260VwnX1xGZU KYcAw+FK0NVZoCUHG7liQ6hIRBLgMTEwjkB4GLEe/ltZ+/6hX8pWAvevPwjtUsMblP awAoP4hArDzJHufuX6PSjt2aWrqSE4uqeCq/e8OCcDqZNCOZhPZLtZPsXJXd0ley+C Li1ujA/S67KSbPgfhC+4JIK88ohKV0g43wxAZBW8vTl6kxxv9MO5uqQsTDhgqDB05Y u7+HjT5zrNDmw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 465786883E; Sun, 7 Dec 2025 13:17:56 -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 Tr4DA2RYkeP8; Sun, 7 Dec 2025 13:17:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138672; bh=8bbJT9XetQHBqFo0PpZbI3QISSLVOmCds65esIJ5TGg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aGElmTauu+KsIWbGQC1BYaXGfL+VTmz2PlpZMbZQ11Ou1s+ndlPbmqii/rKslU4UN 6RFLQnraHs4d91FLEKIQS7x5BXTGpzmTbK013jVbPBxVP/045XIEG0V/vppd3D1g9f M6h2kkGm+ULxQAhRXgMGkaEjFQq65V6Vy2D5Xoa5NCYNjDC3D0imWhYkukUK/XcBDv WXGNUJNvyoaBZRJ6Y/gcMQqEsdtMcfooRyYivEBIz19/D2VhF3MPSwRGT0AKmahvJ7 nSNjpFgVq1f8PgEmZHetwA9ahaQTaNL9IoFJzYUMamb9jkbDcXu3FscGvOBR7OxPUf EZ1bvZLjobNfw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id D0DA768950; Sun, 7 Dec 2025 13:17:51 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:14 -0700 Message-ID: <20251207201628.2882382-18-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: MK5CWZ4HHU57HIJDJVQSRUZH24NM3Z4C X-Message-ID-Hash: MK5CWZ4HHU57HIJDJVQSRUZH24NM3Z4C 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: Heinrich Schuchardt , Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 17/22] expo: Add scene_render_obj() to render by object ID 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 function to render a single object by its ID. This provides a convenient way to render individual objects without needing to look up the object pointer first. Assume that text mode is not used. Co-developed-by: Claude Signed-off-by: Simon Glass --- boot/scene.c | 18 ++++++++++++++++++ boot/scene_internal.h | 9 +++++++++ 2 files changed, 27 insertions(+) diff --git a/boot/scene.c b/boot/scene.c index 1bc4c9c25ac..1bcc3c39e33 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -903,6 +903,24 @@ int scene_arrange(struct scene *scn) return 0; } +int scene_render_obj(struct scene *scn, uint id) +{ + struct scene_obj *obj; + int ret; + + obj = scene_obj_find(scn, id, SCENEOBJT_NONE); + if (!obj) + return log_msg_ret("obj", -ENOENT); + + if (!(obj->flags & SCENEOF_HIDE)) { + ret = scene_obj_render(obj, false); + if (ret && ret != -ENOTSUPP) + return log_msg_ret("ren", ret); + } + + return 0; +} + int scene_render_deps(struct scene *scn, uint id) { struct scene_obj *obj; diff --git a/boot/scene_internal.h b/boot/scene_internal.h index 2bfbb5dcf50..5cc81f031a0 100644 --- a/boot/scene_internal.h +++ b/boot/scene_internal.h @@ -314,6 +314,15 @@ bool scene_textline_within(const struct scene *scn, */ int scene_send_click(struct scene *scn, int x, int y, struct expo_action *event); +/** + * scene_render_obj() - Render an object + * + * @scn: Scene containing the object + * @id: Object ID to render + * Returns: 0 if OK, -ENOENT if object not found, -ve on other error + */ +int scene_render_obj(struct scene *scn, uint id); + /** * scene_render_deps() - Render an object and its dependencies * From patchwork Sun Dec 7 20:16:15 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 830 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=1765138683; bh=fUJOzwsAjaSVi5piLi4vBY6E+Vct2ierlIMMF3lnnP8=; 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=Atifbwl7RmoPSuM67F43P1mSzJ4US7U+fuFmH+Prd8BZ1/BJeNIXFQuCLplzXX/tY /HH0gPDmjK28bI2UbKEVZxeLMQfNtW4V36V7xC+nBnZlOyWZ9zw6XJHzReLCPsMq/o 20z8Ei6Gcyz8m+j/Ngf+LZqXta1g+incOx2v118QjYmjv+mBrghUHWIayAeJzP1WlB 52GLsj2AD67r9Z0wBeIDKixXKAHrVTcIpzW0pt/lEgnB2uhE8PKMhCCTL8U7hOH3g3 lLCGsXWBCU+Tkmk7r5un/PwTXWhgj33/ir5St75GAUm5OafdI0j94GSYUjpovVoD4W kZ4UT2sCzH4lw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EB5B5689B3 for ; Sun, 7 Dec 2025 13:18:03 -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 n8H-EInpjzpB for ; Sun, 7 Dec 2025 13:18:03 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138683; bh=fUJOzwsAjaSVi5piLi4vBY6E+Vct2ierlIMMF3lnnP8=; 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=Atifbwl7RmoPSuM67F43P1mSzJ4US7U+fuFmH+Prd8BZ1/BJeNIXFQuCLplzXX/tY /HH0gPDmjK28bI2UbKEVZxeLMQfNtW4V36V7xC+nBnZlOyWZ9zw6XJHzReLCPsMq/o 20z8Ei6Gcyz8m+j/Ngf+LZqXta1g+incOx2v118QjYmjv+mBrghUHWIayAeJzP1WlB 52GLsj2AD67r9Z0wBeIDKixXKAHrVTcIpzW0pt/lEgnB2uhE8PKMhCCTL8U7hOH3g3 lLCGsXWBCU+Tkmk7r5un/PwTXWhgj33/ir5St75GAUm5OafdI0j94GSYUjpovVoD4W kZ4UT2sCzH4lw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D90FE688F6 for ; Sun, 7 Dec 2025 13:18:03 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138681; bh=/f1nt7jMsupwPtHyEwIcI/WPi6LaDjWrvWzw35McJK4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l4MB/W1usrCPEFhu2DrYOavJYazHEbnISDysZcrsFKW06WUZz/PgOHUtw5nu5a4u5 OT8oKs/MO9pY33VxmSHdMYBr09r4dzRk7WXDlNMIPWqZYxhJPFzU68dDxxzK/+qTBu NHLS4XtSE9fCbkVUCVAIQnL1dx1f99DtxhUzgCTfqG7jJJmbm4nQQzkF9Sc69PrE2s K05Tx9Rf+eosLVifNpiYj8ZkZDTv3k7d5QJAQGE90rVhvfP4AnAmoG+EVnQ7wS96Lr U2Cg7uOSmcWlOvBLYjkwijayhKD81JyyIoyMVWwRij41ifOlmZ8W+Ehz5UV6cr5CeU spXPYnuoUupOQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 186E76883E; Sun, 7 Dec 2025 13:18:01 -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 yMEJNqyiXpWp; Sun, 7 Dec 2025 13:18:01 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138677; bh=UvI2jypCGB/7bZbpQOEqeDxF8MAsxJK/VlKPhdU6Vs0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WjxvjsMakH/YL2ChbE10q+mbPNcaF0dOylcjV+Z092WdH4zkCGjwOOR5qI8Dn4j1P rehwevpw4yujkjbPFjEPG/Hxv7sNxo0ZjceU2pvOfEzh7E5KtACjQ6ws+6BUZBNelX H6uoH7FeZesK5wEjil3or6F3iLm6MHt7s9JyGof8lukCDlBfNciE88Apx6kH8B5W7U GZbcbumQIJ+LssorlNaR6eKPkmCpYZrRbds5NpZbBpvVNP32Ya9ifkK/hHYXV3vS6H E7eGizh+UL3vW9i3ZwloLnUthLZXNOYuXJ+8+1ZwYW3QPaTEgrSfxQKkrMl2UOl8qK 6O23e4/vU9u8Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id AF0B7688F6; Sun, 7 Dec 2025 13:17:56 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:15 -0700 Message-ID: <20251207201628.2882382-19-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: YZHXCVHZI4HOCQRRJLSJ6Y3A44UAQXRD X-Message-ID-Hash: YZHXCVHZI4HOCQRRJLSJ6Y3A44UAQXRD 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: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 18/22] expo: Correct rendering of textlines when open 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 When a textline is open, we must render the edit string and show the cursor. The easiest way to do this is to draw the string again, then move the cursor back to the correct place. There is no need to change the font, since the rendering function handles this. Signed-off-by: Simon Glass --- boot/scene_textline.c | 29 +++++++++++------------------ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/boot/scene_textline.c b/boot/scene_textline.c index 7e01959c40d..20e2d7f33c4 100644 --- a/boot/scene_textline.c +++ b/boot/scene_textline.c @@ -189,28 +189,21 @@ int scene_textline_render_deps(struct scene *scn, { const bool open = tline->obj.flags & SCENEOF_OPEN; struct udevice *cons = scn->expo->cons; - struct scene_obj_txt *txt; - int ret; - - scene_render_deps(scn, tline->label_id); - scene_render_deps(scn, tline->edit_id); + uint i; - /* show the vidconsole cursor if open */ + /* if open, render the edit text on top of the background */ if (open) { - /* get the position within the field */ - txt = scene_obj_find(scn, tline->edit_id, SCENEOBJT_NONE); - if (!txt) - return log_msg_ret("cur", -ENOENT); - - if (txt->gen.font_name || txt->gen.font_size) { - ret = vidconsole_select_font(cons, - txt->gen.font_name, - txt->gen.font_size); - } else { - ret = vidconsole_select_font(cons, NULL, 0); - } + int ret; ret = vidconsole_entry_restore(cons, &scn->entry_save); + if (ret) + return log_msg_ret("sav", ret); + scene_render_obj(scn, tline->edit_id); + + /* move cursor back to the correct position */ + for (i = scn->cls.num; i < scn->cls.eol_num; i++) + vidconsole_put_char(cons, '\b'); + ret = vidconsole_entry_save(cons, &scn->entry_save); if (ret) return log_msg_ret("sav", ret); From patchwork Sun Dec 7 20:16:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 831 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=1765138688; bh=3wkkZm6km8RHmD7/Ird5j4eL2vM0wuU6efqc/LEqQkI=; 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=n9QsAwczZ467gofMzBxoyaphg2ZLrIWx5DZ3MZFuzpUeC3LPoLY1BsejG51U6bNmf 73a0HNCNfb22Ctypo2P74jca1eW/PC25xpUziV8AzJFEbfevZGCB9nRt5auEciUE/Q kuJMJM6FO/ABuqOg9Fa6SHKM+DykC+IsL1FdY+VLeWiUSGvXykJoiZnkb9Hm1QnTtq ZWYA6S6muD+dSta2ubjLb1MFyG6jfqes6gANpgk+mrpOpaTsVDJy5BzVr6Q6EcNP6l F4IUGA4KVHU8chchLBS7rvHoLE905MLPLOiHCsGprIHIESopKGQ/h8jy//Pc3WzVvq fT9Rlntn/EUAw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 68109689B4 for ; Sun, 7 Dec 2025 13:18:08 -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 xp29S08Y-ese for ; Sun, 7 Dec 2025 13:18:08 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138688; bh=3wkkZm6km8RHmD7/Ird5j4eL2vM0wuU6efqc/LEqQkI=; 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=n9QsAwczZ467gofMzBxoyaphg2ZLrIWx5DZ3MZFuzpUeC3LPoLY1BsejG51U6bNmf 73a0HNCNfb22Ctypo2P74jca1eW/PC25xpUziV8AzJFEbfevZGCB9nRt5auEciUE/Q kuJMJM6FO/ABuqOg9Fa6SHKM+DykC+IsL1FdY+VLeWiUSGvXykJoiZnkb9Hm1QnTtq ZWYA6S6muD+dSta2ubjLb1MFyG6jfqes6gANpgk+mrpOpaTsVDJy5BzVr6Q6EcNP6l F4IUGA4KVHU8chchLBS7rvHoLE905MLPLOiHCsGprIHIESopKGQ/h8jy//Pc3WzVvq fT9Rlntn/EUAw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 56C0E689A8 for ; Sun, 7 Dec 2025 13:18:08 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138686; bh=wMHb0QeqFToAiF17wEOm4neqza+IkBHttXU+HG7bic8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SYONwTs8GbZHRzLg2PFtw6oi2PiQCWSj/juOWq2Ml0ZAtVOQZg5iTIRosq+eiFVlg dERvBl6KdORRvjya8kGuE77FZ3Zl/VaDC8PWA3ZAi4EjqLKVdAnKvrUH982lmdbu6D GTOPda/72a6+me9q51tcE2fLKNfGyFSfwggC4zFdZxX2j6tbLQ2hIKSmedeZn2ZTJm 9q19Jqqk9woByVv60Xshe1JJsFVeKwyRM1X1x/zfXIIrrpwQrr7bFLzCg2+Cxxyouj uT18plY+LjXIT/VXsQuBZV3d2jyUrIHtYnuFjGiSgFSAowcE6LXKbegLgg4BBuL+9K u2ptYuWoYE91Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5956D688F6; Sun, 7 Dec 2025 13:18:06 -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 bWSZr4vRKuSz; Sun, 7 Dec 2025 13:18:06 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138681; bh=wWGRxfgivXq+DKb6X3j+uFuSyjAqlewM74pifaUQU1w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eu44uIMrN8SxH8kTc37jaRAC2LGbZ/ZTq3RwUt+uwQgN8MyO/vsRoDojA1HTTd9E0 34bw8uMGHFzNk86kKkNwoGyA2MjefBDectCt/Yvk+Ez8dEK9V+XiaUUj2Pha0dinJj 2RayKioUN2Ke4Q5Uemm/WCnBbnfRDE4rrl2JhIU0ofYteMBzaZExFZbwudtpmEPxTx g4SDoxG66Maa97/rlPRF0/HCivaYe2iJt7MWIC1yH3sZwybDTXU7ePdr+GIfGPnEy4 kdy6y2I8bOUO6I5zKhu0F7iIrLzWe1jAOOH6/n9WsCgpybyPAK2VlAsupZXymDuq6a VALfgU8S5jn8Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 5EEC05F6BF; Sun, 7 Dec 2025 13:18:01 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:16 -0700 Message-ID: <20251207201628.2882382-20-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: FA6KQ3JVO5DN7D3VTGFMJL4FS2KNEEHO X-Message-ID-Hash: FA6KQ3JVO5DN7D3VTGFMJL4FS2KNEEHO 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: Heinrich Schuchardt , Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 19/22] menu: Start bootmenu_key values at 0x100 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 At present the backspace key (Ctrl-B) has the same value as BKEY_UP, which means the keys are ambiguous. This causes problems when trying to edit a textline. The same problem applies to other keys used in cread_line_process_ch() Start the bootmenu_key enum values at 0x100 to avoid this collision. Keep BKEY_NONE as 0, since it is a sentinel value. Co-developed-by: Claude Signed-off-by: Simon Glass --- include/menu.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/menu.h b/include/menu.h index 6cede89b950..9914e680307 100644 --- a/include/menu.h +++ b/include/menu.h @@ -45,10 +45,16 @@ struct bootmenu_data { struct bootmenu_entry *first; /* first menu entry */ }; -/** enum bootmenu_key - keys that can be returned by the bootmenu */ +/** + * enum bootmenu_key - keys that can be returned by the bootmenu + * + * These values start at 0x100 to avoid colliding with ASCII control characters + * (0x01-0x1f) which are used for editing operations in textlines. BKEY_NONE is + * kept at 0 as a sentinel value. + */ enum bootmenu_key { BKEY_NONE = 0, - BKEY_UP, + BKEY_UP = 0x100, BKEY_DOWN, BKEY_SELECT, BKEY_QUIT, From patchwork Sun Dec 7 20:16:17 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 832 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=1765138690; bh=MMhj0NXRUKlmd/VhjJJEixAsylVzBOGifd/zOFrOmSs=; 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=hxCzIfni/CcENSAg+z/IDVYvNbO3KgzAli9CW2v5NJ6Hzdhk/DrRoI7luMux1xLy7 m9votC860EaB6bOyFd/OANeTKqMW7ZBPgwOeVfIBGzrjVrgVHPs6fmnKJN3AsouEiD rh9mlYiUKELyUKluqmXDO27xFQ+RxOqhq1aaXO88W89Lr5l+rk9X77XszKofRVvKem ReefQCQKk3G62y1T6c0fEmCQ/N4eMRjQ7l5ejAvHbyXpKzACMbUZ4/VXlmikFJ5wJy gZQ9K6J7k1iZLQuzPqKZqIe4V2D4ehUeNKgRORm3KxyNxmKUrYMsONSq34HJ+G5BYh 9WFKcuj6tegOA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C0F6968950 for ; Sun, 7 Dec 2025 13:18:10 -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 IWzm1dmBX8vw for ; Sun, 7 Dec 2025 13:18:10 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138689; bh=MMhj0NXRUKlmd/VhjJJEixAsylVzBOGifd/zOFrOmSs=; 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=ot2TrWVUwyWeDXNwtw3zABLM9M9uCX1M7WmKRvsgspvC0dnsa4ix+dbkyyl8SUFD9 6DjBtvlH5JyV4vD6RIP55kieHXungLrWZu8lWjDjewCzZue5lwMcAEjqOgEVvIRic5 STYDzjRROF9syT1fhYg8Sx784aDedK1lfGc3t+eKqHSuIW6pVZ0cLLp4XXxKL1p2Zv 6Z7z29oic5eFQLaNcb9CPryNqz9xpIYw1Elsn4s3ns/jKg3UNJamTuJjuhtFzPxwfH M5erymBNbiDFLzZQTP1vvrL7O2hAc5tN6cXIv7N53h724oIJZxbiUAfhf2Uw0UwKUT IMEO6/1uq3trw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C1619689A8 for ; Sun, 7 Dec 2025 13:18:09 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138686; bh=ST1FyJZ9UNnib7Wz6MySuXVW/YYvUjcJWGFd9Sjl6UY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MbbC7z1HHi4OyQ32lq+bAScPEADC01OTWdiH0ybYJEVRX6bWgxSkOK0aM88e5XPgw CTXofQJ2zJrJRqy4/R4U4F4+EFQEglLJnSJbJW4g2ofLO9OU5IPhWDC6EvIGdzGtdQ iOBQWDeWLFe7BNV5ZheDKSseDi3Gg/XYlImx47HL99knsibluz9v44xBiPkV8sl4yf YH/KDuvs2MAUyf3KJdghBNqEtZyeCxkjzLWiZlEDb/Zk4hjG5es3MZ0cQfmmRR53uT lfbYZ4ftX/28S9IsYBHkWAF5j4CbviCihcCBf9lR6Bi14yctUbS/jb8vB/QBmrk1L0 bnbo/vjUD5ptA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AE7DE5F6BF; Sun, 7 Dec 2025 13:18:06 -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 yibssMRT8hR0; Sun, 7 Dec 2025 13:18:06 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138686; bh=Uzb4QGWCtsL9FnBPlHS9nUq0x6yl+1S8A3JEA3VEdV0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y25IluSm41WbFz195jyfdFUTep+UxZWHjuIkfiA7ZJqsT3Uy+L40gvHtD+7D/dTHY Mw/AQUIpy9LgbIDw+0tTA5PMPJG5PyP47HmKs5BQv5TRzH5oN7hdwtoaHPNXjw/54y XmuDje6K12syz4nVw9bqjGy2wRn4NY30pbTE8XCwMKWcx3n7fniKcctLyxD7FNCs6c 5phcseGmWQh+XgUoSc/WDynJr61Cklosp/iqWvoNcjjtaZO+kHe8ALKyeXYLL1jOqj UsQ5Yw7uTfspkM/jqcX2mh6WK66Yd1bs3uBD1MZfANuS5stFZr7R81R61LPq3/ksza N6FUDfp9Jmoxg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 103E66883E; Sun, 7 Dec 2025 13:18:05 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:17 -0700 Message-ID: <20251207201628.2882382-21-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ZNWSLO4SWBN4OW4NZCSD7SGLQEFZEMDR X-Message-ID-Hash: ZNWSLO4SWBN4OW4NZCSD7SGLQEFZEMDR 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: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 20/22] expo: Always send keys to highlighted textline 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 Move textline key handling outside the loop so keys are always sent to the highlighted textline, regardless of whether it is open. This allows the textline to respond to keyboard input even if not in a popup expo. Otherwise continue to send keys to menus as now. Signed-off-by: Simon Glass --- boot/scene.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/boot/scene.c b/boot/scene.c index 1bcc3c39e33..5c19bff6011 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -1152,6 +1152,16 @@ int scene_send_key(struct scene *scn, int key, struct expo_action *event) return 0; } + if (cur && cur->type == SCENEOBJT_TEXTLINE) { + struct scene_obj_textline *tline; + + tline = (struct scene_obj_textline *)cur; + ret = scene_textline_send_key(scn, tline, key, event); + if (ret) + return log_msg_ret("key", ret); + return 0; + } + list_for_each_entry(obj, &scn->obj_head, sibling) { if (obj->type == SCENEOBJT_MENU) { struct scene_obj_menu *menu; @@ -1161,15 +1171,6 @@ int scene_send_key(struct scene *scn, int key, struct expo_action *event) if (ret) return log_msg_ret("key", ret); break; - } else if (!(obj->flags & SCENEOF_OPEN) && - obj->type == SCENEOBJT_TEXTLINE) { - struct scene_obj_textline *tline; - - tline = (struct scene_obj_textline *)obj; - ret = scene_textline_send_key(scn, tline, key, event); - if (ret) - return log_msg_ret("key", ret); - break; } } From patchwork Sun Dec 7 20:16:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 833 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=1765138694; bh=H99RFforvVvtmzlYxIf+0P/qAviiLjPQ+DP+2pF1wu4=; 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=goaRZZEI8/F1MPud6FxAPXussICI7OjWkaAICLfXorwgsHyqxBcpv1BpTFwJWyTEe zNulKO3f/rAZId3jJNylfx1wJcUOZe6fWYdCtQOig3eAqq34vz11/U26YLKldCXaVn 4tMwM6yRsDb8EB7gcgFzOEiDe3P74B/OLHyzVRz64+05/qRiu4TK103BMOC++mmxNH INp71eXv3uJ+lBSUzWYm+1frT5AM90vH4F6d9JzrbB2z7mV4chn75sS1RQmy6Y2DJC zA3m5duUcB0SsUkVS3VOBYjJevPjZnzRKXHZ/XZPoxTMFELs59Xzluw7vHyfY1y3Id 0Xez+V3t8XNwg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4659C689A7 for ; Sun, 7 Dec 2025 13:18:14 -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 IlrC7LbBOJEN for ; Sun, 7 Dec 2025 13:18:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138694; bh=H99RFforvVvtmzlYxIf+0P/qAviiLjPQ+DP+2pF1wu4=; 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=goaRZZEI8/F1MPud6FxAPXussICI7OjWkaAICLfXorwgsHyqxBcpv1BpTFwJWyTEe zNulKO3f/rAZId3jJNylfx1wJcUOZe6fWYdCtQOig3eAqq34vz11/U26YLKldCXaVn 4tMwM6yRsDb8EB7gcgFzOEiDe3P74B/OLHyzVRz64+05/qRiu4TK103BMOC++mmxNH INp71eXv3uJ+lBSUzWYm+1frT5AM90vH4F6d9JzrbB2z7mV4chn75sS1RQmy6Y2DJC zA3m5duUcB0SsUkVS3VOBYjJevPjZnzRKXHZ/XZPoxTMFELs59Xzluw7vHyfY1y3Id 0Xez+V3t8XNwg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 34D4168900 for ; Sun, 7 Dec 2025 13:18:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138692; bh=0E1W4EGsXeagHqbiRBOKfuPKk7hT2jpseEZY+U8ehvA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wXiafChL5tp4wf0VXnpTjn3u2U+atEuMJ+MDUpCX0vAWQGrSh/W9ZjAcpv+9kMAuo 4bWNPiXw+ehz6Ap4f3RzDEoTkz5bxu1IvVNNUYGPS7v3yRT+KFqKvgMVFWg1kGtVXn fDrfKky2g2ANepsmH/+Sl/1m7yiy7V+qD+utGZRIxXG6xzblr9BYouwXaLguJbwuwh b095fyN5/40jO6+gLQsjYPlgBaWYDyVj9+DtDUbZ8XuVLGZ3JMNLefY1g9YRC8pxuE KFbhriHzuyiqILj/3JGj7UI/YysGqCxN9+v1HbFOWRgNnBgot0ovDWuKw7r4VX3ukN w9OESabmwBptQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 18E1A68950; Sun, 7 Dec 2025 13:18:12 -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 se7aj89B00HN; Sun, 7 Dec 2025 13:18:12 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138687; bh=g5Fhe47j2ANcszityU8DPFuiBPA3S3Ue1wx/6I4cSms=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NikEhrbvGHXan8F3CxSLWf6iAwhAvarrPdHGJtfZgz28ZZKmFu2YfQ7EuZULd2ZHB JUEuBu7odeuapDwMDXQllbARqwKz9XOLA6U5tggxmPmbRzua8jE0NaoczkdV3yEB/6 hY2AuyPwCZsd4f+9APlbVz6P60wOVUTT+BioPGv7P7tOPlLRhkj51DQqz9C2J+Eunk MCRIYDsNcChMoTkTmcnutaPbyYQUjzdpzjmRz62ZRmZWmMtIJdJ7GDO1DoVHH0Hkn1 myNA5gqeNVw/0cDOK82DD730AwTpurbz5cnKadRN7Gg7ZmqQ7ExFKitHtt1DNBZfsK ZmxePWURheNeQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 048C66883E; Sun, 7 Dec 2025 13:18:06 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:18 -0700 Message-ID: <20251207201628.2882382-22-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: IUMS5WBULOMQ43DO7YDTEOJKAMWRO3KU X-Message-ID-Hash: IUMS5WBULOMQ43DO7YDTEOJKAMWRO3KU 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: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 21/22] expo: Consider an item selected when a password is entered 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 When the user types in an unlock password then presses 'enter', select the item containing the password. This avoids needing to click on an item as well. Signed-off-by: Simon Glass --- boot/bootflow_menu.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/boot/bootflow_menu.c b/boot/bootflow_menu.c index ee3150afef4..01af30c6627 100644 --- a/boot/bootflow_menu.c +++ b/boot/bootflow_menu.c @@ -457,6 +457,13 @@ int bootflow_menu_poll(struct expo *exp, int *seqp) } case EXPOACT_QUIT: return -EPIPE; + case EXPOACT_CLOSE: + /* + * Password textline closed (Enter pressed) - treat as + * selection + */ + *seqp = act.select.id - ITEM_PASS; + break; case EXPOACT_CLICK: if (act.select.id == OBJ_SETTINGS) return -ECOMM; /* layout change request */ From patchwork Sun Dec 7 20:16:19 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 834 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=1765138696; bh=K1NOSJda/+EGeFdbb68z5ZnXJQCACi5jZvYztPcHWBM=; 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=pKAKEOUsjyHDs1cK4VLl4xxcAeJ9yF7BzQzWshKPjNEWsndvwV2xq0lxeatJJMxPy sBnM3V+4UUk071qk/V8uiWci97lHq2knQEgvBh3KImKGJr+D8YZyFx1uPFOLeSqMG5 zqqOmlbtwIJqpJUyCaFMJM1dnhxnqrmyCBPnsBmoA0rE1o88estjrZnXVN/8mRDEjZ u+7Zkhnks+nmsY0SSkEC61K+KUSByDRZOr1y0oULqI9AI3A8KoXrdaqREoCRmb16bj oU6sRtwnx1CiLHbNEmct68gSle2bVCT7TRlTbFWsyc+m3NL/AsiMX9drscQGhnOSb3 97T3QG2TqPH4w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B364F689B1 for ; Sun, 7 Dec 2025 13:18:16 -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 jpBl6l3LU0CL for ; Sun, 7 Dec 2025 13:18:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138695; bh=K1NOSJda/+EGeFdbb68z5ZnXJQCACi5jZvYztPcHWBM=; 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=sGFOZImZUPksBmB1fPpXzKbRj/cdCaWhzdYxG6tPMO2NZHdGbmbBhMOCok9jBoRPg MQosO+YWTIsbUY3nIx2OG+v7krWJFb0LqXUb9I0HidUXygbh54+VPYO8qEmSS+LMwS XSbSrDB9DCGa4HQw8n3cwVtEXKhc8ljKlQJmCiMaCEpnAhQ0IYcjJ2yqoYaGJVtokc d/TNDzQijRDlomvoCu8cG2lc8oql9hOr0whtQl5+gS+BFfH86tJRFIFWiEisY8Tz3g NPrx6/506GAnn296xwwZ9ddJAqE6LFE/iREb0CkR2OVZHdtiojsphd3n6hpKBvkbvv fLcRP2jntV84Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 474BE689B7 for ; Sun, 7 Dec 2025 13:18:15 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138692; bh=7X02oRByF6zfNH+llGZD/drM0lpb266hPH6NiN69UpQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WzsQlsFiJocMRuTFEhOYotNb5LWAmxJ/+3UI8xYq3T20IDBmk0Pbwao9qhI8IyTi7 xyBJlzg+/DqcBpbPZ7DMjRCJGIZ+DkWAL/Srut5vzTojgyrxRnirwS2AkIeoC6OZ4q iokgLqZhYjaGsig2DflP2KQtgqsat+BjBb6HkTL7M83nFHyEOc7nQccbAIRNKMmr0Q 4Dob3QiIeksfB7iY4ao0qnseqi/fwcxCyyP8kyVg3D7ZmYbToQjpeNUW+GSuVeUa2j BvhPfxe+CfmxcuTOnRQuQdWcsJAIVzRo3p0xsGJdRuRO8r4J8LZjyhjLC2jToJzAfy oViobeH7mlFEg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2CE106883E; Sun, 7 Dec 2025 13:18:12 -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 MUcXMTyaY33a; Sun, 7 Dec 2025 13:18:12 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1765138691; bh=MhLS/rft3NL3j0lI63dwHagynKBZ+uyRBiuEoVnNjXY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=je5tXqHS4LAxf4awpaMM0KzHBF6up57yy670UxNF+IzHDpmk/GzGOiWUnI3AmSeTZ EOBxLQP9Ti1GWvHUdO/+1+LobYyWlAgHNxGdZ0wiMaExrQGqdeEMlIcnNERyhWWPXY qB7i149qUXpef+vZakN/YD3lh01vYHmOU97zTwMChgxZSPWuPr6pbYZdbveJohWav7 ATakRchtdCXfCMIso7TckDzIpCsK/IsLNGxpJS5/o57/GhjqAEJlu9KBFe5NxVHYMr o4i19o48DAKGJnATT8GbWFB38+BzqyJ0AqeirJ8h3hq+Epjq5CjZdCFXRNY3T9S6FC NzsfVAKGErMPA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 51BCA5F6BF; Sun, 7 Dec 2025 13:18:11 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 7 Dec 2025 13:16:19 -0700 Message-ID: <20251207201628.2882382-23-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251207201628.2882382-1-sjg@u-boot.org> References: <20251207201628.2882382-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: BPJGAM7YXMR4XY6QJU3JK4POLRNSC2LN X-Message-ID-Hash: BPJGAM7YXMR4XY6QJU3JK4POLRNSC2LN 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: Heinrich Schuchardt , Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 22/22] test: expo: Add a test for textline rendering in an expo 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 test that creates a textline in a non-popup expo, renders it, opens it, sends keypresses to edit text (including cursor movement with Ctrl+B and character deletion with Ctrl+D), and verifies the text is saved when the textline is closed. Co-developed-by: Claude Signed-off-by: Simon Glass --- test/boot/expo.c | 116 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/test/boot/expo.c b/test/boot/expo.c index f98a1e46854..03ad3e2167d 100644 --- a/test/boot/expo.c +++ b/test/boot/expo.c @@ -33,6 +33,7 @@ enum { OBJ_MENU_TITLE, OBJ_BOX, OBJ_BOX2, + OBJ_TEXTLINE, OBJ_TEXTED, OBJ_OVERLAP, @@ -1392,3 +1393,118 @@ static int expo_dump_test(struct unit_test_state *uts) return 0; } BOOTSTD_TEST(expo_dump_test, UTF_DM | UTF_SCAN_FDT); + +/* Check behaviour of textlines in a non-popup expo */ +static int expo_render_textline(struct unit_test_state *uts) +{ + struct scene_obj_textline *tline; + struct scene_obj_menu *menu; + struct abuf buf, logo_copy; + struct expo_action act; + struct scene *scn; + struct udevice *dev; + struct expo *exp; + int id; + + ut_assertok(create_test_expo(uts, &exp, &scn, &menu, &buf, &logo_copy)); + dev = exp->display; + + id = scene_textline(scn, "textline", OBJ_TEXTLINE, 20, &tline); + ut_assert(id > 0); + ut_assertok(scene_obj_set_pos(scn, OBJ_TEXTLINE, 500, 500)); + strcpy(abuf_data(&tline->buf), "sample hopwind"); + + /* create the label text object */ + id = scene_txt_str(scn, "tline-label", 0, 0, "Label:", NULL); + ut_assert(id > 0); + tline->label_id = id; + + /* create the edit text object pointing to the textline buffer */ + id = scene_txt_str(scn, "tline-edit", 0, 0, abuf_data(&tline->buf), + NULL); + ut_assert(id > 0); + tline->edit_id = id; + ut_assertok(scene_txt_set_font(scn, tline->edit_id, + "nimbus_sans_l_regular", 40)); + + expo_set_scene_id(exp, SCENE1); + ut_assertok(scene_arrange(scn)); + ut_assertok(expo_render(exp)); + ut_asserteq(21007, video_compress_fb(uts, dev, false)); + + /* highlight the textline and re-render */ + scene_set_highlight_id(scn, OBJ_TEXTLINE); + ut_assertok(scene_arrange(scn)); + ut_assertok(expo_render(exp)); + ut_asserteq(22693, video_compress_fb(uts, dev, false)); + + /* open the textline and re-render */ + ut_assertok(scene_set_open(scn, OBJ_TEXTLINE, true)); + ut_assertok(scene_arrange(scn)); + ut_assertok(expo_render(exp)); + + /* the cursor should be at the end */ + ut_asserteq(22695, video_compress_fb(uts, dev, false)); + + /* send a keypress to add a character */ + ut_assertok(expo_send_key(exp, 'a')); + ut_assertok(scene_arrange(scn)); + ut_assertok(expo_render(exp)); + ut_asserteq(22818, video_compress_fb(uts, dev, false)); + + /* move cursor left 3 times */ + ut_assertok(expo_send_key(exp, CTL_CH('b'))); + + /* check cursor moved back one position, before 'a' */ + ut_asserteq(14, scn->cls.num); + ut_asserteq(15, scn->cls.eol_num); + ut_asserteq_str("sample hopwinda", abuf_data(&tline->buf)); + ut_assertok(scene_arrange(scn)); + ut_assertok(expo_render(exp)); + ut_asserteq(22884, video_compress_fb(uts, dev, false)); + + ut_assertok(expo_send_key(exp, CTL_CH('b'))); + ut_assertok(expo_send_key(exp, CTL_CH('b'))); + ut_assertok(expo_send_key(exp, CTL_CH('b'))); + + /* check cursor moved back three more positions, before 'i' */ + ut_asserteq(11, scn->cls.num); + ut_asserteq(15, scn->cls.eol_num); + ut_asserteq_str("sample hopwinda", abuf_data(&tline->buf)); + ut_assertok(scene_arrange(scn)); + ut_assertok(expo_render(exp)); + ut_asserteq(22915, video_compress_fb(uts, dev, false)); + + /* delete a character at the cursor */ + ut_assertok(expo_send_key(exp, CTL_CH('d'))); + + /* check character deleted at cursor position */ + ut_asserteq(11, scn->cls.num); + ut_asserteq(14, scn->cls.eol_num); + ut_asserteq_str("sample hopwnda", abuf_data(&tline->buf)); + ut_assertok(scene_arrange(scn)); + ut_assertok(expo_render(exp)); + ut_asserteq(22856, video_compress_fb(uts, dev, false)); + + /* close the textline with Enter (BKEY_SELECT) */ + ut_assertok(expo_send_key(exp, BKEY_SELECT)); + ut_assertok(expo_action_get(exp, &act)); + ut_asserteq(EXPOACT_CLOSE, act.type); + ut_asserteq(OBJ_TEXTLINE, act.select.id); + ut_assertok(scene_set_open(scn, act.select.id, false)); + + /* check the textline is closed and text was saved */ + ut_asserteq(0, tline->obj.flags & SCENEOF_OPEN); + ut_asserteq_str("sample hopwnda", abuf_data(&tline->buf)); + ut_assertok(scene_arrange(scn)); + ut_assertok(expo_render(exp)); + ut_asserteq(22839, video_compress_fb(uts, dev, false)); + + abuf_uninit(&buf); + abuf_uninit(&logo_copy); + + expo_destroy(exp); + + return 0; +} +BOOTSTD_TEST(expo_render_textline, UTF_DM | UTF_SCAN_FDT | UTF_NO_SILENT);