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 62A5AC77B7A for ; Thu, 1 Jun 2023 16:26:30 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B55A986378; Thu, 1 Jun 2023 18:24:54 +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="T0Jd9x6o"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BB23986343; Thu, 1 Jun 2023 18:24:40 +0200 (CEST) Received: from mail-io1-xd2b.google.com (mail-io1-xd2b.google.com [IPv6:2607:f8b0:4864:20::d2b]) (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 B16228633F for ; Thu, 1 Jun 2023 18:24:35 +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-io1-xd2b.google.com with SMTP id ca18e2360f4ac-7770b7c2fa5so2750639f.0 for ; Thu, 01 Jun 2023 09:24:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1685636674; x=1688228674; 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=zCUR+PvwLwWHCGdnY2VqNaxxgHBFRHx4ga1pYR3veNg=; b=T0Jd9x6oz900Zv80Du5PUYqC3+rsTCe4Gb9V24J4fSTOZ2d82s6+mI8QiA6JylRofJ +cW0CdCiNmThWBR+MJ6kNT+2oFoz9DFb7UU50GscXTg0lhfsX4m1txbhnrn0aJ97nsQF wqR6zZuAOGT2i5dD4GJqREGe8F2q+0THTAO1Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685636674; x=1688228674; 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=zCUR+PvwLwWHCGdnY2VqNaxxgHBFRHx4ga1pYR3veNg=; b=WFxvAMioU7kISuwHg8BupMJ7ZMzputK/xMJO56W3XHjvTe/jPhRx8ROTTfVJyw/V8m v61ddsNFW8Hj6CigNJ+FYdkdUnchxKXBLBdf7Aqf5563UC1pGK7gsRrBadhuAgnygOpT i+CMPVaCyX/hRjqQ000vnt8+m4ESbKzz4arzWfCpuNIrFLUpULXb/3QqBz+dYehviAaW Qc9qpgh7ViDIEz0YD7ixoRSf906ATyubWDGs14gY1kpT0yXcOMoH4ClWOOCwITzpBRfg 1jl+adBXE3qmdlpSPHOPcCRGgSD2NFbGO/NGIgIwCVSDq0t6Ffl6cjjvyFNkCYsfqZ0A q0vg== X-Gm-Message-State: AC+VfDyKxSijgn80VyEEneT0VAJpBacdiJxsYtZYcD18/HCyfOn4UUhp cdctD2VZWH+YZLiEChcFdhsWGxY68rPFk1xaLNo= X-Google-Smtp-Source: ACHHUZ5+1VRdnBWtYP8noeRWZLS2YmmYVAiNTcR6Wz6TS5oRcWlTEvE3GUPpEwBZZdwV9CyHyUQKFg== X-Received: by 2002:a92:d352:0:b0:331:5d7c:776d with SMTP id a18-20020a92d352000000b003315d7c776dmr6547322ilh.17.1685636674267; Thu, 01 Jun 2023 09:24:34 -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.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 09:24:34 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Heinrich Schuchardt , Tom Rini , Simon Glass Subject: [PATCH 10/40] expo: Store the console in the expo Date: Thu, 1 Jun 2023 10:22:34 -0600 Message-ID: <20230601162404.220488-9-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 Rather than finding this each time, keep a pointer to it. This simplifies the code a little. Signed-off-by: Simon Glass --- boot/expo.c | 9 +++++++++ boot/scene.c | 10 ++-------- include/expo.h | 2 ++ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/boot/expo.c b/boot/expo.c index 05950a176038..cd1b1a3de50c 100644 --- a/boot/expo.c +++ b/boot/expo.c @@ -83,7 +83,16 @@ const char *expo_get_str(struct expo *exp, uint id) int expo_set_display(struct expo *exp, struct udevice *dev) { + struct udevice *cons; + int ret; + + ret = device_find_first_child_by_uclass(dev, UCLASS_VIDEO_CONSOLE, + &cons); + if (ret) + return log_msg_ret("con", ret); + exp->display = dev; + exp->cons = cons; return 0; } diff --git a/boot/scene.c b/boot/scene.c index d2f77c008cf7..7e9ba047f2d4 100644 --- a/boot/scene.c +++ b/boot/scene.c @@ -278,16 +278,10 @@ static int scene_obj_render(struct scene_obj *obj, bool text_mode) { struct scene *scn = obj->scene; struct expo *exp = scn->expo; - struct udevice *cons, *dev = exp->display; + struct udevice *dev = exp->display; + struct udevice *cons = text_mode ? NULL : exp->cons; int x, y, ret; - cons = NULL; - if (!text_mode) { - ret = device_find_first_child_by_uclass(dev, - UCLASS_VIDEO_CONSOLE, - &cons); - } - x = obj->x; y = obj->y; diff --git a/include/expo.h b/include/expo.h index 8827f4b0b45f..06f5629e03f8 100644 --- a/include/expo.h +++ b/include/expo.h @@ -50,6 +50,7 @@ struct expo_action { * * @name: Name of the expo (allocated) * @display: Display to use (`UCLASS_VIDEO`), or NULL to use text mode + * @cons: Console to use (`UCLASS_VIDEO_CONSOLE`), or NULL to use text mode * @scene_id: Current scene ID (0 if none) * @next_id: Next ID number to use, for automatic allocation * @action: Action selected by user. At present only one is supported, with the @@ -62,6 +63,7 @@ struct expo_action { struct expo { char *name; struct udevice *display; + struct udevice *cons; uint scene_id; uint next_id; struct expo_action action; -- 2.41.0.rc0.172.g3f132b7071-goog