From patchwork Fri Oct 3 16:54:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 483 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=1759510565; bh=U0fIZVgD+1R4FBWG1Bi7PKl5MiARkU5egCobgqUDlS8=; 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=EbPZds5ba6Y0GhVCV4WBS8rx+9Yw6prJnYbBZQ8HJpv8t5raOsc1ddI4rEQk8x6h2 fAkVFNl/GYDUK6DCQf8Pe8RVJt5f7JDI59p5B/Y6iSLnRT9mkHCNT3Tv7YyMTivg3R dgtmMraraB5sHxUXrTIXOrElmaoE+KLiTTSbN4cqn9sOh1WKmAxhEW6ewu7STPxtLb kMTv0A+YorbzD7yJnWWW/l+7ImcPfdLYmQu8+X8uXXf+t4rSEvGkC50H4ry3o6ihpY j1Z6Ih2u9f1DIyx8uebLqib1CBrxQnrA55nOPa5dIb7kUjOoNRgl+tgLAjf/hCW2rb v2lJDqqx5xhjw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5603667EBD for ; Fri, 3 Oct 2025 10:56:05 -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 vNcu9501j6WV for ; Fri, 3 Oct 2025 10:56:05 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759510565; bh=U0fIZVgD+1R4FBWG1Bi7PKl5MiARkU5egCobgqUDlS8=; 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=EbPZds5ba6Y0GhVCV4WBS8rx+9Yw6prJnYbBZQ8HJpv8t5raOsc1ddI4rEQk8x6h2 fAkVFNl/GYDUK6DCQf8Pe8RVJt5f7JDI59p5B/Y6iSLnRT9mkHCNT3Tv7YyMTivg3R dgtmMraraB5sHxUXrTIXOrElmaoE+KLiTTSbN4cqn9sOh1WKmAxhEW6ewu7STPxtLb kMTv0A+YorbzD7yJnWWW/l+7ImcPfdLYmQu8+X8uXXf+t4rSEvGkC50H4ry3o6ihpY j1Z6Ih2u9f1DIyx8uebLqib1CBrxQnrA55nOPa5dIb7kUjOoNRgl+tgLAjf/hCW2rb v2lJDqqx5xhjw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4606967E83 for ; Fri, 3 Oct 2025 10:56:05 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759510562; bh=1aa5wqQV/Wo8LKr+qbeM1GD5dKtCOC7ZhQNZFU8dSXo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bgj0zCaOY3Fxt5G+7T+oRGZG/kMSe3W6e0+FLtkp5Trqh2nrVK2VB1kaEOlb7E1PR tYjcaqPaSvasGQ3cQ8SfLsPk2U1/OTDlQggppl4HFMnUoOyBbjEkXeXwaE/iu1Goc8 0senZ6zZ2YrgpBe5cKr4NZNnjNEs3+cL6swYetSORdVlT5xIRPeS4ElVI6fWhy28wC oe3En1wLmU1dCqiKfvC2YM8CQ4Lc3jlId1fjiAumXcVpZSXbUpBab6NzafFkLQpyMJ U/pe627hBHHMArPDcdsc2K0w2YcrUIscy2mApsLdQNUkzKY8tQAV5F2lrUr10aqLR2 i1uZWU4QFxKJw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BAEBB67E83; Fri, 3 Oct 2025 10:56:02 -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 VLRYTxKJgZWZ; Fri, 3 Oct 2025 10:56:02 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759510556; bh=Nv+jk5+CD67Q4cm7WgYLZ1ZRNef4s00wdX8k7ZDZWFw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MSOQflnQB5b9Wa2T8bQnJVfWM9RwxLWwZ8ahUbjQ7rmh4Uq2s3V2gWDBIe3WpjFzI wyI70tcU4kJ1IbRxuWgK+lItcLm4YZU62bxNq06klnviWD2nmLWP2SBMq5rJT5727p NR5fqQcaDdSeKulEvJJrg/FRuanmNM4KouiyQ2CRiH0W+lJ7uMTcxhuvqmc1N9Syve mWNMghOgGTgCR/1bn1SsEpg2CLxA6sz6Syqvu89YYagiiJXWFBisOvYYhMHqJW0Gk7 TAsSpfsPTNMlVK8XH0RmYKE+lkPPrr5eJg4OqCWADx4ft4AyBnAWR6yJ4jJ0eAaf/M qeYMeDkkqwD4A== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C40FA67E7C; Fri, 3 Oct 2025 10:55:55 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 3 Oct 2025 10:54:55 -0600 Message-ID: <20251003165525.440173-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251003165525.440173-1-sjg@u-boot.org> References: <20251003165525.440173-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: TNBNIUJTR3DGNSGUOTM3SU2A3ANQDP5B X-Message-ID-Hash: TNBNIUJTR3DGNSGUOTM3SU2A3ANQDP5B 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 02/22] sandbox: Add -V flag for video test delay 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 -V flag to sandbox which accepts a delay in milliseconds. This causes video tests to pause after each assertion, allowing the display output to be visually inspected. This is useful for debugging video tests and understanding what is being drawn at each step. Co-developed-by: Claude Signed-off-by: Simon Glass --- arch/sandbox/cpu/start.c | 10 ++++++++++ arch/sandbox/include/asm/state.h | 1 + doc/arch/sandbox/sandbox.rst | 4 ++++ test/dm/video.c | 7 +++++-- 4 files changed, 20 insertions(+), 2 deletions(-) diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c index 43adc4cdb4f..559c11a2dbb 100644 --- a/arch/sandbox/cpu/start.c +++ b/arch/sandbox/cpu/start.c @@ -365,6 +365,16 @@ static int sandbox_cmdline_cb_double_lcd(struct sandbox_state *state, SANDBOX_CMDLINE_OPT_SHORT(double_lcd, 'K', 0, "Double the LCD display size in each direction"); +static int sandbox_cmdline_cb_video_test(struct sandbox_state *state, + const char *arg) +{ + state->video_test = simple_strtol(arg, NULL, 10); + + return 0; +} +SANDBOX_CMDLINE_OPT_SHORT(video_test, 'V', 1, + "Enable video test mode (ms delay between asserts)"); + static const char *term_args[STATE_TERM_COUNT] = { "raw-with-sigs", "raw", diff --git a/arch/sandbox/include/asm/state.h b/arch/sandbox/include/asm/state.h index af92f4e6fcd..fc3c39cde27 100644 --- a/arch/sandbox/include/asm/state.h +++ b/arch/sandbox/include/asm/state.h @@ -177,6 +177,7 @@ struct sandbox_state { bool soft_fail; /* Continue on failure */ bool pager_bypass; /* Enable pager-bypass mode */ bool no_term_present; /* Assume no terminal present */ + int video_test; /* ms to wait before next assert */ /* Pointer to information for each SPI bus/cs */ struct sandbox_spi_info spi[CONFIG_SANDBOX_SPI_MAX_BUS] diff --git a/doc/arch/sandbox/sandbox.rst b/doc/arch/sandbox/sandbox.rst index 31a670ce2ab..bfc0ee70834 100644 --- a/doc/arch/sandbox/sandbox.rst +++ b/doc/arch/sandbox/sandbox.rst @@ -252,6 +252,10 @@ available options. Some of these are described below: -v, --verbose Show console output from tests. Normally this is suppressed. +-V, --video_test + Enable video test mode with a delay (in milliseconds) between assertions. This + allows time to examine the display during testing. + -w, --write Write driver state to state file on exit. In conjunction with `-r`, this allows sandbox to save and restore emulated hardware state (such as a TPM) across diff --git a/test/dm/video.c b/test/dm/video.c index b1bf08a99f7..f8c126dba5c 100644 --- a/test/dm/video.c +++ b/test/dm/video.c @@ -50,6 +50,7 @@ DM_TEST(dm_test_video_base, UTF_SCAN_PDATA | UTF_SCAN_FDT); int video_compress_fb(struct unit_test_state *uts, struct udevice *dev, bool use_copy) { + struct sandbox_state *state = state_get_current(); struct video_priv *priv = dev_get_uclass_priv(dev); uint destlen; void *dest; @@ -70,8 +71,10 @@ int video_compress_fb(struct unit_test_state *uts, struct udevice *dev, if (ret) return ret; - /* provide a useful delay if #define LOG_DEBUG at the top of file */ - if (_DEBUG) + /* provide a useful delay if -V flag is used or LOG_DEBUG is set */ + if (state->video_test) + mdelay(state->video_test); + else if (_DEBUG) mdelay(300); return destlen;