From patchwork Wed Oct 1 23:05:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 472 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=1759359975; bh=/A8GN/a9A/Fm5pwWdSmASnKnFnqqFZmnhCxwhEQUTCg=; 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=SNgF6H2NUfLFONf4J3BKjqMF6hP0N2QXzRDsGGhwi1ifwbLVCgUpdDwcm8mC4CbaP o7SzhHavab0ctU4WIA4NdiZoKTlTumxcgRThkQyQicHKW6qovIyyuCSytZzQd6RSTr gV8XH6A3AtWpzJhavxErdBO9cFyPjCv+TjgYlvr95oYn5u57lsZcbvwcfPozvg/kHh 9TYb2NVOlikTKGJcaOIcBQwSh+7vbI9X7jYx4aPxp4cCBwQGh2k+UDuDEGbIVkIkvl Ay5mMBp00m/r9YU8mmE4OFv63cJ/kqvhrpmchej9aLOKjkqqzjL2xEoC4+JsoshGvp bQSr9RZ+j4duQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DF23B67EFA for ; Wed, 1 Oct 2025 17:06:15 -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 ix2ojDOSPFl4 for ; Wed, 1 Oct 2025 17:06:15 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759359975; bh=/A8GN/a9A/Fm5pwWdSmASnKnFnqqFZmnhCxwhEQUTCg=; 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=SNgF6H2NUfLFONf4J3BKjqMF6hP0N2QXzRDsGGhwi1ifwbLVCgUpdDwcm8mC4CbaP o7SzhHavab0ctU4WIA4NdiZoKTlTumxcgRThkQyQicHKW6qovIyyuCSytZzQd6RSTr gV8XH6A3AtWpzJhavxErdBO9cFyPjCv+TjgYlvr95oYn5u57lsZcbvwcfPozvg/kHh 9TYb2NVOlikTKGJcaOIcBQwSh+7vbI9X7jYx4aPxp4cCBwQGh2k+UDuDEGbIVkIkvl Ay5mMBp00m/r9YU8mmE4OFv63cJ/kqvhrpmchej9aLOKjkqqzjL2xEoC4+JsoshGvp bQSr9RZ+j4duQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id CC70867E4B for ; Wed, 1 Oct 2025 17:06:15 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759359974; bh=Vy+aszK/Iks5MCc4KfnVTHZtIVjrK6lbEzwsN+KMZDg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cqs9Wus3/88YFE5khahXXLFtKfKyzg2aLx9RVUG03GvBWhDwjykwFX0ENge1GVcGO QtzloQlpLxcxws3jyknKKQBO97LLBm4RoDRNnWh81GRviiixezXGIJpkXnwyZfVEm1 uEnDpULjI90GtbpUUgE0jOD9W1SHKP6/l9MrXNh7piq4hFHiIOPA7vPEjybjz5WHeD 8mRiEWonVtM/UZ0vFJKTNfktvJerhVBNBBU3y2LCspnY+6xU2SysXIWxL6DeYoc2mQ uP16puFs1kng/ntnAQ15yum+2pw4FCJWdn7IZ18xR9WYO+Gah/9SnT5CI97Xa34ryY Kkewc+F1r///w== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 81F3367E44; Wed, 1 Oct 2025 17:06:14 -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 E7vgnk0E2z92; Wed, 1 Oct 2025 17:06:14 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759359972; bh=x6Ywk6Y+w3KdvC3Tw6Zc8NmPVdPf28Gmcnp6M17Ndjw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=D+C6lP834Cgc8dDNfkVzrNtV+hgaybq7LFfGD3et/F9K1v/XpKkGVAvHdXR1Zgke6 fvvYJVPgLGvN6S3o53GRvTtZ7caS4DKnWygI03flqLrr8la6QNJwQ9H/Lt0gJDhsAJ WftHupQXa6kfB9sr1pnW8Rxt0L9SzEkQCjJs2fLuucjGJSsYWLbGUazJMBKcDUXNsQ 7NeHoRPJOB4/1pf6XAJ46RhXpdTFd/4dTJOKzUMvyYdunoiIY3wf/GjuEkxU3jyjRW uQRnoOCkJDrOdr9dFhQuGw8E5xRjWIuRtwWSAcyVnbdYrJmHEcLnc4z3y189oCyuEw 9RmWGNByYJSsg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id EEF1A67E42; Wed, 1 Oct 2025 17:06:11 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 1 Oct 2025 17:05:32 -0600 Message-ID: <20251001230537.3324058-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251001230537.3324058-1-sjg@u-boot.org> References: <20251001230537.3324058-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: WWQKJGIAWR57F6UYHC6AUSVHGA556X3F X-Message-ID-Hash: WWQKJGIAWR57F6UYHC6AUSVHGA556X3F 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 6/6] 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 --- cmd/video.c | 30 ++++++++++++++++++++++++++++-- doc/usage/cmd/video.rst | 19 +++++++++++++++++++ test/dm/video.c | 16 ++++++++++++++++ 3 files changed, 63 insertions(+), 2 deletions(-) diff --git a/cmd/video.c b/cmd/video.c index c9f2d91a0ba..6f3fa29a147 100644 --- a/cmd/video.c +++ b/cmd/video.c @@ -8,6 +8,7 @@ #include #include +#include #include #include @@ -47,6 +48,29 @@ static int do_video_puts(struct cmd_tbl *cmdtp, int flag, int argc, return ret ? CMD_RET_FAILURE : 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", @@ -61,8 +85,10 @@ U_BOOT_CMD( U_BOOT_LONGHELP(video, "setcursor - Set cursor position\n" - "video puts - Write string at current position"); + "video puts - Write string at current position\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(puts, 2, 1, do_video_puts), + 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 139f90bd3ff..d7e2527805a 100644 --- a/doc/usage/cmd/video.rst +++ b/doc/usage/cmd/video.rst @@ -11,6 +11,7 @@ Synopsis video setcursor video puts + video images Description ----------- @@ -40,6 +41,15 @@ Write a string to the video console at the current cursor position. string Text string to display +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 -------- @@ -55,6 +65,15 @@ Print at different positions:: => video setcursor 0 10 => video puts "Line 10" +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 98bb0057b18..1f1bf7c59c8 100644 --- a/test/dm/video.c +++ b/test/dm/video.c @@ -1105,3 +1105,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);