From patchwork Tue Oct 14 11:12: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: 592 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=YIAvc5MR; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 66DAE68143 for ; Tue, 14 Oct 2025 05:13:49 -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 7bTHQAy8ZPio for ; Tue, 14 Oct 2025 05:13:49 -0600 (MDT) Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1E3F168112 for ; Tue, 14 Oct 2025 05:13:48 -0600 (MDT) Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 76D51680C5 for ; Tue, 14 Oct 2025 05:13:43 -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 89UGkkXdU-3R for ; Tue, 14 Oct 2025 05:13:43 -0600 (MDT) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.166.176; helo=mail-il1-f176.google.com; envelope-from=sjg@chromium.org; receiver=u-boot.org Received: from mail-il1-f176.google.com (mail-il1-f176.google.com [209.85.166.176]) by mail.u-boot.org (Postfix) with ESMTPS id 71A2A66DD8 for ; Tue, 14 Oct 2025 05:13:39 -0600 (MDT) Received: by mail-il1-f176.google.com with SMTP id e9e14a558f8ab-43094e0aeaeso17205045ab.2 for ; Tue, 14 Oct 2025 04:13:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1760440418; x=1761045218; 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=d5ne2Jvg3AIRxiUi7tHFF5uYdS5ay58wxYooYAijM/Q=; b=YIAvc5MRXZdwVQ17eTzx+YJWdVGGOvwOLtNZHt3ZNprX6fKxcRyOnKixRb3gmI/YZ1 iEqaNemJFAAxQhQapBg+cq6cJ3Zesq/o1HrjpA1wwFuPErpoHtuTgGnrHHVyXUVsHKK1 osQEX3tKtpBjqsk+q3TPqNI9x+2SwBaBDj4Ec= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760440418; x=1761045218; 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=d5ne2Jvg3AIRxiUi7tHFF5uYdS5ay58wxYooYAijM/Q=; b=pTFi5SS4fI9EHocPRwosbMRjaOYmPZA4/EPuZolCV21tmU7wugDKpU5pYRIg4OPkbK YLOLMf+TgszsuSK1tuafDfQD3PlCGhEBLiUBLylh8ovgyUdsO+98OjdHHblVguS8SATE 79Vum+eankfxtnrbZ0zH5NB3fiQIMn9lPlMJ5GJSEOujpqHCLNUsBnZbuyzTiUbEfliU U9+/Ngb2MCjBTJ+eVTrAdipVJHeOyT9qMzo2sgtLUS37+0WaTBk5FbNeqJIg937xaMCo 7sEkZf6Gk9NLoMeQ0zvlJmjJQfxG+L1NebEgjQfqtduzaTP8tTZamx4UE8ts3JHHdkhY NVBw== X-Gm-Message-State: AOJu0YxWGhuYR0MVLgpXUxXD9BTAjKxqQ76WR270gxykDbLD8ZWl0eTC ayoAJsyreO/FhDo3sbqEGzCd9LTcvVVYmPFX7KVaNGjLa0F5EIMcjqKwfFKE9PhgIrXFWOKYM8h a+YRABzmwJlk= X-Gm-Gg: ASbGnctKUxn64orKVvH0ZZusfMi63h3Wh6YM3Vlu1c/HCt3x2Vl64l/tECBQQoaA+Vv Greq0NOw0G1zC+DLZiolsbNsFjmOenim8dHVC5vXdHxaJa6zpMHT4/3kOtvdhzrU6tXomPHqmdo M+a1HZa8Pkw9G7rrjB5DGX5gs7ZVH81KzM9h3CAXqPOB4LAL6MRZPuqkGWbFNAGlShsZ8b6hDFQ Fd6pPDnVhcYAx5KSQpE9hIlgWOuGecqA5HpQzk5Qn1nNcB5lGdcAG2AiAbDsmvQc/O1sAWxVvyk +XT2N1dDDw/2g4yivBB944pliPEw8Ais+Fl5qbdGuNgCVtZ2dezw7PJKwfD/vMLmAHhIREEgpYd 9PBS5xDDGxPGc4mPzQ1IGr0/9/Sa18nsbgi6UxPmPUHiI1rzGNQte+nPz X-Google-Smtp-Source: AGHT+IFDSbRzL182aYusHTkkOqIGjgDKSzgZFUhBXddSpMnutORjWe5Xz0eOi9bawWuEhx4CHzz0uQ== X-Received: by 2002:a05:6e02:3497:b0:430:9f96:23ce with SMTP id e9e14a558f8ab-4309f96255amr40127775ab.8.1760440418056; Tue, 14 Oct 2025 04:13:38 -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.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Oct 2025 04:13:36 -0700 (PDT) From: Simon Glass To: U-Boot Concept Date: Tue, 14 Oct 2025 05:12:45 -0600 Message-ID: <20251014111301.1059317-9-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: LEVNJRE4SKJXRTIJAXU55PP6OM263TIU X-Message-ID-Hash: LEVNJRE4SKJXRTIJAXU55PP6OM263TIU 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 08/16] mouse: Place mouse in the middle of the display List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: When starting the expo, put the mouse in the middle of the display so it is more visible to the user. Signed-off-by: Simon Glass --- drivers/input/mouse-uclass.c | 2 ++ include/mouse.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/input/mouse-uclass.c b/drivers/input/mouse-uclass.c index 16a391532ae..dea8babf5fe 100644 --- a/drivers/input/mouse-uclass.c +++ b/drivers/input/mouse-uclass.c @@ -97,6 +97,8 @@ int mouse_set_video(struct udevice *dev, struct udevice *video_dev) if (video_dev) { uc_priv->video_width = video_get_xsize(video_dev); uc_priv->video_height = video_get_ysize(video_dev); + uc_priv->last_pos.x = uc_priv->video_width / 2; + uc_priv->last_pos.y = uc_priv->video_height / 2; } else { uc_priv->video_width = 0; uc_priv->video_height = 0; diff --git a/include/mouse.h b/include/mouse.h index 1a3a93801e2..92609cfd0e0 100644 --- a/include/mouse.h +++ b/include/mouse.h @@ -168,6 +168,8 @@ int mouse_set_ptr_visible(struct udevice *dev, bool visible); * Sets up the video device in the mouse uclass private data so mouse drivers * can scale coordinates to match the display resolution. * + * This also places the mouse in the middle of the display + * * @dev: Mouse device * @video_dev: Video device * Returns: 0 if OK, -ve on error