From patchwork Thu Oct 2 15:45:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 481 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=1759420010; bh=ut4bnCoJYVW+pqxw3qZA9nPvDAXYwIJUr8z2SSY8bl0=; 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=FFDCNvV6sbdXGrcAclNpegDN5QWeDg/MJmKEDyRMEnOuS+6ILJy+UUjEiP8vm/m95 8J+HzKgOu2PibOgin7GpYHf6F1osSrwOdpLSRXWMJ9KjgSFjUrAbUUChhamaMnctK1 XSMUz0jLZZJxfKcDG+HsCKgVgML3xvM+1Ex4uz0OLn0UertxTdhDgXj6kqL8v9T1iY fofASqdhUdU204BqxDInj4YDaLVnF427GHgG8hxCwycd3KZcpPF0atod96fH7aeu5i aTVC0LHTbg1hRR3SCiIk+mh8ovq3B5b936VkAmSzZSbFbJlh0x8m3CR3Rywxm0hDJB 4//ktQe9aml7A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C4A3667F17 for ; Thu, 2 Oct 2025 09:46:50 -0600 (MDT) 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 Q77IXCr-nLYt for ; Thu, 2 Oct 2025 09:46:50 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759420010; bh=ut4bnCoJYVW+pqxw3qZA9nPvDAXYwIJUr8z2SSY8bl0=; 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=FFDCNvV6sbdXGrcAclNpegDN5QWeDg/MJmKEDyRMEnOuS+6ILJy+UUjEiP8vm/m95 8J+HzKgOu2PibOgin7GpYHf6F1osSrwOdpLSRXWMJ9KjgSFjUrAbUUChhamaMnctK1 XSMUz0jLZZJxfKcDG+HsCKgVgML3xvM+1Ex4uz0OLn0UertxTdhDgXj6kqL8v9T1iY fofASqdhUdU204BqxDInj4YDaLVnF427GHgG8hxCwycd3KZcpPF0atod96fH7aeu5i aTVC0LHTbg1hRR3SCiIk+mh8ovq3B5b936VkAmSzZSbFbJlh0x8m3CR3Rywxm0hDJB 4//ktQe9aml7A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B111267EC6 for ; Thu, 2 Oct 2025 09:46:50 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759420009; bh=DUPmgSfbQm76Skn+qvRaAWj8qPj4fNaM+ivPFKktBZA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EFCIvwaYdMBS4myQ1z2nxTvw9mUMTYoa8Z7KpM+VDk/NrHbLnAebLBKKUUPOkXB9B Bu5C3dezSCTvn6tTpagTeKEkYnEze3roS3IYefOKGfuUlBPoVNHYaZXf/t6mpAMKYT cp9B1ZdSKQVQm+KWY+tfSd+BOpRoFbGxvT8RDysO59bvBq+JeVjGyEsmsXv3LAKol7 F56KHZgQd4Ln9hMdNNaytfXnozKt2/yF4quB0gpLt/dppluTdYvqO8ZHEOhlUspVYq 6T4jbuHjCu0D9aTMl3ZIxuUjIvj35FizNJU8RmPt8ghwCSwOKo7z6cS3P/GPFr22GW AsT8FHso2QKZQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5803567E4D; Thu, 2 Oct 2025 09:46:49 -0600 (MDT) 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 4QkIIp_OQeP8; Thu, 2 Oct 2025 09:46:49 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759420003; bh=iq1FFXMntGaUAwdEKh2X075UiTawwAup1Shc0bXU7U8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fVwHSJM9WWT2HOzWfPsaxOIE5DISF5W+AkHFW9oOFE/8V47kegicxxRxoiyY0OUNf 6EPAvAHnCEorX3X5TnPEe3xXERKDwNLLPj0cPX0b/5atH3zE2IwMIy428A16xOOgfQ zGZg2//gOypOJPSzX4lQQ2DBAf8pjrkrSsTeGYHQ6io91vO9cMMdPhYDVGC2L4kZ71 67yn6Gi299aCiBDaR0l1ps5ZMiAAOjWwO3z7NsnkI0xnE5IdmF/+VRn9A2SucESn0t ty9t58VXKw/Hm1QL7Mcau5NBa6+aWHecMaUh6UkRLf3x6PnQcjvkmtVbaolPpVPHwm cKJlDXsqi4Mvg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 4FCA267D8D; Thu, 2 Oct 2025 09:46:43 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 2 Oct 2025 09:45:49 -0600 Message-ID: <20251002154554.4129220-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251002154554.4129220-1-sjg@u-boot.org> References: <20251002154554.4129220-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 64KMTY3BEPCG7NT4ZRJ6TVK4ZUP5VFRW X-Message-ID-Hash: 64KMTY3BEPCG7NT4ZRJ6TVK4ZUP5VFRW X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Heinrich Schuchardt , Simon Glass , Claude X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH v2 9/9] video: Provide a command to list built-in images 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 'video images' command which lists the graphical images that are compiled into U-Boot. Generally the only one is the logo. Co-developed-by: Claude Signed-off-by: Simon Glass --- (no changes since v1) cmd/video.c | 30 ++++++++++++++++++++++++++++-- doc/usage/cmd/video.rst | 21 ++++++++++++++++++++- test/dm/video.c | 16 ++++++++++++++++ 3 files changed, 64 insertions(+), 3 deletions(-) diff --git a/cmd/video.c b/cmd/video.c index 503433b9a63..4f00ffa2f77 100644 --- a/cmd/video.c +++ b/cmd/video.c @@ -8,6 +8,7 @@ #include #include +#include #include #include @@ -100,6 +101,29 @@ static int do_video_write(struct cmd_tbl *cmdtp, int flag, int argc, return 0; } +static int do_video_images(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) +{ + struct video_image *image; + int count, i; + + image = ll_entry_start(struct video_image, video_image); + count = ll_entry_count(struct video_image, video_image); + + printf("%-20s %10s\n", "Name", "Size"); + printf("%-20s %10s\n", "--------------------", "----------"); + + for (i = 0; i < count; i++, image++) { + ulong size = (ulong)image->end - (ulong)image->begin; + + printf("%-20s %10lu\n", image->name, size); + } + + printf("\nTotal images: %d\n", count); + + return 0; +} + U_BOOT_CMD( setcurs, 3, 1, do_video_setcursor, "set cursor position within screen", @@ -116,9 +140,11 @@ U_BOOT_LONGHELP(video, "setcursor - Set cursor position\n" "video puts - Write string at current position\n" "video write [-p] [: ]... - Write strings at specified positions\n" - " -p: Use pixel coordinates instead of character positions"); + " -p: Use pixel coordinates instead of character positions\n" + "video images - List images compiled into U-Boot"); U_BOOT_CMD_WITH_SUBCMDS(video, "Video commands", video_help_text, U_BOOT_SUBCMD_MKENT(setcursor, 3, 1, do_video_setcursor), U_BOOT_SUBCMD_MKENT(puts, 2, 1, do_video_puts), - U_BOOT_SUBCMD_MKENT(write, CONFIG_SYS_MAXARGS, 1, do_video_write)); + U_BOOT_SUBCMD_MKENT(write, CONFIG_SYS_MAXARGS, 1, do_video_write), + U_BOOT_SUBCMD_MKENT(images, 1, 1, do_video_images)); diff --git a/doc/usage/cmd/video.rst b/doc/usage/cmd/video.rst index 288260bd979..81433e486ac 100644 --- a/doc/usage/cmd/video.rst +++ b/doc/usage/cmd/video.rst @@ -13,7 +13,8 @@ Synopsis video setcursor video puts - video write [: ]... + video write [-p] [: ]... + video images Description ----------- @@ -66,6 +67,15 @@ locations in a single command. string Text string to display at the specified position +video images +~~~~~~~~~~~~ + + video images + +List all images that are compiled into U-Boot. This shows the name and size +of each image that was built from .bmp files in the drivers/video/images +directory. + Examples -------- @@ -90,6 +100,15 @@ Write text using pixel coordinates:: => video write -p 0:0 "Top left corner" a0:80 "Pixel position" +List compiled-in images:: + + => video images + Name Size + -------------------- ---------- + u_boot 6932 + + Total images: 1 + Configuration ------------- diff --git a/test/dm/video.c b/test/dm/video.c index 598e71411f5..b1bf08a99f7 100644 --- a/test/dm/video.c +++ b/test/dm/video.c @@ -1114,3 +1114,19 @@ static int dm_test_video_cmd(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_video_cmd, UTF_SCAN_PDATA | UTF_SCAN_FDT); + +/* video images command */ +static int dm_test_video_images(struct unit_test_state *uts) +{ + ut_assertok(run_command("video images", 0)); + ut_assert_nextline("Name Size"); + ut_assert_nextline("-------------------- ----------"); + ut_assert_nextline("bgrt 43926"); + ut_assert_nextline("u_boot 6932"); + ut_assert_skip_to_line(""); + ut_assert_nextline("Total images: 2"); + ut_assert_console_end(); + + return 0; +} +DM_TEST(dm_test_video_images, UTF_SCAN_PDATA | UTF_SCAN_FDT | UTF_CONSOLE);