From patchwork Sun Jan 18 20:42:39 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 106 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=1768768997; bh=hJmHWPJn+B6FmCvQpkDUQ4iSL9CD2S4P1Sg7xEUZKqM=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=tAPRytHUHgbwHcMm2/19Ugcdy2L5AwWm8jSJXqDxj7hXb/JDCEu0/BtcanlWyIYp8 zMncOkoniDWOJ4NzVqxXiTqRH5xvJUGsI00dP2XbMXo39SM1ZnrL9/Y5e337aFkQVc nccGPlsQnywYKJcDj++0F52V1jyxFb6U75Y9NoWyaOmCsx1a+dq7nOoxLEJ4nvquhp UAXNS5NkT567oLGLA/R0Dr7JVvbwAFNdB6GvnElmEzFqoWLH/VsNIuE/oKODw9pQ02 0qE4+b+KvRfr0RmhR1zm1+GlX9TCJDyi2Sx2kERCCSMQY8oUyyG3iIUvryjhdmuEiE OZF86pjtVjygA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5B25869499 for ; Sun, 18 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 FSjKHrB2LyV0 for ; Sun, 18 Jan 2026 13:43:17 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768768997; bh=hJmHWPJn+B6FmCvQpkDUQ4iSL9CD2S4P1Sg7xEUZKqM=; h=From:To:Date:CC:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=tAPRytHUHgbwHcMm2/19Ugcdy2L5AwWm8jSJXqDxj7hXb/JDCEu0/BtcanlWyIYp8 zMncOkoniDWOJ4NzVqxXiTqRH5xvJUGsI00dP2XbMXo39SM1ZnrL9/Y5e337aFkQVc nccGPlsQnywYKJcDj++0F52V1jyxFb6U75Y9NoWyaOmCsx1a+dq7nOoxLEJ4nvquhp UAXNS5NkT567oLGLA/R0Dr7JVvbwAFNdB6GvnElmEzFqoWLH/VsNIuE/oKODw9pQ02 0qE4+b+KvRfr0RmhR1zm1+GlX9TCJDyi2Sx2kERCCSMQY8oUyyG3iIUvryjhdmuEiE OZF86pjtVjygA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 484176948C for ; Sun, 18 Jan 2026 13:43:17 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768768994; bh=YA/2jRdbvECZTTS85ivFanUqdZeQHrwqa8+yATQV++Q=; h=From:To:Cc:Subject:Date:From; b=u7eRhBcVHOswCUitmkKW4Am1fLY7/1qamppWWJ0QATgdOlGpnCtwB08aHuq5Yr/2G 0Zyz9CfncFxY0rmxnaoTPh7s6MBbkgxTOWlzJmUvbD4Xhw4sDykq8Iz0sYy/5Bz95F cAynxf9LcEz0zVrm3oAJMk0l6KXql3MwUxRTNm5p7ycZiePZ1C24atw4/WE70fwC+h /io0dk3qNYb3sYbwMpI8LgjzVC/I9GW0Xd1Gpyq54eMSzA47rUe66UoPCVjo72UbEv aSHCSbWgpFgBZfMJvJV98ezn6rGESXIoSC89zUw7Z0grEngQg8cYuoTMlFWvLw1MXa +fH01Ch/nKhUQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 44AB1693A2; Sun, 18 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 8zix01P7N3Yc; Sun, 18 Jan 2026 13:43:14 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768768990; bh=xrC3gs9l0YIritC+pBlJeK5seC7PMAyl7J1lM+uvQrY=; h=From:To:Cc:Subject:Date:From; b=INxyYFzgBalXfUuprSDHxMdp3NNU47B6qdu+s0NvtApBhy94602JrmfNc3saFsuz3 vUmtvyhslkwIe6rE/2dIz4IOdtW2ytRMf4OJUXv+LR4itv14W6ABvqr3OsqyiHeFMs tKMgBhymayflUNQ/KiWanSStjDqacE6nPLd8AvNgdosiFBwwd6znwE54s89SI1KrRD +lNo9HFjH4Kt1UtW94lvOnVMLHlf0gsyuYJHkNBYmlgn/R1m92VDJYbY75fq/P+AZx WUEF6RVo2sJvUAmZ8/xUQadqcGTgeQ2Bo3on9wyp+Xk0ud7K7IdOttWOtjVj94DeCg cuAFT5/oiPEsg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 091A669394; Sun, 18 Jan 2026 13:43:09 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sun, 18 Jan 2026 13:42:39 -0700 Message-ID: <20260118204303.1982533-1-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Message-ID-Hash: AVKTJQJ2XXWDZSG6GXWZ73ZJH4GUWY57 X-Message-ID-Hash: AVKTJQJ2XXWDZSG6GXWZ73ZJH4GUWY57 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 00/16] expo: Continue preparations for textedit (part D) List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass At present vidconsole uses a save/restore model for its state. The textline object saves the state, does its drawing, then restores it. This is fairly clumsy and makes textedit harder to implement. This series continues the changes to adjust this, adding a putch() callback to the CLI line-editing code, so that output can (later) be directed to the correct context. It also adds word-wrapping support to the textedit scene object. The remaining patches refactor the textline and textedit code to share common functionality through a new scene_txtin structure and helper functions. This allows textedit to properly calculate its bounding box and dimensions, enabling word-wrapping within the edit area. It also includes an attempted fix for the flaky FPDT test. Overall code-size is neutral, e.g. for Thumb2 with EXPO: 03: cli: Add putch callback to struct cli_line_state arm: (for 1/1 boards) all +92.0 text +92.0 04: cli: Convert ERASE_TO_EOL macro to a function arm: (for 1/1 boards) all -104.0 text -104.0 05: cli: Add cls_putnstr() for string output with callback arm: (for 1/1 boards) all -20.0 text -20.0 Without EXPO, code size reduces by about 56 bytes (e.g. xilinx_versal_virt) Simon Glass (16): test: acpi: Fix flaky dm_test_acpi_fpdt checksum test cli: Add putch callback to struct cli_line_state cli: Convert ERASE_TO_EOL macro to a function cli: Add cls_putnstr() for string output with callback expo: Wire up putch callback for textline editing test: expo: Add a separate test for textedit expo: Refactor textedit to use label_id and edit_id expo: Rename textline max_chars to line_chars expo: Add line_chars to scene_obj_txtedit expo: Add arrangement support for textedit expo: Introduce scene_txtin for common text-input fields expo: Factor out common calc_bbox code into scene_txtin.c expo: Add scene_obj_txtin() helper for text-input objects expo: Add scene_txtin_init() for common text-input init expo: Add scene_txtin_arrange() for common arrangement code expo: Enable textedit dimension calculation for word-wrap boot/Kconfig | 1 + boot/Makefile | 2 +- boot/bootctl/multi_ui.c | 4 +- boot/bootflow_menu.c | 6 +- boot/cedit.c | 12 ++-- boot/expo_build.c | 12 ++-- boot/expo_dump.c | 10 ++- boot/scene.c | 64 ++++++++++--------- boot/scene_internal.h | 78 ++++++++++++++++++++--- boot/scene_textedit.c | 65 +++++++++++++++---- boot/scene_textline.c | 105 ++++++++++++++----------------- boot/scene_txtin.c | 70 +++++++++++++++++++++ cmd/Kconfig | 8 +++ common/cli_readline.c | 121 ++++++++++++++++++++++-------------- doc/usage/cmd/cedit.rst | 2 +- include/cli.h | 2 + include/expo.h | 45 ++++++++------ test/boot/bootctl/bootctl.c | 12 ++-- test/boot/cedit.c | 8 +-- test/boot/expo.c | 105 ++++++++++++++++++++----------- test/dm/acpi.c | 13 ++-- 21 files changed, 495 insertions(+), 250 deletions(-) create mode 100644 boot/scene_txtin.c