From patchwork Fri Sep 19 20:14:24 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 359 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=1758312983; bh=w9ETM4OIAk3ZmFM1cYsjQJwmXPQWFsie8/vcUGfHXLk=; 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=WPenNMNSOwg0VRsz3N4aUKCSPK3foaqR9JVJBxtsqvqZ7Ty9wWhscRK9vIfu9emzm L4i9vM86F9wbuTRhWfRZb6yxouUgRa26LNWunz1KSy6z7QHuP8DmY0UL4i8BEbA1Jt m85HWSyPj8TSt6G6oSG3vgWBTNc93SaPYhihLDUI0FYTYTMjRNQzdrt19zTSi6cKUA hlxhxjRAyjVA/YumrjA+F4rhUydVBeiNcoenb31+R/JeClpdVE6gWMSh46QyIgC/U2 15ZkP3mzQbqQ+AKJxz4MoFmMA3MDLRQzYbj3hO4jkz7LZwOSdKHpXBD+RSEJON2K0B JEWJPxJn++OlQ== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1549C67C6C for ; Fri, 19 Sep 2025 14:16:23 -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 BSjcBnHSmN3k for ; Fri, 19 Sep 2025 14:16:23 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758312982; bh=w9ETM4OIAk3ZmFM1cYsjQJwmXPQWFsie8/vcUGfHXLk=; 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=su1ivgAjsowymm1lJF0ELrBln253o+OPTiT66K98HBcWMW3n65YuZaV0D6ghQ1m/H UOGKShh7uBa67+9FP/7JltHDuwi1OD/OVgZxPkMChLJRbHPcCDZfVudn4RkrUH0Jy/ dukZYFvtWa9Lb+NUyh29coPYJ1atVsuwDnOIdr3P8B7vTmaoa9tLCoN9nNZ2AFiIR1 FQqljIR3E+RC7M7BZkccxtJMQsobj7CSMPXx7ah5w6+r4ABxA53oVcCy3/oNZH/6ml UPtlMYJx5eyJXPX0CHIzM0YqF9ZJKb/xLJJzKhMaJvy6Kqd1S2bJ6LrizP5sdhvS0a 1RHWNc7jr0y3w== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id F1F5367C58 for ; Fri, 19 Sep 2025 14:16:22 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758312980; bh=5871fXo8lakSzbOuVDqY3FJecRzi74cWMJHm+dFb4BU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W4DSMXXwzyTkZJTz72ESQZpAQfK0SfhGrxYpwJoX35o+3UXT7g8uYftHnAGcfGhgw 1wvQr8f1F7P9FLHXG8JguhSnv02vjhiRhhFKzORGqh/rtvZUtQVOMOta2M3ljYhfbi X8x5xf9BJ4o1Uyhwl4IUA8I6e5b7saWlEnul8jEJVuOXZ5IL/xtAH51jutc+QURusm /3zFyKWNs+dLp9NaGVKKvSEfXKRBFb9IiurCad8sVp8YeKDHKaPnUce96mA8gxeaL3 7fbBBoNMS4VeM1ATYnDSxiZewmxeMKqxHoPN88u9qmjqrdj+v+yV79UegUPOHp5iIo onjPKAUNX99+Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id D6A8567B3B; Fri, 19 Sep 2025 14:16:20 -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 l1YFBf2uan5j; Fri, 19 Sep 2025 14:16:20 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758312979; bh=U0ZulDJEi08Z5TTuJQv1JSZO7Goo5B7F8SelNUQAX+I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bwzIARw0LfCsYCc9NbciRmmHrCvSX5uVwoyJSyDT5hiOx5UguipoITV8UjCOD2Lvv Ej/Ty9zNU4Dl5whzUW6xFOxmUVVi4XAuO3rvuO2lT9g7GHAyByaZFnru5FaWvbutSr 5exlf8hcK7MmEWkxX+Ijdu6T9XpSlSGfjQEcApdWYzQEXTOMqdfPbScHFLCYEsykGb nrWOzi3Uq2HZcemTTzkyoL3Aj5siQNEB1FUTYGD3tByd7KlJcc/mTtjN7PmgFqElaH clOeDWti+3414qHdYKDMxmqZ5N1IIqdQip+fqEOO6cUcxyWV+2dc46bMoMpR9KQXmi QSq9cWzojPISw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 11EB067A99; Fri, 19 Sep 2025 14:16:19 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 19 Sep 2025 14:14:24 -0600 Message-ID: <20250919201507.4024144-18-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250919201507.4024144-1-sjg@u-boot.org> References: <20250919201507.4024144-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: VVGF36PVW73NCQTTW5R472APQBKIJHYP X-Message-ID-Hash: VVGF36PVW73NCQTTW5R472APQBKIJHYP 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 17/42] video: Provide an idle function for the console 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 Add a way to tell the console that the machine is idle. This will be used (later) to show the cursor. Call the video console sync after that, so that any updates are shown. Keep the video_sync_all() for the case where CONFIG_CURSOR is not enabled, to reduce code size. Signed-off-by: Simon Glass --- drivers/video/vidconsole-uclass.c | 4 ++++ drivers/video/video-uclass.c | 15 ++++++++++++++- include/video_console.h | 7 +++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index cb7212e9730..46fd355c05f 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -837,3 +837,7 @@ void vidconsole_set_bitmap_font(struct udevice *dev, } vc_priv->xstart_frac = 0; } + +void vidconsole_idle(struct udevice *dev) +{ +} diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index cd5c8dd8fad..be014a770d0 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -621,7 +621,20 @@ int video_default_font_height(struct udevice *dev) static void video_idle(struct cyclic_info *cyc) { - video_sync_all(); + if (CONFIG_IS_ENABLED(CURSOR)) { + struct udevice *cons; + struct uclass *uc; + + /* Handle cursor display for each video console */ + uclass_id_foreach_dev(UCLASS_VIDEO_CONSOLE, cons, uc) { + if (device_active(cons)) { + vidconsole_idle(cons); + video_sync(cons->parent, true); + } + } + } else { + video_sync_all(); + } } void video_set_white_on_black(struct udevice *dev, bool white_on_black) diff --git a/include/video_console.h b/include/video_console.h index 8cd1ccacb0f..842ead8d6a1 100644 --- a/include/video_console.h +++ b/include/video_console.h @@ -613,4 +613,11 @@ void vidconsole_set_quiet(struct udevice *dev, bool quiet); void vidconsole_set_bitmap_font(struct udevice *dev, struct video_fontdata *fontdata); +/* + * vidconsole_idle() - Handle periodic cursor display during idle time + * + * @dev: vidconsole device + */ +void vidconsole_idle(struct udevice *dev); + #endif