From patchwork Fri Oct 10 03:42: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: 567 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=1760067801; bh=lfUk1W7sJMaLm0CbS8q+N42aacPNy/mq4UZoHRTbNRc=; 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=HLulwZ8PYN2uWDJMkOPg1+wYE6Tebtux5Bgb4MaxTn39Esw73KEBzjqV2gHVBYEQY OtLKdW86t/S/oFhTUDrCMXonkpSew1akHf6+4zSq82k1iWYgJ9/Elhn6QFaP5ZDev+ dg4JICoW5oMizqPW2q2cXd3717+BUYAvKFObeeHAmZd73RFnOOhcG6ibVgZhPF6ATa UZrp7zTiSis4LobIxEhfAKO1XkMY4RvY06vnt2G8UIYGvUxLvVsQAf9rHKBLk3R9AP 5aOwgOoK+U/dHhCQk2w1tArZVngN8PrEom+hAFOMC7jUTUFEiKmfByaHPTTdAXvDSh qWvsw/rBj+Idw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6BFB96806E for ; Thu, 9 Oct 2025 21:43:21 -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 ZZQDIpFabrYb for ; Thu, 9 Oct 2025 21:43:21 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067799; bh=lfUk1W7sJMaLm0CbS8q+N42aacPNy/mq4UZoHRTbNRc=; 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=XpAFesw5nAPZkdyDtSZTZD4uuEQOdag/dBeO2miF8DeAteMDUJfb1q9KKmRVV20YL Kk573zyOfnJbeH9lGGL1FurlVrcl/x+uKfb4odhsZ9sur2whXRuaFoeVKhrEpdrQ1Q xV0Ks/m1PjGDdGk50RXkWiY5Ksf/JkETMXToPZIA5GkoNoIjpspl76YRIwsxEFCJbS SPJtPPFZJER0HtnRm1ccyu0Xe1YIB81xa8lvgB6fRY9WtS9AbBcVixusICAbeMZqt5 XfT702gsHMsuVNnOlJR++XNunPgwoNgEyyTGq1qHQypLk92S5WZ8IGcWVQOUwHDOub skyS/jCCClXQg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 674E068030 for ; Thu, 9 Oct 2025 21:43:19 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067796; bh=OW+1y5QZ7sYJM4/7nhbepDTzl0uQzkie8F5bdC5V3Zc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qjq1zED5nVLao+j34LDdj3RbvSBJkLboVKz/NZOtbS1kXscNI+sMx0QERCI4qRWGD 52I2s927cGAfpGqWqtGYWKwCx0gA6sB92P9erIyreJPRxKRAb8ZTPT4DtKhAU4AYuu UE+gBNrauB/yTV9Q6JcH9kScHzzkHb8KKaQb6l2BMncPre/lY+8NfztYp5VgfRMx2J tCrxDx62jBMy1D2n2LoEnACC2QegH3mve8Xfk/TaVl+DU6q+5+/Wd5VhD92nAxzW8Z VpbkAEesWf4O+6bSM9CpwHT41ZZ4QiHDMqQYzwRzlt6lW8JIjdZOApAt5Y/jkwc6oC SwBLyd3br50GA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6CDD668030; Thu, 9 Oct 2025 21:43:16 -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 SgJ24jDx-Cia; Thu, 9 Oct 2025 21:43:16 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067796; bh=gdLGaWAobmqg5PACWXuwI2qthZmekqzTstBF21Y8gaQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Zmkmp9xm64ySeCxamUnn/e77SwMOV5Ma81K679tU4P8ULDqI9MhXkTSNXNsr+AkJp BMjW+7WXYpQ5fBemJbFCZ7e7MM+qnfviRmgy+tD71m6o/2KsjusUlI7kZ+Kc6mCgKf M4nkB979KPJxncw0VV+r9PNzMHyuxSk3SV+CL2OlMnl3/2hUPlBx9wTnKK5f+8hSKQ WI7H7nFtCYRU5ZQWSAP1O002QYOhq9cf8Fov5PvCaVOhJ7DPQObRagCfbegyG2QK+P ifz9wfKtd2qJe0jKIIoGcXJc9bC9YfeTXUlj9aI95G4gJzf3GzE+Th2jxmsWZghsZ5 XnZUrbGfuN0Lg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C181167F7F; Thu, 9 Oct 2025 21:43:15 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 9 Oct 2025 21:42:29 -0600 Message-ID: <20251010034255.1099728-2-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251010034255.1099728-1-sjg@u-boot.org> References: <20251010034255.1099728-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 6NGYLHRUQLIMG7ARMNJNH4O4R2T75NRZ X-Message-ID-Hash: 6NGYLHRUQLIMG7ARMNJNH4O4R2T75NRZ 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 01/18] test: video: Fix 16bpp BMP pixel format conversion 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 The video_write_bmp() function was writing 16bpp framebuffer data directly to BMP files without proper format conversion. The framebuffer uses RGB565 format (5 red, 6 green, 5 blue), but standard Windows BMP 16bpp format uses RGB555 (5 red, 5 green, 5 blue). Convert pixels from RGB565 to RGB555 by: - Extracting the 5-bit red, 6-bit green, and 5-bit blue components - Dropping the LSB of the green channel to convert from 6 to 5 bits - Reconstructing as RGB555 with the same R/B order This fixes incorrect colors in BMP output files (e.g., orange appearing as blue). Co-developed-by: Claude Signed-off-by: Simon Glass --- test/dm/video.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/test/dm/video.c b/test/dm/video.c index b06facec6e1..e51ff7789c7 100644 --- a/test/dm/video.c +++ b/test/dm/video.c @@ -70,7 +70,7 @@ static int video_write_bmp(struct unit_test_state *uts, struct udevice *dev, void *bmp_data; int ret, y; - /* Support 16bpp and 32bpp */ + /* Support 16bpp (converted to 15bpp for BMP) and 32bpp */ switch (priv->bpix) { case VIDEO_BPP16: bpp = 16; @@ -112,7 +112,24 @@ static int video_write_bmp(struct unit_test_state *uts, struct udevice *dev, void *src = priv->fb + (height - 1 - y) * priv->line_length; void *dst = bmp_data + y * row_bytes; - memcpy(dst, src, width * bytes_per_pixel); + if (bpp == 16) { + /* Convert RGB565 to RGB555 for BMP format */ + u16 *src16 = (u16 *)src; + u16 *dst16 = (u16 *)dst; + int x; + + for (x = 0; x < width; x++) { + u16 pixel = src16[x]; + /* Extract RGB565 components */ + u16 r = (pixel >> 11) & 0x1f; /* 5 bits */ + u16 g = (pixel >> 5) & 0x3f; /* 6 bits */ + u16 b = pixel & 0x1f; /* 5 bits */ + /* Convert to RGB555: drop LSB of green */ + dst16[x] = (r << 10) | ((g >> 1) << 5) | b; + } + } else { + memcpy(dst, src, width * bytes_per_pixel); + } } ret = os_write_file(fname, bmp, bmp_size); From patchwork Fri Oct 10 03:42: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: 569 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=1760067808; bh=DQck7Q6MwbmfQQ73UhDeLe5TEoshOSqmfWUbttr8En4=; 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=HA1wC2s441Q8jaQm8EzzF+MqIIm2nBAO88NBOJVbGKZtC7DDMWSYnY0YhvH7KxsgN Dn5eTRYXG0kwcheumPp1bK6NKlegdiC/7CSXN+7g6mkzUgMAR09pj66iUNlO0bmuu8 FwZohoghO0yNnm0KJt6npldi7FWjywkl3vl40a6kXmfnjAVEXKXqDsLHzwruupKjzY G66KjeB1B29flTGa+sGm5u+gB1mDIlkMgJzrVSKg7gxLp9haG4UMeekVQcIik+1Wtz Q1mVOhtDvQZP4ZM3Bse/+4NFMkHsrDIMJHzvPFgVSBMshDmxQlVlKCridzr3NNn1TV 0fu5rPJQ9uxrw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B18BB67F7F for ; Thu, 9 Oct 2025 21:43:28 -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 aLKMohFoRxTw for ; Thu, 9 Oct 2025 21:43:28 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067806; bh=DQck7Q6MwbmfQQ73UhDeLe5TEoshOSqmfWUbttr8En4=; 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=COeHbi+DInsWk75YmFiudzM52S4x678U1AsktmFwK+HbwdjOpte5sVl6dC6rUmJ7/ j4aFTDincb6noWZKJjjku3XFt14M+y4bkRxPmiZpHtohmixIF7Wto/+9YVXvzePzeM 3CK6kPfQqgaYF7XftgORBGj3mpW2AXd1mKRq/Wzdi5Sa8oHzPB2vcRtjaAqEe+efYn QQ6kRYUV1IlypHguq0p0Wkak9tgU9AScNCtORkr98iP8w1TueLPHzbW+R7Wx821u9f WiES4y8Kl7rwFP3uP8XRTFnWFLID3ImAOXcTPDi7sPyokE/QhQ2WbDzx9Vzm2eGabu nCLRwgByxth7g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AE9A667FF2 for ; Thu, 9 Oct 2025 21:43:26 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067803; bh=vtujPPnNgGdL8J5iAutXXo1eJLSZoV2DfuJDly2vIvc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f6TwHYX9xAhE84gH8W5UjD3RapbRpDEYULPXjUkwUrmFxVICCHbVdEqskQ6bZVXtE pFlz96eLP2Lff8hBTiTQdaukaVSg9/RQu75Swl9rpd7J4u+BMve7mh/MEQNdoBJGHk 1lD8WXu6xAMwTVuWGIRhdUPs/h+NR5SDkQ+vPF1lPSOF3Rf5PkGizc0S50h0+Dk4m9 XtCP3zqQi+6/lDg6R4P5b7AJM9vMYjOgoDU48gkkBTeW872gN3a0it7Zjl+kwmU6qB K9xnbXpOLL/LByk19sbs3Lms186a2DTtCQpy2yBIDwnxcPpFUetvLRwM4t1d68DwlT LPBImxMIhaENQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A7BB76806E; Thu, 9 Oct 2025 21:43:23 -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 KXLa5EEUxwJO; Thu, 9 Oct 2025 21:43:23 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067797; bh=hB4X1KA6Czlo0pcz9ajhW66wynyTQusJfVzJnFBJ0go=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZvXTgV/QujBFNL5YHMO3i1PG/Sxdf698rcSQs5nn8N/XkKnt3gexP7xwTlBNDsQkX 1+dcgmncpRJpbDCyRqismtchwnR753SREU4zhX4OR2AGHDQG+HR2LFEIYKrvB1i6Q5 DydvlkFtngUeKDs2EEJJ5oeMzW8R1M4eCUsslEHM0jgp/om+LBi+VHolRzOKet4SS/ Ryex7P1UX/xqj0GWaG46y2n0S3C+ZBz3xHgKpjJMqkdyNYgKc81nMwN+6vwH0CyiKs VHYcHetn4fHmyZZ7ggmmd7MuWyhqGzcfHb+2tH+lO9tJu6ChXiZGcynLulfYPkb0w7 1xUIrfqtrJWRg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id AE96367F7F; Thu, 9 Oct 2025 21:43:16 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 9 Oct 2025 21:42:30 -0600 Message-ID: <20251010034255.1099728-3-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251010034255.1099728-1-sjg@u-boot.org> References: <20251010034255.1099728-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: KQW5VDXG6536YHE7R6KSJ3WP3QCMH6DQ X-Message-ID-Hash: KQW5VDXG6536YHE7R6KSJ3WP3QCMH6DQ 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/18] test: Add a way to printf() into a membuf 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 membuf_printf() function which supports writing a formatted string into a membuf. Co-developed-by: Claude Signed-off-by: Simon Glass --- include/membuf.h | 13 +++++++++++++ lib/membuf.c | 14 ++++++++++++++ test/lib/membuf.c | 40 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+) diff --git a/include/membuf.h b/include/membuf.h index 3352faa0606..17fe721ee3c 100644 --- a/include/membuf.h +++ b/include/membuf.h @@ -268,4 +268,17 @@ int membuf_new(struct membuf *mb, int size); */ void membuf_dispose(struct membuf *mb); +/** + * membuf_printf() - write a formatted string to a membuff + * + * Formats a string and writes it to the membuff. Returns the number of bytes + * written (not including the terminating nul). + * + * @mb: membuff to write to + * @fmt: format string + * @...: arguments for format string + * Return: number of bytes written, or negative error + */ +int membuf_printf(struct membuf *mb, const char *fmt, ...); + #endif diff --git a/lib/membuf.c b/lib/membuf.c index 47a1b06664a..207dff5625b 100644 --- a/lib/membuf.c +++ b/lib/membuf.c @@ -9,6 +9,7 @@ #include #include #include +#include #include "membuf.h" static inline bool is_full(const struct membuf *mb) @@ -435,3 +436,16 @@ void membuf_dispose(struct membuf *mb) free(mb->start); membuf_uninit(mb); } + +int membuf_printf(struct membuf *mb, const char *fmt, ...) +{ + char buf[256]; + va_list args; + int len; + + va_start(args, fmt); + len = vsnprintf(buf, sizeof(buf), fmt, args); + va_end(args); + + return membuf_put(mb, buf, len); +} diff --git a/test/lib/membuf.c b/test/lib/membuf.c index 2e7de9cdc57..7ae9c079a4c 100644 --- a/test/lib/membuf.c +++ b/test/lib/membuf.c @@ -261,3 +261,43 @@ static int lib_test_membuf_init(struct unit_test_state *uts) return 0; } LIB_TEST(lib_test_membuf_init, 0); + +/* test membuf_printf() */ +static int lib_test_membuf_printf(struct unit_test_state *uts) +{ + struct membuf mb; + int ret, exp_len; + char buf[100]; + char out[100]; + + /* Initialize membuf with a buffer */ + membuf_init(&mb, buf, sizeof(buf)); + + /* Test simple string */ + ret = membuf_printf(&mb, "Hello"); + ut_asserteq(5, ret); + ut_asserteq(5, membuf_get(&mb, out, sizeof(out))); + out[5] = '\0'; + ut_asserteq_str("Hello", out); + + /* Test formatted string with integers */ + exp_len = 9; + membuf_purge(&mb); + ret = membuf_printf(&mb, "Value: %d", 42); + ut_asserteq(exp_len, ret); + ut_asserteq(exp_len, membuf_get(&mb, out, sizeof(out))); + out[exp_len] = '\0'; + ut_asserteq_str("Value: 42", out); + + /* Test formatted string with multiple arguments */ + membuf_purge(&mb); + exp_len = 10; + ret = membuf_printf(&mb, "x=%d y=%d", 10, 200); + ut_asserteq(exp_len, ret); + ut_asserteq(exp_len, membuf_get(&mb, out, sizeof(out))); + out[exp_len] = '\0'; + ut_asserteq_str("x=10 y=200", out); + + return 0; +} +LIB_TEST(lib_test_membuf_printf, 0); From patchwork Fri Oct 10 03:42: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: 568 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=1760067806; bh=dYC/efNeGVYu4iMVJJI9r6Abn7tHnIF05M9jbZLnJ/4=; 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=dHfdCoKx9Vec5izDnMb3wGz9K9iQwWZYFxtMP/+7covvZdxJS3EuLCgxmu//GH7r4 o4opRikG6igaJRNRSeYr7mwDHl1elsVLMTmFyOPqYLCFtt6iAazwzEcNabKbhaZ9Nr BXm+u8LOVHoCE5YEOcKlEyclGzMLyruz9yjrMHuYfiyIcGLnSwcH0ekaOD02HDlD91 yhwXnv7Hkjr8TWDAZP3TICe++FAW/eDrFPyndPHDZAzjQCFYAG2ieVnctyuB9msG5Q xsFVvi1p3+aLY4MeAAHEbG5DUimpzjziAJbLcP/FohnyWI2ua3vMSnOFpwjP5iW3l6 6pqko6c00aTZA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2386A6806A for ; Thu, 9 Oct 2025 21:43:26 -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 MuMwMrFn9bJT for ; Thu, 9 Oct 2025 21:43:26 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067806; bh=dYC/efNeGVYu4iMVJJI9r6Abn7tHnIF05M9jbZLnJ/4=; 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=dHfdCoKx9Vec5izDnMb3wGz9K9iQwWZYFxtMP/+7covvZdxJS3EuLCgxmu//GH7r4 o4opRikG6igaJRNRSeYr7mwDHl1elsVLMTmFyOPqYLCFtt6iAazwzEcNabKbhaZ9Nr BXm+u8LOVHoCE5YEOcKlEyclGzMLyruz9yjrMHuYfiyIcGLnSwcH0ekaOD02HDlD91 yhwXnv7Hkjr8TWDAZP3TICe++FAW/eDrFPyndPHDZAzjQCFYAG2ieVnctyuB9msG5Q xsFVvi1p3+aLY4MeAAHEbG5DUimpzjziAJbLcP/FohnyWI2ua3vMSnOFpwjP5iW3l6 6pqko6c00aTZA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1203F67F7F for ; Thu, 9 Oct 2025 21:43:26 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067803; bh=DV7Zvn9HPDI7r+x4SS1EDJxzCf6q7OPCOmHAC+wYVI8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NwQ1vRoWXdHR6dHTKFNGP1loMUzNPPpYKXu6eEFQREUX+E1AW5TN47T2P5cAeRcgK MLDtT+kEWxaNkSQSDS7BGqZedidyPMMgTtP9NykJI4ooVfgXaWLeF9DzHjdH9OlgnV hhFYR71c0KONbkjScGNHBsCMYHyag8twGobgdIcUoISEL1OA09CHesrVCB0UXME6k+ QrQLHzeCpwg7u1qEiyeXIREtHl/hjgzZRRw9LcukO3+Uu/GZoqNJy8nCp8sCkxStN3 JdfH4PhexwzAASV2ATPc1h/cFo3A9diewmCqOJV3GNI964oHTIrLEGf0HXqLEuuMqy HzEaNUf0fUxpw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A776E67FF2; Thu, 9 Oct 2025 21:43:23 -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 UaxPKlPv7R84; Thu, 9 Oct 2025 21:43:23 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067801; bh=zgnQBghzHiE1V3NCw8UvyWszgxpvGpOTH+tw9S6qs4U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rdf1BVtxelK9TenJJGJqSm9psy+WgWHYMYXtSDZtQ17nEeQjyrdCS51ycCpFW/GpC M7s3QNsIuK7exWn9SjjfD9gar85jZyVFqSfcTZIY3pESOa1gwq11zCBL19m9tGgeiw BEenXSzqrMqsx/FUA7JOGp5hw0r6qeqG49Ww6uV9IudR2v4aINNpm8oUiyESK4gs1m DMPjNe977ErlVBu0zp5OrkjhxKcKY9wkV0Qvv+i+J7STW0gSqZ8ZoAfa3v0z+++zX5 o0/rsaPoREl0/D5cO5u//KbrVFP5SvUq/iBzetC7YDjYnyMLlb5HBZLiHcTzJlxxdh A/h53nT8gHb6g== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 607916806A; Thu, 9 Oct 2025 21:43:21 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 9 Oct 2025 21:42:31 -0600 Message-ID: <20251010034255.1099728-4-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251010034255.1099728-1-sjg@u-boot.org> References: <20251010034255.1099728-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: PE7DBXSTFN5TW2LPQLEKTDR4LCWPL3UD X-Message-ID-Hash: PE7DBXSTFN5TW2LPQLEKTDR4LCWPL3UD 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 X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 03/18] input: Correct handling of mouse clicks 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 possible that there is already a mouse click available, so mouse_get_click() should check that first, before reading any further events. Signed-off-by: Simon Glass Fixes: 90e109789e3 ("mouse: Move click detection into mouse_get_event()") --- drivers/input/mouse-uclass.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/input/mouse-uclass.c b/drivers/input/mouse-uclass.c index 7cbe961af35..16a391532ae 100644 --- a/drivers/input/mouse-uclass.c +++ b/drivers/input/mouse-uclass.c @@ -57,15 +57,14 @@ int mouse_get_click(struct udevice *dev, struct vid_pos *pos) /* Process all available events until we find a click */ while (true) { - if (mouse_get_event(dev, &event)) - return -EAGAIN; /* No more events */ - - /* Check if this event resulted in a click */ if (uc_priv->click_pending) { *pos = uc_priv->click_pos; uc_priv->click_pending = false; break; } + + if (mouse_get_event(dev, &event)) + return -EAGAIN; /* No more events */ } return 0; From patchwork Fri Oct 10 03:42: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: 570 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=1760067813; bh=TOf1TZgy9POoeXM22CJ+DywjT9eZs7JmeB/ayZrwSNE=; 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=o9LFWfdqP52X13CZF9kNogKjl2C3k55Y2PT8RrtjPXayqMJd/es/3GCstcn9+3tQ3 mMH+1LWQ9GzDGsA+OwhZI1DmGBO9DxGPlhVDZ/gjmiDxDF3485wWOQR/MeCc4ccBZ8 UzEYRCK8isNyF6CRfAv4LlqzjGmjcG5JcpyqITUjR6KdVu9NrXQooYnk+PCG47NKSP 5Qsvd1Ga5r2KfKk4y7SvoP5SZxbCbqUnyLtgTKCMxKMjndjVgiHr8CUhUo0Ro41Us3 QSyjp3AeSZqVR7rk2KkstpGi+2C6u6tihFwhF2/HQFuQOvVLFLHT7nzrDlmEfGLJMH 4oa0EGzqlK1Cg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 256676806A for ; Thu, 9 Oct 2025 21:43:33 -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 y2R2PgdGxj_a for ; Thu, 9 Oct 2025 21:43:33 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067813; bh=TOf1TZgy9POoeXM22CJ+DywjT9eZs7JmeB/ayZrwSNE=; 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=o9LFWfdqP52X13CZF9kNogKjl2C3k55Y2PT8RrtjPXayqMJd/es/3GCstcn9+3tQ3 mMH+1LWQ9GzDGsA+OwhZI1DmGBO9DxGPlhVDZ/gjmiDxDF3485wWOQR/MeCc4ccBZ8 UzEYRCK8isNyF6CRfAv4LlqzjGmjcG5JcpyqITUjR6KdVu9NrXQooYnk+PCG47NKSP 5Qsvd1Ga5r2KfKk4y7SvoP5SZxbCbqUnyLtgTKCMxKMjndjVgiHr8CUhUo0Ro41Us3 QSyjp3AeSZqVR7rk2KkstpGi+2C6u6tihFwhF2/HQFuQOvVLFLHT7nzrDlmEfGLJMH 4oa0EGzqlK1Cg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1537368030 for ; Thu, 9 Oct 2025 21:43:33 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067810; bh=qhAmaFcJUY3bwd7KFpWVPrDBdSpUOFKH+AmETliX7zQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f0RhABEv2pcxabWNHfPelHE0zfFFLJNaJgUvJseiTaO4ZQw5oM59MN+IQxTY6oddw egV2/sxVIYnRlU6imiLP4wnxPZiWoDBP469u3t0kHzCh8RnIx8KcmTYj2hLUvX43jW cBO+t+GS1+i9B4y8ceJpa+PyV86Llm49LnTtBxoC6KfYpHgARoFr+arZEj+C3UlaLr oXZsFXo8/aPldOf7WbGA4vq6eZ0QC36oxCoBcM24qbUIeKeiyMPYg+B/4ld9vlklgX PtY//55pCkblk2QMNsTr9uVb3hcBurEVnVw1qYbDgINQX0fpV1hGMqsnINmHu1j/Nr p02KEjih+FF2Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id ECA6F67F7F; Thu, 9 Oct 2025 21:43:30 -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 JHQ_lrX0sxRY; Thu, 9 Oct 2025 21:43:30 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067803; bh=QSBG5Or0zLqwl0oWN2TqRp5Qbf6dyk8d8LkMd4I30/0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CycZF7HjM/lFVOlmvoCZ1nTCUTg4Xu9Mum+vOTfTfYkW+XTusYGY0q+T4gCJFBxwe 19CBm+U4+rPd+wbPLRIeUbvu62nkK8obucSmrJibI0ts1nVxGZSMSlDgbRkZ5GWziv aNvFDYWsF3ewp9NFg4yEzL3dSxhtrE6W+r2Jx3U4tudJR3wfOHRwVH8Q0835is9CS2 xQm8ttKtymKXS2nkftBYitaLww9xv1BTHsIDGZCbY06kZPks3nYYA6okZp44SeajeL GJmGWmXBGk6iRclBdEMuMII4WGAN9XX4Vdk0p29QVgyMoqYLNo58Wlmawe0x+UGXya +V+9Goibam3QQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 65E2067FA3; Thu, 9 Oct 2025 21:43:23 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 9 Oct 2025 21:42:32 -0600 Message-ID: <20251010034255.1099728-5-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251010034255.1099728-1-sjg@u-boot.org> References: <20251010034255.1099728-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: M2BMIMG7MBMLT7JFHM4YNILX4RVTJHLK X-Message-ID-Hash: M2BMIMG7MBMLT7JFHM4YNILX4RVTJHLK 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 X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 04/18] expo: Correct key-polling timeout 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 When a character is received it should reset the timeout, even if the character does not result in output from cli_ch_process() Fix this, so that keypresses which consist of escape codes are correctly interpreted. Signed-off-by: Simon Glass Fixes: a5c5b3b2fb6 ("expo: Speed up polling the keyboard") --- boot/expo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/boot/expo.c b/boot/expo.c index 5704dd9fecc..1fb6d6e9417 100644 --- a/boot/expo.c +++ b/boot/expo.c @@ -486,17 +486,17 @@ int expo_iter_scene_objs(struct expo *exp, expo_scene_obj_iterator iter, static int poll_keys(struct expo *exp) { - int ichar, key; + int ch = 0, ichar, key; ichar = cli_ch_process(&exp->cch, 0); if (!ichar) { /* Check once for available input */ if (tstc()) { - ichar = getchar(); - ichar = cli_ch_process(&exp->cch, ichar); + ch = getchar(); + ichar = cli_ch_process(&exp->cch, ch); } - if (!ichar && get_timer(exp->last_key_ms) >= 10) + if (!ch && get_timer(exp->last_key_ms) >= 10) ichar = cli_ch_process(&exp->cch, -ETIMEDOUT); } From patchwork Fri Oct 10 03:42:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 571 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=1760067815; bh=4uRJoU/Lo488CcH7R5AM27wjpKwom2VtWlSBZVbV9rU=; 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=QzVI0PYvDkYj7VmOYQaT1Fl8wMiTPirtLzD/PHSwQxx1MkUmXLeHKrQ7E3IiIN3Aa 4Xwbym8c0DpKOpqXqT8aF3m2+T72/xmZujFdM5OlU0sCj19a9niPdfJx+rxwimweNI NSGivk0jEookcqZzEuAKiqFv1bVZxy/BaKHURPG71UAghaIGjqhD5dMMpyWngA/sgo gSAABJnue02rsCeZNPGf/DWzA4viC+4bCsqRy5Vj5NyKTy8kJBH3EY9gfboSQPmDeJ UU7sZcpj6rYzuGxxGCHS3ZFacocTwrv6Wlx0gQFVR79Dn9fL5lah11HegGZSpDfQBT ifOwa66C5lDLQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 85E6E67F7F for ; Thu, 9 Oct 2025 21:43:35 -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 PM2Dae2N0xZD for ; Thu, 9 Oct 2025 21:43:35 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067814; bh=4uRJoU/Lo488CcH7R5AM27wjpKwom2VtWlSBZVbV9rU=; 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=ty9EE+adKHc7/74EehRxgbJCHKZlJqGFaUt2PyWlgau91mnG/VTD+TE0PLPxvnm9L nosJjwEbdN2zNZ6RJdzSPyiMl1iCjzQ/sNEOn/hxCQ4djvSnZ8xCAgknmgnSmYcOM3 Q5lk1YpPptCFF+f4lnPqfJLraU1Rp3QLB4dv9R8XH45KZlzMJLX2jTOTrz+Z4gIvXc J0PrUW7XWIbF85V2fE0siHES267/OMylis50CpBSKYlV9gZAsNM7syg4tZfGS2epCA 5TA36uK5V+Pf5h/XRrz/V7dj6VJdaqzag1E/Y+Q5N+73+pYqHUczJ/4xQaioKYc6oK rMzbCa4hSqpmg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7020E67FF2 for ; Thu, 9 Oct 2025 21:43:34 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067812; bh=hn8SezsMob9bZCIEvL7tUiBre1snPMrB1xn+U6r+JlM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kJjT0NGtGvf4QVw4D07iVQGog1QWyoulEBIcGRlC5/3aLQ1r8G1i2GwiDzvH+FvoU D4GXu9g1FihoQ1VXbeARGQ/KcT0+i4fW8eJ3GLIFKUY0roYC0WrBXSjf8PqiVjbkXW 0KqT+3WCyFwCIu6a6+e8yW9YHZGazegYHDhltlnQVZDHb4arO+EK6UWKEJK/A1r/Mz RKcMIYeDufxwm4qnAbOoeR15rKi/xgi5WrpwgdYEc4SM4TuRIsRw/jw2V2+RLoPqPM McMttuVGmoYacS7WVAOCEzF1I8TnyeQueqPc3p0TFMNtDOmJ1pb+GpLdBdZJj4doP/ AsS3ybhtek2uQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 693F967FA3; Thu, 9 Oct 2025 21:43:32 -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 dlBCks1XB2DC; Thu, 9 Oct 2025 21:43:32 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067808; bh=OhvNCdaVALVqdhy3ILvxUp9M7YeontW2j3U38yEZf6U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rwm4Nfarr89H49NTpZdqd2P66xDOgk07qCBebljMskFQLOWFJTwaeqX1d5Ln18590 W8kS8cEgbANNvrUf21LYE6egRx+JC/XSx4AFPwYrJCh9G5s42ttXVNqjSwkN6SXxDn lmI8yuHAOb0szg7ec7U51mhzEvyjwh0GgFgmWlfqReC4pF967s8kUUBL+MaodQJv1l LJqd+y5ThMbfn7ujQMIHtMCgVutiV71mdocrwxt3lHC4xRVZuix9i2I2HIoJwM3hac Lr0AcY3yX4ela8+zEFpwYLahKLLCzQBkw2/UX/09SkPeveFFDmiH8bIWkEAgvn1SHZ /qe0QMdDdwlPg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id F2E1A68030; Thu, 9 Oct 2025 21:43:27 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 9 Oct 2025 21:42:33 -0600 Message-ID: <20251010034255.1099728-6-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251010034255.1099728-1-sjg@u-boot.org> References: <20251010034255.1099728-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: YUGY6Q3R63OZ7H5TEIVI7FRQ4EIVMBER X-Message-ID-Hash: YUGY6Q3R63OZ7H5TEIVI7FRQ4EIVMBER 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 05/18] expo: Provide user-friendly output of scene enums 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 few functions which can convert a flag and an object type to strings. Co-developed-by: Claude Signed-off-by: Simon Glass --- boot/scene.c | 42 ++++++++++++++++++++++++++++++++++++++++++ boot/scene_internal.h | 16 ++++++++++++++++ test/boot/expo.c | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+) diff --git a/boot/scene.c b/boot/scene.c index ec0c5899bca..c2e4d8e1330 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -19,6 +19,29 @@ #include #include "scene_internal.h" +static const char *const scene_flag_names[] = { + "hide", + "point", + "open", + "size_valid", + "sync_pos", + "sync_size", + "sync_width", + "sync_bbox", + "manual", + "dirty", +}; + +static const char *const scene_obj_type_names[] = { + "none", + "image", + "text", + "box", + "textedit", + "menu", + "textline", +}; + int scene_new(struct expo *exp, const char *name, uint id, struct scene **scnp) { struct scene *scn; @@ -1634,3 +1657,22 @@ int scene_dims_union(struct scene *scn, uint id, struct scene_obj_dims *dims) return 0; } + +const char *scene_flag_name(uint flag) +{ + int bit; + + bit = ffs(flag) - 1; + if (bit < 0 || bit >= ARRAY_SIZE(scene_flag_names)) + return "(none)"; + + return scene_flag_names[bit]; +} + +const char *scene_obj_type_name(enum scene_obj_t type) +{ + if (type >= ARRAY_SIZE(scene_obj_type_names)) + return "unknown"; + + return scene_obj_type_names[type]; +} diff --git a/boot/scene_internal.h b/boot/scene_internal.h index 00696979f7d..9bf2cb8f8f2 100644 --- a/boot/scene_internal.h +++ b/boot/scene_internal.h @@ -540,4 +540,20 @@ int scene_calc_arrange(struct scene *scn, struct expo_arrange_info *arr); int scene_txt_generic_init(struct expo *exp, struct scene_txt_generic *gen, const char *name, uint str_id, const char *str); +/** + * scene_flag_name() - Get the name of a scene flag + * + * @flag: Single-bit flag mask (e.g. BIT(7)) + * Return: Flag name, or "(none)" if flag is 0 or out of range + */ +const char *scene_flag_name(uint flag); + +/** + * scene_obj_type_name() - Get the name of a scene object type + * + * @type: Object type + * Return: Type name, or "unknown" if out of range + */ +const char *scene_obj_type_name(enum scene_obj_t type); + #endif /* __SCENE_INTERNAL_H */ diff --git a/test/boot/expo.c b/test/boot/expo.c index 8a401ba9884..7c27da165c5 100644 --- a/test/boot/expo.c +++ b/test/boot/expo.c @@ -1220,3 +1220,41 @@ static int expo_test_calc_fps(struct unit_test_state *uts) return 0; } BOOTSTD_TEST(expo_test_calc_fps, 0); + +/* Test scene_flag_name() */ +static int expo_scene_flag_name(struct unit_test_state *uts) +{ + /* Test valid flags */ + ut_asserteq_str("hide", scene_flag_name(SCENEOF_HIDE)); + ut_asserteq_str("point", scene_flag_name(SCENEOF_POINT)); + ut_asserteq_str("open", scene_flag_name(SCENEOF_OPEN)); + ut_asserteq_str("manual", scene_flag_name(SCENEOF_MANUAL)); + + /* Test invalid flag (0) */ + ut_asserteq_str("(none)", scene_flag_name(0)); + + /* Test invalid flag (out of range) */ + ut_asserteq_str("(none)", scene_flag_name(BIT(20))); + + return 0; +} +BOOTSTD_TEST(expo_scene_flag_name, 0); + +/* Test scene_obj_type_name() */ +static int expo_scene_obj_type_name(struct unit_test_state *uts) +{ + /* Test all valid object types */ + ut_asserteq_str("none", scene_obj_type_name(SCENEOBJT_NONE)); + ut_asserteq_str("image", scene_obj_type_name(SCENEOBJT_IMAGE)); + ut_asserteq_str("text", scene_obj_type_name(SCENEOBJT_TEXT)); + ut_asserteq_str("box", scene_obj_type_name(SCENEOBJT_BOX)); + ut_asserteq_str("menu", scene_obj_type_name(SCENEOBJT_MENU)); + ut_asserteq_str("textline", scene_obj_type_name(SCENEOBJT_TEXTLINE)); + ut_asserteq_str("textedit", scene_obj_type_name(SCENEOBJT_TEXTEDIT)); + + /* Test invalid type (out of range) */ + ut_asserteq_str("unknown", scene_obj_type_name(SCENEOBJT_TEXTLINE + 1)); + + return 0; +} +BOOTSTD_TEST(expo_scene_obj_type_name, 0); From patchwork Fri Oct 10 03:42:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 572 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=1760067817; bh=jZE1Bs3nXrXe1ThWFL+qFKAaGoJBf3RxrlD3b2xwRvA=; 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=tDVyz2A6WX3kW8vE4SkZsvursMnh5oPELYS3PIxhneCe6LcncpfAQEVk630BxOkkw /AYdvdVfCSSEXVrQ/cSj9iipYgE4mOkWRorKrMWNIDMse84BJhY7TzFRPRCEf12vty llCvyC4Jj3qktBHTftucCghLs/66xtTtzKwgj0HHB2RNanFFMf3ctzvTcIp6pTtx1x 9ucV7tlOTavE+pv39Trwaj/tF9oCwh/MG45tHCReo50Zw7eOUpmF6nO04DOzxWYBXs WPbH3vnbdf+gF3Lu4njfCZg11mIxgTNM9QBkEiM2MgWjI3IMuQ1OVe4+o4baDwAgNw xkt1IGdjzFnSA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D3EB768030 for ; Thu, 9 Oct 2025 21:43:37 -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 dXj_0zWghDhI for ; Thu, 9 Oct 2025 21:43:37 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067817; bh=jZE1Bs3nXrXe1ThWFL+qFKAaGoJBf3RxrlD3b2xwRvA=; 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=tDVyz2A6WX3kW8vE4SkZsvursMnh5oPELYS3PIxhneCe6LcncpfAQEVk630BxOkkw /AYdvdVfCSSEXVrQ/cSj9iipYgE4mOkWRorKrMWNIDMse84BJhY7TzFRPRCEf12vty llCvyC4Jj3qktBHTftucCghLs/66xtTtzKwgj0HHB2RNanFFMf3ctzvTcIp6pTtx1x 9ucV7tlOTavE+pv39Trwaj/tF9oCwh/MG45tHCReo50Zw7eOUpmF6nO04DOzxWYBXs WPbH3vnbdf+gF3Lu4njfCZg11mIxgTNM9QBkEiM2MgWjI3IMuQ1OVe4+o4baDwAgNw xkt1IGdjzFnSA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C258967FA3 for ; Thu, 9 Oct 2025 21:43:37 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067815; bh=jtwTEHT9FNbuutjnoy5KYgi60Sou+BgyJGCdfhRuSSg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X77k8iXZTJw2rGQeWcncQRbkFerpVJ5B/0lBSkQienwR1zfrHR4NPfxSIsjmpFYOq w0EqingFANHkwRj/ecw2ci0WiPJpHV0e1OOnL/jM7tDja/jCVpwAvrIWTd7XE8qxWC MvmHi2uAUlcACOKx7II+I826sC9W2rS+VQrmsbVPU5PumblFUG/PvFplKQ1bB+oAz2 9ML1ZMjtHXxS9Wpk0BDaPn/K5cFzRTLspsK97NI1hXJwDtH3sw/Xpau0vvZiMY5UJD b1HRjeLbf/aAOih9yhhtYDMPfhN8rZHOaEeeJ8mKwj1z1JJend6+tyaZ76UOnfftEm uY5MB9uy6fqcw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 755CB68084; Thu, 9 Oct 2025 21:43:35 -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 06TdRUtmxQDS; Thu, 9 Oct 2025 21:43:35 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067813; bh=LCeWDRZXusYnDNJippV/LG/R2GHVh5zPNL/ZtGPIgG8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dgbv90K60uqVJh22ITt7aqACu0MuqoHdtZRG7fwdTE98y9yt8KN+wQYi33fKvgbzx 9VpxQ9A1yD1GxBJ9lgYMfBdyiNt0J1y2zMaLWovfYQyFke/yPXK+jnV/DuIvit2Y6R BH47HscRwJwqUnzfs6fJNB+Scmu6welpnEp0WpngLzMY/IjqUvdTgA8GnwlIFvt7XX UWnwLXPT3HuK1hNxfsfTY8qHzzEzWJP/HIZ5MZUw15v30VeXyfgIw4FY3rPs5qgSe4 qh+z9ANplhum1S2/JVTImrTSHQpvhHZvhdPq1n/BOxVXKQpc0pUfvWeY/Y8fSD03zh kGaCOMW2QY/Zw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B0FB267F7F; Thu, 9 Oct 2025 21:43:32 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 9 Oct 2025 21:42:34 -0600 Message-ID: <20251010034255.1099728-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251010034255.1099728-1-sjg@u-boot.org> References: <20251010034255.1099728-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: VC45PXYZJXWV7K2FGGX5TMFNMXAGYPKE X-Message-ID-Hash: VC45PXYZJXWV7K2FGGX5TMFNMXAGYPKE 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 06/18] expo: Provide a way to dump an expo 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 For debugging it is sometimes helpful to dump an expo. Add an implementation of this, writing to a membuf. Add a MAINTAINERS entry for expo, including this next file. Co-developed-by: Claude Signed-off-by: Simon Glass --- MAINTAINERS | 3 + boot/Kconfig | 9 ++ boot/Makefile | 1 + boot/expo_dump.c | 271 +++++++++++++++++++++++++++++++++++++++++++++++ include/expo.h | 18 ++++ test/boot/expo.c | 46 ++++++++ 6 files changed, 348 insertions(+) create mode 100644 boot/expo_dump.c diff --git a/MAINTAINERS b/MAINTAINERS index e858331455c..2a2a42aec5e 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -944,6 +944,8 @@ F: boot/bootflow.c F: boot/bootm_final.c F: boot/bootmeth*.c F: boot/bootstd.c +F: boot/expo*.c +F: boot/scene*.c F: cmd/bootdev.c F: cmd/bootflow.c F: doc/develop/bootstd/ @@ -955,6 +957,7 @@ F: include/bootdev.h F: include/bootflow.h F: include/bootmeth.h F: include/bootstd.h +F: include/expo.h F: net/eth_bootdevice.c F: test/boot/ diff --git a/boot/Kconfig b/boot/Kconfig index fb34a10106b..b255245335b 100644 --- a/boot/Kconfig +++ b/boot/Kconfig @@ -982,6 +982,15 @@ config EXPO The expo can be presented in graphics form using a vidconsole, or in text form on a serial console. +config EXPO_DUMP + bool "Allow dumping the contents of an expo" + depends on EXPO + default y if SANDBOX + help + This provides a way to dump an expo as test, including most of the + details in the structures. This can be useful when debugging or + comparing two expos. + config EXPO_TEST bool "Enable test mode for expo" depends on EXPO diff --git a/boot/Makefile b/boot/Makefile index bb1888f1656..3cb138ae022 100644 --- a/boot/Makefile +++ b/boot/Makefile @@ -57,6 +57,7 @@ obj-$(CONFIG_CMD_ADTIMG) += image-android-dt.o obj-$(CONFIG_$(PHASE_)LOAD_FIT) += common_fit.o obj-$(CONFIG_$(PHASE_)EXPO) += expo.o scene.o expo_build.o +obj-$(CONFIG_$(PHASE_)EXPO_DUMP) += expo_dump.o obj-$(CONFIG_$(PHASE_)EXPO) += scene_menu.o scene_textline.o scene_textedit.o obj-$(CONFIG_$(PHASE_)EXPO_TEST) += expo_test.o ifdef CONFIG_COREBOOT_SYSINFO diff --git a/boot/expo_dump.c b/boot/expo_dump.c new file mode 100644 index 00000000000..711b26eb220 --- /dev/null +++ b/boot/expo_dump.c @@ -0,0 +1,271 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Dump functions for expo objects + * + * Copyright 2025 Canonical Ltd + * Written by Simon Glass + */ + +#define LOG_CATEGORY LOGC_EXPO + +#include +#include +#include +#include +#include +#include "scene_internal.h" + +/** + * struct dump_ctx - Context for dumping expo structures + * + * @mb: Membuf to write output to + * @scn: Current scene being dumped (or NULL if not in a scene) + * @indent: Current indentation level (number of spaces) + */ +struct dump_ctx { + struct membuf *mb; + struct scene *scn; + int indent; +}; + +/** + * outf() - Output a formatted string with indentation + * + * @ctx: Dump context containing membuf, scene, and indent level + * @fmt: Format string + * @...: Arguments for format string + */ +static void outf(struct dump_ctx *ctx, const char *fmt, ...) +{ + char buf[256]; + va_list args; + int len; + + va_start(args, fmt); + membuf_printf(ctx->mb, "%*s", ctx->indent, ""); + len = vsnprintf(buf, sizeof(buf), fmt, args); + membuf_put(ctx->mb, buf, len); + va_end(args); +} + +static const char *obj_name(struct dump_ctx *ctx, uint id) +{ + struct scene_obj *obj; + + if (!id) + return "(none)"; + + obj = scene_obj_find(ctx->scn, id, SCENEOBJT_NONE); + if (!obj) + return "(not found)"; + + return obj->name; +} + +static void dump_menu(struct dump_ctx *ctx, struct scene_obj_menu *menu) +{ + struct scene_obj *obj = &menu->obj; + struct scene_menitem *item; + + outf(ctx, "Menu: pointer_id %d title_id %d manual %d\n", + menu->pointer_id, menu->title_id, + !!(obj->flags & SCENEOF_MANUAL)); + + ctx->indent += 2; + list_for_each_entry(item, &menu->item_head, sibling) { + outf(ctx, "Item %d: name '%s' label_id %d desc_id %d\n", + item->id, item->name, item->label_id, item->desc_id); + } + ctx->indent -= 2; +} + +static void dump_text(struct dump_ctx *ctx, struct scene_obj_txt *txt) +{ + const char *str = expo_get_str(ctx->scn->expo, txt->gen.str_id); + + outf(ctx, "Text: str_id %d font_name '%s' font_size %d\n", + txt->gen.str_id, + txt->gen.font_name ? txt->gen.font_name : "(default)", + txt->gen.font_size); + ctx->indent += 2; + outf(ctx, "str '%s'\n", str ? str : "(null)"); + ctx->indent -= 2; +} + +static void dump_box(struct dump_ctx *ctx, struct scene_obj_box *box) +{ + outf(ctx, "Box: fill %d width %d\n", box->fill, box->width); +} + +static void dump_image(struct dump_ctx *ctx, struct scene_obj_img *img) +{ + outf(ctx, "Image: data %lx\n", (ulong)map_to_sysmem(img->data)); +} + +static void dump_textline(struct dump_ctx *ctx, + struct scene_obj_textline *tline) +{ + outf(ctx, "Textline: label_id %d edit_id %d\n", + tline->label_id, tline->edit_id); + ctx->indent += 2; + outf(ctx, "max_chars %d pos %d\n", tline->max_chars, tline->pos); + ctx->indent -= 2; +} + +static void dump_textedit(struct dump_ctx *ctx, + struct scene_obj_txtedit *tedit) +{ + outf(ctx, "Textedit: str_id %d font_name '%s' font_size %d\n", + tedit->gen.str_id, + tedit->gen.font_name ? tedit->gen.font_name : "(default)", + tedit->gen.font_size); +} + +static void obj_dump_(struct dump_ctx *ctx, struct scene_obj *obj) +{ + char flags_buf[256]; + bool first = true; + int bit; + int pos = 0; + + outf(ctx, "Object %d (%s): type %s\n", obj->id, obj->name, + scene_obj_type_name(obj->type)); + ctx->indent += 2; + + /* Build flags string */ + for (bit = 0; bit < 16; bit++) { + uint flag = BIT(bit); + + if (obj->flags & flag) { + pos += snprintf(flags_buf + pos, sizeof(flags_buf) - pos, + "%s%s", first ? "" : ", ", + scene_flag_name(flag)); + first = false; + } + } + outf(ctx, "flags %s\n", pos > 0 ? flags_buf : ""); + outf(ctx, "bbox: (%d,%d)-(%d,%d)\n", + obj->bbox.x0, obj->bbox.y0, obj->bbox.x1, obj->bbox.y1); + outf(ctx, "dims: %dx%d\n", obj->dims.x, obj->dims.y); + + switch (obj->type) { + case SCENEOBJT_NONE: + break; + case SCENEOBJT_IMAGE: + dump_image(ctx, (struct scene_obj_img *)obj); + break; + case SCENEOBJT_TEXT: + dump_text(ctx, (struct scene_obj_txt *)obj); + break; + case SCENEOBJT_BOX: + dump_box(ctx, (struct scene_obj_box *)obj); + break; + case SCENEOBJT_MENU: + dump_menu(ctx, (struct scene_obj_menu *)obj); + break; + case SCENEOBJT_TEXTLINE: + dump_textline(ctx, (struct scene_obj_textline *)obj); + break; + case SCENEOBJT_TEXTEDIT: + dump_textedit(ctx, (struct scene_obj_txtedit *)obj); + break; + } + ctx->indent -= 2; +} + +static void scene_dump_(struct dump_ctx *ctx) +{ + struct scene_obj *obj; + + outf(ctx, "Scene %d: name '%s'\n", ctx->scn->id, ctx->scn->name); + ctx->indent += 2; + outf(ctx, "title_id %d (%s)\n", + ctx->scn->title_id, obj_name(ctx, ctx->scn->title_id)); + outf(ctx, "highlight_id %d (%s)\n", + ctx->scn->highlight_id, obj_name(ctx, ctx->scn->highlight_id)); + + list_for_each_entry(obj, &ctx->scn->obj_head, sibling) { + /* Skip hidden objects */ + if (obj->flags & SCENEOF_HIDE) + continue; + obj_dump_(ctx, obj); + } + ctx->indent -= 2; +} + +void scene_dump(struct membuf *mb, struct scene *scn, int indent) +{ + struct dump_ctx ctx; + + ctx.mb = mb; + ctx.scn = scn; + ctx.indent = indent; + + scene_dump_(&ctx); +} + +static void expo_dump_(struct dump_ctx *ctx, struct expo *exp) +{ + struct scene *scn; + struct expo_theme *theme = &exp->theme; + + outf(ctx, "Expo: name '%s'\n", exp->name); + ctx->indent = 2; + outf(ctx, "display %s\n", + exp->display ? exp->display->name : "(null)"); + outf(ctx, "cons %s\n", exp->cons ? exp->cons->name : "(none)"); + outf(ctx, "mouse %s\n", exp->mouse ? exp->mouse->name : "(none)"); + outf(ctx, "scene_id %d\n", exp->scene_id); + outf(ctx, "next_id %d\n", exp->next_id); + outf(ctx, "req_width %d\n", exp->req_width); + outf(ctx, "req_height %d\n", exp->req_height); + outf(ctx, "text_mode %d\n", exp->text_mode); + outf(ctx, "popup %d\n", exp->popup); + outf(ctx, "show_highlight %d\n", exp->show_highlight); + outf(ctx, "mouse_enabled %d\n", exp->mouse_enabled); + outf(ctx, "mouse_ptr %p\n", exp->mouse_ptr); + outf(ctx, "mouse_size %dx%d\n", exp->mouse_size.w, + exp->mouse_size.h); + outf(ctx, "mouse_pos (%d,%d)\n", exp->mouse_pos.x, + exp->mouse_pos.y); + outf(ctx, "damage (%d,%d)-(%d,%d)\n", exp->damage.x0, exp->damage.y0, + exp->damage.x1, exp->damage.y1); + outf(ctx, "done %d\n", exp->done); + outf(ctx, "save %d\n", exp->save); + outf(ctx, "last_key_ms %ld\n", exp->last_key_ms); + + if (exp->display) { + struct video_priv *vid_priv = dev_get_uclass_priv(exp->display); + + outf(ctx, "video: %dx%d white_on_black %d\n", + vid_priv->xsize, vid_priv->ysize, + vid_priv->white_on_black); + } + + outf(ctx, "Theme:\n"); + ctx->indent = 4; + outf(ctx, "font_size %d\n", theme->font_size); + outf(ctx, "white_on_black %d\n", theme->white_on_black); + outf(ctx, "menu_inset %d\n", theme->menu_inset); + outf(ctx, "menuitem_gap_y %d\n", theme->menuitem_gap_y); + + ctx->indent = 0; + outf(ctx, "\nScenes:\n"); + ctx->indent = 2; + list_for_each_entry(scn, &exp->scene_head, sibling) { + ctx->scn = scn; + scene_dump_(ctx); + outf(ctx, "\n"); + } +} + +void expo_dump(struct expo *exp, struct membuf *mb) +{ + struct dump_ctx ctx; + + ctx.mb = mb; + ctx.scn = NULL; + ctx.indent = 0; + + expo_dump_(&ctx, exp); +} diff --git a/include/expo.h b/include/expo.h index b51d946f367..619af627840 100644 --- a/include/expo.h +++ b/include/expo.h @@ -14,6 +14,7 @@ #include #include +struct membuf; struct udevice; #include @@ -1240,4 +1241,21 @@ void expo_damage_reset(struct expo *exp); */ void expo_damage_add(struct expo *exp, const struct vid_bbox *bbox); +/** + * expo_dump() - Dump expo structure to a membuf + * + * @mb: membuf to write to + * @exp: Expo to dump + */ +void expo_dump(struct expo *exp, struct membuf *mb); + +/** + * scene_dump() - Dump scene structure to a membuf + * + * @mb: membuf to write to + * @scn: Scene to dump + * @indent: Indentation level + */ +void scene_dump(struct membuf *mb, struct scene *scn, int indent); + #endif /*__EXPO_H */ diff --git a/test/boot/expo.c b/test/boot/expo.c index 7c27da165c5..e8716b86991 100644 --- a/test/boot/expo.c +++ b/test/boot/expo.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -1258,3 +1259,48 @@ static int expo_scene_obj_type_name(struct unit_test_state *uts) return 0; } BOOTSTD_TEST(expo_scene_obj_type_name, 0); + +/* Test expo_dump() */ +static int expo_dump_test(struct unit_test_state *uts) +{ + struct scene_obj_menu *menu; + struct abuf buf, logo_copy; + struct scene *scn; + struct expo *exp; + struct membuf mb; + char mb_buf[4096]; + char *data; + int len; + + membuf_init(&mb, mb_buf, sizeof(mb_buf)); + + ut_assertok(create_test_expo(uts, &exp, &scn, &menu, &buf, &logo_copy)); + + /* Arrange the scene so objects have proper dimensions */ + ut_assertok(scene_arrange(scn)); + + /* Dump the expo */ + expo_dump(exp, &mb); + + /* Get the dumped data */ + len = membuf_getraw(&mb, sizeof(mb_buf), false, &data); + ut_assert(len > 0); + ut_assertnonnull(data); + + /* Nul-terminate for strstr to work */ + if (len < sizeof(mb_buf)) + data[len] = '\0'; + + /* Check for a few elements in the output */ + ut_assert(strstr(data, "Expo: name")); + ut_assert(strstr(data, "my menus")); + ut_assert(strstr(data, "Scene")); + ut_assert(strstr(data, "main")); + + abuf_uninit(&buf); + abuf_uninit(&logo_copy); + expo_destroy(exp); + + return 0; +} +BOOTSTD_TEST(expo_dump_test, UTF_DM | UTF_SCAN_FDT); From patchwork Fri Oct 10 03:42:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 573 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=1760067822; bh=XH7ChI9TXpEJCJKfpENtKB05zGATbyRmH4lSwFiXrYY=; 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=jkfIu7D4AXRtLa3HAJjsxQWh6DtD8EwX1CferpyQROuX8+U7Fe8NR1dp5OtZGHPBq rGVG+hWtlUfXpj1qBNhfGDugrPk6LsbqKRMEHpEAaxpHc0SuSv2gi5hqYSMyxhbxVw ftwgCWYlz6vwLP0NaQIKFua9LCGYHO+AnRtOaaqC0LGhGdOCs1TI54LoONxZw3coY7 ep05oYo4NQWwRCjw85NDr8UOXIiNwAfNWYVhcFnK6kt/QiL9Ccu6a+3MJ4z27OMo8m tO7dpkg+Qb+B1N1LeCycX0tM7MBidfrzDQiS+lmXG2TDCC9duitQ7NO3PByHikpATj +oiaUvCLFTObA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8959868080 for ; Thu, 9 Oct 2025 21:43:42 -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 shrsaQp2UO9W for ; Thu, 9 Oct 2025 21:43:42 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067822; bh=XH7ChI9TXpEJCJKfpENtKB05zGATbyRmH4lSwFiXrYY=; 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=jkfIu7D4AXRtLa3HAJjsxQWh6DtD8EwX1CferpyQROuX8+U7Fe8NR1dp5OtZGHPBq rGVG+hWtlUfXpj1qBNhfGDugrPk6LsbqKRMEHpEAaxpHc0SuSv2gi5hqYSMyxhbxVw ftwgCWYlz6vwLP0NaQIKFua9LCGYHO+AnRtOaaqC0LGhGdOCs1TI54LoONxZw3coY7 ep05oYo4NQWwRCjw85NDr8UOXIiNwAfNWYVhcFnK6kt/QiL9Ccu6a+3MJ4z27OMo8m tO7dpkg+Qb+B1N1LeCycX0tM7MBidfrzDQiS+lmXG2TDCC9duitQ7NO3PByHikpATj +oiaUvCLFTObA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 778D76806E for ; Thu, 9 Oct 2025 21:43:42 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067820; bh=sgNUPiP1P35/GvW0IcPywU/FwYhLOI9uMdQrBFHPork=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nZle91lwBNVnbrhhiaix9gXkm/KndF4C2/tl913g16ivLOJ8XVjpdgkoTwxZNddFy YysA4DuO9xfceB4DfRukdBuacMiQH3z3VOZn5eqCLWN5ZdriG+zZw2jduZ/BB2xdvO rg69tC5eXyD0nkSymG+DjCUdCEKN9eucP05h7GtGidZvzAnpkKD6rouC9za159bEAn pCWTNEt4BApKd+uwD47E1jV9X1gSNw6fkZI3ZXsJAQZBZ/2wzwQiwVwIvWmnEWDUI3 1QkVEpGwYX1odeeEeabQTOerPLoFcSIiPdrWXyVmI0yB24Fdh/lI+3wuhFZgTpI9dc mpUKkBYPU2lig== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 230EB67F7F; Thu, 9 Oct 2025 21:43:40 -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 hH4f7NNrJWcM; Thu, 9 Oct 2025 21:43:40 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067815; bh=nsCEdhtQrNLMLit7C7IwCmuag0xhC57X8kKdChah1Kk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ghk8I5D1Lt7dA9sst9kZRzC6Os3TqSWxIyRQ/xhQT/pVQoV9zUPo+wHs9ZO5S508D pklFB6xZdG86TvglaZMqe/3G47Ig/b0DiV0WB9ujBxPuDVE70nUfcFWCgpFGPxsibW dHU/gRAXuH2B7X39SOiXcSL1HfnaY7XGFh3T/fkFBq67KZSPhvCR3XqXk6ExBb+SuH fb076NVi576jNgFxkLpj0FS68hw857gYmyTvrrhnkXu+Bezze0zTc+ruhf2T4UK52v 3GYDV1Iuy6y0yo8yYq90wMCwmRZIHJLZk/hj2sbb9t4Vb0DyaP7+1KlgTHwo49NcCk aIa90XNwcpG5A== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id C204E6807C; Thu, 9 Oct 2025 21:43:34 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 9 Oct 2025 21:42:35 -0600 Message-ID: <20251010034255.1099728-8-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251010034255.1099728-1-sjg@u-boot.org> References: <20251010034255.1099728-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 2KOFV5IFWSXS7POTSJETEVWDZIHDSIXZ X-Message-ID-Hash: 2KOFV5IFWSXS7POTSJETEVWDZIHDSIXZ 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 07/18] expo: Provide a command to dump a cedit expo 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 'cedit dump' command which dumps the contents of an expo for debugging. Co-developed-by: Claude Signed-off-by: Simon Glass --- cmd/Kconfig | 9 +++ cmd/cedit.c | 38 +++++++++++ doc/usage/cmd/cedit.rst | 141 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 188 insertions(+) diff --git a/cmd/Kconfig b/cmd/Kconfig index 0c6d1c4b185..224d5a83987 100644 --- a/cmd/Kconfig +++ b/cmd/Kconfig @@ -485,6 +485,15 @@ config CMD_CEDIT providing a UI for the user to adjust settings. Subcommands allow loading and saving of configuration as well as showing an editor. +config CMD_CEDIT_DUMP + bool "Allow dumping the contents of a cedit expo" + depends on CMD_CEDIT && EXPO_DUMP + default y + help + Provides a 'cedit dump' command to dump the expo in a human-readable + format. This can be useful for debugging or for checking that the + expo contains the expected objects. + config CMD_ELF bool "bootelf" default y diff --git a/cmd/cedit.c b/cmd/cedit.c index 6db5806e851..e446f61b3ba 100644 --- a/cmd/cedit.c +++ b/cmd/cedit.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -291,6 +292,37 @@ static int do_cedit_run(struct cmd_tbl *cmdtp, int flag, int argc, return 0; } +#ifdef CONFIG_CMD_EDIT_DUMP +static int do_cedit_dump(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) +{ + struct membuf mb; + char buf[256]; + int len; + + if (check_cur_expo()) + return CMD_RET_FAILURE; + + if (membuf_new(&mb, 131072)) { + printf("Failed to allocate membuf\n"); + return CMD_RET_FAILURE; + } + + expo_dump(cur_exp, &mb); + + /* Output the data in chunks */ + do { + len = membuf_get(&mb, buf, sizeof(buf) - 1); + buf[len] = '\0'; + puts(buf); + } while (len); + + membuf_dispose(&mb); + + return 0; +} +#endif /* CONFIG_CMD_EDIT_DUMP */ + U_BOOT_LONGHELP(cedit, "load - load config editor\n" #ifdef CONFIG_COREBOOT_SYSINFO @@ -302,6 +334,9 @@ U_BOOT_LONGHELP(cedit, "cedit write_env [-v] - write settings to env vars\n" "cedit read_cmos [-v] [dev] - read settings from CMOS RAM\n" "cedit write_cmos [-v] [dev] - write settings to CMOS RAM\n" +#ifdef CONFIG_CMD_EDIT_DUMP + "cedit dump - dump expo structure\n" +#endif "cedit run - run config editor"); U_BOOT_CMD_WITH_SUBCMDS(cedit, "Configuration editor", cedit_help_text, @@ -315,5 +350,8 @@ U_BOOT_CMD_WITH_SUBCMDS(cedit, "Configuration editor", cedit_help_text, U_BOOT_SUBCMD_MKENT(write_env, 2, 1, do_cedit_write_env), U_BOOT_SUBCMD_MKENT(read_cmos, 2, 1, do_cedit_read_cmos), U_BOOT_SUBCMD_MKENT(write_cmos, 2, 1, do_cedit_write_cmos), +#ifdef CONFIG_CMD_EDIT_DUMP + U_BOOT_SUBCMD_MKENT(dump, 1, 1, do_cedit_dump), +#endif U_BOOT_SUBCMD_MKENT(run, 1, 1, do_cedit_run), ); diff --git a/doc/usage/cmd/cedit.rst b/doc/usage/cmd/cedit.rst index e54ea204b9f..0eb8f09dc2c 100644 --- a/doc/usage/cmd/cedit.rst +++ b/doc/usage/cmd/cedit.rst @@ -19,6 +19,7 @@ Synopsis cedit read_env [-v] cedit write_cmos [-v] [dev] cedit cb_load + cedit dump Description ----------- @@ -101,6 +102,20 @@ cedit cb_load This is supported only on x86 devices booted from coreboot. It creates a new configuration editor which can be used to edit CMOS settings. +cedit dump +~~~~~~~~~~ + +Dumps the current expo structure to the console. This shows the expo, its +scenes, objects, and their properties in a human-readable format. This is useful +for debugging and understanding the structure of the configuration editor. + +Configuration +------------- + +The cedit command is only available if CONFIG_CMD_CEDIT=y. + +The 'cedit dump' subcommand is only available if CONFIG_CMD_CEDIT_DUMP=y. + Example ------- @@ -234,3 +249,129 @@ Update the checksum in CMOS RAM:: Checksum 7100 written => cbcmos check => + +This shows dumping the cedit:: + + Expo: name 'name' + display (null) + cons (none) + mouse (none) + scene_id 0 + next_id 42 + req_width 0 + req_height 0 + text_mode 0 + popup 0 + show_highlight 0 + mouse_enabled 0 + mouse_ptr 0000000000000000 + mouse_size 0x0 + mouse_pos (0,0) + damage (0,0)-(0,0) + done 0 + save 0 + last_key_ms 271450936 + Theme: + font_size 0 + white_on_black 0 + menu_inset 0 + menuitem_gap_y 0 + + Scenes: + Scene 6: name 'main' + title_id 19 (title) + highlight_id 0 ((none)) + Object 19 (title): type text + flags + bbox: (0,0)-(0,0) + dims: 0x0 + Text: str_id 20 font_name '(default)' font_size 0 + str 'Test Configuration' + Object 21 (prompt): type text + flags + bbox: (0,0)-(0,0) + dims: 0x0 + Text: str_id 22 font_name '(default)' font_size 0 + str 'UP and DOWN to choose, ENTER to select' + Object 8 (cpu-speed): type menu + flags + bbox: (0,0)-(0,0) + dims: 0x0 + Menu: pointer_id 0 title_id 23 manual 0 + Item 10: name '00' label_id 25 desc_id 0 + Item 11: name '01' label_id 27 desc_id 0 + Item 12: name '02' label_id 29 desc_id 0 + Object 23 (title): type text + flags + bbox: (0,0)-(0,0) + dims: 0x0 + Text: str_id 24 font_name '(default)' font_size 0 + str 'CPU speed' + Object 25 (item-label): type text + flags + bbox: (0,0)-(0,0) + dims: 0x0 + Text: str_id 26 font_name '(default)' font_size 0 + str '2 GHz' + Object 27 (item-label): type text + flags + bbox: (0,0)-(0,0) + dims: 0x0 + Text: str_id 28 font_name '(default)' font_size 0 + str '2.5 GHz' + Object 29 (item-label): type text + flags + bbox: (0,0)-(0,0) + dims: 0x0 + Text: str_id 30 font_name '(default)' font_size 0 + str '3 GHz' + Object 13 (power-loss): type menu + flags + bbox: (0,0)-(0,0) + dims: 0x0 + Menu: pointer_id 0 title_id 31 manual 0 + Item 14: name '00' label_id 33 desc_id 0 + Item 15: name '01' label_id 35 desc_id 0 + Item 16: name '02' label_id 37 desc_id 0 + Object 31 (title): type text + flags + bbox: (0,0)-(0,0) + dims: 0x0 + Text: str_id 32 font_name '(default)' font_size 0 + str 'AC Power' + Object 33 (item-label): type text + flags + bbox: (0,0)-(0,0) + dims: 0x0 + Text: str_id 34 font_name '(default)' font_size 0 + str 'Always Off' + Object 35 (item-label): type text + flags + bbox: (0,0)-(0,0) + dims: 0x0 + Text: str_id 36 font_name '(default)' font_size 0 + str 'Always On' + Object 37 (item-label): type text + flags + bbox: (0,0)-(0,0) + dims: 0x0 + Text: str_id 38 font_name '(default)' font_size 0 + str 'Memory' + Object 17 (machine-name): type textline + flags + bbox: (0,0)-(0,0) + dims: 0x0 + Textline: label_id 39 edit_id 18 + max_chars 20 pos 20 + Object 39 (title): type text + flags + bbox: (0,0)-(0,0) + dims: 0x0 + Text: str_id 40 font_name '(default)' font_size 0 + str 'Machine name' + Object 18 (edit): type text + flags + bbox: (0,0)-(0,0) + dims: 0x0 + Text: str_id 41 font_name '(default)' font_size 0 + str '' From patchwork Fri Oct 10 03:42:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 574 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=1760067824; bh=6mgFPRIzQjg/wL9arcBls5B0hhD11Lj8BG7rdAel/e0=; 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=LVg3sT29urAUk+7ChtH0l/ksB145+QQFsO3ndCuU3IivPVHfCk8cmxH/H/Lz6NpaB XhvL7/MoFC8NGzwfKzTN4ua+/AW+fwtRE3wb2IPkjKuRb/bCAR0126HToIu+Opw5WJ XalYhKqbuj/kkR8wfNZ/joroG/s7RttOIzOBJNf+XIC4D0C1zfB++ehJQiZ38hh5+J XRIF2tQC21HwlfILO9oJPc+hmEccu81jDYzNnt4RDq+SkbhaTamG4ey+k948Tn8Frk lbYOxp+g5EBn5HoLq09V5+JA/+Ca+I7gmU0Z3EuoiPfCJ2npetsye5KPlAj473OE3V 90FvuMZa1tlpQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DF50968084 for ; Thu, 9 Oct 2025 21:43:44 -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 8GkLvCrj7dY8 for ; Thu, 9 Oct 2025 21:43:44 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067823; bh=6mgFPRIzQjg/wL9arcBls5B0hhD11Lj8BG7rdAel/e0=; 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=mx6/vJHeFZb962k9e7RJxjEdug61uLbajXAkrdPtFWZj96kBlCQCZJlpYfGH+2CVB hC7+huGQUzR/1tNqB22YHnQtL/a5tRXMZ2APu8w9n9PfDjEltBXlZ36OA/DxydqAhC SQLnJEfIDoverOmTNzCeEBaqWIsFGGgOoY1e4mXcEo15D+6TgJ3csX+ZiI0gGx2IU6 4Fmf94ugAUgx42Bt7au8lplIGgNBhW/vuiIkYzxQDa8Zz6P5BCVB704fjKlaPTjwTJ j6ZiMFF4/zm9IXMNYuwKFGuG85hg1UsjybKNEdEqQMCoXFWD54RsNxahvKwonFj02/ XFZPG5jmXKkxA== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E641167FE9 for ; Thu, 9 Oct 2025 21:43:43 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067821; bh=JHku3ka3SENUBK7GQjKoSpGGE+jvfW3JYtOxCWDY6b4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LW+swe3bmdtn68ozXnqfJUyqXxdzT40K0xrmbwd+FUVPJtDjTLz6g7jTXHApFF+NA wxtWqLNHamfne1Wl06b0/QYuiYYxnvohdjQ+jmZ6/xWRtSY66QjFXOXd9icAZalVpo YXd5hHx53DdUKZrknF/e5YxNTnDE9HCbPX6LJ6ZeiaTlakIJE5+nhYT8wQlA9FV8dR vRuWwtluAQ8Gja2U/yjJunlnB+v0wvRGbhxLhzgVQd282Jv3avKDz/oQcte3SZND4l lDLEapUG6p2qmJ9aBxUTn8xdWDjwR8wA44Tx49tb+BT/cv6JjGpVbaEuHnWtgi+nfR QLaFNcp/hSxCA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4099F67FC1; Thu, 9 Oct 2025 21:43:41 -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 gygIaFaWdGWM; Thu, 9 Oct 2025 21:43:41 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067819; bh=zdAoW5HgddvDAymURY4iMIXEM9VzbF6EraeYLuAAxCY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PDvt0M4taukKalHDsAVzfQx46/yFRBasSm4d/AAd4LiVKIDl4wgRJdaZXlY9qBEID e+crdt8KBXsql2KwhMZWqLMC7fBD00BcFvHHkEGO/nZonmD6+QjGpUkK6eC48+0iNK RMXEnT1seqy3KvMrcC5Y1YtAYcQywpfL3IQ3UplB58mnS8UewJgkum/S6yK94Gdaz9 VFlWLXZz9MUrej5j5cJR2OmobdQi7+6fwach7AY3SXVLSEHRLXw8AAQ/GEQuLB6zGa UAuLG4hRbL1qG5LQACxqrlfT8Ir9iIkTXA8wJKsahcWYwq22RYnGnwLyrH4/pLC2rS GcCb0/jlUPYOg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7427268030; Thu, 9 Oct 2025 21:43:39 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 9 Oct 2025 21:42:36 -0600 Message-ID: <20251010034255.1099728-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251010034255.1099728-1-sjg@u-boot.org> References: <20251010034255.1099728-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: ZLGOQA47YJ432F6CAZD2QY6NBYIFFUCS X-Message-ID-Hash: ZLGOQA47YJ432F6CAZD2QY6NBYIFFUCS 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 X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 08/18] expo: Provide a version of scene_within() with takes an obj 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 When the object pointer is already available we don't want to have to look it up. Provide a new is_within() function which takes an object pointer instead of an ID. Signed-off-by: Simon Glass --- boot/scene.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/boot/scene.c b/boot/scene.c index c2e4d8e1330..c1ecbfcc67a 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -1129,6 +1129,22 @@ int scene_send_key(struct scene *scn, int key, struct expo_action *event) return 0; } +/** + * is_within() - check if a point is considered within an object ID + * + * @scn: Scene to check + * @obj: object to check + * @x: X coordinate of the point + * @y: Y coordinate of the point + * Return: true if the point is considered within the object, false if not + */ +static bool is_within(const struct scene_obj *obj, int x, int y) +{ + /* Check if point (x, y) is within object's bounding box */ + return (x >= obj->bbox.x0 && x <= obj->bbox.x1 && + y >= obj->bbox.y0 && y <= obj->bbox.y1); +} + bool scene_within(const struct scene *scn, uint id, int x, int y) { struct scene_obj *obj; @@ -1141,9 +1157,7 @@ bool scene_within(const struct scene *scn, uint id, int x, int y) log_debug("- id %d: '%s' bbox x0 %d y0 %d x1 %d y1 %d\n", id, obj->name, obj->bbox.x0, obj->bbox.y0, obj->bbox.x1, obj->bbox.x1); - /* Check if point (x, y) is within object's bounding box */ - return (x >= obj->bbox.x0 && x <= obj->bbox.x1 && - y >= obj->bbox.y0 && y <= obj->bbox.y1); + return is_within(obj, x, y); } bool scene_obj_within(const struct scene *scn, struct scene_obj *obj, int x, From patchwork Fri Oct 10 03:42:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 575 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=1760067830; bh=rtm7s39zJrKXS6ptSzfIU9xrhw3DWR+jKb4UyndakQU=; 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=ix2noS/6JOuXdlpSn4nR1EgqpDyDJQAWwHGPwV4N6xEEsGppFBVCLMFgM9olsi/S+ tE4pvs5l/CFMIo7R7xDbMs/YZRe6fmvURzu1ruGUE9k5Gk0M+IS0MaXwj/z3CcRR5s x8Kwq7P1kTbms5X9cHT6znUTbwu4rOrHkMANLP9Y2LgscTn8bIkVYIgPI7ae0nkBAm jrD3By40PxqbOj88c7Xec/nSjP3PMoDm+ko448vP9dvGxAxft6dRFFD8e0LNnMflcn lZRq0iMC5qQd0ad0QHnRooWyBKh9RCSPBKGZG+ugD9U2RlN0rwG9VVCh8PAbVc1kfm Bvrcc/T4aLGFQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5F7AE68080 for ; Thu, 9 Oct 2025 21:43: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 eNpKErrQw1zT for ; Thu, 9 Oct 2025 21:43:50 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067830; bh=rtm7s39zJrKXS6ptSzfIU9xrhw3DWR+jKb4UyndakQU=; 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=ix2noS/6JOuXdlpSn4nR1EgqpDyDJQAWwHGPwV4N6xEEsGppFBVCLMFgM9olsi/S+ tE4pvs5l/CFMIo7R7xDbMs/YZRe6fmvURzu1ruGUE9k5Gk0M+IS0MaXwj/z3CcRR5s x8Kwq7P1kTbms5X9cHT6znUTbwu4rOrHkMANLP9Y2LgscTn8bIkVYIgPI7ae0nkBAm jrD3By40PxqbOj88c7Xec/nSjP3PMoDm+ko448vP9dvGxAxft6dRFFD8e0LNnMflcn lZRq0iMC5qQd0ad0QHnRooWyBKh9RCSPBKGZG+ugD9U2RlN0rwG9VVCh8PAbVc1kfm Bvrcc/T4aLGFQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 48B4667FF2 for ; Thu, 9 Oct 2025 21:43:50 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067827; bh=exAyhmuT77zx7uw6jWlhAP7wfOnc7NfPU4d0AbwxsHo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dkX/L10MvohL5FuQ3hdFgllqnweSsVdAk/vLHC4wnE+cjcNQZeJ0P45SFisCH9Acd zBBV44jSniQrdNyjFG0zNpnd37o2DbRwYd1yeds2gPzRCK6pi5ZsOjyomgIahfRnkR Wwl/SAOMX1sb93bgxXU+k7XKpe+dlXJAJuIL2wrFahBi4FmzIFJTrdzDM85NlAwAUR +fx5ceOaaFxmo5h87JhHo0s/nxVQ3QcIimFEOsaz6qLrED2v+/LK4iQc8qFw6CZS31 CxNeHSzf6OPBERZnteqKZTI4870JbDpe34nNN6cR3PAgQvmjmJIHoWuBmwivmXgMoT A83m1Epc9XbGw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 242A167FE9; Thu, 9 Oct 2025 21:43:47 -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 OSqvy_cc8DML; Thu, 9 Oct 2025 21:43:47 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067821; bh=3O2wK4D9tS+Q7Zm/5oBTatJtOyjv3XrXTsW1tjJMMi0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MdWosxM4yQH56TVH9whcG+jrpQHm2eCq3X1p/2XVhSRxDU/KJemTiEdOiKl9Hs8hO GPc6vh8AA2Dwi9w/xTkDhSypCk3FIkvF4vMjcI28fP8yqkMjkT9NpTIrOu89ewnWbN KZOj7Z0Vx2mra/hk03OYJ+Gf5GpAW3BT7J1zxDKxMd7kAUZ3GwDWjiv9OUXEGLjtxJ 9sKmn3R1OCzs0CsBrO2qRa2wvs/g0tMvy2YQVpPkJAzVyvXf3ScpKUHHhJHPU+omNe SR1wRH8BDphh1R9X++VBEQ/E4Nlyy8RYZlk5xzsdTsTUPHSD0r5Ip8hOpUQMXSXy7d qUIdb4zHqkO5w== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 863EB67FF2; Thu, 9 Oct 2025 21:43:41 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 9 Oct 2025 21:42:37 -0600 Message-ID: <20251010034255.1099728-10-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251010034255.1099728-1-sjg@u-boot.org> References: <20251010034255.1099728-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 5IONADZBESZ5QPIOP7XP52LJCQ2R6IMS X-Message-ID-Hash: 5IONADZBESZ5QPIOP7XP52LJCQ2R6IMS 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 09/18] expo: Export scene_find_obj_within() and add a test 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 easier to test this function directly than via click_check(). Set up a test expo with an extra overlapping object and add some tests. Update the existing render test to take account of the new object. Co-developed-by: Claude Signed-off-by: Simon Glass --- boot/scene.c | 11 +------ boot/scene_internal.h | 10 ++++++ test/boot/expo.c | 71 +++++++++++++++++++++++++++++++++++++------ 3 files changed, 72 insertions(+), 20 deletions(-) diff --git a/boot/scene.c b/boot/scene.c index c1ecbfcc67a..a9e0d1f1266 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -1193,16 +1193,7 @@ bool scene_obj_within(const struct scene *scn, struct scene_obj *obj, int x, return within; } -/** - * scene_find_obj_within() - Find an object that is within the coords - * - * @scn: Scene to check - * @x: X coordinates of the click - * @y: Y coordinate of the click - * Return: object that is being clicked on, NULL if none - */ -static struct scene_obj *scene_find_obj_within(const struct scene *scn, int x, - int y) +struct scene_obj *scene_find_obj_within(const struct scene *scn, int x, int y) { struct scene_obj *obj; diff --git a/boot/scene_internal.h b/boot/scene_internal.h index 9bf2cb8f8f2..8e61067d4b4 100644 --- a/boot/scene_internal.h +++ b/boot/scene_internal.h @@ -556,4 +556,14 @@ const char *scene_flag_name(uint flag); */ const char *scene_obj_type_name(enum scene_obj_t type); +/** + * scene_find_obj_within() - Find an object that is within the coords + * + * @scn: Scene to check + * @x: X coordinates of the click + * @y: Y coordinate of the click + * Return: object that is being clicked on, NULL if none + */ +struct scene_obj *scene_find_obj_within(const struct scene *scn, int x, int y); + #endif /* __SCENE_INTERNAL_H */ diff --git a/test/boot/expo.c b/test/boot/expo.c index e8716b86991..db4a54e7cd7 100644 --- a/test/boot/expo.c +++ b/test/boot/expo.c @@ -34,6 +34,7 @@ enum { OBJ_BOX, OBJ_BOX2, OBJ_TEXTED, + OBJ_OVERLAP, /* strings */ STR_SCENE_TITLE, @@ -55,6 +56,8 @@ enum { STR_ITEM2_KEY, STR_ITEM2_PREVIEW, + STR_OVERLAP, + /* menu items */ ITEM1, ITEM1_LABEL, @@ -599,6 +602,14 @@ static int create_test_expo(struct unit_test_state *uts, struct expo **expp, abuf_printf(text, "This\nis the initial contents of the text editor " "but it is quite likely that more will be added later"); + /* + * Add an extra text object that overlaps with OBJ_TEXT to test reverse + * search order. OBJ_TEXT is at (400, 100), so let's add one nearby + */ + ut_assert(scene_txt_str(scn, "overlap", OBJ_OVERLAP, STR_OVERLAP, + "overlap text", NULL) > 0); + ut_assertok(scene_obj_set_pos(scn, OBJ_OVERLAP, 405, 105)); + *expp = exp; *scnp = scn; *menup = menu; @@ -720,17 +731,17 @@ static int expo_render_image(struct unit_test_state *uts) /* render it */ expo_set_scene_id(exp, SCENE1); ut_assertok(expo_render(exp)); - ut_asserteq(18782, video_compress_fb(uts, dev, false)); + ut_asserteq(19065, video_compress_fb(uts, dev, false)); ut_asserteq(0, scn->highlight_id); ut_assertok(scene_arrange(scn)); ut_asserteq(0, scn->highlight_id); ut_assertok(expo_render(exp)); - ut_asserteq(20373, video_compress_fb(uts, dev, false)); + ut_asserteq(20707, video_compress_fb(uts, dev, false)); ut_assertok(scene_arrange(scn)); ut_assertok(expo_render(exp)); - ut_asserteq(20373, video_compress_fb(uts, dev, false)); + ut_asserteq(20707, video_compress_fb(uts, dev, false)); scene_set_highlight_id(scn, OBJ_MENU); ut_asserteq(OBJ_MENU, scn->highlight_id); @@ -742,7 +753,7 @@ static int expo_render_image(struct unit_test_state *uts) ut_assert(!(obj->flags & SCENEOF_HIDE)); ut_assertok(expo_render(exp)); - ut_asserteq(20373, video_compress_fb(uts, dev, false)); + ut_asserteq(20707, video_compress_fb(uts, dev, false)); /* move down */ ut_assertok(expo_send_key(exp, BKEY_DOWN)); @@ -755,7 +766,7 @@ static int expo_render_image(struct unit_test_state *uts) ut_asserteq(ITEM2, scene_menu_get_cur_item(scn, OBJ_MENU)); ut_assertok(scene_arrange(scn)); ut_assertok(expo_render(exp)); - ut_asserteq(19649, video_compress_fb(uts, dev, false)); + ut_asserteq(19953, video_compress_fb(uts, dev, false)); ut_assertok(video_check_copy_fb(uts, dev)); /* hide the text editor since the following tests don't need it */ @@ -764,18 +775,18 @@ static int expo_render_image(struct unit_test_state *uts) /* do some alignment checks */ ut_assertok(scene_obj_set_halign(scn, OBJ_TEXT3, SCENEOA_CENTRE)); ut_assertok(expo_render(exp)); - ut_asserteq(16323, video_compress_fb(uts, dev, false)); + ut_asserteq(16626, video_compress_fb(uts, dev, false)); ut_assertok(scene_obj_set_halign(scn, OBJ_TEXT3, SCENEOA_RIGHT)); ut_assertok(expo_render(exp)); - ut_asserteq(16240, video_compress_fb(uts, dev, false)); + ut_asserteq(16634, video_compress_fb(uts, dev, false)); ut_assertok(scene_obj_set_halign(scn, OBJ_TEXT3, SCENEOA_LEFT)); ut_assertok(scene_obj_set_valign(scn, OBJ_TEXT3, SCENEOA_CENTRE)); ut_assertok(expo_render(exp)); - ut_asserteq(18714, video_compress_fb(uts, dev, false)); + ut_asserteq(19056, video_compress_fb(uts, dev, false)); ut_assertok(scene_obj_set_valign(scn, OBJ_TEXT3, SCENEOA_BOTTOM)); ut_assertok(expo_render(exp)); - ut_asserteq(18670, video_compress_fb(uts, dev, false)); + ut_asserteq(19024, video_compress_fb(uts, dev, false)); /* make sure only the preview for the second item is shown */ obj = scene_obj_find(scn, ITEM1_PREVIEW, SCENEOBJT_NONE); @@ -801,7 +812,7 @@ static int expo_render_image(struct unit_test_state *uts) exp->show_highlight = true; ut_assertok(scene_arrange(scn)); ut_assertok(expo_render(exp)); - ut_asserteq(18830, video_compress_fb(uts, dev, false)); + ut_asserteq(19181, video_compress_fb(uts, dev, false)); /* now try in text mode */ expo_set_text_mode(exp, true); @@ -1260,6 +1271,46 @@ static int expo_scene_obj_type_name(struct unit_test_state *uts) } BOOTSTD_TEST(expo_scene_obj_type_name, 0); +/* Test scene_find_obj_within() */ +static int expo_find_obj_within(struct unit_test_state *uts) +{ + struct scene_obj_menu *menu; + struct abuf buf, logo_copy; + struct scene_obj *obj; + struct scene *scn; + struct expo *exp; + + ut_assertok(create_test_expo(uts, &exp, &scn, &menu, &buf, &logo_copy)); + + /* Arrange the scene so objects have proper bounding boxes */ + ut_assertok(scene_arrange(scn)); + + /* + * Check finding a menu by 'clicking' on a menu item label - menu items + * are at (50,436) for ITEM1 and (50,454) for ITEM2 + */ + obj = scene_find_obj_within(scn, 60, 440); + ut_assertnonnull(obj); + ut_asserteq(OBJ_MENU, obj->id); + + /* logo and text are not highlightable, so they should not be found */ + ut_assertnull(scene_find_obj_within(scn, 60, 30)); + ut_assertnull(scene_find_obj_within(scn, 410, 110)); + + /* empty space */ + ut_assertnull(scene_find_obj_within(scn, 10, 10)); + + /* way outside bounds */ + ut_assertnull(scene_find_obj_within(scn, 9999, 9999)); + + abuf_uninit(&buf); + abuf_uninit(&logo_copy); + expo_destroy(exp); + + return 0; +} +BOOTSTD_TEST(expo_find_obj_within, UTF_DM | UTF_SCAN_FDT); + /* Test expo_dump() */ static int expo_dump_test(struct unit_test_state *uts) { From patchwork Fri Oct 10 03:42:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 576 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=1760067832; bh=nB3GkYQ5B68vtqWCNWSP6lYR8+yhePNMbp4zH8jbAl4=; 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=D8C6HZ8Ic+4Sq/y6MTH0EdsH6JNGfKa113+1yE1otpwEIroW9eMb4d716qozx9lvp 7uawz71rl50kADzT5egT4/bGL0QJ19Bch96J6elhSu1Rz0zuCCL5YUvC4t2I7tmSyo Qs+InfBIJpNX2I6S97Eqprhd1e9Dd0ZPsnod9I3161zIUW/BVynBPf6ZEilk0Lf4X9 vItMSLjhM5bk2C3L0RKs2xKl/LXGOvRYbwcIl3RbsDjIc6zG9rAokdBqd8fU0fDUZk LALqGG/tic0FspzE8jjGRJXBQq6rbeeIALt3yF1pCoZU7952kkRddw91aWEAViZkO0 rZyjuSa1f5uMQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BDED767FC1 for ; Thu, 9 Oct 2025 21:43:52 -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 N8LYlYrzZ_SX for ; Thu, 9 Oct 2025 21:43:52 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067832; bh=nB3GkYQ5B68vtqWCNWSP6lYR8+yhePNMbp4zH8jbAl4=; 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=D8C6HZ8Ic+4Sq/y6MTH0EdsH6JNGfKa113+1yE1otpwEIroW9eMb4d716qozx9lvp 7uawz71rl50kADzT5egT4/bGL0QJ19Bch96J6elhSu1Rz0zuCCL5YUvC4t2I7tmSyo Qs+InfBIJpNX2I6S97Eqprhd1e9Dd0ZPsnod9I3161zIUW/BVynBPf6ZEilk0Lf4X9 vItMSLjhM5bk2C3L0RKs2xKl/LXGOvRYbwcIl3RbsDjIc6zG9rAokdBqd8fU0fDUZk LALqGG/tic0FspzE8jjGRJXBQq6rbeeIALt3yF1pCoZU7952kkRddw91aWEAViZkO0 rZyjuSa1f5uMQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AC5AA67FF2 for ; Thu, 9 Oct 2025 21:43:52 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067830; bh=yphxJajDG2jnAl1MHsRfkYOjK5oMaT8LxEhDfyMak3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ST2Bey6D/tNPyKJ7MFNK2xf7VcbdxtfbtiGjXAsMOw6gyC6rWuJWz39yq4Cbe5YrL CALnKNvcZ7XJnbYviP8yKmrUgVlWj8kOYp//HUCYy2T6MMfkkIC3dHAVO0RyIvi6vZ +JViZLXa623FaZxJNGCD7TD0+16G2g1vWK18IMHHiJGUaGXMaH/mis/8JAMVr9PCqk gxV3KWUy0ljk8yetdWUgO5O1wyhL8jlXwD8+iYkM32yb/glmeTn5bRAY6KNKeHdvxN 6PJhQ09+ZB6OFmE+ExmuUQTuDYT329gc89UqVCJQGY/N19RxRpyV5oV/x650keErkm ONOZcniKyYYrQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4CAC86807B; Thu, 9 Oct 2025 21:43: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 10026) with ESMTP id 0Y66T89x4mVj; Thu, 9 Oct 2025 21:43:50 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067826; bh=J8AfH/YGPop7Zxrd4J/L/dHRxp1ZKHnfaIDqX9kAdtQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g3HEBmh/VPBconxql4Hiw03ZfoXpcOAFzLF1ae/Gblpzkyv9ZDKnKVX+bsBdTTia2 mgFgzUs4kX367d+wU6jH0Iby+pUxuTnAhKSyindFYLQwIl1c3xTu1S3+/vUsbKxpgJ 1UI31gY402CxCSev5LfHhc73XTpQWzyzHoZIEVaXlwDedeLmF7Z/V02j5hU/dmYWBy eIVH0CPoeVXoMLDgBxEzvl01Rc69hzHmUpose2wuEivTEq9v6eeV39IuiZ7UJpIzxi GwMr+kITzrNUj1WaFobvVHx2d/81XyW5RvfGuJJNSnfl9mCd1DllkMYg6c26m0rCiB jcpbITnRkWiMQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 3A50E67FC1; Thu, 9 Oct 2025 21:43:46 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 9 Oct 2025 21:42:38 -0600 Message-ID: <20251010034255.1099728-11-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251010034255.1099728-1-sjg@u-boot.org> References: <20251010034255.1099728-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: F7XBVOPBZWL6ENQ6KPYZOOOPA76XYQPL X-Message-ID-Hash: F7XBVOPBZWL6ENQ6KPYZOOOPA76XYQPL 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/18] expo: Allow searching click positions from top to bottom 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 Since the scene is drawn by iterating through the list of objects, when the user clicks somewhere we should look at the top-most object under the mouse first. This is not true when a menu is popped up, since we only care about the menu in that case. Add a way to reverse the direction of the object search. For now there are no new test cases, since OBJ_OVERLAP is a text object and cannot currently be clicked on. Co-developed-by: Claude Signed-off-by: Simon Glass --- boot/scene.c | 45 +++++++++++++++++++++++++++++-------------- boot/scene_internal.h | 5 ++++- test/boot/expo.c | 10 +++++----- 3 files changed, 40 insertions(+), 20 deletions(-) diff --git a/boot/scene.c b/boot/scene.c index a9e0d1f1266..05a683dd1da 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -1193,20 +1193,37 @@ bool scene_obj_within(const struct scene *scn, struct scene_obj *obj, int x, return within; } -struct scene_obj *scene_find_obj_within(const struct scene *scn, int x, int y) +struct scene_obj *scene_find_obj_within(const struct scene *scn, int x, int y, + bool reverse) { struct scene_obj *obj; - log_debug("within: x %d y %d\n", x, y); - list_for_each_entry(obj, &scn->obj_head, sibling) { - log_debug(" - obj %d '%s' can_highlight %d within %d\n", - obj->id, obj->name, scene_obj_can_highlight(obj), - scene_obj_within(scn, obj, x, y)); - if (scene_obj_can_highlight(obj) && - scene_obj_within(scn, obj, x, y)) { - log_debug("- returning obj %d '%s'\n", obj->id, - obj->name); - return obj; + log_debug("within: x %d y %d reverse %d\n", x, y, reverse); + if (reverse) { + list_for_each_entry_reverse(obj, &scn->obj_head, sibling) { + log_debug(" - obj %d '%s' can_highlight %d within %d\n", + obj->id, obj->name, + scene_obj_can_highlight(obj), + scene_obj_within(scn, obj, x, y)); + if (scene_obj_can_highlight(obj) && + scene_obj_within(scn, obj, x, y)) { + log_debug("- returning obj %d '%s'\n", obj->id, + obj->name); + return obj; + } + } + } else { + list_for_each_entry(obj, &scn->obj_head, sibling) { + log_debug(" - obj %d '%s' can_highlight %d within %d\n", + obj->id, obj->name, + scene_obj_can_highlight(obj), + scene_obj_within(scn, obj, x, y)); + if (scene_obj_can_highlight(obj) && + scene_obj_within(scn, obj, x, y)) { + log_debug("- returning obj %d '%s'\n", obj->id, + obj->name); + return obj; + } } } log_debug("- no object\n"); @@ -1238,7 +1255,7 @@ static void send_click_obj(struct scene *scn, struct scene_obj *obj, int x, } log_debug("no object; finding...\n"); - obj = scene_find_obj_within(scn, x, y); + obj = scene_find_obj_within(scn, x, y, false); if (obj) { event->type = EXPOACT_POINT_OPEN; event->select.id = obj->id; @@ -1264,7 +1281,7 @@ static int scene_click_popup(struct scene *scn, int x, int y, } /* check that the click is within our object */ - chk = scene_find_obj_within(scn, x, y); + chk = scene_find_obj_within(scn, x, y, false); log_debug("chk %d '%s' (obj %d '%s')\n", chk ? chk->id : -1, chk ? chk->name : "(none)", obj->id, obj->name); if (!chk) { @@ -1323,7 +1340,7 @@ int scene_send_click(struct scene *scn, int x, int y, struct expo_action *event) return 0; } - obj = scene_find_obj_within(scn, x, y); + obj = scene_find_obj_within(scn, x, y, false); log_debug("non-popup obj %d '%s'\n", obj ? obj->id : -1, obj ? obj->name : "(none)"); if (!obj) diff --git a/boot/scene_internal.h b/boot/scene_internal.h index 8e61067d4b4..e2f4cc066d0 100644 --- a/boot/scene_internal.h +++ b/boot/scene_internal.h @@ -562,8 +562,11 @@ const char *scene_obj_type_name(enum scene_obj_t type); * @scn: Scene to check * @x: X coordinates of the click * @y: Y coordinate of the click + * @reverse: true to search from top to bottom (reverse order), false for + * bottom to top * Return: object that is being clicked on, NULL if none */ -struct scene_obj *scene_find_obj_within(const struct scene *scn, int x, int y); +struct scene_obj *scene_find_obj_within(const struct scene *scn, int x, int y, + bool reverse); #endif /* __SCENE_INTERNAL_H */ diff --git a/test/boot/expo.c b/test/boot/expo.c index db4a54e7cd7..e32550a6685 100644 --- a/test/boot/expo.c +++ b/test/boot/expo.c @@ -1289,19 +1289,19 @@ static int expo_find_obj_within(struct unit_test_state *uts) * Check finding a menu by 'clicking' on a menu item label - menu items * are at (50,436) for ITEM1 and (50,454) for ITEM2 */ - obj = scene_find_obj_within(scn, 60, 440); + obj = scene_find_obj_within(scn, 60, 440, false); ut_assertnonnull(obj); ut_asserteq(OBJ_MENU, obj->id); /* logo and text are not highlightable, so they should not be found */ - ut_assertnull(scene_find_obj_within(scn, 60, 30)); - ut_assertnull(scene_find_obj_within(scn, 410, 110)); + ut_assertnull(scene_find_obj_within(scn, 60, 30, false)); + ut_assertnull(scene_find_obj_within(scn, 410, 110, false)); /* empty space */ - ut_assertnull(scene_find_obj_within(scn, 10, 10)); + ut_assertnull(scene_find_obj_within(scn, 10, 10, false)); /* way outside bounds */ - ut_assertnull(scene_find_obj_within(scn, 9999, 9999)); + ut_assertnull(scene_find_obj_within(scn, 9999, 9999, false)); abuf_uninit(&buf); abuf_uninit(&logo_copy); From patchwork Fri Oct 10 03:42:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 577 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=1760067836; bh=GAcG8wRqF3Ozd9a1q0r5OJaIBsfAZtgKUr1a3zM0Fqk=; 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=A9k6wveWK/FJjNbI9SW3tou8RfHIeSA5UUYwHwjlHJ9j11pQAazI5JBmCxIgDPa4d 4SI2kuAMwErt9kWCEfh54FIHAKgTHE43rbaZRtSg3lxb/22Zmsey51GgYDbPbDQoLM bAGw2tIE4J14B3azwJOqzPPJSG8irwVDploBSxG5osqCeKjkWBr0Uau7X72wRxuKor hoVeVPTGtAZYTNPiAa/7tDOAoktZGTVMVrudKegtXrLyqTNw2eqnayGXVVPh3XofpY LTcXv05qYRnSQSm44tRTy9hvPUC55dWfzHGx0FwvxxO1NbBicmSP+T8PV+SQHZJ12f Vn2z8DhVloHDQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3283A67FE9 for ; Thu, 9 Oct 2025 21:43:56 -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 w0SRZvWKg0LA for ; Thu, 9 Oct 2025 21:43:56 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067836; bh=GAcG8wRqF3Ozd9a1q0r5OJaIBsfAZtgKUr1a3zM0Fqk=; 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=A9k6wveWK/FJjNbI9SW3tou8RfHIeSA5UUYwHwjlHJ9j11pQAazI5JBmCxIgDPa4d 4SI2kuAMwErt9kWCEfh54FIHAKgTHE43rbaZRtSg3lxb/22Zmsey51GgYDbPbDQoLM bAGw2tIE4J14B3azwJOqzPPJSG8irwVDploBSxG5osqCeKjkWBr0Uau7X72wRxuKor hoVeVPTGtAZYTNPiAa/7tDOAoktZGTVMVrudKegtXrLyqTNw2eqnayGXVVPh3XofpY LTcXv05qYRnSQSm44tRTy9hvPUC55dWfzHGx0FwvxxO1NbBicmSP+T8PV+SQHZJ12f Vn2z8DhVloHDQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2041468044 for ; Thu, 9 Oct 2025 21:43:56 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067834; bh=PJm7JRS6HUIrlPmLyKUmwHv/Hf4vXdr95PiiqpnCy+8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rNcWvyQw7PXxZ31+uxsEk6axKhn1zoIXH9SGCZGD3DAmizoz/GPzo/ob4R3inUHPs TkfHD/0vJy1j3X5GDzGAkzv2Y1XVOHEcyJzuPpJJigSCs1qk8RB/O89mhhFLt+jaVa tgGH6hZc1YYxXR9HSchSeckQE8TgXanaBd1LJVmJ5DLIDgbnvdjoblaukDm+DgVg/0 FF5TVh8NoknzfZqFj98wjyUmoJaIjOPflSkc7aKWxJ3ZhyGAeGpdPy68qYw1U34W+6 J61G+CQ2cF7RBYP0WQBk7dn9229TPpOCWq8+jMKrx6SWS0WIeTMEEEeeiZopRSFJuh DyvsSywf+Xoqw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A016F67F7F; Thu, 9 Oct 2025 21:43:54 -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 e0SoQivEPwdy; Thu, 9 Oct 2025 21:43:54 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067830; bh=NqYqQ5Svg9IuGabqCKWo/r4URNdzC3yXTcWbYHbeaj8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FK8bITYlHIM4domsqE7O7+rZbkfunzG6AS6W5r+JiqMFRURKKJm+tpNnlL1v7ldbo cB8S5rzbbvHnIKmWc5g1QTEivi+TkFozjGI6qlmOs291qSnfcX0CRuZRC1v6+lyLRr gUpgGRhV4NK3pSKQt7l9KUEnnfRL0jF3ePUoshgaB2bAggH6uR+56LhSR3G4pbDIRW CB7SGmp7MAYFePERhIq9mNuoMGLlGTbxBTYCN1tuUTkSOx3fhM0N6gqyb3O0KFD+hu 9CMI8JSFkN8oXfobozhwVfaloWKQS6CYADgyF7Nu4iGmFrRsnXL0za0e/XBgPV9MLS KkV9v3zBpVyZQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 88FFC67FE9; Thu, 9 Oct 2025 21:43:50 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 9 Oct 2025 21:42:39 -0600 Message-ID: <20251010034255.1099728-12-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251010034255.1099728-1-sjg@u-boot.org> References: <20251010034255.1099728-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: WBWMABJJHIMJLRQRCWKIBNJWR5ILQL54 X-Message-ID-Hash: WBWMABJJHIMJLRQRCWKIBNJWR5ILQL54 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 11/18] expo: Allow searching for any object type by position 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 At present only highlightable objects can be clicked on, i.e. menus and textlines. Update scene_find_obj_within() so that it can find any type of object, if requested. Update all the callers to false, so things work the same. Since the scene is drawn by iterating through the list of objects, when the user clicks somewhere we should look at the top-most object under the mouse first. So reverse the direction of the object search. Update the tests to cover this new feature. Co-developed-by: Claude Signed-off-by: Simon Glass --- boot/scene.c | 15 ++++++------- boot/scene_internal.h | 3 ++- test/boot/expo.c | 49 +++++++++++++++++++++++++++++++++++++------ 3 files changed, 53 insertions(+), 14 deletions(-) diff --git a/boot/scene.c b/boot/scene.c index 05a683dd1da..4cf1b6d5852 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -1194,18 +1194,19 @@ bool scene_obj_within(const struct scene *scn, struct scene_obj *obj, int x, } struct scene_obj *scene_find_obj_within(const struct scene *scn, int x, int y, - bool reverse) + bool reverse, bool allow_any) { struct scene_obj *obj; - log_debug("within: x %d y %d reverse %d\n", x, y, reverse); + log_debug("within: x %d y %d reverse %d allow_any %d\n", x, y, reverse, + allow_any); if (reverse) { list_for_each_entry_reverse(obj, &scn->obj_head, sibling) { log_debug(" - obj %d '%s' can_highlight %d within %d\n", obj->id, obj->name, scene_obj_can_highlight(obj), scene_obj_within(scn, obj, x, y)); - if (scene_obj_can_highlight(obj) && + if ((allow_any || scene_obj_can_highlight(obj)) && scene_obj_within(scn, obj, x, y)) { log_debug("- returning obj %d '%s'\n", obj->id, obj->name); @@ -1218,7 +1219,7 @@ struct scene_obj *scene_find_obj_within(const struct scene *scn, int x, int y, obj->id, obj->name, scene_obj_can_highlight(obj), scene_obj_within(scn, obj, x, y)); - if (scene_obj_can_highlight(obj) && + if ((allow_any || scene_obj_can_highlight(obj)) && scene_obj_within(scn, obj, x, y)) { log_debug("- returning obj %d '%s'\n", obj->id, obj->name); @@ -1255,7 +1256,7 @@ static void send_click_obj(struct scene *scn, struct scene_obj *obj, int x, } log_debug("no object; finding...\n"); - obj = scene_find_obj_within(scn, x, y, false); + obj = scene_find_obj_within(scn, x, y, false, false); if (obj) { event->type = EXPOACT_POINT_OPEN; event->select.id = obj->id; @@ -1281,7 +1282,7 @@ static int scene_click_popup(struct scene *scn, int x, int y, } /* check that the click is within our object */ - chk = scene_find_obj_within(scn, x, y, false); + chk = scene_find_obj_within(scn, x, y, false, false); log_debug("chk %d '%s' (obj %d '%s')\n", chk ? chk->id : -1, chk ? chk->name : "(none)", obj->id, obj->name); if (!chk) { @@ -1340,7 +1341,7 @@ int scene_send_click(struct scene *scn, int x, int y, struct expo_action *event) return 0; } - obj = scene_find_obj_within(scn, x, y, false); + obj = scene_find_obj_within(scn, x, y, false, false); log_debug("non-popup obj %d '%s'\n", obj ? obj->id : -1, obj ? obj->name : "(none)"); if (!obj) diff --git a/boot/scene_internal.h b/boot/scene_internal.h index e2f4cc066d0..2bfbb5dcf50 100644 --- a/boot/scene_internal.h +++ b/boot/scene_internal.h @@ -564,9 +564,10 @@ const char *scene_obj_type_name(enum scene_obj_t type); * @y: Y coordinate of the click * @reverse: true to search from top to bottom (reverse order), false for * bottom to top + * @allow_any: true to allow searching non-highlight objects * Return: object that is being clicked on, NULL if none */ struct scene_obj *scene_find_obj_within(const struct scene *scn, int x, int y, - bool reverse); + bool reverse, bool allow_any); #endif /* __SCENE_INTERNAL_H */ diff --git a/test/boot/expo.c b/test/boot/expo.c index e32550a6685..66fd5a2873f 100644 --- a/test/boot/expo.c +++ b/test/boot/expo.c @@ -1289,19 +1289,56 @@ static int expo_find_obj_within(struct unit_test_state *uts) * Check finding a menu by 'clicking' on a menu item label - menu items * are at (50,436) for ITEM1 and (50,454) for ITEM2 */ - obj = scene_find_obj_within(scn, 60, 440, false); + obj = scene_find_obj_within(scn, 60, 440, false, false); ut_assertnonnull(obj); ut_asserteq(OBJ_MENU, obj->id); - /* logo and text are not highlightable, so they should not be found */ - ut_assertnull(scene_find_obj_within(scn, 60, 30, false)); - ut_assertnull(scene_find_obj_within(scn, 410, 110, false)); + /* + * Check with allow_any=false for non-highlightable objects - logo and + * text are not highlightable, so they should not be found + */ + ut_assertnull(scene_find_obj_within(scn, 60, 30, false, false)); + ut_assertnull(scene_find_obj_within(scn, 410, 110, false, false)); + + /* Test with allow_any=true for non-highlightable objects */ + obj = scene_find_obj_within(scn, 60, 30, false, true); + ut_assertnonnull(obj); + ut_asserteq(OBJ_LOGO, obj->id); + + /* + * Check reversing search order with allow_any=true at the overlapping + * position. OBJ_TEXT was created first at (400, 100), and the + * "overlap" text object was created second at (405, 105). They + * overlap at position (410, 110). + * + * With reverse=false, we search from start of list (bottom to top) and + * find OBJ_TEXT first. + */ + obj = scene_find_obj_within(scn, 410, 110, false, true); + ut_assertnonnull(obj); + ut_asserteq(OBJ_TEXT, obj->id); + + /* + * With reverse=true, we search from end of list (top to bottom) and + * find the OBJ_OVERLAP_TEST object first. + */ + obj = scene_find_obj_within(scn, 410, 110, true, true); + ut_assertnonnull(obj); + ut_asserteq(OBJ_OVERLAP, obj->id); + + /* + * Test reverse=true with a non-overlapping object - should get same + * result as reverse=false + */ + obj = scene_find_obj_within(scn, 60, 30, true, true); + ut_assertnonnull(obj); + ut_asserteq(OBJ_LOGO, obj->id); /* empty space */ - ut_assertnull(scene_find_obj_within(scn, 10, 10, false)); + ut_assertnull(scene_find_obj_within(scn, 10, 10, false, false)); /* way outside bounds */ - ut_assertnull(scene_find_obj_within(scn, 9999, 9999, false)); + ut_assertnull(scene_find_obj_within(scn, 9999, 9999, false, false)); abuf_uninit(&buf); abuf_uninit(&logo_copy); From patchwork Fri Oct 10 03:42:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 578 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=1760067841; bh=7pvwGgb6GrKEM+lVy34ENc3BWnnR5jx+NSvBRZBZsCk=; 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=d7OJBBmisRyJVRcpEkix4i3djmeQWZr0VcxlU2E6xqhWSUcSR5IWQWfWHZz32WtBY pOco1KLwq2qCi5SCuGy2+oh0rCbrPhyZjYJ2c10BLxFz/2VnqiVnu8n08xjxshJkMY /71ptrQbdxyIYVYPgexcXxTjbLtFRT0Px1+XP25+EkNP8C8Z3j6XYIoTYJVOLocurg sLZmsI1gfuxrfVusmJdmRpTlhPfI3VE3FK8To+2FNWjKrEXr3FYv1YmnScVJyj4YU0 jq0l85EZ/nK/kQ9nIikwp43Pe0C+bh/uuMx5prJ7iXzXFa09Ht+vlOmk0CJjb0vosZ oa3cIismoDFww== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 2B06468080 for ; Thu, 9 Oct 2025 21:44: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 IybQ_L1WrvDW for ; Thu, 9 Oct 2025 21:44:01 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067841; bh=7pvwGgb6GrKEM+lVy34ENc3BWnnR5jx+NSvBRZBZsCk=; 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=d7OJBBmisRyJVRcpEkix4i3djmeQWZr0VcxlU2E6xqhWSUcSR5IWQWfWHZz32WtBY pOco1KLwq2qCi5SCuGy2+oh0rCbrPhyZjYJ2c10BLxFz/2VnqiVnu8n08xjxshJkMY /71ptrQbdxyIYVYPgexcXxTjbLtFRT0Px1+XP25+EkNP8C8Z3j6XYIoTYJVOLocurg sLZmsI1gfuxrfVusmJdmRpTlhPfI3VE3FK8To+2FNWjKrEXr3FYv1YmnScVJyj4YU0 jq0l85EZ/nK/kQ9nIikwp43Pe0C+bh/uuMx5prJ7iXzXFa09Ht+vlOmk0CJjb0vosZ oa3cIismoDFww== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1652A67FC1 for ; Thu, 9 Oct 2025 21:44:01 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067838; bh=+D8r9iu1cMvB9SAMHWDm3NJCqh9rAY7Fy66+OPefIRs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S+m50dS0jpG2vMum9MhcQgKW2zgnGu2hNZyDq7OaahuW1pIdcCCLSkoNd6VrnI7gg Y1qUwG+9YpacXIpCQm96Vk0JsPg07wuGnXvbrcbPBkrVNt20MzZ72/r5r2MIwXkwKb dNOnJpzTXd8fRba8tyhbJxR8DCdUPJ7wDUkwfvmc87N6g4aedwK7SGpzlwbCuwdXW8 Ph6pwH+51OJ1wGRM++hE7ndd1uI+rsL1D/hVGMu1rPhS+klKyCZFOIiYKuNkjfJ5rp ngauxyJlsqk0mtPF7IlCuTI/2monDqCz2sv7uyYmwV0m1+29xekBfXi0QZlQmEhEus wzKBCuk7ufUQw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7CE4F68044; Thu, 9 Oct 2025 21:43:58 -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 70ZgW-o2uVAh; Thu, 9 Oct 2025 21:43:58 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067835; bh=OWaFVbY+agnTgXYDa88QqpbL2RemK5IebNd2JbEPyPY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qM/SkUgHm6PCE2l6niq0AI5RhmkFA44ZPcjHsh+XjKOXZESvqX/byn6U95j/vOcic 33+gwM3JRjSBYkluvNtOVy82hYVIMAWu2hWigmjA5ipDxmgsrqxGHKqcHLDAy2ugCY 93uQ5FGbBV9GPH9fjSO9GX47DJWE1rR1sgmw6NW8ecOwt0282nJyRzITC75bh4zSvw bCQindDoIoJrsnSUM0AFfdH5y5ugPE9wwtZBU4UiDfYMKz4g1BnNdjfat1eXY38y88 iThflbeJ856CFmU3pGBLJ3zQcxZx5B7omSOAwHGCJFGKUyYxhcKOYL7blw3lBhywEx vQqit7Qfn6fpQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id E153E67FC1; Thu, 9 Oct 2025 21:43:54 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 9 Oct 2025 21:42:40 -0600 Message-ID: <20251010034255.1099728-13-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251010034255.1099728-1-sjg@u-boot.org> References: <20251010034255.1099728-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: VF3CRQ3YNUY6TVUENTZV3KOXXRBZWJ26 X-Message-ID-Hash: VF3CRQ3YNUY6TVUENTZV3KOXXRBZWJ26 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 X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 12/18] expo: Support clicking on any type of object 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 sometimes useful to be able to click on an image (sometimes called an icon). Allow this within expo and return new click action. Signed-off-by: Simon Glass --- boot/bootflow_menu.c | 1 + boot/cedit.c | 3 +++ boot/scene.c | 14 +++++++++++--- include/expo.h | 2 ++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/boot/bootflow_menu.c b/boot/bootflow_menu.c index 3365b5c3b06..bbc9a189c98 100644 --- a/boot/bootflow_menu.c +++ b/boot/bootflow_menu.c @@ -313,6 +313,7 @@ int bootflow_menu_poll(struct expo *exp, int *seqp) } case EXPOACT_QUIT: return -EPIPE; + case EXPOACT_CLICK: default: return -EAGAIN; } diff --git a/boot/cedit.c b/boot/cedit.c index 691780512ca..70a0c22fe68 100644 --- a/boot/cedit.c +++ b/boot/cedit.c @@ -220,6 +220,9 @@ int cedit_do_action(struct expo *exp, struct scene *scn, log_debug("quitting\n"); exp->done = true; break; + case EXPOACT_CLICK: + /* not supported by cedit */ + break; } return 0; diff --git a/boot/scene.c b/boot/scene.c index 4cf1b6d5852..dd13b74b4d7 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -1167,9 +1167,11 @@ bool scene_obj_within(const struct scene *scn, struct scene_obj *obj, int x, switch (obj->type) { case SCENEOBJT_NONE: + break; case SCENEOBJT_IMAGE: case SCENEOBJT_TEXT: case SCENEOBJT_BOX: + within = is_within(obj, x, y); break; case SCENEOBJT_MENU: { struct scene_obj_menu *menu; @@ -1344,15 +1346,21 @@ int scene_send_click(struct scene *scn, int x, int y, struct expo_action *event) obj = scene_find_obj_within(scn, x, y, false, false); log_debug("non-popup obj %d '%s'\n", obj ? obj->id : -1, obj ? obj->name : "(none)"); - if (!obj) - return 0; + if (!obj) { + obj = scene_find_obj_within(scn, x, y, true, true); + log_debug("non-popup any obj %d '%s'\n", obj ? obj->id : -1, + obj ? obj->name : "(none)"); + if (!obj) + return 0; + } switch (obj->type) { case SCENEOBJT_NONE: case SCENEOBJT_IMAGE: case SCENEOBJT_TEXT: case SCENEOBJT_BOX: - /* These objects don't handle clicks directly */ + event->type = EXPOACT_CLICK; + event->select.id = obj->id; break; case SCENEOBJT_MENU: { struct scene_obj_menu *menu; diff --git a/include/expo.h b/include/expo.h index 619af627840..05f61cc9bd9 100644 --- a/include/expo.h +++ b/include/expo.h @@ -56,6 +56,7 @@ enum expo_id_t { * @EXPOACT_REPOINT_OPEN: menu closed, another menu opened (@prev_id indicates * the menu closed, @id indicates menu opened) * @EXPOACT_QUIT: request to exit the menu + * @EXPOACT_CLICK: click on an object */ enum expoact_type { EXPOACT_NONE, @@ -68,6 +69,7 @@ enum expoact_type { EXPOACT_POINT_CLOSE, EXPOACT_REPOINT_OPEN, EXPOACT_QUIT, + EXPOACT_CLICK, }; /** From patchwork Fri Oct 10 03:42:41 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 579 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=1760067843; bh=fOAdd28OvV1dfGFofOVF6h27LdAMwMfwqOlWLTDDUBc=; 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=EU/PZ/YkVj1Yr6M0tQicp4WjAgbL/OwV2c1ONlP0fLbuxo0g1bbH4xlyvoIk3NshK w0Ofk0jMzXvJ3boxPjDyDwLm7NcMWNxiVWHi0UvOKhYQVdPRJTQq8FhjEoBcWsdMb4 FNXAzWSmdbeArjCJ8MLFuwXoEl2iIj49OYm2pGocoKRljm8Fg83VTbQSHyWy/S0eKH Stem2A2jsWaxDSc07KNAzEsJ+BIlbGe90ma9Jxwjzf/V8VaVfP3KAXidk6zuUH+/Ro lt4KydUDsuAyMMVqk+bvnPbrHvQvhM9XXaDRKNR0cGV9FbSV2n9IkxzAlZnSwFz0Cn TtJvp1JnYzbgQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A3B2468080 for ; Thu, 9 Oct 2025 21:44:03 -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 VlQsZfbOtmyZ for ; Thu, 9 Oct 2025 21:44:03 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067841; bh=fOAdd28OvV1dfGFofOVF6h27LdAMwMfwqOlWLTDDUBc=; 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=KtYjZLXxTxj30nJR3rk4M7Y1/09ZIiac96iAaePNV3NDecBthIrRo7TXmTIBd3Gbz trHkaaBPf6xz3ldLKUxB1FXD0qs0n/cdmB/n6O2Vm/cGNsGndk3K0oQc2KlAM/6ZW1 PowzVUwZswWvrmk6kI/3LWkS4fucSompd4QUR78z8Ex8KV8w/5F3QlPpOvG2JybicL K3gKsfKNcWAR11AWCAIcCFKeIFJZMPHl1fmYMRSaKhRtuzTqGY3zDD4MAV8gHLfawi Vkj3JeOi99WwgtakSfXo8uyexLERXpyvXJggZHalqCjCJQnUgaDwZYIPblVYC+4lvI 2ZQOQEpdb9HNQ== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A800568087 for ; Thu, 9 Oct 2025 21:44:01 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067838; bh=/9FUjEkLHEjR4/Y3Ew4okXAfdSJ7wIAee+1/woQs8Ro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jVIopNU6xtPJhvNAH/GHddp3G1H7qyeIFWFl2I8ZqtJ1g0r7s1VP+R6QG0ej8DMEc /qErgPcc/vUBoVEDxzBCrMdNje1kTmvlmOm8TbYo5wQ37+Le58dGubcdY0hl0YSnyK zntPFRhJ/m/gc3B/mRiIpHhBQMcu+OmVhh9piXUpCYMhxzI+JiviSs4r2bim5hRojE Z7OcWU4v9ZQXO4pAiI23guJRenMdhBTcgtPZGo9dikuoYjZAn/1Wnk1sUFfWHfBkZn xiIlmK/emvtLsYp7UaD9A6Rz7LJD5aouhfP9OLqSjWqkCW/MabkKeGH4Qp/6flczA2 XKx/QsI0uoZAg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7EACC68083; Thu, 9 Oct 2025 21:43:58 -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 waLCYN6hG478; Thu, 9 Oct 2025 21:43:58 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067837; bh=cFGYnW3/EJV21sBq1y7YlLfIUNrYud7Vsi9z1dNu6Aw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CF/ba8L6r0hKQwSLWkLbJUv1g/KuWOMjMiOyrxvOPwdneiMY71BUiRLexuRxv9Szv UbtaZ29J9GJtgM+z4n+gb0Dl6QZd9uMfKqzIsvl4iS1UMPyBa/GNO/1EtJ1cufZALg Gz1IGB/gBaMZIjohtntXZiI7ByfA6no+PNyIfW2bNi1DsMyz2r+U+RJA4oFg4LVpA8 ThFj9vpJhBKh3KBBxvp5yJX4v1SruWUXPcey0gFnVEWMkcOVYSeCjkogDq3tatJae2 HlSgiu49hfxCPGtidk1gKIN4pFTvyVSJ/ve/0Bqo8Rec3XFJKbMjhhJB2jRdvBRja6 gccWrVnFsVS5A== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 522BE67FF2; Thu, 9 Oct 2025 21:43:57 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 9 Oct 2025 21:42:41 -0600 Message-ID: <20251010034255.1099728-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251010034255.1099728-1-sjg@u-boot.org> References: <20251010034255.1099728-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: MDVRIRZE2M7FPVMPEWGIDEVJRCWCXBJT X-Message-ID-Hash: MDVRIRZE2M7FPVMPEWGIDEVJRCWCXBJT 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 X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 13/18] expo: Add another logo in the bootmenu 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 In some cases we want to show a logo other than the U-Boot one. Add a field for this, so it can be used by layouts which need it. Signed-off-by: Simon Glass --- boot/bootflow_internal.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/boot/bootflow_internal.h b/boot/bootflow_internal.h index 0b17a23bfd7..b488ecc6102 100644 --- a/boot/bootflow_internal.h +++ b/boot/bootflow_internal.h @@ -12,6 +12,8 @@ /** * enum boomenu_id_t - expo IDs for elements of the bootflow menu * + * @OBJ_OTHER_LOGO: Second logo (separate from the U-Boot logo) + * * The ranges below are as follows: * * @ITEM: Menu items @@ -44,6 +46,7 @@ enum boomenu_id_t { OBJ_MENU_TITLE, OBJ_POINTER, OBJ_AUTOBOOT, + OBJ_OTHER_LOGO, /* strings for menu items */ STR_LABEL = 100, From patchwork Fri Oct 10 03:42:42 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 581 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=1760067848; bh=ZK+3Y/M6EK8uQnVS3sDXRuuz/xzQ4EB/VieMhpKQT6s=; 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=MhaZIzmdpKPi9QOD92Yr0Ae7t+a4ZGz1wlf4llX6B09gSXI60iAw9XzSD3VzoAeLB 7ozI+4rNRsxN7j6XSsV+RvRNR6IZ2He9E5l/sTMwhlRSyH4feAYZ7kA+r3Mk2rMVMZ HOKvnxKGGiX47g7YnK9rGb+TjOrRquEQqrujZCtzYKe6vvLDmenIGeYRrtbGxAH7jJ eMNhag4TjGyhuRagRaBz49xR0ibk1R4HbVe2HmyzDeKA0vHtxYXFZtcEyq6a+Vmh+B SJRqewLhZC/tP5Ctg5JFvIrY8xgjOTWmPI8kWG5rbcdY8YoCGmMce3Y2/CS7o5MQaB U8SPEvvbDMV3g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 4D04668087 for ; Thu, 9 Oct 2025 21:44: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 10024) with ESMTP id 5NBhzXj8YUcJ for ; Thu, 9 Oct 2025 21:44:08 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067848; bh=ZK+3Y/M6EK8uQnVS3sDXRuuz/xzQ4EB/VieMhpKQT6s=; 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=MhaZIzmdpKPi9QOD92Yr0Ae7t+a4ZGz1wlf4llX6B09gSXI60iAw9XzSD3VzoAeLB 7ozI+4rNRsxN7j6XSsV+RvRNR6IZ2He9E5l/sTMwhlRSyH4feAYZ7kA+r3Mk2rMVMZ HOKvnxKGGiX47g7YnK9rGb+TjOrRquEQqrujZCtzYKe6vvLDmenIGeYRrtbGxAH7jJ eMNhag4TjGyhuRagRaBz49xR0ibk1R4HbVe2HmyzDeKA0vHtxYXFZtcEyq6a+Vmh+B SJRqewLhZC/tP5Ctg5JFvIrY8xgjOTWmPI8kWG5rbcdY8YoCGmMce3Y2/CS7o5MQaB U8SPEvvbDMV3g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3317B67FE9 for ; Thu, 9 Oct 2025 21:44:08 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067845; bh=qXRoEYxv1pOf67j56tXy+cQdrL+D62GDF6kkBwfRlh0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PQzxiNyNua9XdP/4vGq5awz8wMbz9Ve+PMXxzgKAga/0I+3QZ+GppVkIkLwOpiKPx 8afxhsnTo3bRaHZsNX3GI9dmIEYqenIwtJy9Rjbnf/L/5whhpRlVN1pTn95qLNYxM1 D80EsD75mLcXgbi7NQRGFAKO+qZwvXEpElfB2o/KxD7EgOZB/xXC8oFh+iWUpk9JgO 54xkMmXAwyhrMsH1Lj2Y7niMJfKWRPJbKfEoF/HAycRNuKFHQsFQK76IPAlYvduI2z dG4UGcAf7rPtqGAA5lR7+sOrrNHbWHbjOW+Vw2rhVCU4efHxx5lYKfrkhq0Njg0wNo /FaBnHQqBaxgg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EE0A868080; Thu, 9 Oct 2025 21:44: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 10026) with ESMTP id kzXDILGxu4e9; Thu, 9 Oct 2025 21:44:05 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067838; bh=naoXEBwBTXXedPdlfEXqOCyrMh352v9EBq3Bj4/LWWM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jWTbprKAkCALzxR6bxeDYKQVZx2kSpA0fYTLkVZTHC+tOfEviPfZEdAL9luy8Y5al KdTzHtBro2Ywk5O4K6ThaGaBmTgrqi+vzy+GI/RorMpLpnIAWSVG5emNnXvUJDXDSG BOYA1MIHpYmbZeO3t5K5Jl1xhqQYYb7m+fj31n+vEYWph/uJbptwR/eiEk4C3hMrCz AqHR7EmdeVmhnUKSTv9e22HJ+Z0KHKJVoLIWIILozmoKzxDvcZWUBO4go3E5bekWVz Wk+RC+CrFBnjUC5J7qskDRPf480xUMj0kIa327XfWwXYejIsgoBcjk4ru0hQhg0elW xWiVRxspW3oFg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 2260867F7F; Thu, 9 Oct 2025 21:43:58 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 9 Oct 2025 21:42:42 -0600 Message-ID: <20251010034255.1099728-15-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251010034255.1099728-1-sjg@u-boot.org> References: <20251010034255.1099728-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: RLXREXB2N5U5HIISVO22NYILLP3PT6AE X-Message-ID-Hash: RLXREXB2N5U5HIISVO22NYILLP3PT6AE 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 X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 14/18] expo: Add a way to select settings 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 In some cases it is useful to provide a settings scene, or perhaps just a button to change the layout. Add support for this. Signed-off-by: Simon Glass --- boot/bootflow_internal.h | 2 ++ boot/bootflow_menu.c | 2 ++ boot/cedit.c | 1 + boot/scene_menu.c | 3 +++ include/bootflow.h | 3 ++- include/expo.h | 2 ++ 6 files changed, 12 insertions(+), 1 deletion(-) diff --git a/boot/bootflow_internal.h b/boot/bootflow_internal.h index b488ecc6102..0ae5b330bd4 100644 --- a/boot/bootflow_internal.h +++ b/boot/bootflow_internal.h @@ -13,6 +13,7 @@ * enum boomenu_id_t - expo IDs for elements of the bootflow menu * * @OBJ_OTHER_LOGO: Second logo (separate from the U-Boot logo) + * @OBJ_SETTINGS: Select settings / change layout * * The ranges below are as follows: * @@ -47,6 +48,7 @@ enum boomenu_id_t { OBJ_POINTER, OBJ_AUTOBOOT, OBJ_OTHER_LOGO, + OBJ_SETTINGS, /* strings for menu items */ STR_LABEL = 100, diff --git a/boot/bootflow_menu.c b/boot/bootflow_menu.c index bbc9a189c98..1f24215f392 100644 --- a/boot/bootflow_menu.c +++ b/boot/bootflow_menu.c @@ -314,6 +314,8 @@ int bootflow_menu_poll(struct expo *exp, int *seqp) case EXPOACT_QUIT: return -EPIPE; case EXPOACT_CLICK: + if (act.select.id == OBJ_SETTINGS) + return -ECOMM; /* layout change request */ default: return -EAGAIN; } diff --git a/boot/cedit.c b/boot/cedit.c index 70a0c22fe68..c82519a0eb3 100644 --- a/boot/cedit.c +++ b/boot/cedit.c @@ -221,6 +221,7 @@ int cedit_do_action(struct expo *exp, struct scene *scn, exp->done = true; break; case EXPOACT_CLICK: + case EXPOACT_SETTINGS: /* not supported by cedit */ break; } diff --git a/boot/scene_menu.c b/boot/scene_menu.c index d54b99979e1..f52d561094b 100644 --- a/boot/scene_menu.c +++ b/boot/scene_menu.c @@ -485,6 +485,9 @@ int scene_menu_send_key(struct scene *scn, struct scene_obj_menu *menu, int key, log_debug("menu quit\n"); } break; + case ' ': + event->type = EXPOACT_SETTINGS; + break; case '0'...'9': key_item = scene_menu_find_key(scn, menu, key); if (key_item) { diff --git a/include/bootflow.h b/include/bootflow.h index 351a6539978..17ecc80c2eb 100644 --- a/include/bootflow.h +++ b/include/bootflow.h @@ -743,7 +743,8 @@ int bootflow_menu_start(struct bootstd_priv *std, bool text_mode, * Return: 0 if a bootflow was chosen, -EAGAIN if nothing is chosen yet, -EPIPE * if the user quit, -EREMCHG if the expo needs refreshing, -ERESTART if * the user tried to move to a new selection but was unable (e.g. already - * at the top and tried to move up) + * at the top and tried to move up), -ECOMM if the user requests settings + * to be opened */ int bootflow_menu_poll(struct expo *exp, int *seqp); diff --git a/include/expo.h b/include/expo.h index 05f61cc9bd9..aa8e41af176 100644 --- a/include/expo.h +++ b/include/expo.h @@ -57,6 +57,7 @@ enum expo_id_t { * the menu closed, @id indicates menu opened) * @EXPOACT_QUIT: request to exit the menu * @EXPOACT_CLICK: click on an object + * @EXPOACT_SETTINGS: select menu settings */ enum expoact_type { EXPOACT_NONE, @@ -70,6 +71,7 @@ enum expoact_type { EXPOACT_REPOINT_OPEN, EXPOACT_QUIT, EXPOACT_CLICK, + EXPOACT_SETTINGS, }; /** From patchwork Fri Oct 10 03:42:43 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 580 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=1760067847; bh=TEqX39wy2QObWVJNCCZbNXEIUjEfVBZZ5IV950nNTaI=; 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=TxCdxLFftnCvmj23h0vs1Ph/YHrQw7FZ5Tst97r/9c025smztHMN/5yJGSfTBy74t Uhfn5za7tB6IU0odubvfUDplJC7WMwdkxA9CirLd5kWOZBPZrhKsiL7mPAdDEx8v4V U5Pf/Gw4j2ZuGa+utaWdfmSvNjh7I/JgpKbgvCN2mCnojS6PRrY5VJWqrAK8+NCihk l+WeGw0uLir6aLH5a5L8QcB6AxxNDkTyRIYioOzSFhlhkjw7rJxs3h6zNQJci2ndlc d0Pqz0ODsNWUy1MOWCYAXOJBQRR5qgODevcRx5gh+8HbIp53D7kEC0F45DIeOe1yp1 mMiSw1QvBvYgg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 26A9867F7F for ; Thu, 9 Oct 2025 21:44:07 -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 7SObT_prmMek for ; Thu, 9 Oct 2025 21:44:07 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067847; bh=TEqX39wy2QObWVJNCCZbNXEIUjEfVBZZ5IV950nNTaI=; 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=TxCdxLFftnCvmj23h0vs1Ph/YHrQw7FZ5Tst97r/9c025smztHMN/5yJGSfTBy74t Uhfn5za7tB6IU0odubvfUDplJC7WMwdkxA9CirLd5kWOZBPZrhKsiL7mPAdDEx8v4V U5Pf/Gw4j2ZuGa+utaWdfmSvNjh7I/JgpKbgvCN2mCnojS6PRrY5VJWqrAK8+NCihk l+WeGw0uLir6aLH5a5L8QcB6AxxNDkTyRIYioOzSFhlhkjw7rJxs3h6zNQJci2ndlc d0Pqz0ODsNWUy1MOWCYAXOJBQRR5qgODevcRx5gh+8HbIp53D7kEC0F45DIeOe1yp1 mMiSw1QvBvYgg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1511B68030 for ; Thu, 9 Oct 2025 21:44:07 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067845; bh=m2lwIuEzBlnO/I52AEIC3Iw8GxCQMeTPEgB2WOs0u4A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LVphiF+2szAiUflbaGbBeqBlMrIzsLmz/u7r0HvI8K47uvacQjNhx45Hy6OHzQcu2 AZbkbt80cXpSyo+UvRywtTUKm+TY2i66nokipK48JHLDV1nce63lr6xPJyKrLGK5gW 2MqqJBTG9qS7HeLtcg1iuJGTdXU0FroC4i3zF1f2Co8naloAUEM6ECGrWrSQLGahB3 P9iVZuHMyDEGr9x9v3QRmFrS+wf8ZPxDGmuLRiLCL0jGyXvffHIky5qCn8zL6XinQ+ EvK2O1Xlava4osO7Y00VPrqY7ztTldyL9U8VylCcKTIgLPtnz5Ivgk6fsL+aVMkpDf fSHTrMKe3GyRw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id EE09767FF2; Thu, 9 Oct 2025 21:44: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 10026) with ESMTP id eRQ9g9wtJNXY; Thu, 9 Oct 2025 21:44:05 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067843; bh=SSWodraftyUgTd7nsOSKOZ0RPtt8CogeleF+voCSbK4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jyqC7EhRtBxxzUsZuNqIAQvQKE4aqJUlfZyPDOvY8enrcSDzskxVu8sJNvw9m/kaI 6JDd9kM1fQahH4Qll+7kskvwwfq+FWw/82hDAEz/nZhRxJw316OxghUF7ugzzc6sSv Ps+kknq4rVhOJ1jymPWBYnLwhAa7Xj8hQlnBAWOMRv7Ypd6u2VjUMYh19w5qP4eJ7/ h3553EHEBZBKVnIchxCGSPNOpUQ0ejIFFgVtKph40h0Id+rHiwqaIr6jFp5GLEbQdC 84Mtj/VLVaL3YM9j3n58vFbo2eWM/XPYxeGMnN2r6vMK92XBOe71pyUpbM3Cr1NqPf 6h6v2dsPwS9JQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id CECE768030; Thu, 9 Oct 2025 21:44:02 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 9 Oct 2025 21:42:43 -0600 Message-ID: <20251010034255.1099728-16-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251010034255.1099728-1-sjg@u-boot.org> References: <20251010034255.1099728-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: UWTT32A7IRXH272GKS3WJ6VJXJ4XNBYE X-Message-ID-Hash: UWTT32A7IRXH272GKS3WJ6VJXJ4XNBYE 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 X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 15/18] expo: Add a help button 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 definition for a button which displays help. For now this is not used in the standard layout. Signed-off-by: Simon Glass --- boot/bootflow_internal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boot/bootflow_internal.h b/boot/bootflow_internal.h index 0ae5b330bd4..ae7bb16ce8d 100644 --- a/boot/bootflow_internal.h +++ b/boot/bootflow_internal.h @@ -14,6 +14,7 @@ * * @OBJ_OTHER_LOGO: Second logo (separate from the U-Boot logo) * @OBJ_SETTINGS: Select settings / change layout + * @OBJ_HELP: Select help * * The ranges below are as follows: * @@ -49,6 +50,7 @@ enum boomenu_id_t { OBJ_AUTOBOOT, OBJ_OTHER_LOGO, OBJ_SETTINGS, + OBJ_HELP, /* strings for menu items */ STR_LABEL = 100, From patchwork Fri Oct 10 03:42: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: 583 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=1760067855; bh=KCfSpsWpiIXPjmie63MlVdVWiNdQ9/wWLA+NnpoC+oU=; 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=CDEftN2JxAhc1sulMeIFa7xQgn9uwnfPWr2HrasB/2mgMyc8RYXXMOSjyH5sbEmG5 wABcxkcbieILYbQSz2k+Z/dWTAR146UoCHjg98vUjIV6wGUtuwe8g5tLSvfsvdX9Ab G2ow2mCJINDVr5TKzf1QfKZkPkgOiuX7eBpx5V3ZLbnIImyDUtlqEu8s0KEOapXLGr DmWYUrJ7385hC5dATRH31lfbtKkkNw8m/wDMvdZuxa6TneyjT5ASWEewJeLgdh4oH1 2PT/zjFZ5zR/gsuf646+Rr4kmWliRlogfRija4DN6RPUnNI+Epx2INiOW8caAXxEgM Q6I9EmJK7pGLg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 062A067F7F for ; Thu, 9 Oct 2025 21:44: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 SRP9u2z-voUi for ; Thu, 9 Oct 2025 21:44:14 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067853; bh=KCfSpsWpiIXPjmie63MlVdVWiNdQ9/wWLA+NnpoC+oU=; 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=lQliB75HZO0X5SHV+DD7DeT8hwRVtLkp4bRJy3ujn6ucJtnR5qWQ9iIB1guV/T+ER I1sNjo1caAeQV0dfDPPsadCm2ayMSyD+ijKz/HZzotzRWxOUdcd7EtQxJl+Q+cS7W7 yTSM14dNeOcixgF4+s2KlV0afZBSAXCyLCX+Ml7arIo1TD1BvR4A8xYB8WOqv+kD47 BV8t7Jq5K4yR8zoUwDMldJXtb7zCgTvrWDY9QdAMbAWbYj6NraHb8t1TSsUm35QMxx jv854ZDCz026DOAYv8bzzOkrEjw4h4plE9xwejiqZX72wQCdzTOaZw+orAX6i8F+tC Dxw88aMEuZFeg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5F5FD6807B for ; Thu, 9 Oct 2025 21:44:13 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067850; bh=slMtUI9VsNIgiYSrziLOD7KUQlA6EYlCHwIFP819Ric=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SUjSTCYQkkdMKcnkLAAvS9JfIRu9Hgo2S2Gi2JNHc4DN0xYWb8riPAFwodl8zjshi zXEnpyBOU7/FB7RaN6LXbf0FFO8AR63F8bydxDbyNySE+WKAGCyGcayI4XWoKJj+W1 q+ovI26HzX1yoNCzMRaxD9Ovbn5fu/m2XZE6nM4uuGgXoIWZeUOr8fSTPxHm4gpe3P pc3e0L746PSx3N7xCRfnh1jt4SnVwf1HCsXSuYJ3IXTy/FYCXptjQbx2cEZYSfLi61 z48SE87X3HCjvVSeGHHr53Zrc67dO5zwfR1CTKBbhvlmr3EBCB6QQY7wORANjW2jay gcwSLd0le4ltQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 97A7568082; Thu, 9 Oct 2025 21:44: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 10026) with ESMTP id M5UgZZ2bxEz5; Thu, 9 Oct 2025 21:44:10 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067845; bh=hjKpVjKLbObeoCs7ejXt1c9qyI+Sl9/Svl9i4USMsTw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JI6I719IpKtbl8OnqQ6N+j2z6odhllh4RLUzhjr02gZIwgN93nlXhlT2cWUKURJFs h78S0uYHnfRDLx8dXkbcGuRmRtcG5F3WDzbHhv1YnVQj/UYTWMhv34MpxOzG/H1UT7 w46du7uzxBw9uuAODzL6wV6G4H2b/hhZsS48actYl5jdjo6B44rmPtydPWvEXyVVle qZV4xQwoaqewd2Pz21/dVfOOM8dvukbAGgzpMHF6p23sP3kmjfnxvPZeFYjFAzgoAW TaE+uZ/S9ncuPfDmisPP0B965EA9RKXEUAlK1YPZ6lpMLVstF9d8JC8oVBQZ1WRw/W 3P0jmeOAS+m+A== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id B405267FC1; Thu, 9 Oct 2025 21:44:04 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 9 Oct 2025 21:42:44 -0600 Message-ID: <20251010034255.1099728-17-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251010034255.1099728-1-sjg@u-boot.org> References: <20251010034255.1099728-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 5BM4LOSYZBBOUT57WPTNEEBPOL5RKNHV X-Message-ID-Hash: 5BM4LOSYZBBOUT57WPTNEEBPOL5RKNHV 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 X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 16/18] expo: Add a way to display the distro version-name 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 Some distros have a name in addition to the version. Add an object for that in case it is needed. Move the existing objects down to make room. Add a definition for a button which displays help. For now this is not used in the standard layout. Signed-off-by: Simon Glass --- boot/bootflow_internal.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/boot/bootflow_internal.h b/boot/bootflow_internal.h index ae7bb16ce8d..8731e9950fd 100644 --- a/boot/bootflow_internal.h +++ b/boot/bootflow_internal.h @@ -23,6 +23,7 @@ * @ITEM_DESC: Longer description or pretty name, e.g. "Ubuntu 2024.04 LTS" * @ITEM_KEY: Keypress to select this item, e.g. "1" * @ITEM_PREVIEW: Preview image for the OS + * @ITEM_VERSION_NAME: Distro's name for the version, e.g. 'Noble Numbat' */ enum boomenu_id_t { START, @@ -56,13 +57,15 @@ enum boomenu_id_t { STR_LABEL = 100, STR_DESC = 200, STR_KEY = 300, + STR_VERSION_NAME = 400, /* menu items / components (bootflow number is added to these) */ - ITEM = 400, - ITEM_LABEL = 500, - ITEM_DESC = 600, - ITEM_KEY = 700, - ITEM_PREVIEW = 800, + ITEM = 600, + ITEM_LABEL = 700, + ITEM_DESC = 800, + ITEM_KEY = 900, + ITEM_PREVIEW = 1000, + ITEM_VERSION_NAME = 1100, /* left margin for the main menu */ MARGIN_LEFT = 100, From patchwork Fri Oct 10 03:42:45 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 582 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=1760067852; bh=L4512rUdmbbcgHYfJg4qXq/UTJWMBy2GG/8rEWZBa0g=; 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=tomGUOtqqL4nv9UTFjwpiNVNvGop9lH6BCZlTobqa9gkQjCn/RYP9JZ19OJGxtSIM XohC3Bu3LuzDfJyDWkfbDAly/gR4pPVqKDH44Uup6ClUkGoqRnw2M59WTlK06ER2vy NXOCP91TNEi87lChe1dfcpUoY7LLx8B3/uzKmq+EhOB+HLIzvVmLfcMUjPLmhhKUcs dr6gy9gpZwNW9cKQONx0b5mm3J3MxSzGTxPrnm/Mzp8gmsd8vomaMsUykqLnEOUVSf 8tNJhKans/YK12HhFrc+ar4pC4ab9DKNOo3tlr6SuGul1p4gdaN2+C1kyyUuBrIrAs weWQ/sON/inZw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A378668083 for ; Thu, 9 Oct 2025 21:44:12 -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 XfprVT9vzaOH for ; Thu, 9 Oct 2025 21:44:12 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067852; bh=L4512rUdmbbcgHYfJg4qXq/UTJWMBy2GG/8rEWZBa0g=; 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=tomGUOtqqL4nv9UTFjwpiNVNvGop9lH6BCZlTobqa9gkQjCn/RYP9JZ19OJGxtSIM XohC3Bu3LuzDfJyDWkfbDAly/gR4pPVqKDH44Uup6ClUkGoqRnw2M59WTlK06ER2vy NXOCP91TNEi87lChe1dfcpUoY7LLx8B3/uzKmq+EhOB+HLIzvVmLfcMUjPLmhhKUcs dr6gy9gpZwNW9cKQONx0b5mm3J3MxSzGTxPrnm/Mzp8gmsd8vomaMsUykqLnEOUVSf 8tNJhKans/YK12HhFrc+ar4pC4ab9DKNOo3tlr6SuGul1p4gdaN2+C1kyyUuBrIrAs weWQ/sON/inZw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 9363C6807B for ; Thu, 9 Oct 2025 21:44:12 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067850; bh=rPVOnWp72H3WGPoYgg8sU3ny2kITGQeLGMot2SE9avY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bnE0WENS0ftLOfp4qOVUz5F72Dle/AEnTxFQJFcIMDQsfc7uIxeZuLgE8VyZPtZHB CoMtjYVorxLZMbqYnPG7T/Q4/0nKruO6wDerEzFIITIca1ZxQMpXjeAmrHNoD7trwg llw62Tr2+xJU51/3hmMdgyF4myMmHWaXQBMGsIL2h1r+lmpSmr2Zzk+VZdSF9wDTKw TjvzvOhisf1+XykLZbW66D7sOaO1y7of7NbNXVzvpCHi6XKRf8xgNYZMSs4rdQSEwM 78xyTDfflDuLLO09+bt5EmMQPS/kdYyJ1WrivRhzyqmRdUwRRsvJr2PNucSdLY6ypK 2v8buLm07VbBA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 97A2D68030; Thu, 9 Oct 2025 21:44: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 10026) with ESMTP id he49Jmjv4Ios; Thu, 9 Oct 2025 21:44:10 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067849; bh=32jGJNwiAz1f3g5H0eAElHBZEsj2F/nubxKCc7EPrdE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TZdgrj8i/2kL367ssybmOmgq+kLh2vnbaARYiBtxLlwp9PXZL7KXxDrpFMqGmyFb9 TKiTub1AqUXi8sHCciVG6bdyJvac2BT10jZHMkx+ARgxGjtlvuZi3m0o0QUUWwuBYG wCDjCPOjl7ZilT8Sahn4Q6Jb+q8ucCTUxpd+y2BE+7QGqe/3PsNCno+pKOF9k4KoRB zEiyvP3/DG1GAWaWvU14tzTkZoCEvK2P+yh2JXmvGUGn61MEvig4e2dAAT8ocvWOQY lM+qXbQjRsbVTGIo1dI/qkuvDdOm38fFRrzKu0Hp3xo5OgNvbaaEABCV13Um1K/EYY UxKC+/3E3syrQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 4FD1967FED; Thu, 9 Oct 2025 21:44:09 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 9 Oct 2025 21:42:45 -0600 Message-ID: <20251010034255.1099728-18-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251010034255.1099728-1-sjg@u-boot.org> References: <20251010034255.1099728-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: 5U6MFXODIA5N2FEKGF5TV454XHLRUGND X-Message-ID-Hash: 5U6MFXODIA5N2FEKGF5TV454XHLRUGND 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 X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 17/18] expo: Add a box around each item 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 Some layouts show a box around each menu item. Add an item for that. For now this is not used in the standard layout. Signed-off-by: Simon Glass --- boot/bootflow_internal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boot/bootflow_internal.h b/boot/bootflow_internal.h index 8731e9950fd..dc5f587e83e 100644 --- a/boot/bootflow_internal.h +++ b/boot/bootflow_internal.h @@ -24,6 +24,7 @@ * @ITEM_KEY: Keypress to select this item, e.g. "1" * @ITEM_PREVIEW: Preview image for the OS * @ITEM_VERSION_NAME: Distro's name for the version, e.g. 'Noble Numbat' + * @ITEM_BOX: Box around the item (normally hidden) */ enum boomenu_id_t { START, @@ -66,6 +67,7 @@ enum boomenu_id_t { ITEM_KEY = 900, ITEM_PREVIEW = 1000, ITEM_VERSION_NAME = 1100, + ITEM_BOX = 1200, /* left margin for the main menu */ MARGIN_LEFT = 100, From patchwork Fri Oct 10 03:42:46 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 584 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=1760067858; bh=U1QPGyQafpL3vb7Gq7KZl/d5MALBAfavYWxKDminMH0=; 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=eoZOwUR9UZCVwy1KQ4mP6okE/FAR5+37Cxovyit8FEGM2kVL76PyA509938nGXXTk MXvSQT7ESXTrS11+hRBeJfo6KdkGjvHgQBCIuBte3oc4q72dThiX/+Z2UAuEx1LsbS bIMVLlrugJC22iZO5pIhEHa0uOLzoMG7OjIF2AmWlnU31Edq6rS5/HCeFlPMFfqyK5 x9EzMNtLHx9Ygjhzb0iFpnzupR+G0T1wrHzPEta9vIPegs4X0IlcZ5YVtvDkxDA1Cp MP+njKBV/TuQ+pK8nKImi28zzpf/XiPRd4UHN2RSOIBM6vwhj4WcTA2+EL8N3NUQ1D rUxveqOX46ZDg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C9ADA68082 for ; Thu, 9 Oct 2025 21:44:18 -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 bTH7hESbisLE for ; Thu, 9 Oct 2025 21:44:18 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067858; bh=U1QPGyQafpL3vb7Gq7KZl/d5MALBAfavYWxKDminMH0=; 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=eoZOwUR9UZCVwy1KQ4mP6okE/FAR5+37Cxovyit8FEGM2kVL76PyA509938nGXXTk MXvSQT7ESXTrS11+hRBeJfo6KdkGjvHgQBCIuBte3oc4q72dThiX/+Z2UAuEx1LsbS bIMVLlrugJC22iZO5pIhEHa0uOLzoMG7OjIF2AmWlnU31Edq6rS5/HCeFlPMFfqyK5 x9EzMNtLHx9Ygjhzb0iFpnzupR+G0T1wrHzPEta9vIPegs4X0IlcZ5YVtvDkxDA1Cp MP+njKBV/TuQ+pK8nKImi28zzpf/XiPRd4UHN2RSOIBM6vwhj4WcTA2+EL8N3NUQ1D rUxveqOX46ZDg== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B8A6267FF2 for ; Thu, 9 Oct 2025 21:44:18 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067857; bh=ieRNFi8Q5wX/p+z2emsU/Jnckqcz3Y6aaNGJxua/1Sg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ht6UAzkWnAiS+dVQDYZq6jogpwP6xa62ZkEYHEI4/wW7EjzXEcphnMbae4+KBny9j v8x99uN2pNCj3/g7kLceV0ytY3R2gQKveaAbdOHSGimhq6t1HUgaP0pdKLV7yP/7Fu p3QSedWL3eFQXDL7qezcQgxJRhIUBPVFjanD+dCfc9YhI2DoZHH4elq+s1jrDmFSUX yXkOqQSi5PR9UiLSTKx19OgxwwGhwBkfYlbdYpKD0SuF3P/uiGSiRI7n1BIXs2Skum STZhCyl1i7E92QjXkMmiy4QsgSkANtRFI5VGCic67Vo9SHiBXm+B7I26S8+0o8VMmQ 5NlIOViaGD3Dw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3FFFD67F7F; Thu, 9 Oct 2025 21:44:17 -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 tt5lN2jCyCp0; Thu, 9 Oct 2025 21:44:17 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1760067850; bh=YoYa2Vv+hhndSDqOSopfjKmrBrcvQDPUpMNoQPDV4K4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dbsScSXIthpfNjXFi7UxaI+j4WFTOBpa1jwax/WqlzpHwdQ5jcO204lo68VVyEJin 0fTGquyRtnRKRGOh8WBaw3eUZdWAk7Y7z0HWRdXQhmHriXDcPzdVV+pO8RMx2HTVwi sQWfpgqc9ytd0w8/Vo/srMSkIVyhba9BFZdYPAHJISDBmnzXocGKOXb7b+7RlTL/6v IlLTTivgtExBquKNiZSaM7A9XJTLWXNl2DN3tyDgyICSYYYSXCfSRuKbzIIDvh0knJ /EWPXCj8ppNSuJGjkystB74FdWiHtsQ8cgCUpaL+EnM2g2s5TW62k85ocLkrjlcSGN YRehKjpy4vcEA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 20C1D67FF2; Thu, 9 Oct 2025 21:44:10 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Thu, 9 Oct 2025 21:42:46 -0600 Message-ID: <20251010034255.1099728-19-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251010034255.1099728-1-sjg@u-boot.org> References: <20251010034255.1099728-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: BGHDUQ6MDAZKBTTBV4YY4FPAP66BERHP X-Message-ID-Hash: BGHDUQ6MDAZKBTTBV4YY4FPAP66BERHP 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 X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 18/18] expo: Add an image that indicates verification 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 Where an OS is verified by a vendor, add a way to show a suitable symbol to indicate this. Signed-off-by: Simon Glass --- boot/bootflow_internal.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/boot/bootflow_internal.h b/boot/bootflow_internal.h index dc5f587e83e..519c3ee782a 100644 --- a/boot/bootflow_internal.h +++ b/boot/bootflow_internal.h @@ -25,6 +25,7 @@ * @ITEM_PREVIEW: Preview image for the OS * @ITEM_VERSION_NAME: Distro's name for the version, e.g. 'Noble Numbat' * @ITEM_BOX: Box around the item (normally hidden) + * @ITEM_VERIFIED: Indicates that the item is verified by the vendor */ enum boomenu_id_t { START, @@ -68,6 +69,7 @@ enum boomenu_id_t { ITEM_PREVIEW = 1000, ITEM_VERSION_NAME = 1100, ITEM_BOX = 1200, + ITEM_VERIFIED = 1300, /* left margin for the main menu */ MARGIN_LEFT = 100,