From patchwork Wed Oct 1 23:05:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 467 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=1759359957; bh=y3OP/berZWbXD0C9YCB7YgeIY7kIo+b/bZAahAD+Auw=; 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=fJoqoGwKErEUENh4ivDIUMDyQKTBpo/YhJ+ynSHwj3/aVr5yQBdzxTrHMI0jTxKjE sbvBX66ot270v7Zo0iFU11bihsvQoJwdHUJxwglq5TRYyDhVBBwnjp4K0McMiqY2fc L9Vv69zQQzuB5DLHSDzkbWdMbDmNcDCddnfgNC3By+tfu99TNZYokFHWMzbTuT2a3R 2BimRSqmurZveA5RgXikBMHC1yidtcOC4AFvQZIyk/edrTROSULLsMFDX4IjPwnHL8 2H0dCRmzwK9HuR2hzLbWINpbB0HRDfU+I/Oe3KsNIFe1+zjNNxkdnfaqxW6qv0RcG3 S/vOTDZccmzQw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4E81A67EEA for ; Wed, 1 Oct 2025 17:05:57 -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 GfiF3ceMvxOV for ; Wed, 1 Oct 2025 17:05:57 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759359957; bh=y3OP/berZWbXD0C9YCB7YgeIY7kIo+b/bZAahAD+Auw=; 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=fJoqoGwKErEUENh4ivDIUMDyQKTBpo/YhJ+ynSHwj3/aVr5yQBdzxTrHMI0jTxKjE sbvBX66ot270v7Zo0iFU11bihsvQoJwdHUJxwglq5TRYyDhVBBwnjp4K0McMiqY2fc L9Vv69zQQzuB5DLHSDzkbWdMbDmNcDCddnfgNC3By+tfu99TNZYokFHWMzbTuT2a3R 2BimRSqmurZveA5RgXikBMHC1yidtcOC4AFvQZIyk/edrTROSULLsMFDX4IjPwnHL8 2H0dCRmzwK9HuR2hzLbWINpbB0HRDfU+I/Oe3KsNIFe1+zjNNxkdnfaqxW6qv0RcG3 S/vOTDZccmzQw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3E20167E4B for ; Wed, 1 Oct 2025 17:05:57 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759359955; bh=uV+baz4K37RQmSzBO9KciTj+jrKBKDJBcVo/3w3HCwE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DBY/bRpOzMN752VwsiRsvkyWPa8eRBsBpvUFlGR0Ry1xO1ZiawtBm1iX7youlV/GV 1HW/n33mwbz/xIeJqV2xoePx802rJPJe5/5ox0cleZYlnPQj6JPx1T746Wx7etpl2e PPfeTFLmCBxhVj8aBDj3Aho3vTTdQ4WJFBAxg9INCz75as5vIk3mGfE6fQ6DXSKa3U sCj7aXeGOn3P27I3xucdrURPgEdEHlVauDssyHORDJaEExsu9Dk0WrOiksACkjWrme MWTGFgWZ2Jg5HEsG/QCcQOeU6uZDNrhR7RzJudSf0drBFlc2knFitbMgl0We64vrcc NCsqDXomPmekw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8AFC367E42; Wed, 1 Oct 2025 17:05:55 -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 r_aFPdz8tT6w; Wed, 1 Oct 2025 17:05:55 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759359951; bh=IBGyW73xyayyUMzjC5XhxPYxXBZb86aR1z/4swt8viY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wbq/lf3hp+9CIyPLQa9nXZHrRWwAU3Um9R1//4uFynf5A/9T557AVe1Ke3dXqr94D Vj4gx/D4oiLz6WPbjy10W7/nsMQCBxUFdSRcm1CvYp5KXWx+Q1C7PWwxJEP2a6BvXF qR3Ey53y660ud1ziDlaImP2YslQ/kJgfZegk7YBaRJAuGEIQaMhLJkfV8SNqmmB34n 9ZZDHjaZ41Z/JMLPZr405CNIofgIyCIjYeF+kgn2kxCRWJClKGNecXYvcIJ3yU3Pxm MscX9rVGdIHlpY09WLuOS2I3UPmh3mOKGAAu7xtM6ltGq5w99HEbZIR3hqZOa43L6+ bTexKfxbvjZkA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 2DBBA67D8D; Wed, 1 Oct 2025 17:05:51 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 1 Oct 2025 17:05:27 -0600 Message-ID: <20251001230537.3324058-2-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: VFGGZUULHRTLNUBYAX5Z2MF6DO7TWZL4 X-Message-ID-Hash: VFGGZUULHRTLNUBYAX5Z2MF6DO7TWZL4 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 1/6] video: doc: Add docs and tests for video commands 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 documentation and a simple test for the setcurs and lcdputs commands. Co-developed-by: Claude Signed-off-by: Simon Glass --- doc/usage/cmd/lcdputs.rst | 57 +++++++++++++++++++++++++++++++++++++++ doc/usage/cmd/setcurs.rst | 52 +++++++++++++++++++++++++++++++++++ doc/usage/index.rst | 2 ++ test/dm/video.c | 20 ++++++++++++++ 4 files changed, 131 insertions(+) create mode 100644 doc/usage/cmd/lcdputs.rst create mode 100644 doc/usage/cmd/setcurs.rst diff --git a/doc/usage/cmd/lcdputs.rst b/doc/usage/cmd/lcdputs.rst new file mode 100644 index 00000000000..f34dbb3e3f1 --- /dev/null +++ b/doc/usage/cmd/lcdputs.rst @@ -0,0 +1,57 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +.. index:: + single: lcdputs (command) + +lcdputs command +=============== + +Synopsis +-------- + +:: + + lcdputs + +Description +----------- + +The lcdputs command prints a string to the video framebuffer at the current +cursor position. + +string + Text string to display on the video console + +Examples +-------- + +Print a simple string:: + + => lcdputs "Hello World" + +Combine with setcurs to position text:: + + => setcurs 10 5 + => lcdputs "Positioned text" + +Print multiple lines:: + + => setcurs 0 0 + => lcdputs "Line 1" + => setcurs 0 1 + => lcdputs "Line 2" + +Configuration +------------- + +The lcdputs command is available if CONFIG_CMD_VIDEO=y. + +See also +-------- + +* :doc:`setcurs` - set cursor position + +Return value +------------ + +The return value $? is 0 (true) on success, 1 (false) on failure. diff --git a/doc/usage/cmd/setcurs.rst b/doc/usage/cmd/setcurs.rst new file mode 100644 index 00000000000..7aa2a4f454d --- /dev/null +++ b/doc/usage/cmd/setcurs.rst @@ -0,0 +1,52 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +.. index:: + single: setcurs (command) + +setcurs command +=============== + +Synopsis +-------- + +:: + + setcurs + +Description +----------- + +The setcurs command sets the cursor position on the video console. + +col + Column position in pixels (0-based) + +row + Row position in pixels (0-based) + + +Examples +-------- + +Set cursor to column 10, row 5:: + + => setcurs 10 5 + +Move cursor to top left:: + + => setcurs 0 0 + +Configuration +------------- + +The setcurs command is available if CONFIG_CMD_VIDEO=y. + +See also +-------- + +* :doc:`lcdputs` - print string on video framebuffer + +Return value +------------ + +The return value $? is 0 (true) on success, 1 (false) on failure. diff --git a/doc/usage/index.rst b/doc/usage/index.rst index 21d6d120e7c..0f271c1280d 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -85,6 +85,7 @@ Shell commands cmd/if cmd/itest cmd/imxtract + cmd/lcdputs cmd/load cmd/loadb cmd/loadm @@ -117,6 +118,7 @@ Shell commands cmd/scmi cmd/scp03 cmd/seama + cmd/setcurs cmd/setexpr cmd/sf cmd/shim diff --git a/test/dm/video.c b/test/dm/video.c index 702e9854005..287ba24eb6a 100644 --- a/test/dm/video.c +++ b/test/dm/video.c @@ -1080,3 +1080,23 @@ static int dm_test_video_backspace_truetype(struct unit_test_state *uts) return 0; } DM_TEST(dm_test_video_backspace_truetype, UTF_SCAN_PDATA | UTF_SCAN_FDT); + +/* video commands */ +static int dm_test_video_cmd(struct unit_test_state *uts) +{ + struct udevice *dev, *con; + + ut_assertok(select_vidconsole(uts, "vidconsole0")); + ut_assertok(video_get_nologo(uts, &dev)); + ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con)); + ut_assertok(vidconsole_select_font(con, "8x16", 0)); + + ut_assertok(run_command("setcurs 10 5", 0)); + + ut_assertok(run_command("lcdputs \"Test string\"", 0)); + ut_asserteq(188, video_compress_fb(uts, dev, false)); + ut_assertok(video_check_copy_fb(uts, dev)); + + return 0; +} +DM_TEST(dm_test_video_cmd, UTF_SCAN_PDATA | UTF_SCAN_FDT); From patchwork Wed Oct 1 23:05:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 468 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=1759359961; bh=0N5rUxJ0zdAtLODZAciafooTMRzW7KcCa7SyqdtpT4E=; 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=IVRPpG2HiCwABzdOvs8ElOaUVC6FLOF83bbCitg7iIrTrU7NzFXpflPy+jHr65flT gxQU9vKCfLOBj/8Gcdmv50zUssrGPCxTRR3cH5RMGCXTi7oMVGxSesf+kpDXx+XSqw aWAXCPDcOC+aFZE7qKvUR9R90oF/tU9zRDAbfmpGLNrblDHlyuj8ySsR9EmvhQsWxL RDdmYgppLg5mGW58ut9TpSSXn64f6JrZP/uZasVS8va4mwDjuGHzcBKHeA4j2V7XyC C6P8ZdDwkOtbXZlJJhSmv3j5cN2C69TWPzNvveyeObjjtDvUpCQnpPjHzPbU67OFpX 9kIYK3DN0Tm1g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BC80E67EE8 for ; Wed, 1 Oct 2025 17:06:01 -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 MkHQBrjcJ935 for ; Wed, 1 Oct 2025 17:06:01 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759359961; bh=0N5rUxJ0zdAtLODZAciafooTMRzW7KcCa7SyqdtpT4E=; 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=IVRPpG2HiCwABzdOvs8ElOaUVC6FLOF83bbCitg7iIrTrU7NzFXpflPy+jHr65flT gxQU9vKCfLOBj/8Gcdmv50zUssrGPCxTRR3cH5RMGCXTi7oMVGxSesf+kpDXx+XSqw aWAXCPDcOC+aFZE7qKvUR9R90oF/tU9zRDAbfmpGLNrblDHlyuj8ySsR9EmvhQsWxL RDdmYgppLg5mGW58ut9TpSSXn64f6JrZP/uZasVS8va4mwDjuGHzcBKHeA4j2V7XyC C6P8ZdDwkOtbXZlJJhSmv3j5cN2C69TWPzNvveyeObjjtDvUpCQnpPjHzPbU67OFpX 9kIYK3DN0Tm1g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id ABA9467E4B for ; Wed, 1 Oct 2025 17:06:01 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759359959; bh=Uy6ummKZ8Jd+Hhd4oZWMCYr2T86K7G619KqpnNtOhoY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MLccU+21XtoQR2zQdfsVMfFfmS1lVg2h8rE8aA5v8S7IUQbPqsXQ9Ckuh2ZZiwXaW p7h4AyYRj5S3g03B4w1052LNDOQnYSs7pkap0vsh+FwsPCjXjPEheM25wX4ecQSXuG bdnXSIcSt0+NwvaI2dTaP+hnvto2Xb52JBHu8M+mMFdyJTSwacoHWgYG1XlbD7OnlN tj8lLCFLH5k2j//mN+8Zama60+b87TI623HYNBlmBSc7xy9dkPsZL8nybVb093kOov vkl7zW/92DjICyRGdWhbuFOcdU40Ydzsvl+tBxTLKqc6IzQaayAnE8UqaU8LxY41k2 9Z21bSB9Xkjaw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id ADCFF67E4B; Wed, 1 Oct 2025 17:05:59 -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 MenbLQDpflFp; Wed, 1 Oct 2025 17:05:59 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759359956; bh=Nuw9CQn7zSN1AjsYqnmlhj2YpcMwD9bypIBzAS/Ljd0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hzvnbZZhdTfe8Alxroh7FqZtI4RZ6X1fQz2Llk/mRq319A6v8shHDFw6Hg6pFd0+w wmhn5Dv6qIyQ8PDGPG/h+IVNdj4dCZgt+ZUE1e2FXpCqFfQ2CHPXUyg5h5gAmePd5p vaA0nL2FRNFJp+8ZkMMcMIr71re3qOj5tclRA4LJ4qk+HOUTKvpTgPxjREvcbxZKDZ 4ajve1LK0aWMYDdQp9aJFqoc33SN7+3kCBktlvZvgRMpA508R+hbACyEJ4QSYSkHYI mMG+AMFSBh7DWFzaj/eTdTW8bMeylLYIh87r56zP9aJxb4Z1Hx3DXOTKWPeJAeKZX1 uO9SbMRgNp+WQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id CE9D167D8D; Wed, 1 Oct 2025 17:05:55 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 1 Oct 2025 17:05:28 -0600 Message-ID: <20251001230537.3324058-3-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: 7GZRPKONCLLI5OKSDVGYYZIDVWAR5L22 X-Message-ID-Hash: 7GZRPKONCLLI5OKSDVGYYZIDVWAR5L22 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 2/6] video: Add video command with subcommands 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' command with 'setcursor' and 'puts' subcommands that provide an alternative interface to the existing setcurs and lcdputs commands. Update the test is updated to test both the legacy commands and the new 'video' command. Co-developed-by: Claude Signed-off-by: Simon Glass --- cmd/video.c | 8 +++++ doc/usage/cmd/lcdputs.rst | 1 + doc/usage/cmd/setcurs.rst | 1 + doc/usage/cmd/video.rst | 66 +++++++++++++++++++++++++++++++++++++++ doc/usage/index.rst | 1 + test/dm/video.c | 5 +++ 6 files changed, 82 insertions(+) create mode 100644 doc/usage/cmd/video.rst diff --git a/cmd/video.c b/cmd/video.c index 91bd6de14dc..c9f2d91a0ba 100644 --- a/cmd/video.c +++ b/cmd/video.c @@ -58,3 +58,11 @@ U_BOOT_CMD( "print string on video framebuffer", " " ); + +U_BOOT_LONGHELP(video, + "setcursor - Set cursor position\n" + "video puts - Write string at current position"); + +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)); diff --git a/doc/usage/cmd/lcdputs.rst b/doc/usage/cmd/lcdputs.rst index f34dbb3e3f1..26e777970d5 100644 --- a/doc/usage/cmd/lcdputs.rst +++ b/doc/usage/cmd/lcdputs.rst @@ -49,6 +49,7 @@ The lcdputs command is available if CONFIG_CMD_VIDEO=y. See also -------- +* :doc:`video` - video command with subcommands * :doc:`setcurs` - set cursor position Return value diff --git a/doc/usage/cmd/setcurs.rst b/doc/usage/cmd/setcurs.rst index 7aa2a4f454d..76a8438afd5 100644 --- a/doc/usage/cmd/setcurs.rst +++ b/doc/usage/cmd/setcurs.rst @@ -44,6 +44,7 @@ The setcurs command is available if CONFIG_CMD_VIDEO=y. See also -------- +* :doc:`video` - video command with subcommands * :doc:`lcdputs` - print string on video framebuffer Return value diff --git a/doc/usage/cmd/video.rst b/doc/usage/cmd/video.rst new file mode 100644 index 00000000000..139f90bd3ff --- /dev/null +++ b/doc/usage/cmd/video.rst @@ -0,0 +1,66 @@ +.. index:: + single: video (command) + +video command +============= + +Synopsis +-------- + +:: + + video setcursor + video puts + +Description +----------- + +The video command provides access to the video-console subsystem. + +video setcursor +~~~~~~~~~~~~~~~ + + video setcursor + +Set the cursor position on the video console. + +col + Column position in pixels (0-based) + +row + Row position in pixels (0-based) + +video puts +~~~~~~~~~~ + + video puts + +Write a string to the video console at the current cursor position. + +string + Text string to display + +Examples +-------- + +Set cursor and print text:: + + => video setcursor 10 5 + => video puts "Hello World" + +Print at different positions:: + + => video setcursor 0 0 + => video puts "Top left" + => video setcursor 0 10 + => video puts "Line 10" + +Configuration +------------- + +The video command is available if CONFIG_CMD_VIDEO=y. + +Return value +------------ + +The return value $? is 0 (true) on success, 1 (false) on failure. diff --git a/doc/usage/index.rst b/doc/usage/index.rst index 0f271c1280d..d1887f7d26a 100644 --- a/doc/usage/index.rst +++ b/doc/usage/index.rst @@ -137,6 +137,7 @@ Shell commands cmd/ums cmd/unbind cmd/ut + cmd/video cmd/virtio cmd/wdt cmd/wget diff --git a/test/dm/video.c b/test/dm/video.c index 287ba24eb6a..98bb0057b18 100644 --- a/test/dm/video.c +++ b/test/dm/video.c @@ -1097,6 +1097,11 @@ static int dm_test_video_cmd(struct unit_test_state *uts) ut_asserteq(188, video_compress_fb(uts, dev, false)); ut_assertok(video_check_copy_fb(uts, dev)); + ut_assertok(run_command("video setcursor 0 0", 0)); + ut_assertok(run_command("video puts \"Top left\"", 0)); + ut_asserteq(272, video_compress_fb(uts, dev, false)); + ut_assertok(video_check_copy_fb(uts, dev)); + return 0; } DM_TEST(dm_test_video_cmd, UTF_SCAN_PDATA | UTF_SCAN_FDT); From patchwork Wed Oct 1 23:05:29 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 469 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=1759359966; bh=Sx+RRCCii3LZ+p+oBg+Cvvxnti3iZF45GQFLDJQ7Z5g=; 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=mO5bEKkFLeAU4f+UVJxtnKCXzukcY6c1d4SCNzH8uH1/QqW1vprj6B11Yg36i5et+ cnDDO6ko6eaW3GgnQdELXoMlmZYViz/4d6QChlBrmFO2RD9aLKxSjMaKFkmadorm5u FFwfJjIKETvJpvBztsTcYVQeuKCZLazdATCMENHt7MX408vcuCjqWrdCOScxtaqYUD d30pWP2CA7QXfSsnlZJPOoKZ3QIA24FnRgcX8d+MjmQFNhKC3p8QaFhTevK9cRsTXy as9+DNagc87YnhrbUyhAiJAIyiLnQtO7TRDqNGe6c+rQT2DGobKEBYqF5ogVTlfAMe 6aMKvh0jY4qcg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3C5AA67EE8 for ; Wed, 1 Oct 2025 17:06:06 -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 eaF5X7LFpfjM for ; Wed, 1 Oct 2025 17:06:06 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759359966; bh=Sx+RRCCii3LZ+p+oBg+Cvvxnti3iZF45GQFLDJQ7Z5g=; 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=mO5bEKkFLeAU4f+UVJxtnKCXzukcY6c1d4SCNzH8uH1/QqW1vprj6B11Yg36i5et+ cnDDO6ko6eaW3GgnQdELXoMlmZYViz/4d6QChlBrmFO2RD9aLKxSjMaKFkmadorm5u FFwfJjIKETvJpvBztsTcYVQeuKCZLazdATCMENHt7MX408vcuCjqWrdCOScxtaqYUD d30pWP2CA7QXfSsnlZJPOoKZ3QIA24FnRgcX8d+MjmQFNhKC3p8QaFhTevK9cRsTXy as9+DNagc87YnhrbUyhAiJAIyiLnQtO7TRDqNGe6c+rQT2DGobKEBYqF5ogVTlfAMe 6aMKvh0jY4qcg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2B6BF67E4B for ; Wed, 1 Oct 2025 17:06:06 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759359964; bh=3mBb29K6roMm26EFRL0RDwnf1QO1KuQATr26Wi/Y2Ew=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ngSmssqtFy2/6Cd/zcMUZBWwJbD1ndIlYTok/+rEeVBNfB5UGkKHu6//+M86sHliX JsZfcBanYqqCY/V2jDIOnbA0tVhj+v88dM0oYu1XAf8ENlkK4aIKipz3XjInlmYae9 7Xav6n8r+TRp+Sa5NhhIyGRRmz6D8bQ1iAACWr1KE844Y8Ww1WqIgCpWR6FZeElO18 rk6sAN91VPBq+3sKZw1i/5c4jU/8kr4qndM4OFxjj5kq3m/9XtYghKtwJ5n6QGyhkf 4mOQAovEcn4aRdVKMslqDq9ey8BiuG0H+8j9fLshY44rmomZ4ilcyW5uSIcdg8jFXJ yo2UKKYrXLIwg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2B0EA67E4B; Wed, 1 Oct 2025 17:06:04 -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 1j9ZurE4p2Ud; Wed, 1 Oct 2025 17:06:04 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759359958; bh=tOrceccj5EDkXFmr8IHjAtA9imVxKtAoxGq8046OPvo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ILqDHvm69uR1mFWro9UEPhe/9TRMmwkW6Fi5owskhhTiMNK2nZ68JJ/2j+1uFDp4q 7d16s653ce1YHMACGtexCCe8x+cRJZZCkFOswgrHTY+QAT+bABZAQErNwwjfw+bH9G DcipjBKV7DUJ8hzBbtR4vDHSMXPURaxfyiZ6ATpbqPQmfHazCaP8cDMKNN5IkO0+pC 2fSxg9SyDInPA8NbUPbrOgT8AIX7cnbhxPGEFb3jiIDcy9mp1PreOVe0sTNItve3FY O1awrT/0/FdArjHwd021GLkIsqQZwpt0c6ex2R9eXeZuthQT4LXc8A0Le5FkoflHvB ukpxGtFhHA8fw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E0B7567E44; Wed, 1 Oct 2025 17:05:57 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 1 Oct 2025 17:05:29 -0600 Message-ID: <20251001230537.3324058-4-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: VMRPWYWCETMQDGCTLXAIFPNVFSOSTWHF X-Message-ID-Hash: VMRPWYWCETMQDGCTLXAIFPNVFSOSTWHF 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 3/6] video: Support a linker list of 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 It is inconvenient to have to access graphical images as independent symbols. Create a new rule which handles any file mentioned in drivers/video/images/Makefile For each graphical image, embed in the image and create a linker-list entry for it. Co-developed-by: Claude Signed-off-by: Simon Glass --- include/video.h | 46 +++++++++++++++++++++++++++++++++++++++++++ include/video_image.h | 13 ++++++++++++ scripts/Makefile.lib | 38 +++++++++++++++++++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 include/video_image.h diff --git a/include/video.h b/include/video.h index 9f891cf9d30..9985f5adcf8 100644 --- a/include/video.h +++ b/include/video.h @@ -7,7 +7,9 @@ #ifndef _VIDEO_H_ #define _VIDEO_H_ +#include #include +#include #ifdef CONFIG_SANDBOX #include #endif @@ -201,6 +203,50 @@ enum colour_idx { VID_COLOUR_COUNT }; +/** + * struct video_image - Information about an embedded image + * + * This structure holds the pointers to the start and end of an image + * that is embedded in the U-Boot binary, along with its name. + * On 64-bit: 2*8 + VIDEO_IMAGE_NAMELEN = 32 bytes + * On 32-bit: 2*4 + VIDEO_IMAGE_NAMELEN = 24 bytes + * + * @begin: Pointer to the start of the image data + * @end: Pointer to the end of the image data + * @name: Name of the image (e.g., "u_boot", "canonical"), null-terminated + */ +struct video_image { + const void *begin; + const void *end; + char name[VIDEO_IMAGE_NAMELEN]; +}; + +/** + * video_image_get() - Get the start address and size of an image + * + * @_name: Name of the image taken from filename (e.g. u_boot) + * @_sizep: Returns the size of the image in bytes + * Return: Pointer to the start of the image data + */ +#define video_image_get(_name, _sizep) ({ \ + struct video_image *__img = ll_entry_get(struct video_image, _name, \ + video_image); \ + *(_sizep) = (ulong)__img->end - (ulong)__img->begin; \ + (void *)__img->begin; \ + }) + +/** + * video_image_getptr() - Get the start address of an image + * + * @_name: Name of the image taken from filename (e.g. u_boot) + * Return: Pointer to the start of the image data + */ +#define video_image_getptr(_name) ({ \ + struct video_image *__img = ll_entry_get(struct video_image, _name, \ + video_image); \ + (void *)__img->begin; \ + }) + /** * video_index_to_colour() - convert a color code to a pixel's internal * representation diff --git a/include/video_image.h b/include/video_image.h new file mode 100644 index 00000000000..35d6d7f1fd4 --- /dev/null +++ b/include/video_image.h @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2025 Google LLC + * Written by Simon Glass + */ + +#ifndef __VIDEO_IMAGE_H +#define __VIDEO_IMAGE_H + +/* Maximum length of an embedded image name */ +#define VIDEO_IMAGE_NAMELEN 16 + +#endif /* __VIDEO_IMAGE_H */ diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 5abe428e752..e812327b585 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -523,6 +523,44 @@ cmd_S_splash= \ $(obj)/%_logo.S: $(src)/%_logo.bmp $(call cmd,S_splash) +# Handle image files in drivers/video/images without _logo suffix +# Generate an assembly file to wrap the image data and create a linker-list entry +quiet_cmd_S_image= IMAGE $@ +cmd_S_image= \ +( \ + echo '\#include '; \ + echo '.section .rodata.image.init,"a"'; \ + echo '.balign 16'; \ + echo '.global __image_$(*F)_begin'; \ + echo '__image_$(*F)_begin:'; \ + echo '.incbin "$<" '; \ + echo '__image_$(*F)_end:'; \ + echo '.global __image_$(*F)_end'; \ + echo '.balign 16'; \ + echo ''; \ + echo '/* Linker list entry for this image */'; \ + echo '.section __u_boot_list_2_video_image_2_$(*F), "aw"'; \ + echo '.balign 8'; \ + echo '.global _u_boot_list_2_video_image_2_$(*F)'; \ + echo '_u_boot_list_2_video_image_2_$(*F):'; \ + echo '\#ifdef __LP64__'; \ + echo '.quad __image_$(*F)_begin'; \ + echo '.quad __image_$(*F)_end'; \ + echo '.asciz "'$(*F)'"'; \ + echo '.org _u_boot_list_2_video_image_2_$(*F) + 16 + VIDEO_IMAGE_NAMELEN'; \ + echo '\#else'; \ + echo '.long __image_$(*F)_begin'; \ + echo '.long __image_$(*F)_end'; \ + echo '.asciz "'$(*F)'"'; \ + echo '.org _u_boot_list_2_video_image_2_$(*F) + 8 + VIDEO_IMAGE_NAMELEN'; \ + echo '\#endif'; \ +) > $@ + +ifneq ($(filter drivers/video/images,$(obj)),) +$(obj)/%.S: $(src)/%.bmp + $(call cmd,S_image) +endif + # Generate an assembly file to wrap the EFI 'Boot Graphics Resource Table' image quiet_cmd_S_bgrt= BGRT $@ # Modified for U-Boot From patchwork Wed Oct 1 23:05:30 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 470 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=1759359970; bh=0tGgBNH/9I7T4WJwHmi8ljVuxCHi3sXBlonvuKCsH68=; 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=DHqrIhQ7PnhTmECJ7JFe8DjUU9adMsJOUjYCIzn/zFiDmC8LaR7JoamjPlIo5nWaA Q69HZc5NVqqO14Uvis80GlM4jRANlEXkig7Gcpo2BDE0bNshIMetT2viOc23H7OA0n HNG2L/8oOtSWkkwF2kDXeSZfDNMPVPHDQ4RBYLGUUmocPgioTUr5/vEuuhfSxHhz9S y1qgsYPkCBHVI9Vf0CGLL94gqM2glhLIr6bo+lK8iQzBppZV9zwAiFRl35EmaHzbiV rK6I1e1n16L2YXcrcYMQb33YDgCxhk1ifsEFFo0MsaHgDJRY1g5uuX67DpmXOM3KRu 5lxyEuWeP6SuA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D80E167E42 for ; Wed, 1 Oct 2025 17:06:10 -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 cZdrqs0-QVv3 for ; Wed, 1 Oct 2025 17:06:10 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759359970; bh=0tGgBNH/9I7T4WJwHmi8ljVuxCHi3sXBlonvuKCsH68=; 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=DHqrIhQ7PnhTmECJ7JFe8DjUU9adMsJOUjYCIzn/zFiDmC8LaR7JoamjPlIo5nWaA Q69HZc5NVqqO14Uvis80GlM4jRANlEXkig7Gcpo2BDE0bNshIMetT2viOc23H7OA0n HNG2L/8oOtSWkkwF2kDXeSZfDNMPVPHDQ4RBYLGUUmocPgioTUr5/vEuuhfSxHhz9S y1qgsYPkCBHVI9Vf0CGLL94gqM2glhLIr6bo+lK8iQzBppZV9zwAiFRl35EmaHzbiV rK6I1e1n16L2YXcrcYMQb33YDgCxhk1ifsEFFo0MsaHgDJRY1g5uuX67DpmXOM3KRu 5lxyEuWeP6SuA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C53D267D8D for ; Wed, 1 Oct 2025 17:06:10 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759359968; bh=U+ZPAEJ55/K9XZ8Su2qMKu9ufDwgz16kiGsPMXLEpDA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XDCdjRkA/kTEjV8jPeq7l2WIt/TyB7IfXMslsube5HRM79ZdThkZiTLHjOZpZZrFL N2GHmX7aC44CQbCLFQL6rpDeZjir693fTJHxvpziaQRHA4SbNDJl5WG8XCWE48bVUp XzDFIJIZKk/Fi8zWxpcED4QASb2RWvnCsWbHdJGjNY0iNSd5hYTPrjatQlFQ0dj2rx hVl5dp/oKUV7ZcZWOpxyuo+PYUmlheKtGwh/JkDgsQzzA3UQcaTCy7H75zRbQf6bau qqVh2YLxt6ylswExDQmURg9Vl1q2cus/ACoWI4uBF6Cm4UPPyryHoCK5U6xpjqNAif mheMsrQVh6JJQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9674767E42; Wed, 1 Oct 2025 17:06:08 -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 NrpN4vgcvtoq; Wed, 1 Oct 2025 17:06:08 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759359962; bh=B5VkOJXR9LlcI45WRsXwpYRZtl5eWedvOItliLZkQdM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VLswZ/3Gs8O+r36kyXpi75+RD1wR797jyuv380sJk7gtXmGkqvJOVz3RBl0plVhEv jrr0eMAe+2joBiZeVNgQkvp823jMZJCdE8L8E3FvYSPiws6RUwMBuSgnZAQxT3EuOY FWC7MKNVPRPrkTPb80ok7KGj/L2WFqhycVaUIB3vyabgOGCYWKXi4DatRkAQXPKPQV ie3CQmMSXzNO18Pp0J5nCchGvlgsHrEXwnvGpB1RKZemUZ3rwwKyfEB93qYgRwUZOP lxskOEPNt7d5h9HCVQyf2cRVfmdRXt1E5lBSvBo0l5y73l08K1x6gZAibI/pfow1QY lElb0KcN/5JCw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 9330F67D8D; Wed, 1 Oct 2025 17:06:02 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 1 Oct 2025 17:05:30 -0600 Message-ID: <20251001230537.3324058-5-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: 7C6RSJ3ZEKJZN7SM5P7TYOWMQGHHEXBC X-Message-ID-Hash: 7C6RSJ3ZEKJZN7SM5P7TYOWMQGHHEXBC 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 4/6] video: Move the logo into the new video-images 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 Move u_boot_logo.bmp into drivers/video/images and include it in the build. Make use of the new video_image_get() macro to obtain the logo. Drop the old SPLASH_...() macros. Co-developed-by: Claude Signed-off-by: Simon Glass --- drivers/video/Makefile | 3 ++- drivers/video/images/Makefile | 5 +++++ .../{u_boot_logo.bmp => images/u_boot.bmp} | Bin drivers/video/video-uclass.c | 20 +++++++----------- 4 files changed, 15 insertions(+), 13 deletions(-) create mode 100644 drivers/video/images/Makefile rename drivers/video/{u_boot_logo.bmp => images/u_boot.bmp} (100%) diff --git a/drivers/video/Makefile b/drivers/video/Makefile index e0b0015606f..620f278c738 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -24,7 +24,6 @@ obj-$(CONFIG_$(PHASE_)PANEL) += panel-uclass.o obj-$(CONFIG_PANEL_HX8238D) += hx8238d.o obj-$(CONFIG_$(PHASE_)SIMPLE_PANEL) += simple_panel.o -obj-$(CONFIG_VIDEO_LOGO) += u_boot_logo.o obj-$(CONFIG_$(PHASE_)BMP) += bmp.o obj-y += vesa_helper.o @@ -86,3 +85,5 @@ obj-$(CONFIG_VIDEO_ZYNQMP_DPSUB) += zynqmp/ obj-y += bridge/ obj-y += sunxi/ obj-y += tegra20/ + +obj-y += images/ diff --git a/drivers/video/images/Makefile b/drivers/video/images/Makefile new file mode 100644 index 00000000000..d3aca2ee7f7 --- /dev/null +++ b/drivers/video/images/Makefile @@ -0,0 +1,5 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# Copyright 2025 Simon Glass + +obj-$(CONFIG_VIDEO_LOGO) += u_boot.o diff --git a/drivers/video/u_boot_logo.bmp b/drivers/video/images/u_boot.bmp similarity index 100% rename from drivers/video/u_boot_logo.bmp rename to drivers/video/images/u_boot.bmp diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index be014a770d0..eaf6cf9fc71 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -581,28 +581,24 @@ int video_get_ysize(struct udevice *dev) return priv->ysize; } -#define SPLASH_DECL(_name) \ - extern u8 __splash_ ## _name ## _begin[]; \ - extern u8 __splash_ ## _name ## _end[] - -#define SPLASH_START(_name) __splash_ ## _name ## _begin -#define SPLASH_END(_name) __splash_ ## _name ## _end - -SPLASH_DECL(u_boot_logo); - void *video_get_u_boot_logo(int *sizep) { + void *ptr; + int size; + + ptr = video_image_get(u_boot, &size); if (sizep) - *sizep = SPLASH_END(u_boot_logo) - SPLASH_START(u_boot_logo); + *sizep = size; - return SPLASH_START(u_boot_logo); + return ptr; } static int show_splash(struct udevice *dev) { - u8 *data = SPLASH_START(u_boot_logo); + u8 *data; int ret; + data = video_image_getptr(u_boot); ret = video_bmp_display(dev, map_to_sysmem(data), -4, 4, true); return 0; From patchwork Wed Oct 1 23:05:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 471 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=QvqK0D1odPfXDcotQukpHRiyHBr0R/0fAVG55jWZUPY=; 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=hESHjwPhfa4xupqppQqt3L1i/aHXXFeidItzRvQygeYLdlAgNPlmdzlvfl5UgeHQx 5KZmpONhjx0vawUhot+A95jnWrw2R9JiU4UO3Uf7QSSF/7rxqGASRw6lcpKviZeExi X8gaTkOQf3ts1lKd+8hoQBABMkf6UPRkyQ+SRx9hor2d5bq34WZii22MMWUcYJ7xy+ 80BuQrfad2JY0NKFBiYlgG7+ctQ7i17ZlAoNtmDWW3LSud6RYhSnbSwF8N+SpTqih/ zXkFBXsLem6DhI44ZLhX8m0HrCBqsfG2asCBZsS0YrHrZCO5NT8olOCxeU6M8BwZBb JzhEABJjQKZCA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 62B6567EE9 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 9pW6RiE2EU0O 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=QvqK0D1odPfXDcotQukpHRiyHBr0R/0fAVG55jWZUPY=; 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=hESHjwPhfa4xupqppQqt3L1i/aHXXFeidItzRvQygeYLdlAgNPlmdzlvfl5UgeHQx 5KZmpONhjx0vawUhot+A95jnWrw2R9JiU4UO3Uf7QSSF/7rxqGASRw6lcpKviZeExi X8gaTkOQf3ts1lKd+8hoQBABMkf6UPRkyQ+SRx9hor2d5bq34WZii22MMWUcYJ7xy+ 80BuQrfad2JY0NKFBiYlgG7+ctQ7i17ZlAoNtmDWW3LSud6RYhSnbSwF8N+SpTqih/ zXkFBXsLem6DhI44ZLhX8m0HrCBqsfG2asCBZsS0YrHrZCO5NT8olOCxeU6M8BwZBb JzhEABJjQKZCA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4D9CB67E42 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=1759359973; bh=NuQv7EKBaDuLMyFNvuKZN+iBdbH+Hsu4C1T5fBzUMbI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u0OWLIKLTtg0mAC5deGY05fEBPRjedjtud+yUag+9lWpJn1zPaNfWUK6c45yKJ/h0 ClhJaUd3uYuxCEWQPRQv6h+dyZOxojou2VhWmcpe+5DAogip6sNhWeadtc2zRTktdD txwUSPnOOx1BSE9LkXFhuMXJIjthUva+DMTINBu9kSkAu1nTIKbfRpm7oBI4L0UlkV QHoBhTGCTpqouNqmF1kMDnkpAJ0aSsUm/upeQLGGC9X9miy7yiXGAd/MxkS9ixXovJ MC9AcTtCQootiUb1icggnob5lHrH2SvHoK01xWW0RlPalA/mkIERybiXLlA+ppzmiy hhUIfvNLjeUlg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4AE6867D8D; Wed, 1 Oct 2025 17:06:13 -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 xApTaNSsP-fy; Wed, 1 Oct 2025 17:06:13 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759359967; bh=ovdIgoFTPeMLjmVzP4FKSS0F93bHq2nooUg6Ri43cq0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WUOkRQD4rZn7yXWGUcRGo5wcXwGqQylRal8R4iLSm7qHd5bJINzYDcgeSzCsjWP/f dD+7JWXa7DTAfzYI5mpDOvfz8BMBmdakqt8XVSZON0AFxqK35m4QvjvuylzScarcxv Ff7MQeoWOAdOoIM+UgNf3St/qq69J2yltjW/ksnBGbN+dIrC+AjrEajxK9aGOQrGp2 nmkVPwYjHhQKR9wEu4hJGXNY+bWwU0rBCwkhxeEfMInB1/+2YFB93Zumrrc/X4h/TT sbVrRszCMt5EydJizECTgOViWslxSyD0hIDyQcP6CA9rrNilywOSDeWADh3OLIjxO6 nf6nc0lBioMqQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 4950B67E44; Wed, 1 Oct 2025 17:06:07 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Wed, 1 Oct 2025 17:05:31 -0600 Message-ID: <20251001230537.3324058-6-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: M6QPGHYSJC5DDRFFJIOHHB2KY5D57YH5 X-Message-ID-Hash: M6QPGHYSJC5DDRFFJIOHHB2KY5D57YH5 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 5/6] acpi: bgrt: Move the BGRT image into the images 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 Move the BGRT image to use the same video_image linker-list approach as the other embedded image. Move it into the drivers/video/images directory and rename it to 'bgrt.bmp' since we know it is an image. Drop the old bgrt Makefile rule as it is no-longer needed. Co-developed-by: Claude Signed-off-by: Simon Glass --- drivers/video/images/Makefile | 4 ++++ .../video/images/bgrt.bmp | Bin lib/acpi/Makefile | 2 -- lib/acpi/acpi_extra.c | 22 ++++-------------- scripts/Makefile.lib | 18 -------------- 5 files changed, 8 insertions(+), 38 deletions(-) rename lib/acpi/bgrt_image.bmp => drivers/video/images/bgrt.bmp (100%) diff --git a/drivers/video/images/Makefile b/drivers/video/images/Makefile index d3aca2ee7f7..9b0d85cd2c8 100644 --- a/drivers/video/images/Makefile +++ b/drivers/video/images/Makefile @@ -3,3 +3,7 @@ # Copyright 2025 Simon Glass obj-$(CONFIG_VIDEO_LOGO) += u_boot.o + +ifdef CONFIG_$(PHASE_)GENERATE_ACPI_TABLE +obj-y += bgrt.o +endif diff --git a/lib/acpi/bgrt_image.bmp b/drivers/video/images/bgrt.bmp similarity index 100% rename from lib/acpi/bgrt_image.bmp rename to drivers/video/images/bgrt.bmp diff --git a/lib/acpi/Makefile b/lib/acpi/Makefile index a4850fcc108..4b9b1ef8029 100644 --- a/lib/acpi/Makefile +++ b/lib/acpi/Makefile @@ -12,8 +12,6 @@ obj-$(CONFIG_$(PHASE_)ACPIGEN) += acpi_table.o obj-y += acpi_extra.o obj-y += acpi_writer.o -obj-y += bgrt_image.o - # With QEMU the ACPI tables come from there, not from U-Boot ifndef CONFIG_QFW_ACPI obj-y += base.o diff --git a/lib/acpi/acpi_extra.c b/lib/acpi/acpi_extra.c index 7620f953add..709f64305b5 100644 --- a/lib/acpi/acpi_extra.c +++ b/lib/acpi/acpi_extra.c @@ -13,23 +13,6 @@ #include #include -#define BGRT_DECL(_name) \ - extern u8 __bgrt_ ## _name ## _begin[]; \ - extern u8 __bgrt_ ## _name ## _end[] - -#define BGRT_START(_name) __bgrt_ ## _name ## _begin -#define BGRT_END(_name) __bgrt_ ## _name ## _end - -BGRT_DECL(image); - -static void *bgrt_get_image(int *sizep) -{ - if (sizep) - *sizep = BGRT_END(image) - BGRT_START(image); - - return BGRT_START(image); -} - int acpi_write_bgrt(struct acpi_ctx *ctx) { struct udevice *dev; @@ -42,7 +25,10 @@ int acpi_write_bgrt(struct acpi_ctx *ctx) /* If video is available, use the screen size to centre the logo */ have_video = !uclass_first_device_err(UCLASS_VIDEO, &dev); - logo = bgrt_get_image(&size); + if (!IS_ENABLED(CONFIG_VIDEO)) + return -ENOENT; + + logo = video_image_get(bgrt, &size); /* If there's no logo data, there's nothing to report */ if (!logo) diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index e812327b585..6a64760de5e 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -561,24 +561,6 @@ $(obj)/%.S: $(src)/%.bmp $(call cmd,S_image) endif -# Generate an assembly file to wrap the EFI 'Boot Graphics Resource Table' image -quiet_cmd_S_bgrt= BGRT $@ -# Modified for U-Boot -cmd_S_bgrt= \ -( \ - echo '.section .rodata.bgrt.init,"a"'; \ - echo '.balign 16'; \ - echo '.global __$(*F)_image_begin'; \ - echo '__$(*F)_image_begin:'; \ - echo '.incbin "$<" '; \ - echo '__$(*F)_image_end:'; \ - echo '.global __$(*F)_image_end'; \ - echo '.balign 16'; \ -) > $@ - -$(obj)/%_image.S: $(src)/%_image.bmp - $(call cmd,S_bgrt) - # EFI applications # A Makefile target *.efi is built as EFI application. # A Makefile target *_efi.S wraps *.efi as built-in EFI application. 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);