From patchwork Mon Oct 6 20:58:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 527 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=1759784388; bh=2YU5d8+c+7ClNa//uaYBBx7O6UkScx7S5kNrCapakMA=; 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=AxNtfOjqSF+GpSCGA3iX6K0rKNjHMxm8nLWDiuYEKslGHIqAwOacaDVrlO+wiNODP sgEC59LaoKqmwB3e1myzDl+FFCgPQFSMShqgVpZcjAKPAk6qb3NLhbhXTfdCVKQPGZ g7Y0z59BE5FJp/0WvZ6AiRc6gTGSse+xpZ4pNfStLlmsSEnaPxyICrU+1nrvTexKQr RF8xpX0F+iJtZC/0W8UaPh4tbmHzSEDTfKmBKuih12h1c5iBtGNESMd8YJ5xO1meLF MwLPgwFhf3M6wD/wxduote5RQs29Yf7eQdVH5OBb84BefkxmThvSB6/55cTNNjts26 pSBsHLtuLT6Sg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3270E67FCB for ; Mon, 6 Oct 2025 14:59:48 -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 GeJZNSHeVpue for ; Mon, 6 Oct 2025 14:59:48 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759784387; bh=2YU5d8+c+7ClNa//uaYBBx7O6UkScx7S5kNrCapakMA=; 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=DHXfmbLoyP8iobGm5lUYsY1echSE/OaPDbyIuyDuZY8i2iHvayAMRc9bE8dlqL09s A1sjJiAfvvLiTM+EMA4Z38tQgMdvTMxVRqG6ojzc3cMxyreJ3wFKD8yAxeh3KN6UWq +3OHxOXuTSP2iUowCZD5u7OE1BINgWeuOpx0JDKAbQ3oSM0iG9+tKBGddeIzBd84Y6 IDfXm04iYY9ETcGLSaDzcr6HiAYCn7phabPxCcDUpj9oQrPjBj1nAPcQZUOR2eBVKI E+dOsOsdaVrMPbx6Uw5W8uatMMm3Um66ICLJ1lwFeWXAIpQe2M2KyoCoeKaPlcz+8m +5lkFLuBd1taw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1B6E867F03 for ; Mon, 6 Oct 2025 14:59:47 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759784385; bh=PPoWqyxPGl0z2JtMTKMsIYJThmIlb+NpkbFckDo39T0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=snKjcBX2W9bXGJuN0oVY4/ZcUTpdU5sC8gpTmfZ2uSyiGWqdrUtuNdOGi50K7d9Wf q5ze4nzYm9ogZ3g4NqSl+GCQjPJy/Bm6FYchdwG4+TWmfvUmj3gA/X80bNG9UzrFUq /EmQq425UIXnl6gS7e5etOCRMxeuzK3UVGjce0gNTAxDG79NZB9FFgcW6/bzlE/F30 k5RaMQW5I2X5sLEXLIhWp1aFSqb2uk4zRWUh8Gnej5Pu3oVFkBbZDYTYMsAqRfyXaY tRyxukeV+DXBtvFKZMQlBNuF9PXdT9cx207vtS2eoiHDK1i6iixCCmZ+bXIz+uJk2T sn54z/Xyqx4CQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6CF0F67F8D; Mon, 6 Oct 2025 14:59:45 -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 N-KqOQNzwxqK; Mon, 6 Oct 2025 14:59:45 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759784379; bh=b+AoF9BoIQTr8r50lOYzKva7L88JVCkV6DnbQsDHhao=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ifya17VAYcvUXoX0Pom2b5NM+JKpu8UCqL02A6RB5gN7izKBjQmwZ8sMKC/lU2F3I 41H4BYqIUOYxHRDphRtCo3VUmLtT0lJLZfIe8ooHYZH+5nYyBect7lsMAsugLRZvtn 9ZGdvDVJJQoVLcVa4zR8EEYIFed0K8aZnRTr5V5HUL4liEpOQ5dPbYqWDoVN9qcMxv EznRAAgVW4LrlT+vaCU0J5S93p25ijpzgHaOdhRZR5E8/SN6OQG3YSOlSCWX/Y892P 5axv78Snrom4z7MxXkEKIazAs9BtlO5RmfiZ3uTu19Is6px60VttRSqjjEsbbmf7wz NntyDYROS5RmQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id EC2DF67F55; Mon, 6 Oct 2025 14:59:38 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 6 Oct 2025 14:58:44 -0600 Message-ID: <20251006205856.2009292-11-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251006205856.2009292-1-sjg@u-boot.org> References: <20251006205856.2009292-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: JW3RBQAHOHN7JKXEPPB5462PFKP3BSVH X-Message-ID-Hash: JW3RBQAHOHN7JKXEPPB5462PFKP3BSVH 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 10/14] expo: Track the number of render calls 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 Keep track of the frame count, i.e. the number of times that expo_render() has been called since expo_enter_mode() was invoked. Allow test mode to be enabled (if compiled in) by setting the 'expotest' environment variable to 1. Co-developed-by: Claude Signed-off-by: Simon Glass --- boot/expo_test.c | 21 +++++++++++++++++++++ include/expo.h | 4 ++++ include/expo_test.h | 11 +++++++++++ 3 files changed, 36 insertions(+) diff --git a/boot/expo_test.c b/boot/expo_test.c index ecef8decc6e..269052a61cb 100644 --- a/boot/expo_test.c +++ b/boot/expo_test.c @@ -8,18 +8,39 @@ #define LOG_CATEGORY LOGC_EXPO +#include +#include #include #include +#include +#include int expo_test_init(struct expo *exp) { + struct expo_test_mode *test; + + test = calloc(1, sizeof(struct expo_test_mode)); + if (!test) + return log_msg_ret("test", -ENOMEM); + + test->enabled = env_get_yesno("expotest") == 1; + exp->test = test; + return 0; } void expo_test_uninit(struct expo *exp) { + free(exp->test); + exp->test = NULL; } void expo_test_update(struct expo *exp) { + struct expo_test_mode *test = exp->test; + + if (!test) + return; + + test->render_count++; } diff --git a/include/expo.h b/include/expo.h index 8ad7415b5a4..e9e71f4fe36 100644 --- a/include/expo.h +++ b/include/expo.h @@ -90,6 +90,8 @@ struct expo_action { }; }; +struct expo_test_mode; + /** * struct expo_theme - theme for the expo * @@ -139,6 +141,7 @@ struct expo_theme { * @priv: Private data for the controller * @done: Indicates that a cedit session is complete and the user has quit * @save: Indicates that cedit data should be saved, rather than discarded + * @test: Pointer to test mode information, NULL if not allocated * @theme: Information about fonts styles, etc. * @scene_head: List of scenes * @str_head: list of strings @@ -165,6 +168,7 @@ struct expo { void *priv; bool done; bool save; + struct expo_test_mode *test; struct expo_theme theme; struct list_head scene_head; struct list_head str_head; diff --git a/include/expo_test.h b/include/expo_test.h index e1918ddeff2..ee4ae4611f7 100644 --- a/include/expo_test.h +++ b/include/expo_test.h @@ -9,6 +9,17 @@ struct expo; +/** + * struct expo_test_mode - Test mode information for expo + * + * @enabled: true if test mode is enabled + * @render_count: Number of calls to expo_render() since expo_enter_mode() + */ +struct expo_test_mode { + bool enabled; + int render_count; +}; + #if CONFIG_IS_ENABLED(EXPO_TEST) /**