From patchwork Tue Oct 14 11:12: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: 589 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org Authentication-Results: mail.u-boot.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=jsQ8L8gH; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 627DE68112 for ; Tue, 14 Oct 2025 05:13: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 10024) with ESMTP id jmrXFKrn4TUg for ; Tue, 14 Oct 2025 05:13:41 -0600 (MDT) Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id DDC1F680C5 for ; Tue, 14 Oct 2025 05:13:40 -0600 (MDT) Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 3FDE468149 for ; Tue, 14 Oct 2025 05:13: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 J9oO0707npSr for ; Tue, 14 Oct 2025 05:13:37 -0600 (MDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.166.170; helo=mail-il1-f170.google.com; envelope-from=sjg@chromium.org; receiver=u-boot.org Received: from mail-il1-f170.google.com (mail-il1-f170.google.com [209.85.166.170]) by mail.u-boot.org (Postfix) with ESMTPS id AEC9966DD8 for ; Tue, 14 Oct 2025 05:13:31 -0600 (MDT) Received: by mail-il1-f170.google.com with SMTP id e9e14a558f8ab-42f8da689a6so51217285ab.2 for ; Tue, 14 Oct 2025 04:13:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1760440410; x=1761045210; darn=u-boot.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JelhD7NLh6+w1bRzVrl6Bm5Rn7Ir0fPOyxJVbS3oKSQ=; b=jsQ8L8gHklU747l/eb278m8ClAcJZm5eKmtwU04yZ6ViGVP2RKBplX5VQWWR3vlWuy FdTsqs6wnUadAvvlSW1KD/DeRnl4U02VbOfhy5uiowz23anyUSe7Tr9pEH4ya5mlaCis 70rtGdxw9b0gR6m8D3ArnICG/nC60dXY8t0/c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760440410; x=1761045210; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JelhD7NLh6+w1bRzVrl6Bm5Rn7Ir0fPOyxJVbS3oKSQ=; b=VGRMmYPrQmjMCHo3+3jlWsP5XHkMCVevCohXZBJLAbZhxbwX33BR1TzwFeWMFqrzmx Y+hTbgsytvt4I1q1q0U7EPI9ke3Ge1AUNDYjzCJyrXPEmmxqq0+Gzj9BvoVU2SRm69L2 sV3QxafsC3RWGWawTRev8JpjZ4l8hUuZw1z//1ZFHUfMZgQrpuwSFr7y+GnhweAOXy92 +ZYdbTQyOpaYpYKQVvQP3vK/Zxdo7D0qsW4iB/BMFY7VdgmDzJVRkeN+XdAfmlsRrjwA 99iw2lvqH+fnvIr9XW0K743qz0FWumqT+sbiZfN2AAspNxD+Fl9RpL2IxHXqjP53/RL9 XiKw== X-Gm-Message-State: AOJu0Yyg8lEpVuWjwMWleKrbHbnQz1+63hd808evRb2XAVgZjbCN8u7u VNlxObW4yD2l6Y57/QaVYmgrxp2+Srcc9x9w3AanvQumRbTlxPIn++nJ+EJQbzPyedqrVqcrQsW wuRaXIYw47VQ= X-Gm-Gg: ASbGnct437zXdk3D2r/2r89KRRXzz9xavpYB0LMjYAA/e0sQLemcGfm+Tov3gflViQB tl6Ekt6AF7b9/qnKcEfFg4AV1+UeOodKorQiwJdaXja2A3zrTEwxK3JOxuK3nMIUME/xOPNLnaH 3JHZHN3w+JVy4O4NVTZ4273w42ONI4zNo7WAi+Swkx13dqRN7ZEjXFwn6YeMZ59FM1X5HVgonZi BJFUpBC9n7l4O7KjQSlh0xchRMR70VTwI3I7fERLE2q63QsbF40uMs52pW3aM5ZdWKyZ0jTI0hd Ip3ntl2sPyeOk2RQITH+vDwzrUFsNAaETNvj/2sXyw7lTvI1gfD20NEJNdSGd5nyXtSPt8PJK7G byrngTYYnFpZ1sPQKS+LKaQMeYXQihoLj7LvewdwYYssUa9fqcBnPwemF X-Google-Smtp-Source: AGHT+IGfU2ZpP5GUQb2r/asM8dIS/gU3gVSChJ51xhEwRuAK5LoECKroNJMo+bfcetu5zboDXW9N/A== X-Received: by 2002:a05:6e02:1c26:b0:430:9f96:23c8 with SMTP id e9e14a558f8ab-4309f962599mr41422425ab.14.1760440410398; Tue, 14 Oct 2025 04:13:30 -0700 (PDT) Received: from chromium.org ([73.34.74.121]) by smtp.gmail.com with ESMTPSA id e9e14a558f8ab-430a3869174sm4608785ab.15.2025.10.14.04.13.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Oct 2025 04:13:29 -0700 (PDT) From: Simon Glass To: U-Boot Concept Date: Tue, 14 Oct 2025 05:12:42 -0600 Message-ID: <20251014111301.1059317-6-sjg@chromium.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251014111301.1059317-1-sjg@chromium.org> References: <20251014111301.1059317-1-sjg@chromium.org> MIME-Version: 1.0 Message-ID-Hash: THQNMQ7TP4J7IGN5C35WUCYOLYEOAWPV X-Message-ID-Hash: THQNMQ7TP4J7IGN5C35WUCYOLYEOAWPV X-MailFrom: sjg@chromium.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: Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 05/16] expo: Avoid setting SCENEOF_SIZE_VALID with menu items List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: The font size of menu items might change, thus requiring the size to be updated. So it is not correct to mark the items as fixed size. Drop this code. Signed-off-by: Simon Glass --- boot/scene.c | 9 +++++++-- boot/scene_menu.c | 13 +++++++------ include/expo.h | 14 ++++++++++++++ 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/boot/scene.c b/boot/scene.c index 04a5e8a03e2..c2d106738f5 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -316,7 +316,7 @@ int scene_obj_set_size(struct scene *scn, uint id, int w, int h) return 0; } -int scene_obj_set_width(struct scene *scn, uint id, int w) +int scene_obj_set_width_flags(struct scene *scn, uint id, int w, uint flags) { struct scene_obj *obj; @@ -324,11 +324,16 @@ int scene_obj_set_width(struct scene *scn, uint id, int w) if (!obj) return log_msg_ret("find", -ENOENT); obj->req_bbox.x1 = obj->req_bbox.x0 + w; - obj->flags |= SCENEOF_SYNC_WIDTH; + obj->flags |= flags; return 0; } +int scene_obj_set_width(struct scene *scn, uint id, int w) +{ + return scene_obj_set_width_flags(scn, id, w, SCENEOF_SYNC_WIDTH); +} + int scene_obj_set_bbox(struct scene *scn, uint id, int x0, int y0, int x1, int y1) { diff --git a/boot/scene_menu.c b/boot/scene_menu.c index f52d561094b..6aa217ecfab 100644 --- a/boot/scene_menu.c +++ b/boot/scene_menu.c @@ -359,13 +359,14 @@ int scene_menu_arrange(struct scene *scn, struct expo_arrange_info *arr, y += height + theme->menuitem_gap_y; } + /* line up the right size of each set of items */ list_for_each_entry(item, &menu->item_head, sibling) { - scene_obj_set_width(menu->obj.scene, item->label_id, - dims[SCENEBB_label].x); - scene_obj_set_width(menu->obj.scene, item->key_id, - dims[SCENEBB_key].x); - scene_obj_set_width(menu->obj.scene, item->desc_id, - dims[SCENEBB_desc].x); + scene_obj_set_width_flags(menu->obj.scene, item->label_id, + dims[SCENEBB_label].x, 0); + scene_obj_set_width_flags(menu->obj.scene, item->key_id, + dims[SCENEBB_key].x, 0); + scene_obj_set_width_flags(menu->obj.scene, item->desc_id, + dims[SCENEBB_desc].x, 0); } if (sel_id) diff --git a/include/expo.h b/include/expo.h index aa8e41af176..7307c3aef98 100644 --- a/include/expo.h +++ b/include/expo.h @@ -943,6 +943,20 @@ int scene_obj_set_pos(struct scene *scn, uint id, int x, int y); */ int scene_obj_set_size(struct scene *scn, uint id, int w, int h); +/** + * scene_obj_set_width_flags() - Set the width of an object, with flags + * + * The given width is marked as 'requested' and will be applied when the scene + * is next arranged. The object flags are ORed with @flags + * + * @scn: Scene to update + * @id: ID of object to update + * @w: width in pixels + * @flags: Flags to OR with the current flags + * Returns: 0 if OK, -ENOENT if @id is invalid + */ +int scene_obj_set_width_flags(struct scene *scn, uint id, int w, uint flags); + /** * scene_obj_set_width() - Set the width of an object *