Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 77C4DC77B7A for ; Thu, 1 Jun 2023 16:31:38 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E925D865DF; Thu, 1 Jun 2023 18:26:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Vzn8Bx9b"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A873B8631B; Thu, 1 Jun 2023 18:25:24 +0200 (CEST) Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 680AB8638C for ; Thu, 1 Jun 2023 18:25:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x132.google.com with SMTP id e9e14a558f8ab-33bdab7b4caso3595455ab.3 for ; Thu, 01 Jun 2023 09:25:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1685636696; x=1688228696; 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=iZSmc7CwK/GjANpuPpzhxVaHpT2pm4WuXZD/vB56DBQ=; b=Vzn8Bx9bZ4ORAot8/3LgXZHJn9EUZxu4QfwX0V+H+NLUylPmzni12MLSml8yl19FH8 nn0skPPqb97ENy7hFMBfftG7KZMVt+owGW3I9FfdBIiYiIVtYUnHxxpabf1H/PeRofkt LoYYnrluSz7EKS+aJVglu41Qferlwb32H/288= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685636696; x=1688228696; 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=iZSmc7CwK/GjANpuPpzhxVaHpT2pm4WuXZD/vB56DBQ=; b=fPsJNUsdkZ2rzOozZtPKlcgzPVlGv1pkc0zHUmkwCn/8YX6H1H/nfC2nuoDt9GLzXH oGZcw1LfPJJzAMOcPoSstBH/4fzZPdN56rI6aAfohYW0oMuz7Gsw2tx1AHH9MHxXNdro ap23xRWDxrmO+dvTmUvtN/QUgXR0T2z4UKPfMhVUdjeAJA28e75WTVkfC0Yxc8Awa0Wi 1NcRQhccrPv5+IaLbRMr1aHMH7fFQ3sFjy1EmcfMo13UWUpKipXXSIsmXfgLMZhG8oZu FFzFzUs/O0DJYGFYc9Ae6CP55K9MScOfUFcWaCZ25AvSis4N7qZKpRolZ6FOZ5uw5P61 E7yA== X-Gm-Message-State: AC+VfDz1rJUcmDba2vF7jtavTPg5HJqyDP4lSZ7NaKaptEUxFxnH1UJo cxkjUmSkg8DcZTE91asRrVSR3psu1Re7OnLs8Qg= X-Google-Smtp-Source: ACHHUZ6S08/mWQaJMezQDn0PdzAMBiQbfJebMV3AskOc6jNXSFJStzEZpkoywBUt61ePBg/keN2hjQ== X-Received: by 2002:a92:d352:0:b0:329:5a6e:3a18 with SMTP id a18-20020a92d352000000b003295a6e3a18mr4777301ilh.4.1685636696298; Thu, 01 Jun 2023 09:24:56 -0700 (PDT) Received: from sjg1.lan (c-73-14-173-85.hsd1.co.comcast.net. [73.14.173.85]) by smtp.gmail.com with ESMTPSA id l1-20020a922901000000b0033a6e7ee4e3sm3862098ilg.1.2023.06.01.09.24.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 09:24:56 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Tom Rini , Simon Glass Subject: [PATCH 34/40] expo: Draw the current opened menu on top Date: Thu, 1 Jun 2023 10:22:58 -0600 Message-ID: <20230601162404.220488-33-sjg@chromium.org> X-Mailer: git-send-email 2.41.0.rc0.172.g3f132b7071-goog In-Reply-To: <20230601162404.220488-1-sjg@chromium.org> References: <20230601162404.220488-1-sjg@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean When a menu is opened, it must be displayed over all other objects in the scene, so that all its items are visible. Handle this by drawing the menu object a second time, after all other objects have been drawn. Draw all of the objects which are dependent on the menu object. Signed-off-by: Simon Glass --- boot/expo.c | 12 ++++++++++++ boot/scene.c | 31 +++++++++++++++++++++++++++++++ boot/scene_internal.h | 20 ++++++++++++++++++++ boot/scene_menu.c | 17 +++++++++++++++++ 4 files changed, 80 insertions(+) diff --git a/boot/expo.c b/boot/expo.c index d5e935966bfd..e99555163ca4 100644 --- a/boot/expo.c +++ b/boot/expo.c @@ -172,6 +172,18 @@ int expo_set_scene_id(struct expo *exp, uint scene_id) return 0; } +int expo_first_scene_id(struct expo *exp) +{ + struct scene *scn; + + if (list_empty(&exp->scene_head)) + return -ENOENT; + + scn = list_first_entry(&exp->scene_head, struct scene, sibling); + + return scn->id; +} + int expo_render(struct expo *exp) { struct udevice *dev = exp->display; diff --git a/boot/scene.c b/boot/scene.c index fb199ef29538..bc213bc08b87 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -421,6 +421,30 @@ int scene_arrange(struct scene *scn) return 0; } +int scene_render_deps(struct scene *scn, uint id) +{ + struct scene_obj *obj; + int ret; + + if (!id) + return 0; + obj = scene_obj_find(scn, id, SCENEOBJT_NONE); + if (!obj) + return log_msg_ret("obj", -ENOENT); + + if (!(obj->flags & SCENEOF_HIDE)) { + ret = scene_obj_render(obj, false); + if (ret && ret != -ENOTSUPP) + return log_msg_ret("ren", ret); + + if (obj->type == SCENEOBJT_MENU) + scene_menu_render_deps(scn, + (struct scene_obj_menu *)obj); + } + + return 0; +} + int scene_render(struct scene *scn) { struct expo *exp = scn->expo; @@ -435,6 +459,13 @@ int scene_render(struct scene *scn) } } + /* render any highlighted object on top of the others */ + if (scn->highlight_id && !exp->text_mode) { + ret = scene_render_deps(scn, scn->highlight_id); + if (ret && ret != -ENOTSUPP) + return log_msg_ret("dep", ret); + } + return 0; } diff --git a/boot/scene_internal.h b/boot/scene_internal.h index 2544c961dab4..dc98ecd02146 100644 --- a/boot/scene_internal.h +++ b/boot/scene_internal.h @@ -160,6 +160,26 @@ int scene_send_key(struct scene *scn, int key, struct expo_action *event); */ void scene_menu_render(struct scene_obj_menu *menu); +/** + * scene_render_deps() - Render an object and its dependencies + * + * @scn: Scene to render + * @id: Object ID to render (or 0 for none) + * Returns: 0 if OK, -ve on error + */ +int scene_render_deps(struct scene *scn, uint id); + +/** + * scene_menu_render_deps() - Render a menu and its dependencies + * + * Renders the menu and all of its attached objects + * + * @scn: Scene to render + * @menu: Menu render + * Returns: 0 if OK, -ve on error + */ +int scene_menu_render_deps(struct scene *scn, struct scene_obj_menu *menu); + /** * scene_menu_calc_dims() - Calculate the dimensions of a menu * diff --git a/boot/scene_menu.c b/boot/scene_menu.c index 20ded91fb3d6..6aab27611d71 100644 --- a/boot/scene_menu.c +++ b/boot/scene_menu.c @@ -544,3 +544,20 @@ void scene_menu_render(struct scene_obj_menu *menu) vid_priv->colour_fg); vidconsole_pop_colour(cons, &old); } + +int scene_menu_render_deps(struct scene *scn, struct scene_obj_menu *menu) +{ + struct scene_menitem *item; + + scene_render_deps(scn, menu->title_id); + scene_render_deps(scn, menu->cur_item_id); + scene_render_deps(scn, menu->pointer_id); + + list_for_each_entry(item, &menu->item_head, sibling) { + scene_render_deps(scn, item->key_id); + scene_render_deps(scn, item->label_id); + scene_render_deps(scn, item->desc_id); + } + + return 0; +} -- 2.41.0.rc0.172.g3f132b7071-goog