From patchwork Mon Jan 19 20:40:54 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1631 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=1768855312; bh=dYZiNootk92VTKWVDgZRr9kF9yETPFoUZ14z0W5rGQU=; 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=RDcb/MNX44wm1DQJ2x/LLAUxu+jmQLfDfFb9KBi/XB3tqPRoomIzzhGPHu0ZsBJDJ K/8TJb8FCYBejKg2miG6JpHmozvKQlrzHiSFsYviCJBLsI5TPU+BDtCfYhcuDsrmq/ uGPZCg6I56Vl8Hpv3EBmxV3pX/+88XOLiWuu2lm89GFQy9vVvfHudaDQen/3SJqx/u Ch+rCeHOuCkVUJR6aNqf3KNYl21Kj/QB8IGkiTXdmSV+EpfDplMESwbwcOO/GsLdq/ PApCC2/LGsaeVUJnF4lp5tqHFE8Hw9TzDe7awb4E7NF3zmdi5c++YKr6LDXP1CSpYv Hcd4B3MkVNMpg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D319869504 for ; Mon, 19 Jan 2026 13:41: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 10024) with ESMTP id DrR2HVgGLbjK for ; Mon, 19 Jan 2026 13:41:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855312; bh=dYZiNootk92VTKWVDgZRr9kF9yETPFoUZ14z0W5rGQU=; 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=RDcb/MNX44wm1DQJ2x/LLAUxu+jmQLfDfFb9KBi/XB3tqPRoomIzzhGPHu0ZsBJDJ K/8TJb8FCYBejKg2miG6JpHmozvKQlrzHiSFsYviCJBLsI5TPU+BDtCfYhcuDsrmq/ uGPZCg6I56Vl8Hpv3EBmxV3pX/+88XOLiWuu2lm89GFQy9vVvfHudaDQen/3SJqx/u Ch+rCeHOuCkVUJR6aNqf3KNYl21Kj/QB8IGkiTXdmSV+EpfDplMESwbwcOO/GsLdq/ PApCC2/LGsaeVUJnF4lp5tqHFE8Hw9TzDe7awb4E7NF3zmdi5c++YKr6LDXP1CSpYv Hcd4B3MkVNMpg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8F92D694CE for ; Mon, 19 Jan 2026 13:41:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855307; bh=EvoK7euc9bgEZVOMe9REqhzjFePzbKSne3Vu4a/iOZ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Urj1ZY6uMytco/G8hFT704R2dWrr0X8hFsmua6QBE89MKIqS3/F00f4mS/2LtmbkV s0BgnLQl9N31p8aZbnRgB094XPmimOQhOwwNMzVxTwB8v5FOuJfrShXhuBUOWBE38c P7T8v8jbXU6/Gqszq1D2eSzzL+v6Fs15jYI3sWPPCG+/BjQ1N9UyLGNed3lASkv+Nk ikROvsSgW73Tj/18UxgNrH6RZrXtuGJAq8EsnMIF3JO/vNxH/wVzQgKsYWUyrdhXXL eravW/BOUQHffG1j7dtlCFJFay1/B3AoSA4tcCW+HOhBPLV2kwBBhGj1GxiH32fB0p RYGvk/fbiL4zA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E2818694CE; Mon, 19 Jan 2026 13:41:47 -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 O0B4wrIMcxMh; Mon, 19 Jan 2026 13:41:47 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855303; bh=r+FqyCkklqT/mEBq39WA7o1nG9Jq831xuJU8LZ2rSyI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H4jq6Z17wcTqC7lGvcudXf+/G3tFBsV+qdnQTC1YMncZ7+2X299G7Sidr7XPgkSt7 AlA72vjnPzcF4tHAqwMO4ubsy9lPQDZWiCC+Pn/1ekD5gysKOR/+FBAmIAvTVF6bbh UX5LRI8qzHi6Y8su7F/kHFrykOMuWMY4BHhihVMzmKHhbX0O9gVxMh/y8TnSTzybm/ oGBE4Hq+lQU2tRiUzvzxWaARa2c+/Ir/7nJfgWDSwqYmwrFWJ2t2rvSfEKSLe2LM/u adr01+rtxlqrjvhV9BYYj1CQD6B5OKmyJ2sTy1g4ho2wXivh3AmUw5efbsVqKS1zpB aingbfhZYHU+g== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id A15AB693BA; Mon, 19 Jan 2026 13:41:43 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:40:54 -0700 Message-ID: <20260119204130.3972647-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: PAXU25XG4ML4DWXPDFFNOCZ6U6GDW6FR X-Message-ID-Hash: PAXU25XG4ML4DWXPDFFNOCZ6U6GDW6FR X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 01/27] hook: Add hooks for kaka 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 Provide a symlink so that tests can run on kaka (a desktop machine). Signed-off-by: Simon Glass --- test/hooks/bin/kaka | 1 + 1 file changed, 1 insertion(+) create mode 120000 test/hooks/bin/kaka diff --git a/test/hooks/bin/kaka b/test/hooks/bin/kaka new file mode 120000 index 00000000000..784d574a1e1 --- /dev/null +++ b/test/hooks/bin/kaka @@ -0,0 +1 @@ +ellesmere \ No newline at end of file From patchwork Mon Jan 19 20:40:55 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1632 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=1768855328; bh=pYoGMdI1hbFBDNTr46YYzc+BZp4FIvhq3CJ946z8oq4=; 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=FRkXaZ9i7hvp7hSMPsfqyUHWyJ1tI1guiJ6lUTzIwu4w+/p+LTuxyASV6VU92GDv9 xKdJSxrrhr78o4VhR2PxsVe/nG7ezHC/2uAhRcSpnp3dRzGUIx3jIrNjVY8toXM2/V 8fi5Eq6DT2DbjcfkXUlbv9rGnxIzhz07ZquHB6Vhq2ehVN9Yos1v3diwdajZywTV/3 SO6p4pcJ2x0rfhrWmfS1WVrFWwaeJ/loaU+5tLtS958zY3IdazH1YYV/ObAwcrDRA0 2qgXQSxezm2VR1Ljafp80sHP9pEaWpZyDgAQxa4gJYRbokAOH+nh3dXIIOt+737HlJ 1e2xe7xyzJUMA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id ABDBC69513 for ; Mon, 19 Jan 2026 13:42: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 HqN7Qdl-QWsV for ; Mon, 19 Jan 2026 13:42:08 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855324; bh=pYoGMdI1hbFBDNTr46YYzc+BZp4FIvhq3CJ946z8oq4=; 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=FdSjDtnqQVL1LqRyyDQIMCAZUrZilkDc313r6hpQAoId5jjhZMQIAJ8ArovsFhPYB F/CA9zyZOK4fqokvIrwhfc1mqrxm+VNm0HNYw4eVOcEz0qv553NL2WbP18J0QYac2S PhMMcM6mMIQcsk7Ei/IBS8NasJPo95Fi/eje4pyQq1CDR4YrkbooamZlqbKY3pUmrK Y7DdVMPA912ssMM/CKU2Es4khzLNZ8n4/XREolx0yQnkbylwvVMl9kWtxmR5sjRyJr DH34PcukfMGyRN+ZR3HofCu2F4ThpeeUS/QAy0Um2YzsehChdG/9ykexNxPmz7Ij+e ej+rMcP2gk3wg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5F9F169504 for ; Mon, 19 Jan 2026 13:42:04 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855317; bh=M13Q2/w9ZHlwSB5EXkixsDtuziwtxTLkAIW+Ek7qdLg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j4uYWYj6yda9QYX/T3gEQNmxunOPupNSsuNWqatXgLHlN39Fu7ppb6XOZqf0g+2ro F/loYv43tnOaXWDSUa/3GX71aymCHFfQ7MtDipwRcR0+XQAk8J1tdOLDSHUjh0aLjO cmovVyB0nB/ky5TN1rIn+aoGqDhgEl7ZEcupKEBV4+XNyzNO7g1b8uI9LK+vTaM2cL DALWmUXPkUlMIx5w9c7pl6nYRU05wdFYW3QLjy6mK/IpI3KRMUZVfnfY+E2GTnV3ZV A8AiFLTgZRj4t4UmFxM9IKERbFH2qqsOjf4MLREkaKQdLZG6JpOoIxKrOOENp6sRcf 4w7pa8D+PD1Sw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6021669504; Mon, 19 Jan 2026 13:41:57 -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 y11qRRRch137; Mon, 19 Jan 2026 13:41:57 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855308; bh=8d1PXn3G4dCxsmDgQQP0rSY+23/8bEFKPkPMEKREVDw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ibV2gsB3joM4oXsvdRxHz71wIxZoeKVFUg+dyyA/z2XlUHZp9VJi3s5kYelneqYSN a23FeDgNIaAFC1XZjxKPJOWG4FhAl9VxfBikPXAsXzhlxT8x/wuzmM5NqztN3kYE0Z c1fTdfHr7b1FHYfBvu8iZnistydilsI5cXXwPCptlJ4oZOt98yRlZDxbTmYcSYXK9d QA9d0E2LR+1jCqhtOfCT+Vk9iPNqG41eztrNbf2onKmvmN6p2RYajtaGIGQ/EfWBqe MtflnO5ZzqltWt00FH5RQ829KTIX5+pfeJVnre9s0ksdFK4SySDHyQ9IU/wH29xY86 ABsp0oOcG+Uvg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3A14C693BA; Mon, 19 Jan 2026 13:41:48 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:40:55 -0700 Message-ID: <20260119204130.3972647-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: CULQ6KMRI5DQ2SPWWWEHK52P75G4DRPD X-Message-ID-Hash: CULQ6KMRI5DQ2SPWWWEHK52P75G4DRPD X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 02/27] test/py: Allow --help without a build directory 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 Currently running './test/py/test.py --help' fails with an error about .config not existing. This is because pytest_configure() tries to parse the build configuration even when just showing help. Add an early return when config.option.help is set, so users can view the help text without needing a build directory. Co-developed-by: Claude Signed-off-by: Simon Glass --- test/py/conftest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/py/conftest.py b/test/py/conftest.py index bd0c226276a..8efbe0d01c6 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -239,6 +239,10 @@ def pytest_configure(config): Returns: Nothing. """ + # Skip full configuration when just showing help + if config.option.help: + return + def parse_config(conf_file): """Parse a config file, loading it into the ubconfig container From patchwork Mon Jan 19 20:40:56 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1633 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=1768855333; bh=YCtgCUzrgS7tq4O6FGZymxgx362aj+9AxnHejl4BhoQ=; 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=iA0lE6N49DpMKkUYuiyxE0sFwlH0qsMwqVVdxKoZJ+ahEPqKK1b0BTYJo7UGeuzk9 /FVHK122y3d6he1NMOoQLR19iyt8F58/KEZ1W6z7qg7pvxH2GEYzqO38+KFBfUp/TM ZC5kgkDvzcRjsKOmlJs/R+qPBNLlV3ZZlnIkSbTWrD+IO4mWCPj168/fwYfZdkZMDh 7PBYJ+frhfEnrVnXf3KuuKn2FOmeEGRQHGN/2E+o2czerk0tCHR26EO8Cr/GM8BmGK wiOFo4PlsYWeALTzhb5LjvjWgv+iw73lvW/Q0qK+J44TAu+fTsQPEpXl6m737gNTCF tgQWliqZTFcuA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BFD1469513 for ; Mon, 19 Jan 2026 13:42: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 JgIbLUAijlI4 for ; Mon, 19 Jan 2026 13:42:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855333; bh=YCtgCUzrgS7tq4O6FGZymxgx362aj+9AxnHejl4BhoQ=; 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=iA0lE6N49DpMKkUYuiyxE0sFwlH0qsMwqVVdxKoZJ+ahEPqKK1b0BTYJo7UGeuzk9 /FVHK122y3d6he1NMOoQLR19iyt8F58/KEZ1W6z7qg7pvxH2GEYzqO38+KFBfUp/TM ZC5kgkDvzcRjsKOmlJs/R+qPBNLlV3ZZlnIkSbTWrD+IO4mWCPj168/fwYfZdkZMDh 7PBYJ+frhfEnrVnXf3KuuKn2FOmeEGRQHGN/2E+o2czerk0tCHR26EO8Cr/GM8BmGK wiOFo4PlsYWeALTzhb5LjvjWgv+iw73lvW/Q0qK+J44TAu+fTsQPEpXl6m737gNTCF tgQWliqZTFcuA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AE11A694CE for ; Mon, 19 Jan 2026 13:42:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855331; bh=5C0ICCeblOCxV6DwFZK3s2C0S3lG4iiHEKKH51YKnXY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HnFc2wFO+NpOA+m4HIN8VkRQ3knzE3FXnqKZHFECNvuQLm2XiTVU84wpXuLaNWUq6 yk9uMZn1GLH22U58XWtp0w3jabuBCpnuOuT3mv6EsrgPWk5WyvoTViT626JHH8Wfak i+NQ7CAsgic3OqStldvcitl/SWi22Jx81oAw68CrdGsTOtLQgpmW39jQMVfVhHHGL7 oT+Oqza9mARUwEfBhUWQsgik7iF+iJwzcRXuIcZ+50ufo1lOx2whm8Yc5i/DwTdwem oZxc0+hWx+CNXLnNu4a7wpN12PsKVug/GDuE6j2q+d+0wBQ2j3thwt3K5WIQk2ZDgY 6/jituEJjvQ4w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3A352693E3; Mon, 19 Jan 2026 13:42:11 -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 oUt-PuOAXovJ; Mon, 19 Jan 2026 13:42:11 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855317; bh=cHHQ+7BtROgumH8aqOxXt1gAqGYCLdXY+Z4DLBtFh4E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=K0c3Od5Q2f718B0NCgYDniUp8GWOCccbDCsVtGjjV6kzxhxPCa1HHCZMXoK+BwdJH 8N0BCVZeJ0DmsCcN9l2JlyhE+TrgceAGYhj4vfIQpiRg+zAqvnPvNgLWCErcS4qqVj p12fCkXSvrUCWaS7TGZSXi3AI+egWxNZ5asRIAXAYLNcZCQiBgMdscPLgo0j+GjsK4 JRkD+iH9PvV2mdiJI4tMvD03+KXOFnwQShq3PWJ4U4ovizBABTVHEGel3J3Z/M5IgG it43ctpRHwi1SEtBK577q7HUn31heZDtI+1QLCRGMKaz2be3VlDcxE/FAECfEvJDJw AXPqC4Qafg4rg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 41AE5694CE; Mon, 19 Jan 2026 13:41:57 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:40:56 -0700 Message-ID: <20260119204130.3972647-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: H4PABLHXJKCOLUG4YVPYIJISLGKFZUVN X-Message-ID-Hash: H4PABLHXJKCOLUG4YVPYIJISLGKFZUVN X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 03/27] proftool: Fix funcgraph depth for exit records 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 funcgraph format requires entry and exit records for the same function to have matching depth values. Currently, exit records have their depth written before decrementing, causing trace-cmd to display incorrect or missing function exits. Move the depth decrement and stack handling to before writing the exit record. This ensures entry at depth N writes depth=N, and exit for the same function also writes depth=N. Fixes: b54d8cf0b5b8 ("trace: Support output of funcgraph records") Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/proftool.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/tools/proftool.c b/tools/proftool.c index c7b427f3078..1f7df6d1973 100644 --- a/tools/proftool.c +++ b/tools/proftool.c @@ -1435,6 +1435,21 @@ static int write_pages(struct twriter *tw, enum out_format_t out_format, tw->ptr += tputq(fout, text_offset + caller_func->offset); } else { + ulong func_duration = 0; + + /* + * For funcgraph, entry and exit of a function must + * have the same depth. Decrement before writing the + * exit record. + */ + if (!entry) { + depth--; + if (stack_ptr && stack_ptr <= MAX_STACK_DEPTH) { + ulong start = func_stack[--stack_ptr]; + + func_duration = timestamp - start; + } + } tw->ptr += tputl(fout, rec_words | delta << 5); tw->ptr += tputh(fout, entry ? TRACE_GRAPH_ENT : TRACE_GRAPH_RET); @@ -1449,14 +1464,6 @@ static int write_pages(struct twriter *tw, enum out_format_t out_format, func_stack[stack_ptr] = timestamp; stack_ptr++; } else { - ulong func_duration = 0; - - depth--; - if (stack_ptr && stack_ptr <= MAX_STACK_DEPTH) { - ulong start = func_stack[--stack_ptr]; - - func_duration = timestamp - start; - } tw->ptr += tputl(fout, 0); /* overrun */ tw->ptr += tputq(fout, 0); /* calltime */ /* rettime (nanoseconds) */ From patchwork Mon Jan 19 20:40:57 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1634 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=1768855336; bh=z6ABGwOGiiSONTOjwqoAuKHBpTbmi9sS3B2VgMtn+50=; 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=a5cUaRO4D8Suk56nEN7+5a13sv5hyb5KPk8rznQcPy6IjC/HM0G0QCJaqDhXClD72 btjaMy4HPrdbSTS1lXZVqb2JrhgcOjufaqlrAku7NysLhGuTRoWMi9pBX5Q5O8X+s9 LAvhA9Gx4kt96KJ2WzoX9tT8YbRglDvZHyxG/P6SPt0cNKD75PKClKE6VaIAJJca/a FBgut477PISi4sn9rNeZ+DhXzzsDlvmhxVWxLwVp35Ee1WeBTB0R2wvXcKmZYcnOF8 mB5V+oWeBHvDhQv6AqZOHC19JRerEhcDl/y6Gu7LcSw4XJC/1C/RjqQkPfZOG0csTN eHi5TDW/O+diQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 403F76951C for ; Mon, 19 Jan 2026 13:42: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 XE8WNkHzRBz6 for ; Mon, 19 Jan 2026 13:42:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855335; bh=z6ABGwOGiiSONTOjwqoAuKHBpTbmi9sS3B2VgMtn+50=; 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=KKZwu8GjGstqNGK+/5wpWvbbAvJ61z/pyhZP/SICuivMFxGZfOZP6S7mlgd910bLZ yLAmffTdrdARXZZbUiObmAgACOXOkUQuQH/8pvE5of9rarsXFM1JN3h6tgwp0N2nKO UTVjXSJZ2It5+3cd1rCvsszsou1d8YmO1OqucJFI8Zcbi9IZMPSZiQm52rdm3TEJ0b XJwWYmHRj/wdnhcms4LUATcqX4Dj5BpgfDzsCV/jdL/J+4JA68o91SajHCWmNQ3bNY x/gUXRBn6GXflWMFlvTiIFGaMx9aIAl/OR85LiXKLsXl5h70+vQHJH6XbRJck5Tm09 DcU88C5I2am8w== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3A10F694CE for ; Mon, 19 Jan 2026 13:42:15 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855333; bh=NY4izJIMEcN8xnzb+ZUe+86xT3KQmK336d6VZE1IJjA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QYHRfnwMYsgJngJDiBqEXZxV3K+vBUZLbngISf9i92qE9M5DzEobDlU9qr2zEvcz5 INKpj6mWMqJD2li/QSnbeR2Fgqk3kqp/FP69bgN+odvRv84+s1IrY5sdTzTpadzYdp 5JWv6TrnRqlgbylJ7hoq/aX62Fk1WiB9KZdJy6aKVn1lM3GijWIYbfaYfQUpQ42JkP s82Pqr29tLaU1LPNDjpl0FMeq4J21sTbEqwFX781PGJ0lMuW2DRWF2b40AQbvpmnAA s0iCV7nQe3+5AbJ/HYEI+V98w8nECDbhwHjA/UIcOTq7h2kcReOn8TvrEaqkT26zYb zOoqOaclOjriQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1B8D0693BA; Mon, 19 Jan 2026 13:42: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 AoU4xrlH3wwd; Mon, 19 Jan 2026 13:42:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855329; bh=3sTbFFC/2fxjMGWfQVGT3MATTaXonds3IHz9AcjKpuM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=isnSwCsNkPEctoR2xW0sh+G6+8zyh0sm6l7xvYKJbmqz10y/hTjhYHQF+jebh0wlo h/rJI1p9I8hx5pi9dfPAtaUao0zCj60ZvDKOg8hmdUgaixk7wokd1/KEwfGBVXLQwk +1dHHOe2x0FrJJG7Kq4gzmwDgTQ43s6z4WwMMPDOfT8/OHYobg323ugt2gZcR/f1Jq YFAG9kILkBpLYmZOvSmD96DjpFE+qr5gen7SZBeUmSMA+O7MZ2DO5VJpsUXoYMPuEv 5Nn5IuyUpPK5yz+l3ffmnJNJACVM0K2+O2h0oGbGIJHtnLdCh4V+DfOv0wU1qQRcHZ Zhu8ZQ7xATHjw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B606B69504; Mon, 19 Jan 2026 13:42:08 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:40:57 -0700 Message-ID: <20260119204130.3972647-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: HGEEBMEWSJPVM7HHBBRVF3XLT2WHHZIG X-Message-ID-Hash: HGEEBMEWSJPVM7HHBBRVF3XLT2WHHZIG X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 04/27] test: trace: Remove stale trace file before saving 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 sandbox filesystem's host save command does not truncate existing files. If a previous test run created a larger trace file, the extra data remains when a smaller trace is written, causing proftool to fail with "Cannot read trace file" when it tries to read past the actual data. Fix this by removing any existing trace file before saving. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- test/py/tests/test_trace.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/py/tests/test_trace.py b/test/py/tests/test_trace.py index fcdcbe2c6db..0bddf408833 100644 --- a/test/py/tests/test_trace.py +++ b/test/py/tests/test_trace.py @@ -65,6 +65,8 @@ def collect_trace(ubman): out = ubman.run_command(f'trace calls {addr:x} {size:x}') print(out) fname = os.path.join(TMPDIR, 'trace') + if os.path.exists(fname): + os.unlink(fname) out = ubman.run_command( 'host save hostfs - %x %s ${profoffset}' % (addr, fname)) return fname, int(dm_f_time[0]) From patchwork Mon Jan 19 20:40:58 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1635 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=1768855340; bh=7HWz9cbDC3h8w119XdBNUtYIOxApI6igJsl7VLzzNNw=; 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=rwNgo2vLGdnEU8Ad0h7aA1e4AsNl0ChJULXAWtSPDkHDHONP1jcKVrgBevDRGxGw0 x0jWWkaowaYGsjc6b7E+Mq3BNOYp8xYPIZpvkzb59i2Fub622DzpXmm3Px2gfhqefb 75TpmX+I+yz6TDh8QZDw4L2qfYLOT6LDKsdQtBTYXr050N9oP16DoYJoFWhl75xgqy bH9d3m6G3kgdVPYc7eiIBvuAdvCInJoLrTOkIseZ9eTL7IBjBwL3nvIzbBvL//o2z3 stXIB4ECAyq1QewN1zs+l4VsB1swkhSZPxTlKI9CAbdBBlOahSpKLscwsrEM2PvCvE xB17eriTHhCvA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BE8236950F for ; Mon, 19 Jan 2026 13:42: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 Mj8mu0WIzIlZ for ; Mon, 19 Jan 2026 13:42:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855340; bh=7HWz9cbDC3h8w119XdBNUtYIOxApI6igJsl7VLzzNNw=; 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=rwNgo2vLGdnEU8Ad0h7aA1e4AsNl0ChJULXAWtSPDkHDHONP1jcKVrgBevDRGxGw0 x0jWWkaowaYGsjc6b7E+Mq3BNOYp8xYPIZpvkzb59i2Fub622DzpXmm3Px2gfhqefb 75TpmX+I+yz6TDh8QZDw4L2qfYLOT6LDKsdQtBTYXr050N9oP16DoYJoFWhl75xgqy bH9d3m6G3kgdVPYc7eiIBvuAdvCInJoLrTOkIseZ9eTL7IBjBwL3nvIzbBvL//o2z3 stXIB4ECAyq1QewN1zs+l4VsB1swkhSZPxTlKI9CAbdBBlOahSpKLscwsrEM2PvCvE xB17eriTHhCvA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AD160694CE for ; Mon, 19 Jan 2026 13:42:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855338; bh=a9DALZ9QUT3Ir+hWZrQZpCDetZGQHH76ox7PjKD3TDs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XjLuMuGgEKNEoeozaTpbxPUJZnxExEHtOhULdQYT4zzpay8Z7OXxcfb2qZaDpDP7X 7UmCWVMsZXEdYP0n3sPU5XeUwFRVBzBvQrK3cUFbOd1kXpi3IwM7beKeXBkZBvsWnl /AdKGRFlT6FNJiKUI+q6HnsT5o3L8G1EoeIDyd6miXCvV6feAn8eGm5JaJBrTFktVI Yvy3GnTxjITSvwo/GC4SHST7FFe3HLwlB6NNivxuORt5MioA7xvi5x6mVmeHNstMOX omkjjd1jUoSLMYFD1TRB6NVX7ALq2YYMlqIU1gBfFLbY7EFxyS3eK0SdjulEl+o5uk ldqLffJ0EPRyA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9D593694CE; Mon, 19 Jan 2026 13:42: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 AE8CVv3rXWRO; Mon, 19 Jan 2026 13:42:18 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855333; bh=onqr3kgXhDVKYrkjM3XnxVmkDrPwMAWd4VotdyjyTkk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S1uBiDI2i0gLrrJU1M9FT4lAomxgHB/LpOO3tPfJ27JEzAy6YtPwdMIHcltOBzLGf B6f34Kd2V2y0Dyqif1NR2BIl7/sgzz92GsnozpnrCjcl7UrqtHfsHbpkhpWuU+6lCU fsQwP3sOxainq+KE7ctWa3F1wN3ukyAdxvI63CC0H/G70ePFqYxTJnEwZ5eCn+yPd3 +wAMjqPCzPsdXZAl/aU3F21ZBwcCglfRK/3zWYGLjiPrEncjzNJjaQ0GBEG0TVBqm9 Sl4a/eyc5GcdgYUPXRbCEUW1+XpFLCo7g8vlMkcUhKQzUke3O5n/s4eGd17RgtU4Kj Nnod9LKxJjEJA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 584A1693E3; Mon, 19 Jan 2026 13:42:13 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:40:58 -0700 Message-ID: <20260119204130.3972647-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 66XT3O4QQW5D4JNZJJRPCLTXAATB24ES X-Message-ID-Hash: 66XT3O4QQW5D4JNZJJRPCLTXAATB24ES X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 05/27] test: trace: Fix funcgraph check for matching exit indent 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 check_funcgraph() function looks for initf_bootstage() entry and its matching exit brace. Fix two issues: 1. The expected_indent should match the entry indent, not child level (indent + 2 spaces). Entry and exit braces are at the same level. 2. Increase head limit from 70 to 100 lines. With the log_file driver enabled, there are more traced function calls and the exit brace may appear beyond line 70. Fixes: 6acf4a242f27 ("proftool: Fix funcgraph depth for exit records") Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- test/py/tests/test_trace.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/py/tests/test_trace.py b/test/py/tests/test_trace.py index 0bddf408833..498949372aa 100644 --- a/test/py/tests/test_trace.py +++ b/test/py/tests/test_trace.py @@ -189,7 +189,7 @@ def check_funcgraph(ubman, fname, proftool, map_fname, trace_dat): 'dump-ftrace', '-f', 'funcgraph']) # Check that the trace has what we expect - cmd = f'trace-cmd report -l {trace_dat} |head -n 70' + cmd = f'trace-cmd report -l {trace_dat} |head -n 100' out = utils.run_and_log(ubman, ['sh', '-c', cmd]) # First look for this: @@ -221,7 +221,7 @@ def check_funcgraph(ubman, fname, proftool, map_fname, trace_dat): break elif func == 'initf_bootstage() ': found_start = True - expected_indent = indent + ' ' + expected_indent = indent elif found_start and indent == expected_indent and brace == '}': found_end = True From patchwork Mon Jan 19 20:40:59 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1636 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=1768855345; bh=phaa0Ri2Bpcqb/GII1/jbduQ8VGldgUI5hoklcE4FoY=; 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=N8vp5zWNfAWl0qhf6TrcqRU7hlQ7XmtKpg3dXiDsrphbonDoGvrIjoU0Dk3LK9JUY 6YFOF9qYkZ3l60SUKpruDq4+tk6MKmelZLsYwxi1PrrUrPdfn/J8FQd1xKtDYp2r4+ xB72GEOvNFCs3TJ2iQ4rmaj6STJqdyAQYSNqtEfRWfXNkbCoMp+CT+fJPvcJKbpY+B ExWY+rqTS0ktYUBjWoSXFV/5t3mIiWL9WwwHy6JYAV47gEYH65+hb4w8uBYnRfO4yV JYzh8dJWUEbDcO8E2haA3K7G4HdLug5CoXvG/QGJpdXhYvR5YSWU2VwcKGhMN/adTF wfN+Jxl5KBOoA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 563A069504 for ; Mon, 19 Jan 2026 13:42:25 -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 rG2oWtcZgpMl for ; Mon, 19 Jan 2026 13:42:25 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855345; bh=phaa0Ri2Bpcqb/GII1/jbduQ8VGldgUI5hoklcE4FoY=; 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=N8vp5zWNfAWl0qhf6TrcqRU7hlQ7XmtKpg3dXiDsrphbonDoGvrIjoU0Dk3LK9JUY 6YFOF9qYkZ3l60SUKpruDq4+tk6MKmelZLsYwxi1PrrUrPdfn/J8FQd1xKtDYp2r4+ xB72GEOvNFCs3TJ2iQ4rmaj6STJqdyAQYSNqtEfRWfXNkbCoMp+CT+fJPvcJKbpY+B ExWY+rqTS0ktYUBjWoSXFV/5t3mIiWL9WwwHy6JYAV47gEYH65+hb4w8uBYnRfO4yV JYzh8dJWUEbDcO8E2haA3K7G4HdLug5CoXvG/QGJpdXhYvR5YSWU2VwcKGhMN/adTF wfN+Jxl5KBOoA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3D836694CE for ; Mon, 19 Jan 2026 13:42:25 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855343; bh=v+i4zl7zXzRvfZ8xK6A2BT9r2yEDUtgt+8x2aqwZXBk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ojoa19rNHF2vTzkB3k8YdRTUTTUe7Rv9FHrSFx+U4os7pG3Zyrsc2aDaXeVMGeFbx uVAtJ6P2zM7cWEUTO/iySURMG29GdhSVOHuG1wvULrZHDtI7M4R7+rcPCTI3/fihoa QYJdPewlL8Fi85OWp6nvWE6P1MMiTFVIrGsI8VYzbNGIWxkHlEZUfx+hvXQ2uJDV+U qEvIaNt49Gf51R+gbWiJVVNKb+jn+QSArO6kARzAoYIshmb1qc2JPKRJxtYUuo7szo rGInBYJOcn7qJ1BNIRdAI+jSGwL/7Za32+3/8BcziyguxsVf+N/fXbsC05geFQt1IJ 6yvbxm8oraWXQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 46022694CE; Mon, 19 Jan 2026 13:42: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 3Lr0WS4rTcF5; Mon, 19 Jan 2026 13:42:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855338; bh=nPN/OwiF7XVfr6L12Js1xM/iCZXJhMOycsKA46E+RM8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XKShZoaoPciHjguxfqTuDzjTRPITK92+w17iG0ffHtRy1RQtpN1Sq/bCDXmrK1aDA g9mNYfS+UdB+5+uIYAqKuX3pQYrRHQJCA0Eg3hMy/MWudJgOAoeVsakw22fDmDD7UZ tTrY+/8Uzz3O+91HXvb3DAgUxORk3dMfqUooaQumBOM0jdrJgw8oOUEOnT7XmD1s5l zKMh+g4hKPNBaHNK5RTEhm/HykeNVKkYob5c4oAfCorKmKpb2pL4Ewj2P6TXx+Frhz t6NkVRZeWBAukGk1MOiC0CdOImdnfDmZrFUiYz0qmGwuFOmeTi9Cw/UbFjae+KFxeU +KtxX5qa+V8UQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id DDAB6693BA; Mon, 19 Jan 2026 13:42:17 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:40:59 -0700 Message-ID: <20260119204130.3972647-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: C6C62W773NZDAETBT755WEAX3546MFJB X-Message-ID-Hash: C6C62W773NZDAETBT755WEAX3546MFJB X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 06/27] pickman: Handle qconfig resync commits specially 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 Commits with subject "configs: Resync with savedefconfig" run savedefconfig on all boards. These cannot be cherry-picked directly because the defconfig state depends on the target branch's Kconfig options, not the source branch. Add detection for qconfig resync commits and instruct the agent to run ./tools/qconfig.py -s -Cy instead of cherry-picking. This regenerates the savedefconfig changes based on the current Kconfig state in the target branch. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/pickman/agent.py | 44 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/tools/pickman/agent.py b/tools/pickman/agent.py index b081c36b504..589d61b727a 100644 --- a/tools/pickman/agent.py +++ b/tools/pickman/agent.py @@ -24,6 +24,12 @@ SIGNAL_SUCCESS = 'success' SIGNAL_APPLIED = 'already_applied' SIGNAL_CONFLICT = 'conflict' +# Commits that need special handling (regenerate instead of cherry-pick) +# These run savedefconfig on all boards and depend on target branch Kconfig state +QCONFIG_SUBJECTS = [ + 'configs: Resync with savedefconfig', +] + # Check if claude_agent_sdk is available try: from claude_agent_sdk import query, ClaudeAgentOptions @@ -45,6 +51,18 @@ def check_available(): return True +def is_qconfig_commit(subject): + """Check if a commit subject indicates a qconfig resync commit + + Args: + subject (str): Commit subject line + + Returns: + bool: True if this is a qconfig resync commit + """ + return any(subject.startswith(pat) for pat in QCONFIG_SUBJECTS) + + async def run(commits, source, branch_name, repo_path=None): # pylint: disable=too-many-locals """Run the Claude agent to cherry-pick commits @@ -70,13 +88,18 @@ async def run(commits, source, branch_name, repo_path=None): # pylint: disable= os.remove(signal_path) # Build commit list for the prompt, marking potentially applied commits + # and qconfig resync commits commit_entries = [] has_applied = False + has_qconfig = False for commit in commits: entry = f' - {commit.chash}: {commit.subject}' if commit.applied_as: entry += f' (maybe already applied as {commit.applied_as})' has_applied = True + if is_qconfig_commit(commit.subject): + entry += ' [QCONFIG RESYNC]' + has_qconfig = True commit_entries.append(entry) commit_list = '\n'.join(commit_entries) @@ -86,7 +109,7 @@ async def run(commits, source, branch_name, repo_path=None): # pylint: disable= if has_applied: applied_note = ''' -IMPORTANT: Some commits may already be applied. Before cherry-picking commits +IMPORTANT: Some commits may already be applied. Before cherry-picking commits marked as "maybe already applied as ", verify they are truly the same commit: 1. Compare the actual changes between the original and found commits: - Use: git show --no-ext-diff > /tmp/orig.patch @@ -99,12 +122,29 @@ marked as "maybe already applied as ", verify they are truly the same comm proceed with the cherry-pick as they are different commits. ''' + # Add note about qconfig resync commits + qconfig_note = '' + if has_qconfig: + qconfig_note = ''' + +IMPORTANT: Commits marked [QCONFIG RESYNC] need special handling. These commits +run savedefconfig on all boards and cannot be cherry-picked directly because the +defconfig state depends on the target branch's Kconfig options. + +For [QCONFIG RESYNC] commits, instead of cherry-picking: +1. Skip the cherry-pick for this commit +2. Run: ./tools/qconfig.py -s -Cy + This regenerates the savedefconfig changes based on the current Kconfig state +3. The qconfig.py tool will create a commit automatically with the updated defconfigs +4. Continue with the remaining commits after qconfig.py completes +''' + # Get full hash of last commit for signal file last_commit_hash = commits[-1].hash prompt = f"""Cherry-pick the following commits from {source} branch: -{commit_list}{applied_note} +{commit_list}{applied_note}{qconfig_note} Steps to follow: 1. First run 'git status' to check the repository state is clean From patchwork Mon Jan 19 20:41:00 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1637 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=1768855350; bh=BQeWrzrCVnfX/2TWTxW0oed9x9NEYekOwXIPtu4MqH0=; 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=ZFd9/QllRQElXZWIZ0J0bW/FvTh9TUsGaC1VIm7Vl33R6VArnJED2QJxfKQYrTUaO uhbFU1lbWSCQIVarpB9FjB8toKXCinuq548U7y2iuEKWdow+kEOT+MjfKkzcKy9fpm XSGIot/Z+SAIq4xj5wvg4roT1R13RkfNA/0QOO50LEGg6DEBRptI3JOOCiOMgHBTmZ gotH6qNsDeCUrGoM9o8l8ZULTOKzYQDBT+C9Eyh/UWzo/ats4JkPP0mTtHbE3uk7PO PXvtID1GDIVS++e6ZNSKtgI4gVci4GqhVU2iVqTb9VJNSvOSzNxxKTtmM0xKGUdG5B PwSwGX5Jvuk1Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4698E69504 for ; Mon, 19 Jan 2026 13:42: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 NygoYcJCOcYR for ; Mon, 19 Jan 2026 13:42:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855350; bh=BQeWrzrCVnfX/2TWTxW0oed9x9NEYekOwXIPtu4MqH0=; 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=ZFd9/QllRQElXZWIZ0J0bW/FvTh9TUsGaC1VIm7Vl33R6VArnJED2QJxfKQYrTUaO uhbFU1lbWSCQIVarpB9FjB8toKXCinuq548U7y2iuEKWdow+kEOT+MjfKkzcKy9fpm XSGIot/Z+SAIq4xj5wvg4roT1R13RkfNA/0QOO50LEGg6DEBRptI3JOOCiOMgHBTmZ gotH6qNsDeCUrGoM9o8l8ZULTOKzYQDBT+C9Eyh/UWzo/ats4JkPP0mTtHbE3uk7PO PXvtID1GDIVS++e6ZNSKtgI4gVci4GqhVU2iVqTb9VJNSvOSzNxxKTtmM0xKGUdG5B PwSwGX5Jvuk1Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 35AA3694F3 for ; Mon, 19 Jan 2026 13:42:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855348; bh=6CcAzxv1BGagpAYR1h3cPGHAAlb0AQkkKiEpfb+Omto=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nn/YTkNvqWYbI/0MMph32W5P5wAkES6U5NCwyw+RhnKuZkFlqW3wC6zdZSMDOu84G hP1/eNu+po5Ma4zO7OOrTIpF7LG2UaG0TO1PyRhW803j0HPSHNRiOggqy1dwzxrYX0 rFpLInspBBdQ/B7ao/LGfvVTuUrxbppJDz9TZpG0ZuhZMA3jQnNyDa5bMkkCQVP3es U99M5fEAmeLzdt75lD1t1oDyF0AzCGedUDAU2Jtm/UeV5unw36DFqIiffq99lcmGnP Reys0ICGd738gdkDFLL5EGG/9Cbk8KW1lJFHMsO7oEIyQmqGgWrTCj9qb4cIZMxfIV FaZZBvqKNP2Aw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2D4A7694CE; Mon, 19 Jan 2026 13:42:28 -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 mdImE-I5coUB; Mon, 19 Jan 2026 13:42:28 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855342; bh=/4D6j6MIML0YNElhrlaAdb2++XyKXMQsVY8vjlqwEtA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QPJ+dOdO8yMr1lGEnDLyIAfQ+m9Ov7hsAl8a6y+DNWlOq+HhbVXgygTkNLDh+UlVg q+b8aE6BgI3QvFIZ/vKRZe7JPIDNk+9smeLf5dWG0eoLcvro0O43VpTINuK/vVfZfn vKjgFy3SG+zKSiYggNV9SDuqxXaT7wk89dKfs5Vy+ga3eZCeeQgKNVHGLBCMkkykA4 vItKAQt2E8Vx8sKWXvUXxjWD5BRp7NQtQdyrQcm5lMBs6mV4QFIhKB2heWApNpaonF USoQsnpLMbSjHy/Hs2InOGIxg7kudJXYsSJS/b35pgIm/IYw/v47T7/Hm5kwvhSSgo a5YxCcwSUrlhw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id A39D6693E3; Mon, 19 Jan 2026 13:42:22 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:41:00 -0700 Message-ID: <20260119204130.3972647-8-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: U6KVT7AAHAZTDKTSFQ7ROA7ODZRVP4H4 X-Message-ID-Hash: U6KVT7AAHAZTDKTSFQ7ROA7ODZRVP4H4 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 07/27] sandbox: test: Add bootph-all to pinctrl-single for serial 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 running sandbox with -T (test mode), a warning appears: pinctrl_select_state_full() sandbox_serial serial: pinctrl_select_state_full: uclass_get_device_by_phandle_id: err=-19 This occurs because the serial device has bootph-all and is probed early, but the pinctrl-single node and its pinconfig child are not bound yet. Add bootph-all to the pinctrl-single-pins node and its pinmux_uart0_pins child so they are available when the serial device is probed. Co-developed-by: Claude Signed-off-by: Simon Glass --- arch/sandbox/dts/test.dts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts index 7a67565e4a9..7716140f2bf 100644 --- a/arch/sandbox/dts/test.dts +++ b/arch/sandbox/dts/test.dts @@ -1874,6 +1874,7 @@ #pinctrl-cells = <1>; pinctrl-single,register-width = <32>; pinctrl-single,function-mask = <0x7f>; + bootph-all; pinmux_pwm_pins: pinmux_pwm_pins { pinctrl-single,pins = < 0x48 0x06 >; @@ -1893,6 +1894,7 @@ 0x70 0x30 0x74 0x00 >; + bootph-all; }; }; From patchwork Mon Jan 19 20:41:01 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1638 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=1768855354; bh=rdqIrbfC0H5QeYwxqDWgjGH3Lj+EBp6xvwBlomT6m9w=; 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=KI9ztg0a6qIx3SY4LJiI1S3Y5uvDggpwf4gb3JyNHYZ+wrjNJni5Lo92XFBbTgEJc x8SgU5foPT7W6oMkl2FDuZeYPiwLJ4h84rENTLJViIrXggp1veGNLNWXD9Eqo2CHLS Bi2AwOudEuozvb9w5x4fNRaeKPXiGBQJ7+w7PdxFmPsG6SSteVFPfiN/BnKOdGh7Em rKYz1m8NcL9EqBrkSSM/h2nF+oR9tRgMSog4XLoORMrp0dZF8fCYFQQiQrKPU0jHZi VBkG+8RbCpm3KgJlbq00wdFCdlO0IhJHXnAjeklrtzYOyJjsarF7vF1F8nJnFXcwBt Orbu+2hkhTW5g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BA91769504 for ; Mon, 19 Jan 2026 13:42:34 -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 aoAhuHNvDqhO for ; Mon, 19 Jan 2026 13:42:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855354; bh=rdqIrbfC0H5QeYwxqDWgjGH3Lj+EBp6xvwBlomT6m9w=; 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=KI9ztg0a6qIx3SY4LJiI1S3Y5uvDggpwf4gb3JyNHYZ+wrjNJni5Lo92XFBbTgEJc x8SgU5foPT7W6oMkl2FDuZeYPiwLJ4h84rENTLJViIrXggp1veGNLNWXD9Eqo2CHLS Bi2AwOudEuozvb9w5x4fNRaeKPXiGBQJ7+w7PdxFmPsG6SSteVFPfiN/BnKOdGh7Em rKYz1m8NcL9EqBrkSSM/h2nF+oR9tRgMSog4XLoORMrp0dZF8fCYFQQiQrKPU0jHZi VBkG+8RbCpm3KgJlbq00wdFCdlO0IhJHXnAjeklrtzYOyJjsarF7vF1F8nJnFXcwBt Orbu+2hkhTW5g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AA67D694CE for ; Mon, 19 Jan 2026 13:42:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855352; bh=AnbYsXvYWPhruPFjpOdmZ+C041lj/rRssE62pTt406o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rIMf4OFJ3Ov5ZNRH+cjhiOhWWjWHBCHKIl+dIrPuxxD8tSa6yzlPz/UCfQLGAZzkP 5zBUEUKMZNFuxcFmfqTWam7JFk26JzaeUHFUaXwxUc10qUm2BBO3D2eLQy06N5gVbA lKOVfVB6ajepE6K6D2+0RWDlZPJX8LKZfYC/ayxfuo8Cw2RhABFMzEiUnOUoB3GVHu iuNiI17IZiZq9P4d60xfbEqEogB70QJ+ovijSCrLUWj2xdxd24WQVVo2w53zyRnaF+ HpNJGpqIZTAz+QeIE9OxgqShjzRbCZx27c3yYLd6oLhHklfHqIulXBrf1Y4TVro3ig u1kUTu2idSI6A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A0AA7694CE; Mon, 19 Jan 2026 13:42: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 9Hm3q0Ez9RXl; Mon, 19 Jan 2026 13:42:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855347; bh=b6AbT1BFcxf9bi+q2pihXEVG2mys7LYQuRqRL2Yqat0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F5WcIhwjwjafz4ODNev6NkRpcNXT5UHaw3JUrhiAn+c16QIiUGIDpNeT4ea/In70k OdwtHl+aPVZ0F/9aPjAgDYa7oYTzdvQJLWHl1AJqWU9ZnQp/r3ghdaYyoNoIyqmrZb 1DE8osqCMF0zYkQNkJk/4zzlV9swuj/HoIEnG7EBcvzeV9SGrzu62yGgdwZCblz39B grONGZw1pAknxchd7QFiIbspg1k9QKubx0uumfTZaBVZCezHMh+7YBB9g9epw15Ch9 0ov7yZMo6s8RTTt34IB8hES794U2dh6g+Og9UtbF8sB1U2ybHaoYSgm1qibj55Bwfr V0tjQjz1pX61A== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3FF75693BA; Mon, 19 Jan 2026 13:42:27 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:41:01 -0700 Message-ID: <20260119204130.3972647-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: W3EJWTZTEROGXKX6RIRQ5VVZT4CN54RD X-Message-ID-Hash: W3EJWTZTEROGXKX6RIRQ5VVZT4CN54RD X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 08/27] test: dm: rtc: Fix flaky dm_test_rtc_dual test 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 test compares times from two RTC devices to verify they can operate independently with different offsets. However, it is flaky because now1 is read with use_system_time=true (using live os_localtime()) while cmp is read with use_system_time=false (using the fixed base_time captured at bind). If exactly 1 second elapses between emulator bind and test execution, the times accidentally match and the test fails. Fix this by: - Reading now1 after switching emul1 to manual mode, so both reads use the fixed base_time - Using a 10-second offset difference instead of 1 second, to account for the fact that each emulator has its own base_time which could differ slightly Also remove the unused now2 and offset variables. Co-developed-by: Claude Signed-off-by: Simon Glass --- test/dm/rtc.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/test/dm/rtc.c b/test/dm/rtc.c index 88f080b64a8..b2687bde433 100644 --- a/test/dm/rtc.c +++ b/test/dm/rtc.c @@ -281,23 +281,30 @@ DM_TEST(dm_test_rtc_reset, UTF_SCAN_PDATA | UTF_SCAN_FDT); /* Check that two RTC devices can be used independently */ static int dm_test_rtc_dual(struct unit_test_state *uts) { - struct rtc_time now1, now2, cmp; + struct rtc_time now1, cmp; struct udevice *dev1, *dev2; struct udevice *emul1, *emul2; - long offset; ut_assertok(uclass_get_device(UCLASS_RTC, 0, &dev1)); - ut_assertok(dm_rtc_get(dev1, &now1)); ut_assertok(uclass_get_device(UCLASS_RTC, 1, &dev2)); - ut_assertok(dm_rtc_get(dev2, &now2)); ut_assertok(i2c_emul_find(dev1, &emul1)); ut_assertnonnull(emul1); ut_assertok(i2c_emul_find(dev2, &emul2)); ut_assertnonnull(emul2); - offset = sandbox_i2c_rtc_set_offset(emul1, false, -1); - sandbox_i2c_rtc_set_offset(emul2, false, offset + 1); + /* + * Put both emulators in manual mode before reading, to avoid a race + * with system time. With use_system_time=true, times are based on + * os_localtime() which advances with real time; with it false, they + * use the fixed base_time captured at bind. Use a large offset + * difference (10s) to account for the fact that each emulator has + * its own base_time, which could differ slightly. + */ + sandbox_i2c_rtc_set_offset(emul1, false, 0); + ut_assertok(dm_rtc_get(dev1, &now1)); + + sandbox_i2c_rtc_set_offset(emul2, false, 10); memset(&cmp, '\0', sizeof(cmp)); ut_assertok(dm_rtc_get(dev2, &cmp)); ut_asserteq(-EINVAL, cmp_times(&now1, &cmp, false)); From patchwork Mon Jan 19 20:41:02 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1639 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=1768855358; bh=5ReHzoKmodMk0tkA1Gy5LUZVEmsWmBvhHi65Iz0nGkk=; 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=ibnPmwVHTaEdIudh8G8ZKZWaTiZd813RtO85IBvsoPCPB6NGsYix0D0eyVbZCaKa1 EgfKc9U7CMIWILO0EyGCzqDC/80f+m3P4MCOztcYNLYlrQ1j3sXoctUYAQOJSAMaMa QIuf6HQHu35i56bCjxQzIgfsfNts85LRFTendTDPA9JdEMnW0tHa6ac+gVnkXTPem1 ReyH4kMitu3FFu1cnK8gufZTZ4VzvQ2r7agtfqso8xW/kiam5dd57o0sYQwSzf9Pmg Ods01PxtzAYDdW7/WFNcn8PVnVcRLeX0g6hjQ7G+pfatTTwZ4/HbgVpz1hav5YpZaI Q+7poiaxPlAkg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2878369504 for ; Mon, 19 Jan 2026 13:42: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 uDu8n0YdOQI1 for ; Mon, 19 Jan 2026 13:42:38 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855358; bh=5ReHzoKmodMk0tkA1Gy5LUZVEmsWmBvhHi65Iz0nGkk=; 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=ibnPmwVHTaEdIudh8G8ZKZWaTiZd813RtO85IBvsoPCPB6NGsYix0D0eyVbZCaKa1 EgfKc9U7CMIWILO0EyGCzqDC/80f+m3P4MCOztcYNLYlrQ1j3sXoctUYAQOJSAMaMa QIuf6HQHu35i56bCjxQzIgfsfNts85LRFTendTDPA9JdEMnW0tHa6ac+gVnkXTPem1 ReyH4kMitu3FFu1cnK8gufZTZ4VzvQ2r7agtfqso8xW/kiam5dd57o0sYQwSzf9Pmg Ods01PxtzAYDdW7/WFNcn8PVnVcRLeX0g6hjQ7G+pfatTTwZ4/HbgVpz1hav5YpZaI Q+7poiaxPlAkg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 17A53694CE for ; Mon, 19 Jan 2026 13:42:38 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855356; bh=Y3MRMh3xJLtl2r5Y6wQn7fzXV+A+uttxBHxQnj1H5u4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zxozd0oLuN9rgUxQehvkOgXKdx+RPxQDOEJCea7VG6N+XXfLl7aWjcyUHwg895y8c AUAqbZu660a6ktD1ePkg34wMmgI3Y8yfFqnobFqHJaPfstBWXUL1wpEst+W9g5KSoh ufA8Ko+332m4wqghuH3cS+ZtCr8Hqa2Hl9Lt5BTa97Tat1bMZDo5v7jZ+V/qhB/tTO 4R/oX3Rc4ywNu+yH3vpHkuSSb7Xb6DxRmKJFpA2gPHGJuHFlEX/08odZCSAmREvoWi FlNPsZH07w0eBfaaAnlXJNPNjrRcXS9TsUN2k0zY4bCdEDG5AJFJ+heBEIozwEO2W1 bDzM4pzq3iHSg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 238B4693BA; Mon, 19 Jan 2026 13:42:36 -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 vEMAO0dqXUGh; Mon, 19 Jan 2026 13:42:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855352; bh=Z50doVVWogws2VEh4Mquyu8ZvYFky+NgdQvMPJmUgbs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hnm9BuxQ/NRawCQxzAcoPZkn8FJHe0+IRblxQhv2/fuOnnFV2E25QrHeYGIcBzHXb WKdyDuR/VM7fUQBCib9Ni4X3/PGgZZjl9Fb82UqX4k3G4QUkAV2a3uTzgMjD5npgQC 6ZCyEovyJr9iuXjR36oSc8b5NE4nAGbWoi+naBShcEfZZbd+l2gBnG+PNZ16XOPZTh Nl8fAYOPuHPJx0lT01tht1Cb36vwMcqqi9xiAfKxZfIb8V41MhtieUJpUD2egU3oOv spYrzD6U6n1ML8IxM5ZckZ63HQgCjw8F+dGVz3rwj/Xtlwmola/XeHVd4uAfnalJAr uDAYiZefctBtA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C9DCD693E3; Mon, 19 Jan 2026 13:42:31 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:41:02 -0700 Message-ID: <20260119204130.3972647-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: JMQYXID4EEO2JO7O6IGQF6JLBCJV7TLM X-Message-ID-Hash: JMQYXID4EEO2JO7O6IGQF6JLBCJV7TLM X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 09/27] video: Log each measured line with log_content() 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 log_debug() to log_content() for line measurement logging and add logging for the final line. This allows detailed line-by-line measurement output to be enabled separately from debug logging. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- drivers/video/console_truetype.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c index f73fb3e6595..98356de2fd2 100644 --- a/drivers/video/console_truetype.c +++ b/drivers/video/console_truetype.c @@ -1075,9 +1075,10 @@ static int truetype_measure(struct udevice *dev, const char *name, uint size, mline.len = (s - text) - start; if (lines && !alist_add(lines, mline)) return log_msg_ret("ttm", -ENOMEM); - log_debug("line x1 %d y0 %d y1 %d start %d len %d text '%.*s'\n", - mline.bbox.x1, mline.bbox.y0, mline.bbox.y1, - mline.start, mline.len, mline.len, text + mline.start); + log_content("line x1 %d y0 %d y1 %d start %d len %d text '%.*s'\n", + mline.bbox.x1, mline.bbox.y0, mline.bbox.y1, + mline.start, mline.len, mline.len, + text + mline.start); start = s - text; start++; @@ -1098,6 +1099,9 @@ static int truetype_measure(struct udevice *dev, const char *name, uint size, mline.len = (s - text) - start; if (lines && !alist_add(lines, mline)) return log_msg_ret("ttM", -ENOMEM); + log_content("line x1 %d y0 %d y1 %d start %d len %d text '%.*s'\n", + mline.bbox.x1, mline.bbox.y0, mline.bbox.y1, + mline.start, mline.len, mline.len, text + mline.start); bbox->valid = true; bbox->x0 = 0; From patchwork Mon Jan 19 20:41:03 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1640 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=1768855363; bh=zzKpnhGTgXu1URKWrngfjM3+TFhjcXB3qQYTRrU2yCw=; 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=ifCHZ3pdn+hALAs03WDPVdABybmVAlKDgM0JmSwwGoh64da6jiIU71N9KnaSme8B+ HdpZIygs8Yr9Jx7xXpOQAtk7KGZci0QNlSPIqGBylK48QlP+ywm6koMRlmJcMMWnz1 kuxMAfDuVp+sGkHXVvr6XCLLucRMqQva8LvanUvWZ4HyQ8146vU1V5KL91umY3CJ9Y 3M6ySkPBZtdKaasVrUmIbG8Is+x74GzQ2mVq438j95Wq5psazTm9yEPX14Bmk9b8Jc uDq8Njw32KdyRnBknv/7kqQAVqfCgmQOviGk+SJp/mHby7EbM06JC2JksCs+jXn1b3 VaSVRaeO1eTXg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0511D69504 for ; Mon, 19 Jan 2026 13:42: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 7LLdToNVHTUj for ; Mon, 19 Jan 2026 13:42:42 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855362; bh=zzKpnhGTgXu1URKWrngfjM3+TFhjcXB3qQYTRrU2yCw=; 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=pTeuUhm9S/4vJkBeEK2OryhulWClFi2n2buFa6uxuAFx7xIsAZZL0deS0WDvks6f9 CpqDsL3HfHPQPFjoATT67lbk+8ZPogk5+fCJbYKSJcTHtTTiQ+qlH5m/gg9pe28FJ3 XuFqZ9jtCArVBTpfyJtPpLdrhlPjP7/njey+Er3btiE9v2yIFshzKd0u1B0evxErBa UnS5ID7QU2pHDw9TaPdsAQxwbQXn6u299Yg8PX203nj+IjJWeCbAIHWGFhK2p6dK3P 7VSMRt0pn7Uapki31OBUVmEjC6BvQxeldIDe7Gh+6UQ7/uhhnkRoPdxednrdpJd21q JlN2k4ZtzGTlw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E7E04694CE for ; Mon, 19 Jan 2026 13:42:42 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855360; bh=R8AbyUtIX6OKu8ocjHu6STWPiFc4hQoNns7EEeTfH3U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w8Kw6Grunr74eOSKCvUr6MD76/COFD8HTPUIOawOKxsN8cUM9D3ZZjIQx+mflaSBK SqgxYVvdSdM7IbsUeINStDTkXC01NJb+lLOJXpahqFGgkpxjJt7JrHNKnmlrfnse8L MuDhBZhrIxSMU+6tLVChPLrw8RCpLq++AfAfqNvnR0/UECnfQoRYFYU5A51g5dT7az 68426WaCCcozpScx5slMrGaFgPInNXldHpoubEpF916QKMZ5Hevmmg/nEQ64BfBTeL Vg+EG5xyPkTxKJ+YUP+fN2Lg88z2alkSA8DhOrDv4gAGCKexDxH8m8TwvK1kRSw5rE 0mzxmO/e1XIcw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B81CD693BA; Mon, 19 Jan 2026 13:42:40 -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 tLscFdvjaqCD; Mon, 19 Jan 2026 13:42:40 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855356; bh=Hq8UTd3vX9kWLVXIM0zBe8CpBkam3BtfZUTos/uApIg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k/kgJoKBy5S8IYHMrNDPU+JfBxJZgmz4mpKf2Ql4v0RFNtZUuhyKl84lbf07QOUNt t8EkFNY74m9ggPFwn7QUTisyNMBXVdXvxrucbrgv54Cn1CUdIFCR9Ig8vq7q9pv2fr Rx/IvFDoZb/OBbLhlpve42EBxiEPNuYIPQu61xpm97hWFl0g2fPN6UGMCRI8zUM+m1 ssQHxkMMGbFyb3swTkdSObvvitdBassjLXZZakFFit6fNMLbm5Okgr00+LmLT1DGPW kSjDNzeTnogrUuIZb8Cgq7O9Jvd063jIcPONHBfD2FWDsDLIdAkSVB51TuO3fak30f ufuaLYsAeZlew== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 67B60693E3; Mon, 19 Jan 2026 13:42:36 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:41:03 -0700 Message-ID: <20260119204130.3972647-11-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: WW46PGFGF2URYDFAPJCTDRBBYWLIHICE X-Message-ID-Hash: WW46PGFGF2URYDFAPJCTDRBBYWLIHICE X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 10/27] sandbox: Add grid-drawing option to sandbox_sdl_sync() 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 an optional struct parameter to sandbox_sdl_sync() to control sync behaviour. Initially this supports drawing a 10-pixel grid overlay on the display, useful for debugging UI layout. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- arch/sandbox/cpu/sdl.c | 20 +++++++++++++++++++- arch/sandbox/include/asm/sdl.h | 8 ++++++-- arch/sandbox/include/asm/sdl_sync.h | 21 +++++++++++++++++++++ drivers/video/sandbox_sdl.c | 2 +- 4 files changed, 47 insertions(+), 4 deletions(-) create mode 100644 arch/sandbox/include/asm/sdl_sync.h diff --git a/arch/sandbox/cpu/sdl.c b/arch/sandbox/cpu/sdl.c index dd2589c64e2..4a98d920c9f 100644 --- a/arch/sandbox/cpu/sdl.c +++ b/arch/sandbox/cpu/sdl.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -310,7 +311,21 @@ static int copy_to_texture(void *lcd_base, const struct vid_bbox *damage) return 0; } -int sandbox_sdl_sync(void *lcd_base, const struct vid_bbox *damage) +static void draw_grid(void) +{ + int x, y; + + SDL_SetRenderDrawColor(sdl.renderer, 192, 192, 192, SDL_ALPHA_OPAQUE); + + for (x = 0; x < sdl.vis_width; x += 10) + SDL_RenderDrawLine(sdl.renderer, x, 0, x, sdl.vis_height - 1); + + for (y = 0; y < sdl.vis_height; y += 10) + SDL_RenderDrawLine(sdl.renderer, 0, y, sdl.vis_width - 1, y); +} + +int sandbox_sdl_sync(void *lcd_base, const struct vid_bbox *damage, + const struct sandbox_sdl_sync_opts *opts) { struct SDL_Rect rect; int ret; @@ -329,6 +344,9 @@ int sandbox_sdl_sync(void *lcd_base, const struct vid_bbox *damage) return -EIO; } + if (opts && opts->draw_grid) + draw_grid(); + /* * On some machines this does not appear. Draw an empty rectangle which * seems to fix that. diff --git a/arch/sandbox/include/asm/sdl.h b/arch/sandbox/include/asm/sdl.h index a80db51ad19..b2965a0a700 100644 --- a/arch/sandbox/include/asm/sdl.h +++ b/arch/sandbox/include/asm/sdl.h @@ -8,6 +8,7 @@ #include #include +#include struct mouse_event; struct vid_bbox; @@ -44,9 +45,11 @@ int sandbox_sdl_remove_display(void); * * @lcd_base: Base of frame buffer * @damage: Optional damage rectangle to limit the update region (may be NULL) + * @opts: Optional sync options (may be NULL) * Return: 0 if screen was updated, -ENODEV is there is no screen. */ -int sandbox_sdl_sync(void *lcd_base, const struct vid_bbox *damage); +int sandbox_sdl_sync(void *lcd_base, const struct vid_bbox *damage, + const struct sandbox_sdl_sync_opts *opts); /** * sandbox_sdl_scan_keys() - scan for pressed keys @@ -139,7 +142,8 @@ static inline int sandbox_sdl_remove_display(void) } static inline int sandbox_sdl_sync(void *lcd_base, - const struct vid_bbox *damage) + const struct vid_bbox *damage, + const struct sandbox_sdl_sync_opts *opts) { return -ENODEV; } diff --git a/arch/sandbox/include/asm/sdl_sync.h b/arch/sandbox/include/asm/sdl_sync.h new file mode 100644 index 00000000000..78f4233e056 --- /dev/null +++ b/arch/sandbox/include/asm/sdl_sync.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2026 Canonical Ltd + * Written by Simon Glass + */ + +#ifndef __SANDBOX_SDL_SYNC_H +#define __SANDBOX_SDL_SYNC_H + +#include + +/** + * struct sandbox_sdl_sync_opts - Options for sandbox_sdl_sync() + * + * @draw_grid: Draw a grid overlay on the display + */ +struct sandbox_sdl_sync_opts { + bool draw_grid; +}; + +#endif diff --git a/drivers/video/sandbox_sdl.c b/drivers/video/sandbox_sdl.c index 7954e266d98..2e2ebe14f84 100644 --- a/drivers/video/sandbox_sdl.c +++ b/drivers/video/sandbox_sdl.c @@ -146,7 +146,7 @@ static int sandbox_sdl_video_sync(struct udevice *vid, uint flags) memset(&plat->last_sync_damage, '\0', sizeof(plat->last_sync_damage)); - return sandbox_sdl_sync(uc_priv->fb, damage); + return sandbox_sdl_sync(uc_priv->fb, damage, NULL); } static const struct video_ops sandbox_sdl_ops = { From patchwork Mon Jan 19 20:41:04 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1641 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=1768855368; bh=Igxo8ATIVqQlC3UzlgqhIqZUKKEDqosv5DxyZ8/K1vE=; 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=V5mxHrPS5zgSbAAXK6caxZ/bR8HVqtw/jXPLUz75ysT07ymKu7tx1VJdyweuGxFnh pnyLzCH5iuBI5C61clv/55pJV0UY5ehcLJ6pnKGKkF1/yDbHD9HtHzvi1dnDbQNvuY CgP3C4k38+lYQQ5Nb8tutSV7UK6V9NnT55oub/H6qs/lr7P61rPD7ugZjT6Odp/9rC hC/s/+K4yrz/vAuBh5N/mdaaFQ6X7bhpBDboyWkje4ZbUdL4bDyoqxOBUP+wdcBtWb q+RjYfaFDaqJ7C1yYOGTmSB3AxgN9Mk6DLnGm2I6WgoXJNLGtYWEnfagfydmVSg0ka kVq3fuGevXpSA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 78F6D693BA for ; Mon, 19 Jan 2026 13:42: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 10024) with ESMTP id IEQ0sLtKcnkI for ; Mon, 19 Jan 2026 13:42:48 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855368; bh=Igxo8ATIVqQlC3UzlgqhIqZUKKEDqosv5DxyZ8/K1vE=; 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=V5mxHrPS5zgSbAAXK6caxZ/bR8HVqtw/jXPLUz75ysT07ymKu7tx1VJdyweuGxFnh pnyLzCH5iuBI5C61clv/55pJV0UY5ehcLJ6pnKGKkF1/yDbHD9HtHzvi1dnDbQNvuY CgP3C4k38+lYQQ5Nb8tutSV7UK6V9NnT55oub/H6qs/lr7P61rPD7ugZjT6Odp/9rC hC/s/+K4yrz/vAuBh5N/mdaaFQ6X7bhpBDboyWkje4ZbUdL4bDyoqxOBUP+wdcBtWb q+RjYfaFDaqJ7C1yYOGTmSB3AxgN9Mk6DLnGm2I6WgoXJNLGtYWEnfagfydmVSg0ka kVq3fuGevXpSA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6894E694CE for ; Mon, 19 Jan 2026 13:42:48 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855365; bh=INrNAwctAeRz3cHNszq5JldaTurtw8r+X+Z0F6jdJfg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GVQLpGHSI1JUl9cmzIDHWRQHBpsLL6rg5LQbV3H84dQ0SFAQ6w/u/rFM7/HcvRwdT sHVRqf7VNxlWfHUVGvSe09eRmpb8kgG3wzPo5xlVwFdlAWYlr+90WiW3ZtXh/NGVNI 1hxXKJg83uc3Gt72N9olgqLETFXERpzirgbYJtG1523lgiwudge/TcbWoDW7tDs4yd H+YYb8WcrrjTKglqxmp82yQ2RmfsxOpnVQj9ZcAhmglc3bIRXCzQm65s8T/mCIaAa/ k+brEItRLEOi+cT1NLEN/7nvFHd72sd7sGlJ9ZaheRjsh9ryCyvztxq6CL2aXLjXLa 9cjOH2Pr09zUg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 688A4693BA; Mon, 19 Jan 2026 13:42:45 -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 C61ur_0Fvhey; Mon, 19 Jan 2026 13:42:45 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855361; bh=pgXpBiS6DKhKSNZEdHfmXZODjOR54Oxhvi5Ymzo/XLM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gt+jwhooFSYps++CfMEFx5KMyklZCVlGJePV/R0h2eSigk85dJSXdLw4hPbIo56Ic 7Oewwphl+D35eLsWObtvmxqJe0KPZhnQeRmtr6Ld0dUVDSPnPVTKNz/CNdgoSjuHt8 MJXC4V2OnL7aHphEhJfSuyQDdn7NJyu2QV89Lsd1ytUjFgnKKT3gAVFOH2aCPvrXbn VXQ4sJe1mxOGs7VoB5d0cenJkf3fI92eiGdN0U+QkBNA/aLkzepFs23xlb1vvxGTXv mb1Q/orDKam/es947h+OxssIrx3Jrli45Iws4DYzYcf4h59GrDoIA2+eu/4M1dWCU1 7njBLh3n3XB7g== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 062F2693E3; Mon, 19 Jan 2026 13:42:40 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:41:04 -0700 Message-ID: <20260119204130.3972647-12-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: SPJSDMHOFT5NAGJGAMYBX4YTVOXYY6KM X-Message-ID-Hash: SPJSDMHOFT5NAGJGAMYBX4YTVOXYY6KM X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 11/27] sandbox: Add 'sb grid' command to enable grid overlay 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 'sb grid <0|1>' command to enable or disable a grid overlay on the sandbox video display. This is useful for debugging UI layout and alignment. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- arch/sandbox/include/asm/state.h | 1 + cmd/sb.c | 15 +++++++++++++++ doc/usage/cmd/sb.rst | 8 ++++++++ drivers/video/sandbox_sdl.c | 6 +++++- test/cmd/sb.c | 23 +++++++++++++++++++++++ 5 files changed, 52 insertions(+), 1 deletion(-) diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h index 1b6eef4a9c3..31766a6e7ea 100644 --- a/arch/sandbox/include/asm/state.h +++ b/arch/sandbox/include/asm/state.h @@ -179,6 +179,7 @@ struct sandbox_state { bool no_term_present; /* Assume no terminal present */ bool quiet_vidconsole; /* Don't use vidconsole for stdout */ bool disable_mcheck; /* Disable mcheck heap protection */ + bool show_grid; /* Show grid overlay on video */ int video_test; /* ms to wait before next assert */ const char *video_frames_dir; /* Directory to write video frames */ int video_frame_count; /* Number of frames written */ diff --git a/cmd/sb.c b/cmd/sb.c index 7de43e7edc3..55a4b5b447f 100644 --- a/cmd/sb.c +++ b/cmd/sb.c @@ -97,6 +97,19 @@ static int do_sb_devon(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_SUCCESS; } +static int do_sb_grid(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) +{ + struct sandbox_state *state = state_get_current(); + + if (argc < 2) + return CMD_RET_USAGE; + + state->show_grid = hextoul(argv[1], NULL); + + return 0; +} + static int do_sb_devoff(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[]) { @@ -147,6 +160,7 @@ static int do_sb_devoff(struct cmd_tbl *cmdtp, int flag, int argc, U_BOOT_LONGHELP(sb, "devoff - Disable device from device tree node\n" "sb devon - Enable device from device tree node\n" + "sb grid <0|1> - Enable/disable grid overlay on video\n" "sb handoff - Show handoff data received from SPL\n" "sb map - Show mapped memory\n" "sb state - Show sandbox state"); @@ -154,6 +168,7 @@ U_BOOT_LONGHELP(sb, U_BOOT_CMD_WITH_SUBCMDS(sb, "Sandbox status commands", sb_help_text, U_BOOT_SUBCMD_MKENT(devoff, 2, 1, do_sb_devoff), U_BOOT_SUBCMD_MKENT(devon, 2, 1, do_sb_devon), + U_BOOT_SUBCMD_MKENT(grid, 2, 1, do_sb_grid), U_BOOT_SUBCMD_MKENT(handoff, 1, 1, do_sb_handoff), U_BOOT_SUBCMD_MKENT(map, 1, 1, do_sb_map), U_BOOT_SUBCMD_MKENT(state, 1, 1, do_sb_state)); diff --git a/doc/usage/cmd/sb.rst b/doc/usage/cmd/sb.rst index b908631dc08..ee72ecd0db9 100644 --- a/doc/usage/cmd/sb.rst +++ b/doc/usage/cmd/sb.rst @@ -13,6 +13,7 @@ Synopsis sb devoff sb devon + sb grid <0|1> sb handoff sb map sb state @@ -40,6 +41,13 @@ devices that are not automatically bound at startup, i.e. those marked as status = "disabled" in the device tree. The parameter is the name of a root devicetree node. +sb grid +~~~~~~~ + +This enables or disables a grid overlay on the video display. When enabled, +a 10-pixel grid is drawn over the display, which is useful for debugging UI +layout and alignment. Use ``sb grid 1`` to enable and ``sb grid 0`` to disable. + sb handoff ~~~~~~~~~~ diff --git a/drivers/video/sandbox_sdl.c b/drivers/video/sandbox_sdl.c index 2e2ebe14f84..4785185dd70 100644 --- a/drivers/video/sandbox_sdl.c +++ b/drivers/video/sandbox_sdl.c @@ -131,6 +131,8 @@ static int sandbox_sdl_video_sync(struct udevice *vid, uint flags) { struct sandbox_sdl_plat *plat = dev_get_plat(vid); struct video_priv *uc_priv = dev_get_uclass_priv(vid); + struct sandbox_state *state = state_get_current(); + struct sandbox_sdl_sync_opts opts; const struct vid_bbox *damage = NULL; if (!(flags & VIDSYNC_FLUSH)) @@ -146,7 +148,9 @@ static int sandbox_sdl_video_sync(struct udevice *vid, uint flags) memset(&plat->last_sync_damage, '\0', sizeof(plat->last_sync_damage)); - return sandbox_sdl_sync(uc_priv->fb, damage, NULL); + opts.draw_grid = state->show_grid; + + return sandbox_sdl_sync(uc_priv->fb, damage, &opts); } static const struct video_ops sandbox_sdl_ops = { diff --git a/test/cmd/sb.c b/test/cmd/sb.c index cb871dffd57..4ce8a8c4215 100644 --- a/test/cmd/sb.c +++ b/test/cmd/sb.c @@ -6,6 +6,7 @@ */ #include +#include #include #include #include @@ -121,3 +122,25 @@ static int dm_test_sb_devoff_not_bound(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_sb_devoff_not_bound, UTF_SCAN_FDT | UTF_CONSOLE); + +/* Test 'sb grid' command */ +static int dm_test_sb_grid(struct unit_test_state *uts) +{ + struct sandbox_state *state = state_get_current(); + + /* Ensure grid is initially off */ + state->show_grid = false; + + /* Enable grid */ + ut_assertok(run_command("sb grid 1", 0)); + ut_assert_console_end(); + ut_asserteq(true, state->show_grid); + + /* Disable grid */ + ut_assertok(run_command("sb grid 0", 0)); + ut_assert_console_end(); + ut_asserteq(false, state->show_grid); + + return 0; +} +DM_TEST(dm_test_sb_grid, UTF_CONSOLE); From patchwork Mon Jan 19 20:41:05 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1642 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=1768855371; bh=3uPT8B2ACpijpOHZKiq8UgLvOSAJbvHdoNmdOCANKcQ=; 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=fD7RJna6Lf7yWMTxsOYgK3XNw7tXCYVEx5DYSuMCTB4DDyge/HC2hS01TcX1EfDRQ d8B745RywFBYG9Nh6WOsweu2alNOHw9qfDrvQraDl8M6jpqq0diokxDLY5hgF4AU7B tz+cnEKBp3un6EWbuxCnPCu0ypNc3e/OUXKv/1+9/Zh5b4aioo85vU7BuUcYTGYEjV rSlfWZLqgBz29bGrrYaR+/ChERMGsJPY0EwDk2jf2VKX6D11J9vxZv2liknYcm/ynN YE6TnSoXZfw/vbnh0iEayxwGkwVctcpZWpvrXYJdsv51IQTvriVBCRHHXWDHuLRXQW TOnQOF1GgKy6Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EC25469504 for ; Mon, 19 Jan 2026 13:42:51 -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 05VlGgwnorBw for ; Mon, 19 Jan 2026 13:42:51 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855371; bh=3uPT8B2ACpijpOHZKiq8UgLvOSAJbvHdoNmdOCANKcQ=; 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=fD7RJna6Lf7yWMTxsOYgK3XNw7tXCYVEx5DYSuMCTB4DDyge/HC2hS01TcX1EfDRQ d8B745RywFBYG9Nh6WOsweu2alNOHw9qfDrvQraDl8M6jpqq0diokxDLY5hgF4AU7B tz+cnEKBp3un6EWbuxCnPCu0ypNc3e/OUXKv/1+9/Zh5b4aioo85vU7BuUcYTGYEjV rSlfWZLqgBz29bGrrYaR+/ChERMGsJPY0EwDk2jf2VKX6D11J9vxZv2liknYcm/ynN YE6TnSoXZfw/vbnh0iEayxwGkwVctcpZWpvrXYJdsv51IQTvriVBCRHHXWDHuLRXQW TOnQOF1GgKy6Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DB07A694CE for ; Mon, 19 Jan 2026 13:42:51 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855370; bh=pK/MMt5oUdGmhXY9eyTkowZIHFMpsEfQ35W8FlbTZoE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A4LmjO56jVmM9hdQH5w2+nFM1A8PobhLZsQzP9qlzmHYiaRKOEVrXQ1UHhvYVAW2d /xeCHINaKtGlYC/TA8QjTdcNGKCcj+Yewdn6BrzvFOgRwQ+kvLy38sKULG3ak7MDxA lTb4ybWO4b0GtGxRPXfHFb3m0q1YKKf7iRCluzhmHYIL5homTtlfLJ1yyld1ppGK99 qahxYOsWg9ZHD4zIx6Iwsr0vb5zE6BPSqul8C6hTY2WPkin0USf6Tq32b4uU2X8IAg CWgsLrVfkFo/yqJFaro6UcQu7qgkA/99aYvyqiR9FebEc4IsEywVMtdu9005aI1GbT cOSxXEGMKWrpQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D7C2C694CE; Mon, 19 Jan 2026 13:42: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 10026) with ESMTP id xkPDcMWiKbUj; Mon, 19 Jan 2026 13:42:50 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855365; bh=Nif0oYZDB9arwCOoCWjotbCz0qDONoY2qfIb8zsxl5c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hf6Rvv0ER2SNMMOyjxFGEfUaN9tbhQfrlgRMmVkDw0TCJlBcDoS+xlf1yCiNZGna0 qELNbyx4sBvDa9uYb9UkBc2omIfnjKn12RGJMxt54/aSnrJocHM5LclaHCRK5FVP2i 0E0iEeD8Yo21OutG6ms5ejOSHmDUP5ks/mMnZhBgt0FsHqBN/hvmjiVFUnoycl5dxz ouAC+Q1bfXPstXhEY5KQFVUdctFaRXgjPLCUx+LMj+fV87KEmF9+QQ7ECrrQaoznGN m2ySTMGMHGmxIw5ikSD6NizDZKxcc0XSdbU/wdx9r7a2tLmH/YWQUiGvH4oP2L8LDH 28HGX6rCw/kzQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 9CF2B693E3; Mon, 19 Jan 2026 13:42:45 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:41:05 -0700 Message-ID: <20260119204130.3972647-13-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: NTZUPN666WSLXTXASLIHDHTEQGXQAYNX X-Message-ID-Hash: NTZUPN666WSLXTXASLIHDHTEQGXQAYNX X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 12/27] sandbox: Allow grid size to be specified in 'sb grid' command 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 an optional second parameter to 'sb grid' to specify the grid size in pixels. For example, 'sb grid 1 14' enables a 20-pixel (0x14) grid. The default remains 10 pixels when no size is specified. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- arch/sandbox/cpu/sdl.c | 11 +++++++---- arch/sandbox/include/asm/sdl_sync.h | 2 ++ arch/sandbox/include/asm/state.h | 1 + cmd/sb.c | 6 ++++-- doc/develop/expo.rst | 4 ++++ doc/usage/cmd/sb.rst | 7 ++++--- drivers/video/sandbox_sdl.c | 1 + test/cmd/sb.c | 11 +++++++++++ 8 files changed, 34 insertions(+), 9 deletions(-) diff --git a/arch/sandbox/cpu/sdl.c b/arch/sandbox/cpu/sdl.c index 4a98d920c9f..f2cc4bbd041 100644 --- a/arch/sandbox/cpu/sdl.c +++ b/arch/sandbox/cpu/sdl.c @@ -311,16 +311,19 @@ static int copy_to_texture(void *lcd_base, const struct vid_bbox *damage) return 0; } -static void draw_grid(void) +static void draw_grid(int size) { int x, y; + if (!size) + size = 0x20; + SDL_SetRenderDrawColor(sdl.renderer, 192, 192, 192, SDL_ALPHA_OPAQUE); - for (x = 0; x < sdl.vis_width; x += 10) + for (x = 0; x < sdl.vis_width; x += size) SDL_RenderDrawLine(sdl.renderer, x, 0, x, sdl.vis_height - 1); - for (y = 0; y < sdl.vis_height; y += 10) + for (y = 0; y < sdl.vis_height; y += size) SDL_RenderDrawLine(sdl.renderer, 0, y, sdl.vis_width - 1, y); } @@ -345,7 +348,7 @@ int sandbox_sdl_sync(void *lcd_base, const struct vid_bbox *damage, } if (opts && opts->draw_grid) - draw_grid(); + draw_grid(opts->grid_size); /* * On some machines this does not appear. Draw an empty rectangle which diff --git a/arch/sandbox/include/asm/sdl_sync.h b/arch/sandbox/include/asm/sdl_sync.h index 78f4233e056..81b28ff61e5 100644 --- a/arch/sandbox/include/asm/sdl_sync.h +++ b/arch/sandbox/include/asm/sdl_sync.h @@ -13,9 +13,11 @@ * struct sandbox_sdl_sync_opts - Options for sandbox_sdl_sync() * * @draw_grid: Draw a grid overlay on the display + * @grid_size: Grid size in pixels (0 for default of 0x20) */ struct sandbox_sdl_sync_opts { bool draw_grid; + int grid_size; }; #endif diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h index 31766a6e7ea..001d780aec8 100644 --- a/arch/sandbox/include/asm/state.h +++ b/arch/sandbox/include/asm/state.h @@ -180,6 +180,7 @@ struct sandbox_state { bool quiet_vidconsole; /* Don't use vidconsole for stdout */ bool disable_mcheck; /* Disable mcheck heap protection */ bool show_grid; /* Show grid overlay on video */ + int grid_size; /* Grid size in pixels (0 for default) */ int video_test; /* ms to wait before next assert */ const char *video_frames_dir; /* Directory to write video frames */ int video_frame_count; /* Number of frames written */ diff --git a/cmd/sb.c b/cmd/sb.c index 55a4b5b447f..dcf7ec9d0b4 100644 --- a/cmd/sb.c +++ b/cmd/sb.c @@ -106,6 +106,8 @@ static int do_sb_grid(struct cmd_tbl *cmdtp, int flag, int argc, return CMD_RET_USAGE; state->show_grid = hextoul(argv[1], NULL); + if (argc >= 3) + state->grid_size = hextoul(argv[2], NULL); return 0; } @@ -160,7 +162,7 @@ static int do_sb_devoff(struct cmd_tbl *cmdtp, int flag, int argc, U_BOOT_LONGHELP(sb, "devoff - Disable device from device tree node\n" "sb devon - Enable device from device tree node\n" - "sb grid <0|1> - Enable/disable grid overlay on video\n" + "sb grid <0|1> [] - Enable/disable grid overlay on video\n" "sb handoff - Show handoff data received from SPL\n" "sb map - Show mapped memory\n" "sb state - Show sandbox state"); @@ -168,7 +170,7 @@ U_BOOT_LONGHELP(sb, U_BOOT_CMD_WITH_SUBCMDS(sb, "Sandbox status commands", sb_help_text, U_BOOT_SUBCMD_MKENT(devoff, 2, 1, do_sb_devoff), U_BOOT_SUBCMD_MKENT(devon, 2, 1, do_sb_devon), - U_BOOT_SUBCMD_MKENT(grid, 2, 1, do_sb_grid), + U_BOOT_SUBCMD_MKENT(grid, 3, 1, do_sb_grid), U_BOOT_SUBCMD_MKENT(handoff, 1, 1, do_sb_handoff), U_BOOT_SUBCMD_MKENT(map, 1, 1, do_sb_map), U_BOOT_SUBCMD_MKENT(state, 1, 1, do_sb_state)); diff --git a/doc/develop/expo.rst b/doc/develop/expo.rst index ca83b403621..fc642ed3696 100644 --- a/doc/develop/expo.rst +++ b/doc/develop/expo.rst @@ -797,6 +797,10 @@ 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" +The :doc:`../usage/cmd/sb` ``grid`` subcommand can be used to overlay a grid on +the display, to help with checking alignment of objects. The grid size defaults +to 0x20 pixels but can be specified as a parameter. + This will write each asserted expo frame to ``/tmp/good/frame0.bmp``, ``/tmp/good/frame1.bmp``, etc. diff --git a/doc/usage/cmd/sb.rst b/doc/usage/cmd/sb.rst index ee72ecd0db9..08f8f87f88f 100644 --- a/doc/usage/cmd/sb.rst +++ b/doc/usage/cmd/sb.rst @@ -13,7 +13,7 @@ Synopsis sb devoff sb devon - sb grid <0|1> + sb grid <0|1> [] sb handoff sb map sb state @@ -45,8 +45,9 @@ sb grid ~~~~~~~ This enables or disables a grid overlay on the video display. When enabled, -a 10-pixel grid is drawn over the display, which is useful for debugging UI -layout and alignment. Use ``sb grid 1`` to enable and ``sb grid 0`` to disable. +a grid is drawn over the display, which is useful for debugging UI layout and +alignment. Use ``sb grid 1`` to enable and ``sb grid 0`` to disable. An +optional second parameter specifies the grid size in pixels (default 0x20). sb handoff ~~~~~~~~~~ diff --git a/drivers/video/sandbox_sdl.c b/drivers/video/sandbox_sdl.c index 4785185dd70..6fc71bc9cb9 100644 --- a/drivers/video/sandbox_sdl.c +++ b/drivers/video/sandbox_sdl.c @@ -149,6 +149,7 @@ static int sandbox_sdl_video_sync(struct udevice *vid, uint flags) sizeof(plat->last_sync_damage)); opts.draw_grid = state->show_grid; + opts.grid_size = state->grid_size; return sandbox_sdl_sync(uc_priv->fb, damage, &opts); } diff --git a/test/cmd/sb.c b/test/cmd/sb.c index 4ce8a8c4215..b1fbddac449 100644 --- a/test/cmd/sb.c +++ b/test/cmd/sb.c @@ -130,6 +130,7 @@ static int dm_test_sb_grid(struct unit_test_state *uts) /* Ensure grid is initially off */ state->show_grid = false; + state->grid_size = 0; /* Enable grid */ ut_assertok(run_command("sb grid 1", 0)); @@ -141,6 +142,16 @@ static int dm_test_sb_grid(struct unit_test_state *uts) ut_assert_console_end(); ut_asserteq(false, state->show_grid); + /* Enable grid with custom size (0x14 = 20 decimal) */ + ut_assertok(run_command("sb grid 1 14", 0)); + ut_assert_console_end(); + ut_asserteq(true, state->show_grid); + ut_asserteq(0x14, state->grid_size); + + /* Clean up */ + state->show_grid = false; + state->grid_size = 0; + return 0; } DM_TEST(dm_test_sb_grid, UTF_CONSOLE); From patchwork Mon Jan 19 20:41:06 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1643 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=1768855376; bh=oMg7UCZfbPXbLb+t5IWlsvuPTCWcfGUJUX1VscGxVsE=; 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=CLiCwUQZwv6CyeMHhglozhoz3EWbRZCF1H2d0VSzglSxsuB/ljCGaFNaz/Y7rrwKV ayRbtRgzzCGJVBTLCWTXH9YrYXefKGVlssSimJuWCXRzFryBI0gTEbKkiY7l8TSb7k J9eB4aNJw+ayUAUFddpZttyayqrUvgNf1gxQ53A8jKMz0R0kqlApXNVaeSct6yFo0/ bU4gCARRf+x+aPwjlHIxpM6EfCpJd0RHemqS4YNpYvbFbUeRiRfzUCUYA3uscO3lts bAWYoC8GGKvGhHmY06RKOuQUuXbUPSgjG5ePu6b7k4/LLf7u7lRFqMa5SvOC6emx4m eNpLca8wyHgCQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C44E569519 for ; Mon, 19 Jan 2026 13:42: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 10024) with ESMTP id vgTSv1eu_5_G for ; Mon, 19 Jan 2026 13:42:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855376; bh=oMg7UCZfbPXbLb+t5IWlsvuPTCWcfGUJUX1VscGxVsE=; 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=CLiCwUQZwv6CyeMHhglozhoz3EWbRZCF1H2d0VSzglSxsuB/ljCGaFNaz/Y7rrwKV ayRbtRgzzCGJVBTLCWTXH9YrYXefKGVlssSimJuWCXRzFryBI0gTEbKkiY7l8TSb7k J9eB4aNJw+ayUAUFddpZttyayqrUvgNf1gxQ53A8jKMz0R0kqlApXNVaeSct6yFo0/ bU4gCARRf+x+aPwjlHIxpM6EfCpJd0RHemqS4YNpYvbFbUeRiRfzUCUYA3uscO3lts bAWYoC8GGKvGhHmY06RKOuQUuXbUPSgjG5ePu6b7k4/LLf7u7lRFqMa5SvOC6emx4m eNpLca8wyHgCQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B2965694CE for ; Mon, 19 Jan 2026 13:42:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855374; bh=JJrIcFFqqXxVvfJ8d+AUA+cpnDuipoe5m6S2PaWjXgQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wok++HfFPmrWR535tVVMb7ylyAhas9fvIs6urcSj3cEy4V3TuyFtu4hcUhzhtV0/D +YsWhBeW3dM39BSnuYxLZQcO91QF/dnXJ1qERmObt4FXPudsP2PogdGftBinKzYJPv pmenPG8Wr0Wo+v4jPdY1bILVMCabzzHwFgJ7zm7+GQ/E8sv/1KWqTI7tOoCNPIlLCE emZVbJXhVyfZ3tycXtYAmMGvLZpQC+XJIMI1XEn7mFYZauoyCmXBWgTggXOcdFC0Mj vlAaqFiPS3bKW5dnwv2/a0NLGvRfZMDK76MGDe+pwey5rbaOiH+Nlj6xeyyRpwbJBv vjoQEqNHC2EWQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9DADF693E3; Mon, 19 Jan 2026 13:42: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 10026) with ESMTP id FDzjUrMwHXV2; Mon, 19 Jan 2026 13:42:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855370; bh=paYXL/BE+jwOA8P9bOZKlRdr7DrwTZePnB81nB2djBc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PKEzunS09s0UqJXc5zWVMBUS33oMegZfB0Uz+FPQigz4G4OZbOxXB1QfuEMcUKxPK +6pIPbt705mcOYMlAQ9ASEQ1SrbXxeerdDVP67BIwbpb2c/+gqOm7Oe2K9OJzfNgiY eDM/UCGCwkvzj6uxh7xb+ZIED5Qpeefrsj4XyY967ZgKCO6EKGZipOUaZmvmuZBVKE LgXPxZILPUpiIZnz8jPHWxnM5S4nN3h8roRkJFdAROZtFnLdlBAbS+52CPQmpS6lVJ DNrhRzJ8Evj9IRetFqXZlolb8QNgRooX75gevxDI+1oD0O4W5E/sgbSLVuzopamdf+ V2fS3clc3yL8Q== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 412C0693BA; Mon, 19 Jan 2026 13:42:50 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:41:06 -0700 Message-ID: <20260119204130.3972647-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: MOA7PSVVEUVWPTEBRKSVMJSTOR4PNMOQ X-Message-ID-Hash: MOA7PSVVEUVWPTEBRKSVMJSTOR4PNMOQ X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 13/27] sandbox: log: Add file log driver 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 log driver that writes log records to a file. This is useful for capturing log output during testing or debugging in sandbox. The filename can be set via the 'log_file' environment variable, or programmatically using log_file_set_fname(). Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- common/Kconfig | 8 +++ common/Makefile | 1 + common/log_file.c | 103 ++++++++++++++++++++++++++++++++++++++ configs/sandbox_defconfig | 2 + doc/develop/logging.rst | 5 ++ include/log.h | 11 ++++ lib/getopt.c | 4 +- test/log/Makefile | 1 + test/log/log_file_test.c | 43 ++++++++++++++++ test/log/log_filter.c | 9 ++-- 10 files changed, 181 insertions(+), 6 deletions(-) create mode 100644 common/log_file.c create mode 100644 test/log/log_file_test.c diff --git a/common/Kconfig b/common/Kconfig index 597bea70b9b..8d3bda6f588 100644 --- a/common/Kconfig +++ b/common/Kconfig @@ -453,6 +453,14 @@ config LOG_SYSLOG Enables a log driver which broadcasts log records via UDP port 514 to syslog servers. +config LOG_FILE + bool "Log output to a file (sandbox only)" + depends on SANDBOX + help + Enables a log driver which writes log records to a file. Set the + 'log_file' environment variable to the filename to use, or call + log_file_set_fname() to set it programmatically. + config SPL_LOG bool "Enable logging support in SPL" depends on LOG && SPL diff --git a/common/Makefile b/common/Makefile index fdf4cff94f4..125f768ef53 100644 --- a/common/Makefile +++ b/common/Makefile @@ -97,6 +97,7 @@ obj-$(CONFIG_DFU_OVER_USB) += dfu.o obj-y += command.o obj-$(CONFIG_$(PHASE_)LOG) += log.o obj-$(CONFIG_$(PHASE_)LOG_CONSOLE) += log_console.o +obj-$(CONFIG_LOG_FILE) += log_file.o obj-$(CONFIG_$(PHASE_)LOG_SYSLOG) += log_syslog.o obj-y += s_record.o obj-$(CONFIG_CMD_LOADB) += xyzModem.o diff --git a/common/log_file.c b/common/log_file.c new file mode 100644 index 00000000000..6f445a9d561 --- /dev/null +++ b/common/log_file.c @@ -0,0 +1,103 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Log driver to write to a file (sandbox only) + * + * Copyright 2026 Canonical Ltd + * Written by Simon Glass + */ + +#include +#include +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +static int log_fd = -1; + +static void append(char **buf, char *buf_end, const char *fmt, ...) +{ + va_list args; + size_t size = buf_end - *buf; + + va_start(args, fmt); + vsnprintf(*buf, size, fmt, args); + va_end(args); + *buf += strlen(*buf); +} + +int log_file_set_fname(const char *fname) +{ + if (log_fd != -1) { + os_close(log_fd); + log_fd = -1; + } + + if (!fname) + return 0; + + log_fd = os_open(fname, OS_O_WRONLY | OS_O_CREAT | OS_O_TRUNC); + if (log_fd < 0) + return log_fd; + + return 0; +} + +static int log_file_emit(struct log_device *ldev, struct log_rec *rec) +{ + int fmt = gd->log_fmt; + char buf[512]; + char *buf_end = buf + sizeof(buf); + char *ptr = buf; + const char *fname; + int len; + + /* If no file open, try to open one from the environment */ + if (log_fd == -1) { + fname = env_get("log_file"); + if (!fname) + return 0; + + log_fd = os_open(fname, OS_O_WRONLY | OS_O_CREAT | OS_O_TRUNC); + if (log_fd < 0) + return 0; + } + + /* + * The output format is designed to give someone a fighting chance of + * figuring out which field is which: + * - level is in CAPS + * - cat is lower case and ends with comma + * - file normally has a .c extension and ends with a colon + * - line is integer and ends with a - + * - function is an identifier and ends with () + * - message has a space before it unless it is on its own + */ + if (!(rec->flags & LOGRECF_CONT) && fmt != BIT(LOGF_MSG)) { + if (fmt & BIT(LOGF_LEVEL)) + append(&ptr, buf_end, "%s.", + log_get_level_name(rec->level)); + if (fmt & BIT(LOGF_CAT)) + append(&ptr, buf_end, "%s,", + log_get_cat_name(rec->cat)); + if (fmt & BIT(LOGF_FILE)) + append(&ptr, buf_end, "%s:", rec->file); + if (fmt & BIT(LOGF_LINE)) + append(&ptr, buf_end, "%d-", rec->line); + if (fmt & BIT(LOGF_FUNC)) + append(&ptr, buf_end, "%s() ", rec->func ?: "?"); + } + if (fmt & BIT(LOGF_MSG)) + append(&ptr, buf_end, "%s", rec->msg); + + len = ptr - buf; + os_write(log_fd, buf, len); + + return 0; +} + +LOG_DRIVER(file) = { + .name = "file", + .emit = log_file_emit, + .flags = LOGDF_ENABLE, +}; diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig index 4dbb77abcff..93ef88d597e 100644 --- a/configs/sandbox_defconfig +++ b/configs/sandbox_defconfig @@ -57,6 +57,7 @@ CONFIG_LOG=y CONFIG_LOG_MAX_LEVEL=9 CONFIG_LOG_DEFAULT_LEVEL=6 CONFIG_LOGF_FUNC=y +CONFIG_LOG_FILE=y CONFIG_DISPLAY_BOARDINFO_LATE=y CONFIG_STACKPROTECTOR=y CONFIG_ANDROID_AB=y @@ -149,6 +150,7 @@ CONFIG_CMD_EROFS=y CONFIG_CMD_EXT4_WRITE=y CONFIG_CMD_SQUASHFS=y CONFIG_CMD_MTDPARTS=y +CONFIG_CMD_LOG=y CONFIG_CMD_STACKPROTECTOR_TEST=y CONFIG_MAC_PARTITION=y CONFIG_OF_CONTROL=y diff --git a/doc/develop/logging.rst b/doc/develop/logging.rst index d7a40c94bf0..6314cae380c 100644 --- a/doc/develop/logging.rst +++ b/doc/develop/logging.rst @@ -172,10 +172,15 @@ enabled or disabled independently: * console - goes to stdout * syslog - broadcast RFC 3164 messages to syslog servers on UDP port 514 +* file - writes to a file (sandbox only) The syslog driver sends the value of environmental variable 'log_hostname' as HOSTNAME if available. +The file driver sends log records to a file and is only available in sandbox. +Set the 'log_file' environment variable to specify the filename, or call +log_file_set_fname() to set it programmatically. + Filters ------- diff --git a/include/log.h b/include/log.h index 8e933071cf1..c79042f1a5c 100644 --- a/include/log.h +++ b/include/log.h @@ -675,6 +675,17 @@ int log_remove_filter(const char *drv_name, int filter_num); */ int log_device_set_enable(struct log_driver *drv, bool enable); +/** + * log_file_set_fname() - Set the filename for the file log driver + * + * This sets or changes the file used by the file log driver. If a file is + * already open it is closed first. + * + * @fname: Filename to use, or NULL to close any existing file + * Return: 0 if OK, -ve on error + */ +int log_file_set_fname(const char *fname); + #if CONFIG_IS_ENABLED(LOG) /** * log_init() - Set up the log system ready for use diff --git a/lib/getopt.c b/lib/getopt.c index e9175e2fff4..c7bb6d3671a 100644 --- a/lib/getopt.c +++ b/lib/getopt.c @@ -25,8 +25,8 @@ int __getopt(struct getopt_state *gs, int argc, char *const argv[], const char *curoptp; /* pointer to the current option in optstring */ while (1) { - log_debug("arg_index: %d index: %d\n", gs->arg_index, - gs->index); + log_content("arg_index: %d index: %d\n", gs->arg_index, + gs->index); /* `--` indicates the end of options */ if (gs->arg_index == 1 && argv[gs->index] && diff --git a/test/log/Makefile b/test/log/Makefile index 24b7c46786d..6fc45d59a16 100644 --- a/test/log/Makefile +++ b/test/log/Makefile @@ -10,6 +10,7 @@ ifdef CONFIG_UT_LOG ifdef CONFIG_SANDBOX obj-$(CONFIG_LOG_SYSLOG) += syslog_test.o obj-$(CONFIG_LOG_SYSLOG) += syslog_test_ndebug.o +obj-$(CONFIG_LOG_FILE) += log_file_test.o endif ifdef CONFIG_LOG diff --git a/test/log/log_file_test.c b/test/log/log_file_test.c new file mode 100644 index 00000000000..e1d6b7dedf1 --- /dev/null +++ b/test/log/log_file_test.c @@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2026 Canonical Ltd + * Written by Simon Glass + * + * Test for log file driver + */ + +#include +#include +#include +#include +#include + +/* Test that the log_file driver can write to a file */ +static int log_test_file_driver(struct unit_test_state *uts) +{ + const char *fname = "/tmp/log_test.log"; + void *buf; + int size; + + ut_assertok(log_file_set_fname(fname)); + + /* Generate some log messages using log rec command */ + run_command("log format Lfm", 0); + run_command("log rec none warning test.c 123 my_func 'Test message'", 0); + run_command("log rec none err error.c 456 err_func 'Error occurred'", 0); + + /* Close the file so we can read it */ + ut_assertok(log_file_set_fname(NULL)); + + /* Read the file contents */ + ut_assertok(os_read_file(fname, &buf, &size)); + + /* Check the contents */ + ut_asserteq_strn("123-my_func() Test message\n", buf); + ut_assertnonnull(strstr(buf, "456-err_func() Error occurred\n")); + + os_free(buf); + + return 0; +} +LOG_TEST(log_test_file_driver); diff --git a/test/log/log_filter.c b/test/log/log_filter.c index 8622dcf2913..05ff4e94bd2 100644 --- a/test/log/log_filter.c +++ b/test/log/log_filter.c @@ -39,11 +39,12 @@ static int log_test_filter(struct unit_test_state *uts) #define create_filter(args, filter_num) do {\ ut_assertok(run_command("log filter-add -p " args, 0)); \ + console_record_readline(uts->actual_str, sizeof(uts->actual_str)); \ ut_assertok(strict_strtoul(uts->actual_str, 10, &(filter_num))); \ ut_assert_console_end(); \ } while (0) - create_filter("", filt1); + create_filter("-l info", filt1); create_filter("-DL warning -cmmc -cspi -ffile", filt2); ldev = log_device_find_by_name("console"); @@ -52,7 +53,7 @@ static int log_test_filter(struct unit_test_state *uts) if (filt->filter_num == filt1) { filt1_found = true; ut_asserteq(0, filt->flags); - ut_asserteq(LOGL_MAX, filt->level); + ut_asserteq(LOGL_INFO, filt->level); ut_assertnull(filt->file_list); } else if (filt->filter_num == filt2) { filt2_found = true; @@ -89,8 +90,8 @@ static int log_test_filter(struct unit_test_state *uts) ut_asserteq(false, filt1_found); ut_asserteq(false, filt2_found); - create_filter("", filt1); - create_filter("", filt2); + create_filter("-l info", filt1); + create_filter("-l info", filt2); ut_assertok(run_command("log filter-remove -a", 0)); ut_assert_console_end(); From patchwork Mon Jan 19 20:41:07 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1644 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=1768855380; bh=1ELjRTR618dfnXZ9ZUV4YAjoO24ZK/lmJXBUw19bkec=; 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=KaMenEVjB2Ku24vq6EH4uODdS20+uamt7nVQIYyiOS1Sf4mFozbex67P5fwf+tpNr 3FiUEfEd1H2d67ijHgL6+fzEXchGi1e4Vh4TYQ5zrXfnud6+PINnUe41ad+U0EYq4x ivM5fXlpQqZjR+GLYXyDFxGRNhXiPfeHqT5u8l5LFvBjcFMVgfZ5z0ZhYMqSFAERPQ GcQrMm/0o0beXkZXMzGJ/T2BnHGyuoG9PwhFzTziYmpYtru5BW1zHaW0nt52ykQPkz XPQ9jJwP7/o7n/UpQ8TLCsOIYg+vpXI0uYS15BnqooG2RxzGliWw4oXGT/pnIWixLk MxdmER/TVr9YQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1FDF36951E for ; Mon, 19 Jan 2026 13:43:00 -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 PuKlGgbuXTMv for ; Mon, 19 Jan 2026 13:43:00 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855380; bh=1ELjRTR618dfnXZ9ZUV4YAjoO24ZK/lmJXBUw19bkec=; 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=KaMenEVjB2Ku24vq6EH4uODdS20+uamt7nVQIYyiOS1Sf4mFozbex67P5fwf+tpNr 3FiUEfEd1H2d67ijHgL6+fzEXchGi1e4Vh4TYQ5zrXfnud6+PINnUe41ad+U0EYq4x ivM5fXlpQqZjR+GLYXyDFxGRNhXiPfeHqT5u8l5LFvBjcFMVgfZ5z0ZhYMqSFAERPQ GcQrMm/0o0beXkZXMzGJ/T2BnHGyuoG9PwhFzTziYmpYtru5BW1zHaW0nt52ykQPkz XPQ9jJwP7/o7n/UpQ8TLCsOIYg+vpXI0uYS15BnqooG2RxzGliWw4oXGT/pnIWixLk MxdmER/TVr9YQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 019C469513 for ; Mon, 19 Jan 2026 13:43:00 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855379; bh=FIWBaHcz5yyLPasQiQDlHWibpbqsPXDVu/SR7P8sWUM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pTaoxAGuUB2BO/Cxqv1P84sKqRNizACkpbdq1yAZvK5HzhL87IWZPFsZHcVNfs9dc JyG2KuEnaD1zjiVmowVK32sasiSxCCT3FU/lgC1OmdkTVXfyTpVXBVMm7G61E/xy2a y23Gsztrf9HPLODJH6fqQj41i+x2StR/tB0/qoBvHbe6jgjgcGEe3ITEnIJbT4L8SD JOc5Z2nTwGQTSn4J+8rIsv34ySJqCLzBe7MnD5Br3vWcW3jpAmQ9d3reuknvNyTrwG lkEuJVzslArn7otvrUC64YlkCQ1HFrUYyjcQcqTwuaixck+qqZGJn6Pg+pQhIscN5j nGaYk59K8THgg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 31700693E3; Mon, 19 Jan 2026 13:42:59 -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 SDJshRXRD_Qh; Mon, 19 Jan 2026 13:42:59 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855375; bh=PJSJQnqdbFhgC+jvRq8Dw/bkjpP8R3v4YuoPmHXG5ew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u6QLsQ2B9xwitZ80OT8fl55hzrrvEwrAwWsot6PBnU75Vwdlm07X8hAyy8WQUQmr7 r8amTy6ObSQXg0DldtQLfjGSYBGcMm2xUGQBmwPg/VLZBaGu68WRshZZmQQxXDPLGc HDzDESccJ4p/VKz2zOfcO5+6HobpgGyq1xQQ1o34Z6Ebb2C45upyHPJKF1pNOiPvMa c4TLZ+feo+lRYMj80ATYDW5o7HtvFfe6/DC4OBR8I3wtIK77OJSlX2qfDglajsQ8zN R7NIs+Ls5KzgkKVnhjJNGhm4iEAQTGAw8xtIJglhPp05zBi8tbGbxKRAimkA/itd1i iFdEhvcWAOGhg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id DCC43693BA; Mon, 19 Jan 2026 13:42:54 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:41:07 -0700 Message-ID: <20260119204130.3972647-15-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: P3EPIZQHNSFTNERZ5Y4VZESP2V3M676E X-Message-ID-Hash: P3EPIZQHNSFTNERZ5Y4VZESP2V3M676E X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 14/27] expo: Use a configurable output function in expo_dump() 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 Refactor the dump context to use a configurable output function instead of directly writing to a membuf. This allows different output targets to be used. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/expo_dump.c | 44 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/boot/expo_dump.c b/boot/expo_dump.c index b2ea60db50c..d357aa6a5be 100644 --- a/boot/expo_dump.c +++ b/boot/expo_dump.c @@ -15,36 +15,64 @@ #include #include "scene_internal.h" +/** + * typedef dump_out_func - Function type for dump output + * + * @priv: Private data for the output function + * @buf: Buffer containing data to output + * @len: Length of data in buffer + */ +typedef void (*dump_out_func)(void *priv, const char *buf, int len); + /** * struct dump_ctx - Context for dumping expo structures * - * @mb: Membuf to write output to + * @out: Output function to call for each piece of output + * @priv: Private data to pass to output function * @scn: Current scene being dumped (or NULL if not in a scene) * @indent: Current indentation level (number of spaces) */ struct dump_ctx { - struct membuf *mb; + dump_out_func out; + void *priv; struct scene *scn; int indent; }; +/** + * dump_out_membuf() - Output function that writes to a membuf + * + * @priv: Pointer to struct membuf + * @buf: Buffer containing data to output + * @len: Length of data in buffer + */ +static void dump_out_membuf(void *priv, const char *buf, int len) +{ + struct membuf *mb = priv; + + membuf_put(mb, buf, len); +} + /** * outf() - Output a formatted string with indentation * - * @ctx: Dump context containing membuf, scene, and indent level + * @ctx: Dump context containing output function, scene, and indent level * @fmt: Format string * @...: Arguments for format string */ static void outf(struct dump_ctx *ctx, const char *fmt, ...) { char buf[256]; + char indent_buf[64]; va_list args; int len; + len = snprintf(indent_buf, sizeof(indent_buf), "%*s", ctx->indent, ""); + ctx->out(ctx->priv, indent_buf, len); + va_start(args, fmt); - membuf_printf(ctx->mb, "%*s", ctx->indent, ""); len = vsnprintf(buf, sizeof(buf), fmt, args); - membuf_put(ctx->mb, buf, len); + ctx->out(ctx->priv, buf, len); va_end(args); } @@ -196,7 +224,8 @@ void scene_dump(struct membuf *mb, struct scene *scn, int indent) { struct dump_ctx ctx; - ctx.mb = mb; + ctx.out = dump_out_membuf; + ctx.priv = mb; ctx.scn = scn; ctx.indent = indent; @@ -262,7 +291,8 @@ void expo_dump(struct expo *exp, struct membuf *mb) { struct dump_ctx ctx; - ctx.mb = mb; + ctx.out = dump_out_membuf; + ctx.priv = mb; ctx.scn = NULL; ctx.indent = 0; From patchwork Mon Jan 19 20:41:08 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1645 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=1768855385; bh=55dumjVmPb+ci5gb2Ikxs6bMtXHVZh3fyabDLGk/FUg=; 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=ZoabWxv89HEGzIFrosK7Hp9lcr0nsrLWP1GX5jIIdkJNQhA1/6SQeVxHYX4LjTdZ1 5xxrueJLxDs5wBaOiLIHE+D5fQdKiuiA24XgnyrTvaFjXPBYtgOJduo65itvFuUgdN GgZfMvQiaKTvDUI2/FGbVStABX8pyCPW9k4HFiaRf9fH6hPpaddZLTMrElTN374JBl rhf9tdsHg/w1Ixwufy/tUo3czQtKZUs74NytORyAOfg0DFlg9QW+Pjsq/YsTbWJfEs /LojyCyS+vpc3W1BIqXiIm4D9QWeghSnsWzO9Iv0K1clgFZ2ZXNZ7BgwNk8He9x2i2 J4Dl8PjZaQtDA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9A6D869519 for ; Mon, 19 Jan 2026 13:43:05 -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 Wov7jJief5FU for ; Mon, 19 Jan 2026 13:43:05 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855385; bh=55dumjVmPb+ci5gb2Ikxs6bMtXHVZh3fyabDLGk/FUg=; 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=ZoabWxv89HEGzIFrosK7Hp9lcr0nsrLWP1GX5jIIdkJNQhA1/6SQeVxHYX4LjTdZ1 5xxrueJLxDs5wBaOiLIHE+D5fQdKiuiA24XgnyrTvaFjXPBYtgOJduo65itvFuUgdN GgZfMvQiaKTvDUI2/FGbVStABX8pyCPW9k4HFiaRf9fH6hPpaddZLTMrElTN374JBl rhf9tdsHg/w1Ixwufy/tUo3czQtKZUs74NytORyAOfg0DFlg9QW+Pjsq/YsTbWJfEs /LojyCyS+vpc3W1BIqXiIm4D9QWeghSnsWzO9Iv0K1clgFZ2ZXNZ7BgwNk8He9x2i2 J4Dl8PjZaQtDA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8A66169504 for ; Mon, 19 Jan 2026 13:43:05 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855383; bh=PBSzhtKUn6al0tzat6Er2Du8cyAhfmbCGF7c9ORwTpk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RUhTMXonCEh6w9toHasuVI8nF6vn9lPjHZCYnv+7+QL3mZFIdfVouxZ3b6btrd4Q+ hiS3gjy8EBHfTq8gBHNBj2qnhECS18aVX/nxkO2Bs3pQ6MeQdk/ozsJAyWotjbyoJZ 37Qbxg8WJYwmH7M83lBIsjOvU/Hp61vD1vnFoM1d+50haZTGEA1H6Y4QbOHlhep8Gf a/eYr8znFTjPFiMKjB55h+XcsHb9Y88K/Knd/wDCNsu7m9BWCfeHVczEOWjkPjoFc9 HqG6tSd2zI6QoOy8eAWaizb4NgiXdfL8Dnmm8ItbgSkaN7Fsn9rTIgI5mu9jGLHgR1 pnxkwJJUI+DpQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C0118693E3; Mon, 19 Jan 2026 13:43: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 10026) with ESMTP id UAzphIxtXw9o; Mon, 19 Jan 2026 13:43:03 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855379; bh=mKYN5ejlzkrkujmvz014Sjy2aM0KmV3V52b+ghI+pxY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AghPuEJ8oJ9gEz1oGuPul0yVC3sKmts2LsLZWFrMSvkzvzQfwGOajwDFqO5NSdrCn 4upy+fhZytPNLSaZIO/SMo6ArMYrQxs/LzXIYlCx6uDB+HXPeW9ENGGG95/ySug25a guynOkbjg8vCA+WrH2BxYOnNSm7Qilxtu1lbY4ek4Pwpif/xnz6pYLPygS5b4JOQ5I W1dCr/KawAVKpoE2B25UMlYRTqum4x2X4tKQazgElOmlHrwo040raSUBXspIMocpQR QwXmKunh8jta5w1X7EwjAyfDYr5pX/DO8XdUvMnmKWqo0XcQoLxp8LdGyFT/UY0pq3 Soojh6xiwWkUw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7774B693BA; Mon, 19 Jan 2026 13:42:59 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:41:08 -0700 Message-ID: <20260119204130.3972647-16-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: NSH6ZIQP6SDGHHA5RUM4UXAK6FDAJD6Z X-Message-ID-Hash: NSH6ZIQP6SDGHHA5RUM4UXAK6FDAJD6Z X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 15/27] expo: Dump the line-measurement 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 Add mline (measurement line) information to the text object dump, showing the start offset, length, and bounding box for each line. This helps debug text layout and word-wrapping issues. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/expo_dump.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/boot/expo_dump.c b/boot/expo_dump.c index d357aa6a5be..cb0a1e443e3 100644 --- a/boot/expo_dump.c +++ b/boot/expo_dump.c @@ -13,6 +13,7 @@ #include #include #include +#include #include "scene_internal.h" /** @@ -111,6 +112,7 @@ static void dump_menu(struct dump_ctx *ctx, struct scene_obj_menu *menu) 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); + const struct vidconsole_mline *mline; outf(ctx, "Text: str_id %x font_name '%s' font_size %x\n", txt->gen.str_id, @@ -118,6 +120,12 @@ static void dump_text(struct dump_ctx *ctx, struct scene_obj_txt *txt) txt->gen.font_size); ctx->indent += 2; outf(ctx, "str '%s'\n", str ? str : "(null)"); + alist_for_each(mline, &txt->gen.lines) { + outf(ctx, "mline: start %x len %x bbox (%x,%x)-(%x,%x)\n", + mline->start, mline->len, + mline->bbox.x0, mline->bbox.y0, + mline->bbox.x1, mline->bbox.y1); + } ctx->indent -= 2; } From patchwork Mon Jan 19 20:41:09 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1646 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=1768855390; bh=0vzqIEwANKeiU2is2z27nVKH1CK4/IKKWxauBb1wVec=; 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=grba4zuy1trlbNWi7IusjC57MXk7a6Sf9YsQzXoN8qDajqoSp3st2dHkkSSLUif89 Yc2LzaQbmA+qyCljLHL8Ev1XOgnDJ1598JMddxqcD1iVepluDYJqMKK+F9p2q7fA3D Qr58X5zcNbQICPQny+CjM7rgyLpdWHdd42OHplcK9WiBYmdYwLv9j/slI5HDDqLRzS YbHnSbZja47ZYan3IK81htmKdc7SOQSkVevAlfNPj3Jkfaxkef2Bljt/PIljkOVTMh pyeAQgN1Va6wMMmmIgumeZbivqCRzz41EoloeFhW4Ha2cnYP8Y7iwfe8xroxVUSkkh I0kmlHtT0Qv2g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 271B869519 for ; Mon, 19 Jan 2026 13:43: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 t6A09VFLZRr5 for ; Mon, 19 Jan 2026 13:43:10 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855390; bh=0vzqIEwANKeiU2is2z27nVKH1CK4/IKKWxauBb1wVec=; 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=grba4zuy1trlbNWi7IusjC57MXk7a6Sf9YsQzXoN8qDajqoSp3st2dHkkSSLUif89 Yc2LzaQbmA+qyCljLHL8Ev1XOgnDJ1598JMddxqcD1iVepluDYJqMKK+F9p2q7fA3D Qr58X5zcNbQICPQny+CjM7rgyLpdWHdd42OHplcK9WiBYmdYwLv9j/slI5HDDqLRzS YbHnSbZja47ZYan3IK81htmKdc7SOQSkVevAlfNPj3Jkfaxkef2Bljt/PIljkOVTMh pyeAQgN1Va6wMMmmIgumeZbivqCRzz41EoloeFhW4Ha2cnYP8Y7iwfe8xroxVUSkkh I0kmlHtT0Qv2g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 16D9069504 for ; Mon, 19 Jan 2026 13:43:10 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855388; bh=cXW0JFRlESkCQZRFjyMh4P+2YqxQ9/vrT6qksEiR4Io=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dWePfBjPkgXd8XR44MNXxX2uVP29j/a7vA2EgD4hgBMaF5dfz7V0VIXD+DymDLDUy SIhpFR1wD0VEjxze5lmpDGqmz2spl8p9g3i2imS4c8facMRte+mTfWuL8r+PliZmAi 4OkzYPmEwVNO1ToQgrC+5nke42Nhm0Yb09WERo/d8KCe0EHDahmrm4qKpzyILGRoA4 A/8QZvZbHd4mqCWdlO3TH8+A8WyVJr3TDhTZ7dpZ6qbOEgterWXhpzct7kq64U0S4P L1aVtMcD5TmsVjsrD7kMRrRyigrxzKJdcsEk2aRt8ftWxV6KIle/CawgKN+ABK9Vyv xhiNC6fd3jPYw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 571E2693E3; Mon, 19 Jan 2026 13:43: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 10026) with ESMTP id 10_NX3W8vFkX; Mon, 19 Jan 2026 13:43:08 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855384; bh=iJc8z1/BAE34Ca2vxZ0rzqzHX0uI42+Hu2pBn3UYmQ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ObxACmBwaZivAn6tvfJDzslXqvKktK9XIGX4xa98Y80hsPgRU16GWwu/+FmW36xyA BnIBBiKd7mcNhgozXIHPdyro0x/mpoqPrjz3Wx0Uz07w9uuy9BZVAd4lBLoNEsGsig 81ng1Bv1BmkFpwUwYyPtnVtcQhPFNubXGdLld49/Q0D0ObcgF306PWfOG0DbuXn0J8 VvWH5CDT5QCfphUNXnEd2uapUWS2ier5vgg/13KLDktTlfzQsFEb0ks/AS8WUkQqP1 PlMQAeu674tsC7dMGgysWfA+Ur9CZTExPjWe81NTkrom/L5+hTUuJrB/wiYOE4LYzg ZmwG0EoqdG8JQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 0D9D0693BA; Mon, 19 Jan 2026 13:43:04 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:41:09 -0700 Message-ID: <20260119204130.3972647-17-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: LP6PLBLRZ2FPXH5LFRJGUAYCANTKXGUL X-Message-ID-Hash: LP6PLBLRZ2FPXH5LFRJGUAYCANTKXGUL X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 16/27] expo: Add debug logging to scene_txtin_arrange() 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 logging to show arr->label_width and margin values used when arranging text-input objects. This helps debug alignment issues. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/scene_txtin.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/boot/scene_txtin.c b/boot/scene_txtin.c index dbd2555f71d..99fad16c11f 100644 --- a/boot/scene_txtin.c +++ b/boot/scene_txtin.c @@ -42,6 +42,10 @@ int scene_txtin_arrange(struct scene *scn, struct expo_arrange_info *arr, if (ret < 0) return log_msg_ret("lab", ret); + if (scene_chklog(obj->name)) + log_debug("arr->label_width %d margin %d\n", + arr->label_width, + theme->textline_label_margin_x); x += arr->label_width + theme->textline_label_margin_x; } From patchwork Mon Jan 19 20:41:10 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1647 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=1768855394; bh=a2gfkbUZhXLHRJc2e4oY1wMMK3Wwray1EXJ+3h4YmlE=; 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=BtdsgcJ5J1uab+ePR4xepBzrtH3sV3S54UJuJvozeW/TPdR6jxiKX3WHLciRfxUZx Z2Ieh+aEo9JUw43NUAy8jwcX6y7Mwb964gi7ZtTZI0t8GYr6embQptk4t0HKWXEQaq +rINuzXwAY3R2GyqIxig8/sQ4+5hM9wBZCL8R0TWmSzZu85Wx/toWzSVbGF2oRqqvD IfayUjK7jjHpy7PaNQePxnB9dXiXlJ9v52/0HR21bzgj/IG44RCC8B8mWSuzG1a63a Yqer7N4pBGpEC2fmPOE/eS9DMbhp0srKOpoxbTJ/p9lucFiiaNgz6g5Q3RZtudsgbM JiMS3DLSbOF6Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C936069519 for ; Mon, 19 Jan 2026 13:43: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 scU0RoN0KxZi for ; Mon, 19 Jan 2026 13:43:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855394; bh=a2gfkbUZhXLHRJc2e4oY1wMMK3Wwray1EXJ+3h4YmlE=; 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=BtdsgcJ5J1uab+ePR4xepBzrtH3sV3S54UJuJvozeW/TPdR6jxiKX3WHLciRfxUZx Z2Ieh+aEo9JUw43NUAy8jwcX6y7Mwb964gi7ZtTZI0t8GYr6embQptk4t0HKWXEQaq +rINuzXwAY3R2GyqIxig8/sQ4+5hM9wBZCL8R0TWmSzZu85Wx/toWzSVbGF2oRqqvD IfayUjK7jjHpy7PaNQePxnB9dXiXlJ9v52/0HR21bzgj/IG44RCC8B8mWSuzG1a63a Yqer7N4pBGpEC2fmPOE/eS9DMbhp0srKOpoxbTJ/p9lucFiiaNgz6g5Q3RZtudsgbM JiMS3DLSbOF6Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B69CB69513 for ; Mon, 19 Jan 2026 13:43:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855393; bh=kpSupJOGoOK3GzEuqXdBMej89hMDmcaj6t05R/9+fEE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=belVGeqh0VROJz1zopYEnCBp3NE8Q0wEgkIcohPPwM/H8795/63/2Xy70Kus7pU93 Rw86i9lVkgDSsfJf1QrF8HxPbIq0MX5TIuhb1XYBrgcSOHKIFMHOUFHdevOLtoKUyB XsPKDOM94101uQfjAc5BRTyiH2fh/oG6ptj+qJwD5tvLCpQf3Mf2w4Z/CDHtWmnmsm YK80IAMiMNvZhKvQoFdOcSbK5NzFCfipidplUglWANu5layfyAzFikiYV46oFAOApN CqsZ23srqtrqPIte3mBF/5NmO7dRxFajjz9oaRV4Ch/4xmyQb41CIRhrUuUBF6SXj9 Y7qHCqGIUJJyQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 098A4693E3; Mon, 19 Jan 2026 13:43: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 pdGSMBhkMCds; Mon, 19 Jan 2026 13:43:12 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855388; bh=Wi9ggxO5/CfRsNvZJA5VQfj24817U7iwzE66+m4xzGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GJg7edElq+5OMdhrJEClcXWiPIkvNzqSpsHNC1pa3HUOjAQ1zVRMUO/GuQMH52vMu VOlKUkA85G2Gdtqy9glwnhN9EFW9lFNxhv/K2dsHAtUSjqqGBCldv1LTsL4vYMDS8F migqST0blXx0eytOEqw2YKxqetLWIQdoDT0Xck+9O7l7OhT/NWVBMg6DQE8ApB/D1G VeXyiTOhHtV06StIhX33Y8VtW3PfsBE9qa980hp9pqna4YVN6XUWArPicx/YPM8PPi L1uWY1C46sqBbmyRuR+hDhpyyD4z7RVHjlWA6fiz1ahTAPQelyHpmTISoxgBLlRl44 QPxGTaKe7yCFA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 9D73C693BA; Mon, 19 Jan 2026 13:43:08 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:41:10 -0700 Message-ID: <20260119204130.3972647-18-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 65UN4LR4UEXJAXPEZTZZSDYRC7QBQMM3 X-Message-ID-Hash: 65UN4LR4UEXJAXPEZTZZSDYRC7QBQMM3 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 17/27] sandbox: expo: Add expo_dump_file() 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 dump expo structures to a file, which is useful for debugging. This uses the configurable output function added in the previous patch. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/expo_dump.c | 36 ++++++++++++++++++++++++++++++++++++ include/expo.h | 9 +++++++++ 2 files changed, 45 insertions(+) diff --git a/boot/expo_dump.c b/boot/expo_dump.c index cb0a1e443e3..940a505b313 100644 --- a/boot/expo_dump.c +++ b/boot/expo_dump.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include "scene_internal.h" @@ -306,3 +307,38 @@ void expo_dump(struct expo *exp, struct membuf *mb) expo_dump_(&ctx, exp); } + +/** + * dump_out_file() - Output function that writes to a file + * + * @priv: Pointer to file descriptor (int *) + * @buf: Buffer containing data to output + * @len: Length of data in buffer + */ +static void dump_out_file(void *priv, const char *buf, int len) +{ + int *fdp = priv; + + os_write(*fdp, buf, len); +} + +int expo_dump_file(struct expo *exp, const char *fname) +{ + struct dump_ctx ctx; + int fd; + + fd = os_open(fname, OS_O_WRONLY | OS_O_CREAT | OS_O_TRUNC); + if (fd < 0) + return fd; + + ctx.out = dump_out_file; + ctx.priv = &fd; + ctx.scn = NULL; + ctx.indent = 0; + + expo_dump_(&ctx, exp); + + os_close(fd); + + return 0; +} diff --git a/include/expo.h b/include/expo.h index e3451d8dd23..c854d78255b 100644 --- a/include/expo.h +++ b/include/expo.h @@ -1279,6 +1279,15 @@ void expo_damage_add(struct expo *exp, const struct vid_bbox *bbox); */ void expo_dump(struct expo *exp, struct membuf *mb); +/** + * expo_dump_file() - Dump expo structure to a file (sandbox only) + * + * @exp: Expo to dump + * @fname: Filename to write to + * Return: 0 if OK, -ve on error + */ +int expo_dump_file(struct expo *exp, const char *fname); + /** * scene_dump() - Dump scene structure to a membuf * From patchwork Mon Jan 19 20:41:11 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1648 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=1768855397; bh=XXgl/YcIxGlSEdWhgNuHluMBZhCTLbJRhwV7YwPJuow=; 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=gXUSupbnQENzvCxPNGANP6QdUi9eiZysrfYOz2HwBMeF65ZpqCP4IkQ3TodWjW9ab Z7/K3HI5YFmtEcq+acVe4lZ6oD6U3RFX7/stzGKALuTYkbtUDgGbSx603E3kj8nnl6 9F9BsUPA9MbncudWSysi3omQ7aDqe6JRwbqBcKtqZmLy5HFFveW+GUIQc7yyuKOC07 XbQ/UFWeHBU1VPXRVmBtpz93mYRcwm0aLw1TLsFxsFUrPVgEz/WiXqLAlHLkycT6z0 uk/JJybAhniARuoQHjwRfog/u88Pz5XyMu0bUvlxv5vXy7ViMgW8zoZqBBe3A/dqZZ uPsmMVA9+ryxQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3FE6769525 for ; Mon, 19 Jan 2026 13:43:17 -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 c_QNzsbz_aPr for ; Mon, 19 Jan 2026 13:43:17 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855396; bh=XXgl/YcIxGlSEdWhgNuHluMBZhCTLbJRhwV7YwPJuow=; 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=ObFywdcfff4gJ2Wf7rqyDDZXmZ1BGmhALrqFAwF+GK5bUc0F+BYjJY3K4o1HeKAZR aIErrssj2coKXrW0aWq4eKYs+GV/DN+/3maqkt4s4Ogeh1+2PeZupkiWBqIxkQwpzo uCx2VzvXrOKG2TeBgK2e4ajlfOQiig1RTxkibX/cdHbyyWfHeKZ5Dp+RPLX56X63V3 Ibq5RspYsY52IPJ59nKB5t/AfKf3Pg9q82Ep7sPtUisoJqkAUgkLO9s5ImVYTtChXU 4EkjhZBRejG+6XdGxwwcG5kEHvJLeNzG69xul5mGU8ScKZFfTdkmaR+3pxOckXJUKy sLaLa9BQ2UxSg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 38D7669504 for ; Mon, 19 Jan 2026 13:43:16 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855394; bh=fVxx5PosZ6mRpJzPLbgtfMYhqtL6CH/Sa6RdQHWKQY4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=r0W8KPwvKTlHdF+OygCUNXUkLmRLdvRp0q0owGSiKoGCN4sceiSyMk2P/3wg5Sr2M extZmnd3E9SaGSKuRlI2p76Et5wcyaqIyciyYBseZn1Ah/xaoeZYFcuxDYYVj6972b EWi9tSSO15KOXy37yHGV8BzMplWvFZ1pXv6YDVh+keFT6+lJu19HNTWi73/spbZOYt M6OU33dk8EaFyweKF4W1Rb267CEpzsrMHIKAUczU+CjIiZFVwiZvPYZChDteTb4Hcf JcLRoc35YYf7K6y4vRCUlwxPNvfc/YYdlH2stjhmxxisULD7AzFiyLhNtBPxty/bjB anHnTObxv2reQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 05C66693E3; Mon, 19 Jan 2026 13:43: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 10026) with ESMTP id 0d-VXQIupd_d; Mon, 19 Jan 2026 13:43:13 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855393; bh=D6HUbfOwJFaB0sBA1sTqO9C2E3pLnd6o+jQl7BEuUNA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oA99oukDrQUasVZXHczEJSG+/x3byv/lLKxrx9K8PoEgXaFyAFucoCLcpO7Lw9PmE gI8w+HUbJW9sJpVuOPX2UszHGyii53c91vsrep5EewwSgTp4JFcmI+lC2uyvqan8oR p1hGFj5GNAgDri8fGgzSyckJP4O7oBzHH4/K8ZVK7vGBHonrKf5pQokRhFQwzAv+6S WXz6mXOtllJkyvLW/jcJPnjGByVZPDSAuoHput4zdMUI3E4hStfx3vpW0IiCZ9hCxu Ag5vv54jrMbPIQ9eyz/FmibWXyJ9OeSBkhN4nMdKRJX91NoWIuEItkXTxTn3wjXXSt V55wwuq6LrOUA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 4D758693BA; Mon, 19 Jan 2026 13:43:13 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:41:11 -0700 Message-ID: <20260119204130.3972647-19-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: R7EHG4KDK6H6CTCKCTDBF3BM56IOBD7V X-Message-ID-Hash: R7EHG4KDK6H6CTCKCTDBF3BM56IOBD7V X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 18/27] expo: Add scene_chklog() for filtered logging 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 helper function that checks the 'expo_log_filter' environment variable. If not set, all objects are logged. If set, it contains a comma-separated list of filters; only objects whose name contains one of the filter strings are logged. The feature is controlled by CONFIG_EXPO_LOG_FILTER, which is enabled by default for sandbox. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/Kconfig | 10 ++++++++++ boot/scene.c | 32 ++++++++++++++++++++++++++++++++ boot/scene_internal.h | 12 ++++++++++++ doc/develop/expo.rst | 27 +++++++++++++++++++++++++++ test/boot/expo.c | 37 +++++++++++++++++++++++++++++++++++++ 5 files changed, 118 insertions(+) diff --git a/boot/Kconfig b/boot/Kconfig index 7ff0dedb748..14b7ed573c9 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -1002,6 +1002,16 @@ config EXPO_TEST variable is set to 1. This is useful for debugging and performance analysis. +config EXPO_LOG_FILTER + bool "Enable expo log filter" + depends on EXPO + default y if SANDBOX + help + Enable the expo log filter. When enabled, the 'expo_log_filter' + environment variable can be set to filter log output by object name. + Only objects whose name contains the filter string are logged. This + is useful for debugging specific expo objects. + config BOOTMETH_SANDBOX def_bool y depends on SANDBOX diff --git a/boot/scene.c b/boot/scene.c index 3565bfd77de..9cade9aad41 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -42,6 +43,37 @@ static const char *const scene_obj_type_names[] = { "textline", }; +bool scene_chklog(const char *name) +{ + const char *filter, *end, *p; + int len; + + if (!CONFIG_IS_ENABLED(EXPO_LOG_FILTER)) + return true; + + filter = env_get("expo_log_filter"); + if (!filter) + return true; + + /* Check each comma-separated filter */ + while (*filter) { + end = strchrnul(filter, ','); + len = end - filter; + + /* Check if this filter segment appears in name */ + for (p = name; *p; p++) { + if (!strncmp(p, filter, len)) + return true; + } + + if (!*end) + break; + filter = end + 1; + } + + return false; +} + int scene_new(struct expo *exp, const char *name, uint id, struct scene **scnp) { struct scene *scn; diff --git a/boot/scene_internal.h b/boot/scene_internal.h index db11f9c0f60..d3c67777cb1 100644 --- a/boot/scene_internal.h +++ b/boot/scene_internal.h @@ -613,6 +613,18 @@ int scene_calc_arrange(struct scene *scn, struct expo_arrange_info *arr); int scene_txt_generic_init(struct expo *exp, struct scene_txt_generic *gen, const char *name, uint str_id, const char *str); +/** + * scene_chklog() - Check if logging is enabled for an object + * + * This checks the 'expo_log_filter' environment variable. If not set, all + * objects are logged. If set, it contains a comma-separated list of filters; + * only objects whose name contains one of the filter strings are logged. + * + * @name: Object name to check + * Return: true if logging should happen, false to skip + */ +bool scene_chklog(const char *name); + /** * scene_flag_name() - Get the name of a scene flag * diff --git a/doc/develop/expo.rst b/doc/develop/expo.rst index fc642ed3696..7ef714be3da 100644 --- a/doc/develop/expo.rst +++ b/doc/develop/expo.rst @@ -605,6 +605,33 @@ 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. +Log filter +~~~~~~~~~~ + +Expo supports filtering log output by object name, which is useful when +debugging specific objects. Set the ``expo_log_filter`` environment variable +to a substring that matches the object names you want to log. + +To enable log filtering:: + + => setenv expo_log_filter texted + => log filter-add -d console -A -c expo -l debug + +This shows debug logs only for objects whose name contains "texted". + +Multiple filters can be specified as a comma-separated list:: + + => setenv expo_log_filter menu,text + +This logs objects matching either "menu" or "text". + +Remove the filter to see all objects:: + + => setenv expo_log_filter + +This feature requires ``CONFIG_EXPO_LOG_FILTER`` which is enabled by default +for sandbox. + Writing expo tests ------------------ diff --git a/test/boot/expo.c b/test/boot/expo.c index 97b9bf82bb7..4febdf87cde 100644 --- a/test/boot/expo.c +++ b/test/boot/expo.c @@ -1260,6 +1260,43 @@ static int expo_scene_obj_type_name(struct unit_test_state *uts) } BOOTSTD_TEST(expo_scene_obj_type_name, 0); +/* Test scene_chklog() */ +static int expo_scene_chklog(struct unit_test_state *uts) +{ + /* Without filter, all objects should be logged */ + env_set("expo_log_filter", NULL); + ut_assert(scene_chklog("my-menu")); + ut_assert(scene_chklog("textline")); + + /* With a single filter, only matching objects should be logged */ + env_set("expo_log_filter", "menu"); + ut_assert(scene_chklog("my-menu")); + ut_assert(scene_chklog("menu-item")); + ut_assert(!scene_chklog("textline")); + ut_assert(!scene_chklog("other")); + + /* With comma-separated filters, any match should pass */ + env_set("expo_log_filter", "menu,text"); + ut_assert(scene_chklog("my-menu")); + ut_assert(scene_chklog("textline")); + ut_assert(scene_chklog("textedit")); + ut_assert(!scene_chklog("other")); + ut_assert(!scene_chklog("image")); + + /* Test with three filters */ + env_set("expo_log_filter", "menu,text,img"); + ut_assert(scene_chklog("my-menu")); + ut_assert(scene_chklog("textline")); + ut_assert(scene_chklog("img-logo")); + ut_assert(!scene_chklog("other")); + + /* Clear the filter */ + env_set("expo_log_filter", NULL); + + return 0; +} +BOOTSTD_TEST(expo_scene_chklog, 0); + /* Test scene_find_obj_within() */ static int expo_find_obj_within(struct unit_test_state *uts) { From patchwork Mon Jan 19 20:41:12 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1649 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=1768855400; bh=ZkmFmdP8+SbzUJoQ2D7OrQFFW3jrF6c1ISOB3Xsf0QE=; 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=C9UFvfcxESeqeafaOKmCdUWHrOgkuPBpV5udN3DlvTN5V7iIQ9q+ELtjF73ZLVQqL 21PJTuIWkl/xNHK8SnybL6S3rvk3xKco1H2RGJqmnGqRPTsCeishEgDTRmub2Q0QJk cZe4GSjAglV9jBSNpIGcwckjT4wU0iAMUd+vve5u4TwZzXh7dq4KfodKYQ88P8uguF mfUDTodTktyj2AaplcEnjg5AX8ViqXZrO+s1iykwNbMR06wfZVPYiCKr9ZVyF5MgtX n6nR9fTiRXEVKPBpfMHB/V7Ox7/IAqYZIbmCz3Bgs+VKMpDNR4BSc8ziRDTZo0addc vuNO2FBm51NQQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BD76B69519 for ; Mon, 19 Jan 2026 13:43: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 thPLlIz_-EvN for ; Mon, 19 Jan 2026 13:43:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855400; bh=ZkmFmdP8+SbzUJoQ2D7OrQFFW3jrF6c1ISOB3Xsf0QE=; 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=C9UFvfcxESeqeafaOKmCdUWHrOgkuPBpV5udN3DlvTN5V7iIQ9q+ELtjF73ZLVQqL 21PJTuIWkl/xNHK8SnybL6S3rvk3xKco1H2RGJqmnGqRPTsCeishEgDTRmub2Q0QJk cZe4GSjAglV9jBSNpIGcwckjT4wU0iAMUd+vve5u4TwZzXh7dq4KfodKYQ88P8uguF mfUDTodTktyj2AaplcEnjg5AX8ViqXZrO+s1iykwNbMR06wfZVPYiCKr9ZVyF5MgtX n6nR9fTiRXEVKPBpfMHB/V7Ox7/IAqYZIbmCz3Bgs+VKMpDNR4BSc8ziRDTZo0addc vuNO2FBm51NQQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id ABA6E69504 for ; Mon, 19 Jan 2026 13:43:20 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855399; bh=/WPR+yVkHLKdwv+pnrQL2lUwqgz3iT2tmT3lzNaMl/E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BN9OZQlcSvkrSmUnKSuHsqAk2Klj+yf0TcXdNA0YzPkby22TPgo6YisLMSywogKQC UvwVGWX/OXAp6bh+MK8Zo07DALw9DPui/VrD/QG5K22h1cDG3/mcL1fQpMAy/cxXVK Zcn+thd6/w911MKWIKlo8i8M9aozi5fAdBGpZNbSz9vt8CLZMB2at13IU+cNzKN/iI FYggHGreVPjhN0b7xj9XL4aMbnUNsM124InRdMJhSDyzFpJtXY5lFegqv3wCbZ7g8k 0VtFDAMqujDEuAd31ToZWXaHetw4oo0EcNumGpkS1HreXayY2KnHXtaIZxCCRHcerr PrTUCACe/CPfw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 870DD69504; Mon, 19 Jan 2026 13:43:19 -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 xikl1N9qz-ZU; Mon, 19 Jan 2026 13:43:19 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855394; bh=5kCtsa9QhfhZUIdUoxue41bJd/Uc7/pcCv3KtrVrGGQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SHaQ6eW7yTL/9j10EsxXRiCwQrEotDKI6FbQNNFkgB90kSLlIS5x+Ut34d/yMj7cZ EIaKS36iVjZNXbyj2lcTtDCM1YTQCuFb1K2bUg2kKpSmPbLO3F5F6YbVs36ugrdds8 0pAPQwSmsGR9QszhfQpTkem40VhaboahgQ+56spoAG7qNh7C0IYvZEV7eOcykncUHL HQq23EkPjAzvX8dEAQhTI6lc3z1MVgfa0z9R28s5/sNBxxUSGCRQpx+h1nC8dmwvvP cETGKktNAXmcl3mg2kRkVxLvMaJz5dP3UQWidQfigZ+qjH0uHcpg78XjP3XknakrMB i/AXEW3q6bRzA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 48A26693BA; Mon, 19 Jan 2026 13:43:14 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:41:12 -0700 Message-ID: <20260119204130.3972647-20-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: WXLPZMRQQAOOKL6KRKQWONP3OKKGJMPS X-Message-ID-Hash: WXLPZMRQQAOOKL6KRKQWONP3OKKGJMPS X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 19/27] expo: Fix textedit word-wrap measurement order 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 Text in a textedit can extend past the right boundary because it is measured before its bbox is set correctly. Call scene_obj_get_hw() after setting the edit text's bbox in scene_txted_calc_dims() to ensure correct word-wrapping. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/scene_textedit.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/boot/scene_textedit.c b/boot/scene_textedit.c index 160b9457a50..2075cfbd417 100644 --- a/boot/scene_textedit.c +++ b/boot/scene_textedit.c @@ -73,6 +73,11 @@ int scene_txted_calc_dims(struct scene_obj_txtedit *ted, struct udevice *cons) if (ret < 0) return log_msg_ret("sbb", ret); + /* Measure the edit text now that its bbox is set correctly */ + ret = scene_obj_get_hw(scn, ted->tin.edit_id, NULL); + if (ret < 0) + return log_msg_ret("hw", ret); + return 0; } From patchwork Mon Jan 19 20:41:13 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1650 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=1768855405; bh=6ipS9+gQ1mXzABf9wSdGalH9xKG2jJYnwvDA4GdACaM=; 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=n5dRCTIlk+ku0upN3OmnfUMHEUZuJLVduOp2zVMEDR7jNvnaeSTnxMD9bdsR+1kMm MJGWfhv+OVLQmwrQtczGCGy5r5V/Og1K/DV6MFAvmoBTZiwLo5oDWLWHzSFcarR6id BNc4BArtc/4PbcU8Pq4rlQZdYXLuD7H8Xi+y+gy2WDZ2lpC1ZKHuF9Mf6Egm7XR0Yj KMdPi4edxLp/Eoel/8jasXyY9zZVc7+hzG7guWNNNgsGlnb/FOFK0qUWESqob+NZCx pgYbNu1oOOIJQbImXXGEm8gXSc4Hnd3wLP4g9mg2UeuTtR+F7rg1qkkO33cZuTNWDV SGvpBqmV7bpCw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 99BBF6951C for ; Mon, 19 Jan 2026 13:43:25 -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 HaDw7mo4hprb for ; Mon, 19 Jan 2026 13:43:25 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855405; bh=6ipS9+gQ1mXzABf9wSdGalH9xKG2jJYnwvDA4GdACaM=; 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=n5dRCTIlk+ku0upN3OmnfUMHEUZuJLVduOp2zVMEDR7jNvnaeSTnxMD9bdsR+1kMm MJGWfhv+OVLQmwrQtczGCGy5r5V/Og1K/DV6MFAvmoBTZiwLo5oDWLWHzSFcarR6id BNc4BArtc/4PbcU8Pq4rlQZdYXLuD7H8Xi+y+gy2WDZ2lpC1ZKHuF9Mf6Egm7XR0Yj KMdPi4edxLp/Eoel/8jasXyY9zZVc7+hzG7guWNNNgsGlnb/FOFK0qUWESqob+NZCx pgYbNu1oOOIJQbImXXGEm8gXSc4Hnd3wLP4g9mg2UeuTtR+F7rg1qkkO33cZuTNWDV SGvpBqmV7bpCw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 87D9369504 for ; Mon, 19 Jan 2026 13:43:25 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855403; bh=Jyl9ZM7GoeOvzNHqyZaSCfrOBFnh5+iRgABlT6UTbgU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dtWZNqyJclott0XgyPO3zA3t4TBZ/WVvC1k9NPJ/lfimaKtgBhTiZ3LbMZWt21QYA GySki/Y9zXLXStPXipF570HJyqEoMbrws8tktMyhm2uLM4EbHO5I9VDucWLMSS6jCC jdhY+ivVINtkMg40SpoI6/r7yU/WhgJRr5qijMgcccjEZOFGYhUO/l3vxjgkJGZBkb fmpF2hq3hq6nOYc1DhyAQyRb/PuqY3wG9blmIYu+WDslVlwjFXfl3oybyeGI9byrYn R03tAJOWWLVw2vkMXwtn5GOierqIDhZpaktHBu+1XnKP+wQPbQPMtCDCd7VPNhxdsZ fofEL24j+r7Eg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 29CDC693BA; Mon, 19 Jan 2026 13:43: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 3gMAamZerkmw; Mon, 19 Jan 2026 13:43:23 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855399; bh=/5PU0nVg6oVI1WH646pubEI/CkXxhc3xVoVOrZFEBro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wRWPp8db/vAJmxRRBkcygZGXgUdpu5bWA7fxDn/xipb3elAdKpoNwBkF8xjlFbZ1h +MDQ20HNG2bpQUt+btrW9J3S3dBOM+2DNRfyrxGFl6G6N6bk1KyVpRBfvOMLnvNlIh u5Rvpn9QbSrSsEPf+4BMKzSuNx8fmWYNdS+vu8xPqP5adB65w7vaG8gLWTjSFYBK9B 0bBxTwf+D9nlxM1ek/308e4TURKLi/KjaNl5LjvSa3Sfv7GvaJnJvpS86DcjMHNRIK D/ykskffIdfOEZu2fIhQlY1rbhivK7yRZQFO3jQpEF4amdCQVDQIP7DEfIZzngOZdB G2puR4yAvPm/w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id D5FB5693E3; Mon, 19 Jan 2026 13:43:18 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:41:13 -0700 Message-ID: <20260119204130.3972647-21-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: RIPXIMHP725HSCEVQ5XJCPAJGAWMVU7N X-Message-ID-Hash: RIPXIMHP725HSCEVQ5XJCPAJGAWMVU7N X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 20/27] expo: Add per-line measurement logging 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 detailed per-line measurement logging using log_content(), showing each line's bounding box and text content after measurement. Use scene_chklog() to filter which objects produce log output. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/scene.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/boot/scene.c b/boot/scene.c index 9cade9aad41..b64ddf51630 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -535,13 +535,27 @@ int scene_obj_get_hw(struct scene *scn, uint id, int *widthp) limit = obj->flags & SCENEOF_SIZE_VALID ? obj->req_bbox.x1 - obj->req_bbox.x0 : -1; - log_debug("obj %s limit %d\n", obj->name, limit); ret = vidconsole_measure(scn->expo->cons, gen->font_name, gen->font_size, str, limit, &bbox, &gen->lines); if (ret) return log_msg_ret("mea", ret); + if (scene_chklog(obj->name)) { + log_debug("obj %s limit %d: %d lines, width %d height %d\n", + obj->name, limit, gen->lines.count, + bbox.x1, bbox.y1); + for (int i = 0; i < gen->lines.count; i++) { + const struct vidconsole_mline *mline; + + mline = alist_get(&gen->lines, i, + struct vidconsole_mline); + log_content("line %d: %d,%d %d,%d '%.*s'\n", i, + mline->bbox.x0, mline->bbox.y0, + mline->bbox.x1, mline->bbox.y1, + mline->len, str + mline->start); + } + } if (widthp) *widthp = bbox.x1; From patchwork Mon Jan 19 20:41:14 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1651 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=1768855410; bh=/LXvrpmSNSRenfeLvGoAdjEH2dgPdcZB53u2r6+roFU=; 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=pxv/32JDVUd6808rq7NQsNC3alsCeIwA17j0+SQN/N//PL0NN2tUi7EIhYk/i4+Ip U5QMWcVhV8XqwBdxaLNfcu9XmEZJ4wn9QioAHxuVHbU0p/5tfRgZUhdpLm4oCE12h6 H6qKUnP9K6BsKFEV90IZO6Ycd6PlI5YneEFndeKpafTy3mO5L4mF5D9suI7Iexw2Pt vWG9fLBa/PgL7E2PCo8dQ86A5PMt0OEx/ikOHwwhiIw16llAHfQC37o1wrTMgaipfD UDHteeYFg3lkMEoouUJS678sXYnW6mIDO1T8PoTB0w+aMpQltX2UtEMcf8yU46TCE7 QxTvBMJEK0bhQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 28C53693BA for ; Mon, 19 Jan 2026 13:43: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 0igH-sADqO14 for ; Mon, 19 Jan 2026 13:43:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855410; bh=/LXvrpmSNSRenfeLvGoAdjEH2dgPdcZB53u2r6+roFU=; 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=pxv/32JDVUd6808rq7NQsNC3alsCeIwA17j0+SQN/N//PL0NN2tUi7EIhYk/i4+Ip U5QMWcVhV8XqwBdxaLNfcu9XmEZJ4wn9QioAHxuVHbU0p/5tfRgZUhdpLm4oCE12h6 H6qKUnP9K6BsKFEV90IZO6Ycd6PlI5YneEFndeKpafTy3mO5L4mF5D9suI7Iexw2Pt vWG9fLBa/PgL7E2PCo8dQ86A5PMt0OEx/ikOHwwhiIw16llAHfQC37o1wrTMgaipfD UDHteeYFg3lkMEoouUJS678sXYnW6mIDO1T8PoTB0w+aMpQltX2UtEMcf8yU46TCE7 QxTvBMJEK0bhQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 187F9693E3 for ; Mon, 19 Jan 2026 13:43:30 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855408; bh=7z7jwbvd7CacpkJDVm9xDYP2fMcHFhVKCYJ5yQeyQ2g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BSpotjL1sil+VUhQtT3sw5nEMoLI2adlTSD5QvWsS6uInOfrF7zCIKBaO5vSm4jAd qLa7a+mnUjxl9XUlGoqbhfnnyyJ8f3K681UmX3WqoF9pWzCgZ1dbvuSTVdsTvJWq5o xI2A8c76kvn08zG1GcbZhYHDkwIyBXsRXKHyfd3u4NANI6I8DYJwrxy5ADWv72vuuw S8r8HEYAofJbwwUbYmVYN+BX/O7ITcptAplHAucgqgWvSadYQAQHwA+c75YVLL9dJx 0TuqqR7OXBF1XVgQvedHTCtT1XvLMatAZEFiEqhEbTxaX/mm8KKPIzbsP0IB+KXqTx mbeVt/6Ahq8sA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 18802693BA; Mon, 19 Jan 2026 13:43:28 -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 LTkgEaGku7Vf; Mon, 19 Jan 2026 13:43:27 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855403; bh=1nYtjd/UtiC+EbWsQhXSjvbwPzWVu7kXlYW6NM12cBo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cy9odT0BzBMjq6JssY5/mcO6nSscl4v1OHMxjNqfakZvTlqRBkDZOETlyaTI37erE N+9yWkRHLGtS3BlC91XjMmEhw+55JNeP91GDmaQ/R5FGHqdjcZUUItLlU9XRqbcDHw vk9bfMTKb2Kg2xZkbPu8AvPXzgmrAxQJP2nDuvFJAHjHfeBMTDUGCt564elHHqPWaq Be6bf+E2ttDg9xWTAJ1waLVz4slhEVYKbFIyS8kCov5egT7x4OC7cscz44OewBla9d PAxAyp7JIG3XCiwMMI7nTK/1S+PuH9ip5XiC3Nkawis0Q61BBoO7dOaon6R6rc77rg dtG70TzbdGfiA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 70BD4693E3; Mon, 19 Jan 2026 13:43:23 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:41:14 -0700 Message-ID: <20260119204130.3972647-22-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: X5NTTIUET2K77WEZDUHUCV4UBI7OAS5D X-Message-ID-Hash: X5NTTIUET2K77WEZDUHUCV4UBI7OAS5D X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 21/27] expo: Add a txtin function to render dependencies 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 Factor out the render_deps code from scene_textline_render_deps() into a shared helper scene_txtin_render_deps(). This handles cursor display when a text-input object is open, including entry restore/save and cursor positioning. For now, only textlines are supported. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/scene.c | 3 +-- boot/scene_internal.h | 25 +++++++++++++------------ boot/scene_textline.c | 29 ----------------------------- boot/scene_txtin.c | 29 +++++++++++++++++++++++++++++ 4 files changed, 43 insertions(+), 43 deletions(-) diff --git a/boot/scene.c b/boot/scene.c index b64ddf51630..ae3851cc82c 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -993,8 +993,7 @@ int scene_render_deps(struct scene *scn, uint id) (struct scene_obj_menu *)obj); break; case SCENEOBJT_TEXTLINE: - scene_textline_render_deps(scn, - (struct scene_obj_textline *)obj); + scene_txtin_render_deps(scn, obj, scene_obj_txtin(obj)); break; } } diff --git a/boot/scene_internal.h b/boot/scene_internal.h index d3c67777cb1..96bc4e06ad6 100644 --- a/boot/scene_internal.h +++ b/boot/scene_internal.h @@ -372,18 +372,6 @@ int scene_render_deps(struct scene *scn, uint id); */ int scene_menu_render_deps(struct scene *scn, struct scene_obj_menu *menu); -/** - * scene_textline_render_deps() - Render a textline and its dependencies - * - * Renders the textline and all of its attached objects - * - * @scn: Scene to render - * @tline: textline to render - * Returns: 0 if OK, -ve on error - */ -int scene_textline_render_deps(struct scene *scn, - struct scene_obj_textline *tline); - /** * scene_iter_objs() - Iterate through all scene objects * @@ -558,6 +546,19 @@ void scene_txtin_calc_bbox(struct scene_obj *obj, struct scene_txtin *tin, struct vidconsole_bbox *bbox, struct vidconsole_bbox *edit_bbox); +/** + * scene_txtin_render_deps() - Render dependencies for a text-input object + * + * Renders the edit text on top of the background if open + * + * @scn: Scene containing the object + * @obj: Object to render + * @tin: Text-input info + * Return: 0 if OK, -ve on error + */ +int scene_txtin_render_deps(struct scene *scn, struct scene_obj *obj, + struct scene_txtin *tin); + /** * scene_obj_calc_bbox() - Calculate bounding boxes for an object * diff --git a/boot/scene_textline.c b/boot/scene_textline.c index f940be3ed28..46ab53e30c9 100644 --- a/boot/scene_textline.c +++ b/boot/scene_textline.c @@ -152,35 +152,6 @@ bool scene_textline_within(const struct scene *scn, return scene_within(scn, tline->tin.edit_id, x, y); } -int scene_textline_render_deps(struct scene *scn, - struct scene_obj_textline *tline) -{ - const bool open = tline->obj.flags & SCENEOF_OPEN; - struct udevice *cons = scn->expo->cons; - uint i; - - /* if open, render the edit text on top of the background */ - if (open) { - int ret; - - ret = vidconsole_entry_restore(cons, &scn->entry_save); - if (ret) - return log_msg_ret("sav", ret); - scene_render_obj(scn, tline->tin.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); - - vidconsole_show_cursor(cons); - } - - return 0; -} - /** * scene_textline_putch() - Output a character to the vidconsole * diff --git a/boot/scene_txtin.c b/boot/scene_txtin.c index 99fad16c11f..2e7c496310d 100644 --- a/boot/scene_txtin.c +++ b/boot/scene_txtin.c @@ -57,6 +57,35 @@ int scene_txtin_arrange(struct scene *scn, struct expo_arrange_info *arr, return x; } +int scene_txtin_render_deps(struct scene *scn, struct scene_obj *obj, + struct scene_txtin *tin) +{ + const bool open = obj->flags & SCENEOF_OPEN; + struct udevice *cons = scn->expo->cons; + uint i; + + /* if open, render the edit text on top of the background */ + if (open) { + int ret; + + ret = vidconsole_entry_restore(cons, &scn->entry_save); + if (ret) + return log_msg_ret("sav", ret); + scene_render_obj(scn, tin->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); + + vidconsole_show_cursor(cons); + } + + return 0; +} + void scene_txtin_calc_bbox(struct scene_obj *obj, struct scene_txtin *tin, struct vidconsole_bbox *bbox, struct vidconsole_bbox *edit_bbox) From patchwork Mon Jan 19 20:41:15 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1652 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=1768855414; bh=c1LByFu34h4xehWMrxXuaYinlybNzgR7027lLlyx9sc=; 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=jCaihBKpygwcRajS7DR/JIB1eCTmGxfjhnohmEnFl5zUT04Do3izKYIKZDjU9OEh3 DPQMlm6uuiGaAJ9GQxUYtLMK7upX76klV5gT/6SqeFSzkXDHZmA8Ko02IeHvC2PHXO zRwVvLWyLxXHTvWvo8ldp+j0UX13FkkfZr4qamM/daNlPdzQbK2O6pjtMgNmkhJI4G 5Y3F6A0mtVclIXpbtkvy291yw7/1I4p/naRjDCCJIfpcr5HkE+jiYhMJR6l7gi8AtU wmMMrRosPslTCO10E54Ykz4DSgsEUqXLFdESP2w11XczIPNvWhvEFYvGrn5Dpi71DK jEljduP4Jg4+A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9374F6951C for ; Mon, 19 Jan 2026 13:43:34 -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 SH-NhXqJyiXZ for ; Mon, 19 Jan 2026 13:43:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855414; bh=c1LByFu34h4xehWMrxXuaYinlybNzgR7027lLlyx9sc=; 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=jCaihBKpygwcRajS7DR/JIB1eCTmGxfjhnohmEnFl5zUT04Do3izKYIKZDjU9OEh3 DPQMlm6uuiGaAJ9GQxUYtLMK7upX76klV5gT/6SqeFSzkXDHZmA8Ko02IeHvC2PHXO zRwVvLWyLxXHTvWvo8ldp+j0UX13FkkfZr4qamM/daNlPdzQbK2O6pjtMgNmkhJI4G 5Y3F6A0mtVclIXpbtkvy291yw7/1I4p/naRjDCCJIfpcr5HkE+jiYhMJR6l7gi8AtU wmMMrRosPslTCO10E54Ykz4DSgsEUqXLFdESP2w11XczIPNvWhvEFYvGrn5Dpi71DK jEljduP4Jg4+A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 83A4669504 for ; Mon, 19 Jan 2026 13:43:34 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855412; bh=RFTswCgyWZrJGIf9ud61pZhkH7oDq2VIYUoewR5FjA0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rhRJm3AY17tpFcYGofsQggDWJ7jiMNhoALwcdcPP9nZHaoM9JIOlXZVC7z+pQ4viH WhIGKCVSTwuj2dkoplk6oBeZWi8zk/lvqR2p+qO045YRyR+0Pomz60YbjRtsL5P8gf dkMQSzERtUDG1SqduCfPVASloHO0dK8lACfPxzdex3equm4DhgK7cPPXNDsJelqI2o MH+8EnljVJf6HBCYQB7kZUiRzM5HWqcmimArljKyI6J8/qAqb/KiIjvBWFwLzayA9G azdWr8y2Lt6B+ze4kgCihTAr0d16elph1YqEXoA8VjB0HagB8FemWdL8g3TAv9PX3s ZkCmUBgsLR6Iw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 89A59693BA; Mon, 19 Jan 2026 13:43: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 yCXe7hbE2Kuq; Mon, 19 Jan 2026 13:43:32 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855408; bh=gnqfTRUiNsIyb+lVnoM+7ZH0RIAeTSyF92qq8S48xwo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M8DJAh52aXQoZ8kHT7b6BLVvLfacfy3NzmokqCa7Qc/kLihFdaL3uc/UTyd8Jn7BG euB/UOT+KejswN92D+4irxjancGMv/MHzK8D0T3TNZ6NjLHj5FNNYbWMDOST7UgQpW oQqF0ktiiYoqpU7Hi3Orzq/NsjhDrj8LjfgL8li2joL92O8Bbf2Jvp4TDJYKraLC29 lLuEojS4OnqGK4jyAil90Uey9e0iwTVYV8EJtf4UxtY+24JHTpFlTAqrvbyVCmYqKN 9qoRNuIzr1oAaa/VNztzFSrGK3+nVtM9nYb5jhJmeShrRvPFwTAdHcPkTcz0Kw4Qno MAZCbkD4g6mWw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 1BBD669504; Mon, 19 Jan 2026 13:43:28 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:41:15 -0700 Message-ID: <20260119204130.3972647-23-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: RBABDP6MXWQVNPC6QGOHLOAWDI36NLCA X-Message-ID-Hash: RBABDP6MXWQVNPC6QGOHLOAWDI36NLCA X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 22/27] expo: Combine textline and textedit switch cases 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 Combine the TEXTLINE and TEXTEDIT cases in scene_obj_render() and scene_apply_theme() since they have identical handling. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/scene.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/boot/scene.c b/boot/scene.c index ae3851cc82c..b05291138ed 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -786,6 +786,7 @@ static int scene_obj_render(struct scene_obj *obj, bool text_mode) break; } case SCENEOBJT_TEXTLINE: + case SCENEOBJT_TEXTEDIT: if (obj->flags & SCENEOF_OPEN) scene_render_background(obj, true, false); break; @@ -796,10 +797,6 @@ static int scene_obj_render(struct scene_obj *obj, bool text_mode) obj->bbox.y1, box->width, vid_priv->colour_fg, box->fill); break; } - case SCENEOBJT_TEXTEDIT: - if (obj->flags & SCENEOF_OPEN) - scene_render_background(obj, true, false); - break; } return 0; @@ -1621,10 +1618,7 @@ int scene_apply_theme(struct scene *scn, struct expo_theme *theme) case SCENEOBJT_MENU: case SCENEOBJT_BOX: case SCENEOBJT_TEXTLINE: - break; case SCENEOBJT_TEXTEDIT: - scene_txted_set_font(scn, obj->id, NULL, - theme->font_size); break; case SCENEOBJT_TEXT: scene_txt_set_font(scn, obj->id, NULL, From patchwork Mon Jan 19 20:41:16 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1653 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=1768855420; bh=n6/diLelfIaMjMXWjSVX6GbI+RhiQiehI6WxxlBjXzU=; 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=gibl68UxrPQB/5gPaKdkbH0e4lXAT3bqEx021Lbq7WULx5S4TofhGHjithL4e8P3x 1/LSByBZ0SmIVZHrxTCCnRM1kfkviUBWAskoAIXMpFZLDAgljHzHfiJ0y916KWSoex joh2bvsbTZouAYDN8nlV0sFFIgBdB0ur2V5KY4/PA+0//aTj4EMrdNSnDVqeE2ureD 7IcYhvBz3gV/fVBcR/PidjrnXu0XqtX+fSyFWlvP9D9gItkDZ+GSvue+0vTgU99gPB KAumiOw2ovY/b6/tblGPMTBCLQ1t+zGNPt0306h+WEZjyQC1zqvXTMmw3mdco1kHdf UUAI6L0atb4LA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0DEC66951C for ; Mon, 19 Jan 2026 13:43:40 -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 iEJPwBiyCTmA for ; Mon, 19 Jan 2026 13:43:39 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855419; bh=n6/diLelfIaMjMXWjSVX6GbI+RhiQiehI6WxxlBjXzU=; 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=GCCSaluope9VVRuDuWzqa2rz2Fu+ICEXr8I/X5P/VVEd2HsYtaODrXVB210CQOsN7 TbTeh0rICG8AGmwf8xho8hfDF8dwjxtx0Bk17oOHtN8FzlkL2SJvWaPOYfwhifGNOn kVFQVA59gs/d9k5N9oc1pLGsmP2Ohji1DL94NUdtejO/UJLP/T8NR0RHeHo2T/XmG3 yL2uYlwLYCz67UcXYP+LfsghWCWeuin033DTNlTzp7PCRraGk6Qf6iGjLJ17S5Yj4Y NZMGlIp/8D4eQ7p5BWWDz4yPQX6DTMC3ro139v0jAal6T9rjDR/cwP/PlL6B/FKi1o ugImrr/09Vr3Q== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id F0A3E69504 for ; Mon, 19 Jan 2026 13:43:39 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855416; bh=ZDCP08/wlWnLwVjwMK6BznjvZyaVZb9fV8Sq7iWgg7g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BlvrnwzJUmTHqVEKAsqkdCNKgwJ9/oopWbJvT2QYBL4wur+VbGII7tfjybkt2wGYi lDgtpxsyl3TMeFWQviTqosZm3fzthjxHZ4tzydCxqHN5R+bbhL3W0MMPI9bammnC6r AacjBGtKpWnzZQO88i3NzwN7TFeB2+2RIk8uT4refWSnjlm/eDxPAoXh+Z2EFq+ga4 RdUMpX7x3vZsIJQBWATZuih1R+rCaLEiD2GXkqqVRkw19at5sv+HrvfykJk6/dRfrw uz6E7MCG+VyU50joyYrkJsdRgsdkMhIFwkuHaDctU4NQzipddIVjnXqdZp3BUMUctf 8f+eMyOyTTyeg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EFAA7693BA; Mon, 19 Jan 2026 13:43:36 -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 JCcDIEMraoiR; Mon, 19 Jan 2026 13:43:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855412; bh=7dcm9P8kAiSNyeDAF/m7VAWQ9CtpLT7WpjGKiYeIIj8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IYLD6gGkVS7WfbqhNjAONyfXq2ZQX4Cls2N/DY7/bDktp3j7s8l3mYjBjVHTib8S4 hJHt5sPrqyQgSajRLndDizis8bbZ/UxANpWH53QyfbU0wIwzMcHKEXsfC+5M5uE0+g qyuiUaGkT6BLxojHkyYLoFToyOEAWDUakDmZ8HU5Ds0H39zyTbDV9vwHZTqaN/s0ML T2qLU6+v176r8PtY9AA8jSDmO41NYk2DulS2vUq5f4YMTU/UCADieMMoHqBbjrFvjh JTUy35m0pX9lKnobnO+gDnLihVfzr8di2I6B7mmw8qQbbJLCRXsQcfTvmyQJ0UH9Q/ HLBxmM5RvBixQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id A12E9693E3; Mon, 19 Jan 2026 13:43:32 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:41:16 -0700 Message-ID: <20260119204130.3972647-24-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: E4Y2XQH4SB5H3CSCK2Y23SEWUUGT4LMZ X-Message-ID-Hash: E4Y2XQH4SB5H3CSCK2Y23SEWUUGT4LMZ X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 23/27] expo: Add scene_txtin_open() for common text-input open code 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 Factor out the open code from scene_textline_open() into a shared helper scene_txtin_open() This sets up the text editor ready for use, including copying the backup text, setting cursor position, and initialising the CLI line state. Update scene_obj_open() to call scene_txtin_open() directly for both textline and textedit objects. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/scene.c | 5 ++--- boot/scene_internal.h | 10 +++++---- boot/scene_textline.c | 45 --------------------------------------- boot/scene_txtin.c | 49 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 57 insertions(+), 52 deletions(-) diff --git a/boot/scene.c b/boot/scene.c index b05291138ed..6b5c934a2e7 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -1670,11 +1670,10 @@ static int scene_obj_open(struct scene *scn, struct scene_obj *obj) case SCENEOBJT_MENU: case SCENEOBJT_TEXT: case SCENEOBJT_BOX: - case SCENEOBJT_TEXTEDIT: break; case SCENEOBJT_TEXTLINE: - ret = scene_textline_open(scn, - (struct scene_obj_textline *)obj); + case SCENEOBJT_TEXTEDIT: + ret = scene_txtin_open(scn, obj, scene_obj_txtin(obj)); if (ret) return log_msg_ret("op", ret); break; diff --git a/boot/scene_internal.h b/boot/scene_internal.h index 96bc4e06ad6..8899ba538ae 100644 --- a/boot/scene_internal.h +++ b/boot/scene_internal.h @@ -569,15 +569,17 @@ int scene_txtin_render_deps(struct scene *scn, struct scene_obj *obj, int scene_obj_calc_bbox(struct scene_obj *obj, struct vidconsole_bbox *bbox); /** - * scene_textline_open() - Open a textline object + * scene_txtin_open() - Open a text-input object * * Set up the text editor ready for use * - * @scn: Scene containing the textline - * @tline: textline object + * @scn: Scene containing the object + * @obj: Object to open + * @tin: Text-input info * Return: 0 if OK, -ve on error */ -int scene_textline_open(struct scene *scn, struct scene_obj_textline *tline); +int scene_txtin_open(struct scene *scn, struct scene_obj *obj, + struct scene_txtin *tin); /** * scene_textline_close() - Close a textline object diff --git a/boot/scene_textline.c b/boot/scene_textline.c index 46ab53e30c9..2199b3d0641 100644 --- a/boot/scene_textline.c +++ b/boot/scene_textline.c @@ -152,48 +152,3 @@ bool scene_textline_within(const struct scene *scn, return scene_within(scn, tline->tin.edit_id, x, y); } -/** - * scene_textline_putch() - Output a character to the vidconsole - * - * This is used as the putch callback for CLI line editing, so that characters - * are sent to the correct vidconsole. - * - * @cls: CLI line state - * @ch: Character to output - */ -static void scene_textline_putch(struct cli_line_state *cls, int ch) -{ - struct scene *scn = container_of(cls, struct scene, cls); - - vidconsole_put_char(scn->expo->cons, ch); -} - -int scene_textline_open(struct scene *scn, struct scene_obj_textline *tline) -{ - struct udevice *cons = scn->expo->cons; - struct scene_obj_txt *txt; - int ret; - - /* Copy the text into the scene buffer in case the edit is cancelled */ - memcpy(abuf_data(&scn->buf), abuf_data(&tline->tin.buf), - abuf_size(&scn->buf)); - - /* get the position of the editable */ - txt = scene_obj_find(scn, tline->tin.edit_id, SCENEOBJT_NONE); - if (!txt) - return log_msg_ret("cur", -ENOENT); - - vidconsole_set_cursor_pos(cons, txt->obj.bbox.x0, txt->obj.bbox.y0); - vidconsole_entry_start(cons); - cli_cread_init(&scn->cls, abuf_data(&tline->tin.buf), tline->tin.line_chars); - scn->cls.insert = true; - scn->cls.putch = scene_textline_putch; - ret = vidconsole_entry_save(cons, &scn->entry_save); - if (ret) - return log_msg_ret("sav", ret); - - /* make sure the cursor is visible */ - vidconsole_readline_start(true); - - return 0; -} diff --git a/boot/scene_txtin.c b/boot/scene_txtin.c index 2e7c496310d..a4c373c14fa 100644 --- a/boot/scene_txtin.c +++ b/boot/scene_txtin.c @@ -10,8 +10,10 @@ #include #include +#include #include #include +#include #include "scene_internal.h" int scene_txtin_init(struct scene_txtin *tin, uint size, uint line_chars) @@ -86,6 +88,53 @@ int scene_txtin_render_deps(struct scene *scn, struct scene_obj *obj, return 0; } +/** + * scene_txtin_putch() - Output a character to the vidconsole + * + * This is used as the putch callback for CLI line editing, so that characters + * are sent to the correct vidconsole. + * + * @cls: CLI line state + * @ch: Character to output + */ +static void scene_txtin_putch(struct cli_line_state *cls, int ch) +{ + struct scene *scn = container_of(cls, struct scene, cls); + + vidconsole_put_char(scn->expo->cons, ch); +} + +int scene_txtin_open(struct scene *scn, struct scene_obj *obj, + struct scene_txtin *tin) +{ + struct udevice *cons = scn->expo->cons; + struct scene_obj_txt *txt; + int ret; + + /* Copy the text into the scene buffer in case the edit is cancelled */ + memcpy(abuf_data(&scn->buf), abuf_data(&tin->buf), + abuf_size(&scn->buf)); + + /* get the position of the editable */ + txt = scene_obj_find(scn, tin->edit_id, SCENEOBJT_NONE); + if (!txt) + return log_msg_ret("cur", -ENOENT); + + vidconsole_set_cursor_pos(cons, txt->obj.bbox.x0, txt->obj.bbox.y0); + vidconsole_entry_start(cons); + cli_cread_init(&scn->cls, abuf_data(&tin->buf), tin->line_chars); + scn->cls.insert = true; + scn->cls.putch = scene_txtin_putch; + ret = vidconsole_entry_save(cons, &scn->entry_save); + if (ret) + return log_msg_ret("sav", ret); + + /* make sure the cursor is visible */ + vidconsole_readline_start(true); + + return 0; +} + void scene_txtin_calc_bbox(struct scene_obj *obj, struct scene_txtin *tin, struct vidconsole_bbox *bbox, struct vidconsole_bbox *edit_bbox) From patchwork Mon Jan 19 20:41:17 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1654 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=1768855424; bh=jiqZAKMEl6UXUiLrloLVNeli33KAbFBWrjYKkiw0JOY=; 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=QumO4JckN6WJ9BHRAtIiTu2uZv68LLdss91VmUoR/x8KWnmwNBnZsz0jhR7hLU23C 5Jwoc/LLKQKQKBBEkhMKrxJ93TzUFxBMrhn2vveIIYNlB7oSq3vPOwHKPic6Tqi8F1 jnuCPhS3REZKhu9SVQp8ZHz03kh90LcW/FfiYWY3e8ZZr6Zc+rmUSWOFFvdtznLBnW 2qOGzRF90VAYV389sKWDZUUxtduwsQiT597FEYlgoviXo+hILo4mDLw8gqakB5IvLt U/dJEfpVIPq+Eeaqf1mdgF7BJAKPzmcL2G1qNGeiIyS/6/fEtFQWDLHUnQFJw0LP+w CJl1ZrSFxCTvg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 96F5C6951C for ; Mon, 19 Jan 2026 13:43:44 -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 5N64HRsR_0OV for ; Mon, 19 Jan 2026 13:43:44 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855424; bh=jiqZAKMEl6UXUiLrloLVNeli33KAbFBWrjYKkiw0JOY=; 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=QumO4JckN6WJ9BHRAtIiTu2uZv68LLdss91VmUoR/x8KWnmwNBnZsz0jhR7hLU23C 5Jwoc/LLKQKQKBBEkhMKrxJ93TzUFxBMrhn2vveIIYNlB7oSq3vPOwHKPic6Tqi8F1 jnuCPhS3REZKhu9SVQp8ZHz03kh90LcW/FfiYWY3e8ZZr6Zc+rmUSWOFFvdtznLBnW 2qOGzRF90VAYV389sKWDZUUxtduwsQiT597FEYlgoviXo+hILo4mDLw8gqakB5IvLt U/dJEfpVIPq+Eeaqf1mdgF7BJAKPzmcL2G1qNGeiIyS/6/fEtFQWDLHUnQFJw0LP+w CJl1ZrSFxCTvg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 86973693E3 for ; Mon, 19 Jan 2026 13:43:44 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855422; bh=b4Sl+J3V9wacvz6OcQQ4u2ThMtv/lkOtj5F1Q8qmLCw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cwR7gpFJz7Znt1WRP7la8sr0q7sJ9oe0rxrM+thQrUyQ0URCsJ3oYlDj5JK7+YdO/ GeK0oOzfcl8igP/mAPdzH/I8oPZSvD3G7uPYMfk+Dl9XcYZlyH/1EtLVvGSXW8np8B lr7CcTWVusELyqkxorP8ESXm/O+dKyjuMitSJQpKvzVwMrjxKdgUA59Jlmj0nCQLnU CCwLdzs311MEV+NncyZ14L11YG084gTjaelyLswUp2QMtUIvH6ZiLB9ex1ywXNg3XA PvCjj8geQMTlORXcdt7n1htyQUMXuWLFmvTKHo5FFLJlMwdB2GWZN+VNzvJfZJM7uK JJf/MTq6af9Tg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 64EB269504; Mon, 19 Jan 2026 13:43: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 39HNhT3j-Rbp; Mon, 19 Jan 2026 13:43:42 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855417; bh=R/s+WwHEi7U/uR/FTjqmfP991f1R66AyqwdqoRhwyqA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VjQ7hM2+kqUv6EODYkv3dj7cgosSvygIaxti+UYD4X6CgGcUtUgHzKYnmjyMiKTje NdEYYKmU/gAUM26vWn96+J4vaDUtTTdfdNe3OGk4DOB+ZRh5MBm9/1wR9TD8FXJOxr WM8ETI1THnTzdC41sFkTaXS4i1u6gyE7NH1DHOzbdptAHNr+qSnP3bGnGz9R3Odek5 VMtHXIoNJSHQlIDgfri8X3ds5h3L2gTFbd/hF1KZ6vA2Taim+WjaFT3Luy+6uIYL6W M8f24QE67XOpsBZw/kY+TVYgev87Eer5mwiFCwkEnoRFM1U8rNYKup8amj6s2CjKgS rVVEEDF5WIA4g== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 43FCE693E3; Mon, 19 Jan 2026 13:43:37 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:41:17 -0700 Message-ID: <20260119204130.3972647-25-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: MGBB2L2S6TSDD7V5QP4VJWRSYNBRBON2 X-Message-ID-Hash: MGBB2L2S6TSDD7V5QP4VJWRSYNBRBON2 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 24/27] expo: Add scene_txtin_close() for common text-input close code 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 scene_txtin_close() to handle closing a text-input object. This hides the cursor by calling vidconsole_readline_end(). Update scene_textline_send_key() to use the new helper when closing on BKEY_QUIT. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/scene_internal.h | 15 +++++++++++---- boot/scene_textline.c | 3 +-- boot/scene_txtin.c | 6 ++++++ 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/boot/scene_internal.h b/boot/scene_internal.h index 8899ba538ae..e732650b99f 100644 --- a/boot/scene_internal.h +++ b/boot/scene_internal.h @@ -582,15 +582,22 @@ int scene_txtin_open(struct scene *scn, struct scene_obj *obj, struct scene_txtin *tin); /** - * scene_textline_close() - Close a textline object + * scene_txtin_close() - Close a text-input object * * Close out the text editor after use * - * @scn: Scene containing the textline - * @tline: textline object + * @scn: Scene containing the object + */ +void scene_txtin_close(struct scene *scn); + +/** + * scene_obj_calc_bbox() - Calculate bounding boxes for an object + * + * @obj: Object to process + * @bbox: Returns bounding boxes for object * Return: 0 if OK, -ve on error */ -int scene_textline_close(struct scene *scn, struct scene_obj_textline *tline); +int scene_obj_calc_bbox(struct scene_obj *obj, struct vidconsole_bbox *bbox); /** * scene_calc_arrange() - Calculate sizes needed to arrange a scene diff --git a/boot/scene_textline.c b/boot/scene_textline.c index 2199b3d0641..9b5c40462fd 100644 --- a/boot/scene_textline.c +++ b/boot/scene_textline.c @@ -114,8 +114,7 @@ int scene_textline_send_key(struct scene *scn, struct scene_obj_textline *tline, memcpy(abuf_data(&tline->tin.buf), abuf_data(&scn->buf), abuf_size(&scn->buf)); - /* cursor is not needed now */ - vidconsole_readline_end(); + scene_txtin_close(scn); } else { event->type = EXPOACT_QUIT; log_debug("menu quit\n"); diff --git a/boot/scene_txtin.c b/boot/scene_txtin.c index a4c373c14fa..d1aa24dac9f 100644 --- a/boot/scene_txtin.c +++ b/boot/scene_txtin.c @@ -104,6 +104,12 @@ static void scene_txtin_putch(struct cli_line_state *cls, int ch) vidconsole_put_char(scn->expo->cons, ch); } +void scene_txtin_close(struct scene *scn) +{ + /* cursor is not needed now */ + vidconsole_readline_end(); +} + int scene_txtin_open(struct scene *scn, struct scene_obj *obj, struct scene_txtin *tin) { From patchwork Mon Jan 19 20:41:18 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1655 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=1768855429; bh=4tzljUunkfbR9Yv5Q2c7o9gwjfgmFJM4ghei15RDXrc=; 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=ljOmHBJmnUa3ExAPKA407s2XuUPUNWTA6yXTzxGlmcl/Lv3mELCkhghgGctDWNSr/ PY59qoGcozwRJVDEATa1rm3ohTF2ZVEjSpAsgbJfkHqNt+NIyAKytW0BJpir8JVJv+ 2okUgtcEQ351J7SjegFb9nHkZk2A3MuKkghOd1EXC0bsaeVb7wVxNFh8RPjqC/jQrB cczf2krhvRl1Y1TdxQ9jvgMEc0GKl6Br3Ag9SCta3pYo04AcFp2GP9vm5odoXlg1o1 pljY/ttEAvhQvkSf2YPlzjQvBmqk4wZnELepuIFD8fDTUq1il9ySMbqv3NM6T37yQ8 kkxHwYbHxcMkg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2A1E6693BA for ; Mon, 19 Jan 2026 13:43:49 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 4jXmTtRTjAx7 for ; Mon, 19 Jan 2026 13:43:49 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855429; bh=4tzljUunkfbR9Yv5Q2c7o9gwjfgmFJM4ghei15RDXrc=; 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=ljOmHBJmnUa3ExAPKA407s2XuUPUNWTA6yXTzxGlmcl/Lv3mELCkhghgGctDWNSr/ PY59qoGcozwRJVDEATa1rm3ohTF2ZVEjSpAsgbJfkHqNt+NIyAKytW0BJpir8JVJv+ 2okUgtcEQ351J7SjegFb9nHkZk2A3MuKkghOd1EXC0bsaeVb7wVxNFh8RPjqC/jQrB cczf2krhvRl1Y1TdxQ9jvgMEc0GKl6Br3Ag9SCta3pYo04AcFp2GP9vm5odoXlg1o1 pljY/ttEAvhQvkSf2YPlzjQvBmqk4wZnELepuIFD8fDTUq1il9ySMbqv3NM6T37yQ8 kkxHwYbHxcMkg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 179E869504 for ; Mon, 19 Jan 2026 13:43:49 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855427; bh=g+XrMQHBCLLF7CAl6B6vPm6kp5xo0F6aSXgBfxxo4Y4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Tf4R6wvET03l2OOaebssH8wdMA+AGo+CUShGnLOjI7acZ155IKwmLYH+hOls7TYtT 0K0pl+ZELLNgley0TrFRQfdpMX6iJfC2fCUDIkdjiak6BwTihRLTOiCWRZsEfGFejm s/LoM8n3F0ogXgPPU4g+1qA7DJuUWDB3JTXI7nJTWYBfi2bLd4sONBLC1+Uel0/F1w FUM7ZjwigUx9ZNVs90JxO4oRr3zcUdG4Tm0X5RNNNmn7XZ7t2PSVq/g3Ryt9w1c930 eEx1tsOMhCebvc+Z6++n9pF3wy4QwdNW1s1M2z27OCQt4rB33EmwIaQMfoAlPt1609 1wrCTXAv26ylw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 03EC169504; Mon, 19 Jan 2026 13:43:47 -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 obGbWID5acvF; Mon, 19 Jan 2026 13:43:46 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855422; bh=IIbdxmBraZwQggBRqP/NPC4o2LKWjiBDQlt+meak6xQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nON3yDvRbt6BuA7s5dWvHcrNoOV3z+m8wdvL4RoTICuT3o1/65d62bcTRSV5ipl+M bKUw8VTTkHvRfeoC90djfTRIJJMhvPFfFi3NyuTIhrkDluqRALLFQ1YLtr7xaCH6NG Yjy9m4yA9W7MBJQPhNnyC/0t/J4Z8iXaxp8/u/SvBxfwtkiIFqBDsubjKWoT1S1K80 7lg2DNiHDsy1bfqHMnXTIkyNj7r8HtA8xYTWYNMM9N54BI4+8rgSUaoLm4p7/ijHt0 lteLsBb4jCYzyBX6WxM+cCZoo7oFXDbQpMAQRiqFaFHytmBXVZ+MvM9WYSqfAlqpMS iAqLTvFZsQXPA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id D206A693BA; Mon, 19 Jan 2026 13:43:41 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:41:18 -0700 Message-ID: <20260119204130.3972647-26-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 432JQ3QZMW7C3NGTI72KV2C5VBDM5ZTR X-Message-ID-Hash: 432JQ3QZMW7C3NGTI72KV2C5VBDM5ZTR X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 25/27] expo: Mark textedits as highlightable 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 SCENEOBJT_TEXTEDIT after SCENEOBJT_TEXTLINE in the enum so it can be highlighted like other text-input objects. Update scene_obj_type_names array to match. Signed-off-by: Simon Glass --- boot/scene.c | 2 +- include/expo.h | 2 +- test/boot/expo.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/boot/scene.c b/boot/scene.c index 6b5c934a2e7..46bc9b64e64 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -38,9 +38,9 @@ static const char *const scene_obj_type_names[] = { "image", "text", "box", - "textedit", "menu", "textline", + "textedit", }; bool scene_chklog(const char *name) diff --git a/include/expo.h b/include/expo.h index c854d78255b..248f2363fe1 100644 --- a/include/expo.h +++ b/include/expo.h @@ -242,11 +242,11 @@ enum scene_obj_t { SCENEOBJT_IMAGE, SCENEOBJT_TEXT, SCENEOBJT_BOX, - SCENEOBJT_TEXTEDIT, /* types from here on can be highlighted */ SCENEOBJT_MENU, SCENEOBJT_TEXTLINE, + SCENEOBJT_TEXTEDIT, }; /** diff --git a/test/boot/expo.c b/test/boot/expo.c index 4febdf87cde..c8c97057d54 100644 --- a/test/boot/expo.c +++ b/test/boot/expo.c @@ -1254,7 +1254,7 @@ static int expo_scene_obj_type_name(struct unit_test_state *uts) ut_asserteq_str("textedit", scene_obj_type_name(SCENEOBJT_TEXTEDIT)); /* Test invalid type (out of range) */ - ut_asserteq_str("unknown", scene_obj_type_name(SCENEOBJT_TEXTLINE + 1)); + ut_asserteq_str("unknown", scene_obj_type_name(SCENEOBJT_TEXTEDIT + 1)); return 0; } From patchwork Mon Jan 19 20:41:19 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1656 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=1768855432; bh=NJwvBj9R2lceYqAU9qoD1Dova8OJ1EWzk1ZF466g7YY=; 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=Rp5QwYMGJEEM2gV8KmehiT65KyxrvqXO+GN8v2LVRlx67trj71Hq5ZbJxAHzK1c/9 DkUO79bMEAF/DqM1IYQWXiXiyN+jTSLvqU+NY1SC/LGI+suHOyDhZKtWPJ6MJYXO4I cAYInqpsvnAo+U6irtAkllAyYQGW4sHVQozx5L9jI74Rt5o0Jw0OAF11X8Rf2Ednaf gOMspuAoFvRjeOT3V+kXoD/ZhrIcvwYtO8kM7mBYdGOOevSD4WhFtZybIBCeTioE0g aQz2GNGUDbwuVwPgKjE4QXRQU9peFnlXXjACXre3TBvQwy0jn5+INGV2k9+6uOyRkQ kyLo6tBHn56jw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D692F69525 for ; Mon, 19 Jan 2026 13:43: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 10024) with ESMTP id IBR5LeMjCjoE for ; Mon, 19 Jan 2026 13:43:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855432; bh=NJwvBj9R2lceYqAU9qoD1Dova8OJ1EWzk1ZF466g7YY=; 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=Rp5QwYMGJEEM2gV8KmehiT65KyxrvqXO+GN8v2LVRlx67trj71Hq5ZbJxAHzK1c/9 DkUO79bMEAF/DqM1IYQWXiXiyN+jTSLvqU+NY1SC/LGI+suHOyDhZKtWPJ6MJYXO4I cAYInqpsvnAo+U6irtAkllAyYQGW4sHVQozx5L9jI74Rt5o0Jw0OAF11X8Rf2Ednaf gOMspuAoFvRjeOT3V+kXoD/ZhrIcvwYtO8kM7mBYdGOOevSD4WhFtZybIBCeTioE0g aQz2GNGUDbwuVwPgKjE4QXRQU9peFnlXXjACXre3TBvQwy0jn5+INGV2k9+6uOyRkQ kyLo6tBHn56jw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C5C8869504 for ; Mon, 19 Jan 2026 13:43:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855430; bh=i4BoX1cpwPh1tz8cofiGK1SEEYh1TcHHAYMBbNk+rqQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lhN1furuw3ShoZjgZ6L9asvIXDXjaFDqgJZTtenqAeqqzZWHsgVF8D35vm1kCp6Gf JRWVkL+6tJp4bet8omOJjtDMbtRwmIBp9IcR1scvp4Ut4hwSiof5Xe0kQqXYLXRTyY ZpHyBZ+RSRqKB3CMmj74u3c3RUmVfW0C/q7nnDHMWV9WHe3kgN4zSzk5rE5rzs4wUg YcCltAjYar3xmz3JnEKLfylKWt4ir3p/rj6YqPlKicWSPYNdFQ+54+CESqVgxNCFZx 1JKW/7GqjsBLSYxqdx0VFa7/Dgkm5OTsisBmMAvR2ELMP8rR+peitKW27puNGu3xI6 kp5dMpf79VJMg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B59C9693BA; Mon, 19 Jan 2026 13:43: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 10026) with ESMTP id 7DntH9mBrtvY; Mon, 19 Jan 2026 13:43:50 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855426; bh=y4QwV2cSvXTFAEXyd93dF2XL/blOzQN7l9wRMyk+7KA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IQ+4Ho7nOcq/KckypxXEx4Y8Mb0+m3H2xkcYzyaAC3hLLPFTHOFGfoaQOvlTkDnBb GPRZpe1I4gMXwAEWo0YDrc1FwY+ZKEHVLzF1iEkir/uK5/j0HG0WHfRHVSCrDz1L/V kbDeZ6EJl/o3giD0e9RwjeZ03G2jHaGdtnoi3yOn9lj38469V80XpRVgYbNpH3kdr5 zmg8P7TW50Nx0AgVbJ6/dvL4JWXuHABCwowhe+jGuNA/emsZ3ErppYZoopqOzLukKp GSuQdstR6xYszx188rDdtLrD4hHIujEzhCMHfg4enJMeyR/VppozbDOu9yYs+oHHUS SJ85QDud44c5A== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 64E3E693E3; Mon, 19 Jan 2026 13:43:46 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:41:19 -0700 Message-ID: <20260119204130.3972647-27-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: UKEIW2H6P7QPZYGEJUJNM7DTE2ARR6TR X-Message-ID-Hash: UKEIW2H6P7QPZYGEJUJNM7DTE2ARR6TR X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 26/27] expo: Fix textedit height calculation 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 scene_txted_arrange() function sets the textedit's height to zero, which causes problems when highlighting since the bounding box has no height. Fix this by calculating the height from the edit text's dimensions, similar to how scene_textline_arrange() does it. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/scene_textedit.c | 44 ++++++++++++++++++++++++++++++++++--------- test/boot/expo.c | 2 +- 2 files changed, 36 insertions(+), 10 deletions(-) diff --git a/boot/scene_textedit.c b/boot/scene_textedit.c index 2075cfbd417..d6ef725db3e 100644 --- a/boot/scene_textedit.c +++ b/boot/scene_textedit.c @@ -54,21 +54,31 @@ int scene_txted_set_font(struct scene *scn, uint id, const char *font_name, int scene_txted_calc_dims(struct scene_obj_txtedit *ted, struct udevice *cons) { + const struct expo_theme *theme = &ted->obj.scene->expo->theme; struct scene *scn = ted->obj.scene; struct scene_obj_txt *txt; - int ret; + int x0, ret; txt = scene_obj_find(scn, ted->tin.edit_id, SCENEOBJT_NONE); if (!txt) return log_msg_ret("txt", -ENOENT); /* - * Set the edit text's bbox to match the textedit's bbox. This ensures - * SCENEOF_SIZE_VALID is set so vidconsole_measure() applies the width - * limit for word-wrapping/clipping. + * Set the edit text's bbox to fit within the textedit's bbox, after + * the label. This ensures SCENEOF_SIZE_VALID is set so + * vidconsole_measure() applies the width limit for word-wrapping. */ + x0 = ted->obj.req_bbox.x0; + if (ted->tin.label_id) { + int width; + + ret = scene_obj_get_hw(scn, ted->tin.label_id, &width); + if (ret < 0) + return log_msg_ret("lab", ret); + x0 += width + theme->textline_label_margin_x; + } ret = scene_obj_set_bbox(scn, ted->tin.edit_id, - ted->obj.req_bbox.x0, ted->obj.req_bbox.y0, + x0, ted->obj.req_bbox.y0, ted->obj.req_bbox.x1, ted->obj.req_bbox.y1); if (ret < 0) return log_msg_ret("sbb", ret); @@ -84,7 +94,8 @@ int scene_txted_calc_dims(struct scene_obj_txtedit *ted, struct udevice *cons) int scene_txted_arrange(struct scene *scn, struct expo_arrange_info *arr, struct scene_obj_txtedit *ted) { - int x; + struct scene_obj *edit; + int x, y; int ret; x = scene_txtin_arrange(scn, arr, &ted->obj, &ted->tin); @@ -92,14 +103,29 @@ int scene_txted_arrange(struct scene *scn, struct expo_arrange_info *arr, return log_msg_ret("arr", x); /* constrain the edit text to fit within the textedit bbox */ - ret = scene_obj_set_bbox(scn, ted->tin.edit_id, x, ted->obj.req_bbox.y0, + y = ted->obj.req_bbox.y0; + ret = scene_obj_set_bbox(scn, ted->tin.edit_id, x, y, ted->obj.req_bbox.x1, ted->obj.req_bbox.y1); if (ret < 0) return log_msg_ret("edi", ret); + /* Re-measure text with the correct limit (bbox may have changed) */ + ret = scene_obj_get_hw(scn, ted->tin.edit_id, NULL); + if (ret < 0) + return log_msg_ret("hw", ret); + + edit = scene_obj_find(scn, ted->tin.edit_id, SCENEOBJT_NONE); + if (!edit) + return log_msg_ret("fnd", -ENOENT); + x += edit->dims.x; + y += edit->dims.y; + + /* + * Set dims based on content size, but don't call scene_obj_set_size() + * as that would overwrite the user-specified req_bbox + */ ted->obj.dims.x = x - ted->obj.req_bbox.x0; - ted->obj.dims.y = 0; - scene_obj_set_size(scn, ted->obj.id, ted->obj.dims.x, ted->obj.dims.y); + ted->obj.dims.y = y - ted->obj.req_bbox.y0; return 0; } diff --git a/test/boot/expo.c b/test/boot/expo.c index c8c97057d54..79e77b83b0a 100644 --- a/test/boot/expo.c +++ b/test/boot/expo.c @@ -1570,7 +1570,7 @@ static int expo_render_textedit(struct unit_test_state *uts) expo_set_scene_id(exp, SCENE1); ut_assertok(scene_arrange(scn)); ut_assertok(expo_render(exp)); - ut_asserteq(19860, video_compress_fb(uts, dev, false)); + ut_asserteq(19841, video_compress_fb(uts, dev, false)); abuf_uninit(&buf); abuf_uninit(&logo_copy); From patchwork Mon Jan 19 20:41:20 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1657 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=1768855436; bh=LRc5iIYAmvJjeyj2QYmRzCGbsPcrbGRB7Dd3MvLnWME=; 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=A7c076YXIKpKHz1j4/T+kJByw4T6D13YQGxY2GSxixBLIcFA3tlXsljB1dajqkiv8 XiYSNjKMr8z/kRzgOtpRbs3Dh+tEKrCNqXnPsy/OQtfvTll/N8MGdlKv29VUu4PKJO DJt/Jvy02LGA42KV5SZcMN21+IzY/qOsANdpjtrfkdwUGT6EIbB+IKkp5u7r4tuf/C WxssvmHMFmSDnp452C9HyavDEAD0g8BXySESWu1pKX3MXcTkKk8d6TYLhoCsrU4ypm 1Ep6EW+HyWnLTPv0DT37K8iSqtyVqHzl9M3wREduYhb7ngk7l/8K+2W6tJUYpXIY3b nJg+2meobxU9g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C22756951C for ; Mon, 19 Jan 2026 13:43: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 10024) with ESMTP id OSXBlR2xViQF for ; Mon, 19 Jan 2026 13:43:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855436; bh=LRc5iIYAmvJjeyj2QYmRzCGbsPcrbGRB7Dd3MvLnWME=; 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=A7c076YXIKpKHz1j4/T+kJByw4T6D13YQGxY2GSxixBLIcFA3tlXsljB1dajqkiv8 XiYSNjKMr8z/kRzgOtpRbs3Dh+tEKrCNqXnPsy/OQtfvTll/N8MGdlKv29VUu4PKJO DJt/Jvy02LGA42KV5SZcMN21+IzY/qOsANdpjtrfkdwUGT6EIbB+IKkp5u7r4tuf/C WxssvmHMFmSDnp452C9HyavDEAD0g8BXySESWu1pKX3MXcTkKk8d6TYLhoCsrU4ypm 1Ep6EW+HyWnLTPv0DT37K8iSqtyVqHzl9M3wREduYhb7ngk7l/8K+2W6tJUYpXIY3b nJg+2meobxU9g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AC5B2693E3 for ; Mon, 19 Jan 2026 13:43:56 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855435; bh=eNoeuJODao8BowWnI02o1A24dQ4pmY27cEuBKJaNBPQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hgO9IJfOyYRECHivmUkVzMhJfswd5KClfiQoqpEIjDNxNS27v+cFmdKK4dw6feRpT xtGsPA2XR0GqGi4PpkmA9CnrCmXvsEghjRjLHz0rp9/nfxYR8LUsE0HjYzCK0ir4aZ pMrOClsPvgzd8nuhiaMI4QpcGUoFEMSn/l3SlxV6ZB4h2izpu0zj8f0BpcjO72KSMf MXLf0B3EMmJQvot6DHF52OmF6cpvqQYv6IyV3RwlFNuKjG+cEGX2mB97rM4NauNWth XPUbAHxSq4CWWx8zOvXBnQfF8ea7fpkkQwkGc+wo5Fj1fOdFeviSp4VtHZNTWjPj9I TQb0WpNCeH6Yw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 499EA693BA; Mon, 19 Jan 2026 13:43:55 -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 ZxycwPanAttb; Mon, 19 Jan 2026 13:43:55 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768855431; bh=D2Lnl3+3OcvO0rTxi05qTKOTLv02siPBopGdAVs9Ppk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bl75avbeYejE3TNG2UYVnRRdZY/QWmg1v/TGABBxuLn/Ui7U4gSuNhQlrF7nPgtNf 2X2a1fPK+WuYZNE+o8wjSdWTNmnOGsJPIrVHcrQvYGVNqGc45g5PRk0iV+46nRIUgl OJkAkiXWjxzTGuZtscWZiRej28lc1+Vv9MALjhAjCIhaRqZa8LBw5oFxfa7ankjwS1 6Ol5wBymDTB3gMTmoAEYMaMs3FVIHFX4ZO6K377fO3CgAeob2KVDyD/5jJKzOXfrX+ S40ffFm0xinoi2uBnezWbl7kHGl99gFfKHcWdXL5XaBiYY+8nZOjZW3sdWlh+0BA0R n2okhcziqUFlw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 00FB9693E3; Mon, 19 Jan 2026 13:43:50 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Mon, 19 Jan 2026 13:41:20 -0700 Message-ID: <20260119204130.3972647-28-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260119204130.3972647-1-sjg@u-boot.org> References: <20260119204130.3972647-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 7XVEGQY6OFCBU6S7X3USCCR6XVWLYXFJ X-Message-ID-Hash: 7XVEGQY6OFCBU6S7X3USCCR6XVWLYXFJ X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 27/27] expo: Render textedit dependencies correctly 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 Update scene_render_deps() to call scene_txtin_render_deps() for textedit objects by grouping SCENEOBJT_TEXTEDIT with SCENEOBJT_TEXTLINE. This enables proper cursor handling when the textedit is open. Add a test for textedit highlighting. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- boot/scene.c | 2 +- test/boot/expo.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/boot/scene.c b/boot/scene.c index 46bc9b64e64..306625361b4 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -983,13 +983,13 @@ int scene_render_deps(struct scene *scn, uint id) case SCENEOBJT_IMAGE: case SCENEOBJT_TEXT: case SCENEOBJT_BOX: - case SCENEOBJT_TEXTEDIT: break; case SCENEOBJT_MENU: scene_menu_render_deps(scn, (struct scene_obj_menu *)obj); break; case SCENEOBJT_TEXTLINE: + case SCENEOBJT_TEXTEDIT: scene_txtin_render_deps(scn, obj, scene_obj_txtin(obj)); break; } diff --git a/test/boot/expo.c b/test/boot/expo.c index 79e77b83b0a..d7430dc4284 100644 --- a/test/boot/expo.c +++ b/test/boot/expo.c @@ -1572,6 +1572,12 @@ static int expo_render_textedit(struct unit_test_state *uts) ut_assertok(expo_render(exp)); ut_asserteq(19841, video_compress_fb(uts, dev, false)); + /* highlight the textedit and re-render */ + scene_set_highlight_id(scn, OBJ_TEXTED); + ut_assertok(scene_arrange(scn)); + ut_assertok(expo_render(exp)); + ut_asserteq(21662, video_compress_fb(uts, dev, false)); + abuf_uninit(&buf); abuf_uninit(&logo_copy);