From patchwork Mon Oct 6 20:58: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: 523 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759784378; bh=cAnVQTKUYdU8D+CFC2lHM7xleZgxd8D8nAO8vpwAbJo=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Bj7YC7VcWYIOUida1gngynXYsuq5A1QfPgfS3gU+l5IH/7rdmmbisgW0y3KIYk6ma 8H+rSCY81C1G35c6BQnZslPgUr9FZhzw7Y0N49MvwFHyLdvbTTWPxB8vZXdmCGT7vY Og5pSu9OA5GB1HvCouYJ2DUoZPwltj2Rst7FO9wuPHxxyuFCGJ378pdulw1tmIlCQx VpsMKa0QoP4xL6XPWf1CG0y/qOCCdy89AyPeGgdq/Xq5UYpadr5B1Fswp6OKXncoHU 3vaRkV3v9Ys2AVAKxHoNFIKqW4QJoJAGP2qAYfY1/2B+mSPY/C9/OhiuTiIs7ktK+d JbhwbhBUe0mVQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id AE06A67FA7 for ; Mon, 6 Oct 2025 14:59: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 zh4camk0bhP4 for ; Mon, 6 Oct 2025 14:59:38 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759784376; bh=cAnVQTKUYdU8D+CFC2lHM7xleZgxd8D8nAO8vpwAbJo=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=J6tXUKi+C7Gx4V7al+ntWkMX1tXshBXdVZ2/s1Ph5j56NWp8O2xJ1K3WsLYKTvp/e bRkvCW8QBQ2D+H1BeQMqHxL9l36UJPyROVFvZHJ3CkkVVCd2rBx8CkgKosI/KxFVdd cAczWS9JEJFh/Fn2axVpGGURc38NhllnvENK6484yS709CxmA5D6Dod4EcvUjDgd45 ll8NcD2vTGPqs9CkK729CYuf0SAcqeQD9HA3a7m+eIjghgF90yDeaIBt1DAl8CTOSK f3QXvH3txX3RXbRGmcytRqRcrS0xrwNg6OM3QM5+dzB7jcbp7TfdFCNe6wTJZqT7jU 0gHvcqmXPFAzw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E877B67FCD for ; Mon, 6 Oct 2025 14:59:36 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759784374; bh=B4P9NfIJzzbmR27Mi+gKVKemCMHgoj59s0C08xsB1f0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VYY+PpT7sTCvbP/fQpc4YTq0psIIW6KCZk2zMtsrqwL57q8c4ENljIEqW3eOPn12Z eDpW/tLXzLGalb7rxTg8p1BTCclyKZFPy6KWgGdoZIaP4N5i3miaGD7OqSk+l0cB8i rgRELdwVCvjvqojZ2fSvOAzhxCoQ5nIOm7gPKjGoa1oxfSYLhMc5YkYvRTVgSrhkv3 h/i92TSOYn3C3spl1hiU3q9RhTJJf4VV4e0/foBiWBHLYJQNI2ZKuaZGs6l16h9RhV tlCXmCb/ZkEg+hnSb6IiAY9EMPypRZ3F/jp/o/4uqQNRLopZ+xo7asVoJzR4OCzEOs 5xBSwu0esSlkQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id C66A767F52; Mon, 6 Oct 2025 14:59: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 10026) with ESMTP id PsJhG438bKS2; Mon, 6 Oct 2025 14:59:34 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1759784370; bh=a+7/+eYb+Kf3VCjW0/XllD6/ZpfgEFsfxftaB/GtGog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SiU8WQGKP+Jtngt20/6TBiTmouc7h1ZBZ81yV8/CgjTKIKyumPW74EzWx7u6fJgLP dRs3njB76Wptc7OExxDcSgV2K4ft3CzH9yjfxvKjrLVvcVi5LhUxqCSTWLFWMLzHXZ QEGg2qsvZXk2QoXErcj+LNOwyUCkNe1RPlQtbgVgXAowKlSpkG0y4xu268HT6fuTci ejhyPAZ47MBbct6cT09U7NwIAu4nFG0J95RlT79B99beGRtgWX/RCS/j4cr3K4YvYr VsTT6LHsPZrYLYDlcLM8P+vhMZFbQ99ILWDTHIdw52OWgMcsaln3L1YdPUESJXL/0u 5iw0Mf9VN/hkg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7D67767F84; Mon, 6 Oct 2025 14:59:30 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Mon, 6 Oct 2025 14:58:40 -0600 Message-ID: <20251006205856.2009292-7-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251006205856.2009292-1-sjg@u-boot.org> References: <20251006205856.2009292-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: OBZQSAT6DE44A5ACRQ524P3N4HJE6TGT X-Message-ID-Hash: OBZQSAT6DE44A5ACRQ524P3N4HJE6TGT X-MailFrom: sjg@u-boot.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: Heinrich Schuchardt , Simon Glass X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 06/14] sandbox: mouse: Implement set_ptr_visible() List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Implement this new method using the SDL layer. Signed-off-by: Simon Glass --- arch/sandbox/cpu/sdl.c | 5 +++++ arch/sandbox/include/asm/sdl.h | 11 +++++++++++ drivers/input/sandbox_mouse.c | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/arch/sandbox/cpu/sdl.c b/arch/sandbox/cpu/sdl.c index 65d55b0085d..c3745fa660e 100644 --- a/arch/sandbox/cpu/sdl.c +++ b/arch/sandbox/cpu/sdl.c @@ -646,3 +646,8 @@ int sandbox_sdl_sound_stop(void) return 0; } + +void sandbox_sdl_set_cursor_visible(bool visible) +{ + SDL_ShowCursor(visible ? SDL_ENABLE : SDL_DISABLE); +} diff --git a/arch/sandbox/include/asm/sdl.h b/arch/sandbox/include/asm/sdl.h index b97773c8a4f..a80db51ad19 100644 --- a/arch/sandbox/include/asm/sdl.h +++ b/arch/sandbox/include/asm/sdl.h @@ -119,6 +119,13 @@ int sandbox_sdl_set_bpp(struct udevice *dev, enum video_log2_bpp l2bpp); */ int sandbox_sdl_get_mouse_event(struct mouse_event *evt); +/** + * sandbox_sdl_set_cursor_visible() - Show or hide the SDL cursor + * + * @visible: true to show the cursor, false to hide it + */ +void sandbox_sdl_set_cursor_visible(bool visible); + #else static inline int sandbox_sdl_init_display(int width, int height, int log2_bpp, bool double_size) @@ -178,6 +185,10 @@ static inline int sandbox_sdl_get_mouse_event(struct mouse_event *evt) return -ENODEV; } +static inline void sandbox_sdl_set_cursor_visible(bool visible) +{ +} + #endif #endif diff --git a/drivers/input/sandbox_mouse.c b/drivers/input/sandbox_mouse.c index ba271242b1a..add7401c4ec 100644 --- a/drivers/input/sandbox_mouse.c +++ b/drivers/input/sandbox_mouse.c @@ -36,8 +36,16 @@ static int mouse_sandbox_get_event(struct udevice *dev, return ret; } +static int mouse_sandbox_set_ptr_visible(struct udevice *dev, bool visible) +{ + sandbox_sdl_set_cursor_visible(visible); + + return 0; +} + const struct mouse_ops mouse_sandbox_ops = { .get_event = mouse_sandbox_get_event, + .set_ptr_visible = mouse_sandbox_set_ptr_visible, }; static const struct udevice_id mouse_sandbox_ids[] = {