From patchwork Wed Feb 4 00:09:52 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1802 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=1770163854; bh=L9XAAhPA/ft0NgJCGnytxhy31/V01a9XaLP5v6mGpRU=; 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=d0vOEomemFWyeOZfKTA6qbdJdqW6m7JkXD5n7pr8tWshD4B9w1UtDg2AdU81ltRNP CrXDEeIoJCEgI9Nni388UmTlX0KjnmWO4EWnOpx7U8Xzh+LqYE7kHUvGq8c7uXLbCj ZiSp5tLs4QgToHHv9SsWuxOnAWD4BgTxTh0y234VE16kPQ0mf3dTHlNWjILXGtOe+x kkMt0KQyGRWO5IwGPSYdi0fKNDO0y62Pn8sePcaeMMPaqAzaogxFzymJ+3xcF8JBgv SfWijkTH+DKmodHA9t0dM9QTT8m2MLNHuInyXsnn6CJAWW3qOehQaKxHQcbzdUJUWO bQfnMWPmTr4Fg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B33D469917 for ; Tue, 3 Feb 2026 17:10:54 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Q-yV5eW3gEfh for ; Tue, 3 Feb 2026 17:10:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770163854; bh=L9XAAhPA/ft0NgJCGnytxhy31/V01a9XaLP5v6mGpRU=; 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=d0vOEomemFWyeOZfKTA6qbdJdqW6m7JkXD5n7pr8tWshD4B9w1UtDg2AdU81ltRNP CrXDEeIoJCEgI9Nni388UmTlX0KjnmWO4EWnOpx7U8Xzh+LqYE7kHUvGq8c7uXLbCj ZiSp5tLs4QgToHHv9SsWuxOnAWD4BgTxTh0y234VE16kPQ0mf3dTHlNWjILXGtOe+x kkMt0KQyGRWO5IwGPSYdi0fKNDO0y62Pn8sePcaeMMPaqAzaogxFzymJ+3xcF8JBgv SfWijkTH+DKmodHA9t0dM9QTT8m2MLNHuInyXsnn6CJAWW3qOehQaKxHQcbzdUJUWO bQfnMWPmTr4Fg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A2B3269911 for ; Tue, 3 Feb 2026 17:10:54 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770163852; bh=s1WbtGI2CIjTbMOXS/aS1UqOH+xkHsWnvGrc4Xu5v8k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AYzv6F5G6fCSFBEgmixyGPr1u+s8czuynop/wThOMJzF4G3BJngM6CUGVAcf111LH AJIlbm3O8anJ/EIBf2KENBjhPDqZuiyzj8Ifsi3VoqCF6azEd1LTPzCb1cvCtfQv+Z 5SueOdHYQdbYsVMdcjqBBQ2l181tHJxjNg9CUikCj32uIr5Raa8Qg8BisFbhMLZVim sinE0ji2/IBk2jUYon1oR6UyLjKoKd+ArmDqE8anHgHfzMPpesd0EIXPMcV06hVnHd ZIKFdtaQhuxliZ9bd+McdUKPXi+HfzBnLJDXlM5O+cfa5NGfS+icXEd3yEJJDmMTBy mmsQCBwsZRHQQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8A44169868; Tue, 3 Feb 2026 17:10:52 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id kg2hPX45g8Z4; Tue, 3 Feb 2026 17:10:52 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1770163848; bh=hUYDnevpKx5sVKHtD8XMpzl8p3G7yvGGvqnQnLpLizU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wxJRz4/6vOrcgT9bwZsxO/V6N0b8djNCYpdZPN1+auNwQ48W3Hb9c1hh3mWVG9ShV u4PKaPtPfxJxeYcvZ1XvgCOsH8ovNcXUjMSP9kZG9Lkv/W48jP3KrXyG+A4YYpparp 5dO2s+e3pBADh7/mwMN/+2P5WCpKBBk4KFdRL1/T1WYibpXxW224bm5XXwI+CScyrD UMeg8CyocbkGb33IQi8J5kjv/E/2e/JRezCBxXhj1NzYz988caRu7flgN0ZMLMk8Vr x354tiwKeIVS4zNbKudAEob5WrkHyWaqHyKNFu2UTVmVelHfZXVMOGRmK4oMaSbS14 T/NWmAKGkauZg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3F4F569909; Tue, 3 Feb 2026 17:10:48 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Tue, 3 Feb 2026 17:09:52 -0700 Message-ID: <20260204001002.2638622-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260204001002.2638622-1-sjg@u-boot.org> References: <20260204001002.2638622-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: IFOKOFEIEBPKJG2GR2J5M7GCH6SLAQVS X-Message-ID-Hash: IFOKOFEIEBPKJG2GR2J5M7GCH6SLAQVS 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 Sonnet 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 08/13] console: Add vidconsole support for length-based output List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add putsn() support to the video console driver to enable efficient rendering of length-specified strings. The vidconsole infrastructure already supports length-based operations through vidconsole_put_stringn(), so this just adds the stdio_dev wrapper. Co-developed-by: Claude Sonnet 4.5 Signed-off-by: Simon Glass --- drivers/video/vidconsole-uclass.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index d13b4eac272..3d440e8e672 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -589,7 +589,7 @@ static void vidconsole_putc(struct stdio_dev *sdev, const char ch) } } -static void vidconsole_puts(struct stdio_dev *sdev, const char *s) +static void vidconsole_putsn(struct stdio_dev *sdev, const char *s, int len) { struct udevice *dev = sdev->priv; struct vidconsole_priv *priv = dev_get_uclass_priv(dev); @@ -597,12 +597,12 @@ static void vidconsole_puts(struct stdio_dev *sdev, const char *s) if (priv->quiet) return; - ret = vidconsole_put_string(dev, NULL, s); + ret = vidconsole_put_stringn(dev, NULL, s, len); if (ret) { #ifdef DEBUG char str[30]; - snprintf(str, sizeof(str), "[vc err: puts %d]", ret); + snprintf(str, sizeof(str), "[vc err: putsn %d]", ret); console_puts_select_stderr(true, str); #endif } @@ -614,6 +614,11 @@ static void vidconsole_puts(struct stdio_dev *sdev, const char *s) } } +static void vidconsole_puts(struct stdio_dev *sdev, const char *s) +{ + vidconsole_putsn(sdev, s, strlen(s)); +} + void vidconsole_list_fonts(struct udevice *dev) { struct vidfont_info info; @@ -950,6 +955,7 @@ static int vidconsole_post_probe(struct udevice *dev) sdev->flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_DM; sdev->putc = vidconsole_putc; sdev->puts = vidconsole_puts; + sdev->putsn = vidconsole_putsn; sdev->priv = dev; return stdio_register(sdev);