From patchwork Tue Oct 14 11:12: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: 588 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=ENVlAxsT; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5BB0E66DD8 for ; Tue, 14 Oct 2025 05:13:38 -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 roSZPE11U9_2 for ; Tue, 14 Oct 2025 05:13:38 -0600 (MDT) Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id A18266813B for ; Tue, 14 Oct 2025 05:13:37 -0600 (MDT) Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8754C6813C for ; Tue, 14 Oct 2025 05:13:34 -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 eb2FxqOCkZ_q for ; Tue, 14 Oct 2025 05:13:33 -0600 (MDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.166.174; helo=mail-il1-f174.google.com; envelope-from=sjg@chromium.org; receiver=u-boot.org Received: from mail-il1-f174.google.com (mail-il1-f174.google.com [209.85.166.174]) by mail.u-boot.org (Postfix) with ESMTPS id 90F5067C83 for ; Tue, 14 Oct 2025 05:13:27 -0600 (MDT) Received: by mail-il1-f174.google.com with SMTP id e9e14a558f8ab-42f90b88beaso19578765ab.3 for ; Tue, 14 Oct 2025 04:13:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1760440406; x=1761045206; 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=S/tg/3+ZojFwF/y9jx5f9/BRn7aldjATwyiDYBGM+Zg=; b=ENVlAxsT1HNT2R733oOdrDv5yxkKQ1XE0uVz0oCtDb3moy5ggjG0ecvoLBMjBaJJdT H1vMC0eAJA01c+nhCxzWiSCd+WsLq1moWItTBT6Z46EU0Re2txN91ekC/bZu/NZrP/mc 9keBkyrSou7C7nqpaCMEZEYxNFfVaGOf/CUVI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760440406; x=1761045206; 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=S/tg/3+ZojFwF/y9jx5f9/BRn7aldjATwyiDYBGM+Zg=; b=kj2skGatGmFYabZmpHFmUPhQlZF6q2OdQ12al7+ukNgARO/ZkQuN2VFIaMB4Mc3pGj oiDLhYklzbdedbxPp+JHa9ZRypkZFUglOi2/ssBYbuJ5c2PGr5rAdrN4ogKXc3iHFt7q a/2DHpDEPa3K5yPUWekQIkbp3O13COPYcG+05JxzD7Ms1rsFdbmIvA7i1ExHspmpyVNk D4nYFEIzGMmXahhz8DEn/E7bMU6ZAxB714bldDwJeT04nJtNaCVTLDnRGXGqgIueoHzQ DhtLwObfMFWufBeSS39STiSKRKs4ZZdWFIVgY4lVYV7drHp+bI20pS7rwwKSNv0/YtBq cvTw== X-Gm-Message-State: AOJu0Yx+/huMt7C1TO+NmS0TT3DtZXqFrl0quoK1dc1xiLzwkgr2VKV7 M/YCzm7rymeC2jndEvffoKX22LkIr8LVoadg8okE47LLmQDWeUOJ8D/Gx+jlWxYubUghOECEI/T 8uXzsQheGcX8= X-Gm-Gg: ASbGncuwHgNCGMwOxOCK/BRG+/zrjjDqeA0BUekbFo/RwLYFkHs+zy11CsFgjuwDsb2 imdLw9m5B8+zO3TaUozjquvqvpbWSlgEaVXiwZkOnQWb0oQ/2WgB55jhHL3wAcmOmgdWMBAqzgt BnU1djkPoGo+YCZzMFo7cvWMAkuTbjmufDPS1/2gURLthB1YNGG2VlNnuu7j2Anh38+suoKTCXL ZcaA7N6UWtxKSpNWyH+3WEKXlh5UeeJbSYlwl59Ee+udpinUkv9JmRXzWgJGuiL8nv9QxLgYVSa Rf7F8y70TWVwOePc/41fCgVZrGOmjqkeNW1tZh0Eg1b7wJlk18LtqH03dCiTR1Khz8zzHKk6ShA NuAfiiNpfn4dfC2T4oIoxHtXrn5yXqTEbKcs= X-Google-Smtp-Source: AGHT+IEjztcHrYErUspi8HToEDYNApt+IvQrlubCLcLjB7ditt69Q2CyR++22BDYS6LPsOOEir4htQ== X-Received: by 2002:a05:6e02:184c:b0:42f:9c5d:81b1 with SMTP id e9e14a558f8ab-42f9c5d821fmr179739165ab.32.1760440406348; Tue, 14 Oct 2025 04:13:26 -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.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Oct 2025 04:13:25 -0700 (PDT) From: Simon Glass To: U-Boot Concept Date: Tue, 14 Oct 2025 05:12:40 -0600 Message-ID: <20251014111301.1059317-4-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: C6Y6CO7CCO6ELVEIW43Z6EPS2Q5T7XCI X-Message-ID-Hash: C6Y6CO7CCO6ELVEIW43Z6EPS2Q5T7XCI 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 03/16] expo: Check the mouse once the video device is known List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: For expos which are designed to use the mouse, the mouse is normally enabled when the expo is created. Setting the display comes later, so move the display-related mouse to expo_set_display() Also get the current mouse position if available. Signed-off-by: Simon Glass --- boot/expo.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/boot/expo.c b/boot/expo.c index 1fb6d6e9417..432e81d3552 100644 --- a/boot/expo.c +++ b/boot/expo.c @@ -151,6 +151,17 @@ int expo_set_display(struct expo *exp, struct udevice *dev) exp->display = dev; exp->cons = cons; + if (IS_ENABLED(CONFIG_MOUSE) && exp->mouse_enabled) { + /* + * Tell the mouse driver about the video device for coordinate + * scaling + */ + ret = mouse_set_video(exp->mouse, exp->display); + if (ret) + return log_msg_ret("msv", ret); + mouse_get_pos(exp->mouse, &exp->mouse_pos); + } + return 0; } @@ -189,11 +200,6 @@ int expo_set_mouse_enable(struct expo *exp, bool enable) if (ret) return log_msg_ret("sme", ret); - /* Tell the mouse driver about the video device for coordinate scaling */ - ret = mouse_set_video(exp->mouse, exp->display); - if (ret) - return log_msg_ret("msv", ret); - /* Get mouse pointer image and dimensions */ exp->mouse_ptr = video_image_getptr(riscos_arrow); if (exp->mouse_ptr) {