From patchwork Fri Sep 19 20:14:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 370 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=1758313022; bh=GuxhvIETO+PVfv/kGfOI+aPYoehbc3r+Xm2/Y/QfbF8=; 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=rYYCSkUqPBSTyv9SGjmz5uGtMAE4NwEkz+csu+tnTpWPEurxhX+em7Su7S373+YA5 ELTglinenQZmW3cG+6TKROcKAMb3+D5Q9OOeN9jpitC5Av/Mdq3L4r6njgLLd1YgWF jKV/Ta6y3sWiH2AE+YgIPUnMyAacN+ZvU4Zf5AGqdweFNc72kKc4Wfpws6ElG66Bm5 Ox6FTN95ONuGddmXQpnJC3J3groRD3Sew6p2pQMPpanlsFZ9FxAx6yVd5O9l6E/wis yTsdcBNP5wmqorMRqaDegDJzKDeH4S6+m7MCsLRfv5mJR9WNH6P6uh3lLr6EUTJ7G7 0o/6lBMJHpotw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 008A267C6C for ; Fri, 19 Sep 2025 14:17:02 -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 Z4dU8fJbADvj for ; Fri, 19 Sep 2025 14:17:01 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758313021; bh=GuxhvIETO+PVfv/kGfOI+aPYoehbc3r+Xm2/Y/QfbF8=; 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=GSBN9l2gmTG0CZZ0BwgPoH0UhX27I3avcX582OeRcXGvIvIhmAnxBBs/L2H3rwAb9 sPiADddsm/RN1rX1R+3kZrsu++TWs4BhDcPaHrjQnq617+pJYn0np32bOwO120eLxu 058PnOF8LJqk244wfFeWI0wYh0wakDv/z4UHUa8Kw9CR8cN1eYIzhBZVSMKm7ThCCK YzAbU8XGsQa1iXiuiO6by/JHO2Z3dB1WaOInbUuI1iOP+Fg0TZ8g7ML87osBxEtAZJ dWj0Qr2bx5S92j1pN68rBgRrln3mcauIBxA1qojOg9+KrxZfCVoASUZNWlfMM/yNoc qHrzGqRr3BgKw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id E163467B55 for ; Fri, 19 Sep 2025 14:17:01 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758313019; bh=7B7L9wIM/QPTGfWE33WX/j/yO8Uze7egApi41Jz42/8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L1zz41CW+LGJyyP8L97iMcQl1ZfTodp14ojQi6cJ0Lrq+bc9rWTb37mQ1b9dEUcLd t4sZcmrC4VmGOYWOP5jl9gGdRIa2TB5E3Q74+FExvdC2GVE3z9QRtswoNXLZ4aUa7d +GKUf5GfUI65zuJbTgco8mOCDXRnZgyVmKXa5fRrxY/e1l8c+lMlovqgd0me3kao1+ mPkCoVhL9WYbbJ0u0YqNHo7AEAZVSYYAS7qmY+nnlqhbLDAmhdWKOlHyA+W3crF/IR I0THZ66LYk13lDigGXTFp1bEdqr7T13TY7/8uCSyEm12HS5LEtl6EfpsiNz7M4Utxb yItOwUAl6iwdA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 89CA967BFC; Fri, 19 Sep 2025 14:16:59 -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 AA5c6m396M61; Fri, 19 Sep 2025 14:16:59 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758313015; bh=GUu88Imq/ju4fw7HacJ0u8mdGOwVDSLbBVA9vEDpvJU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FIFLA6KK1K6Bq8gaU2FyihrnpqCmqRkLrc8KbNKGDGq0zs/MYYMzrz6OThK++V8SK AiomhUnBbbYPwZJZ/O+7Lz8Rkz5yT2ozcoOHYf1u0XVLr5jSQ2ObToBaFTkS2c82Xb xM9/RIM2ZVta462hpDhLvLFqXkA2i97Ghn1o2f6NCYNcmSJWktUK+Eil7L7zJVY1XW IJzVy3R90WesMFQ25QeVIu2H3MndHukKuRCoX6FG7/doDfKcGsqkbxLjkLR5cZr3Ww m2a/Qusol/VNrfj/z2/rvU8vlhLah23RcgY2nddFkiDcU+eduXg6k+SkULUDoLeTDa Ouy8/+wPZ6g7g== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id BEEE767B3B; Fri, 19 Sep 2025 14:16:54 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 19 Sep 2025 14:14:35 -0600 Message-ID: <20250919201507.4024144-29-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: ZYBMHC5PKSOSE3ZIWC6PK6XTGGEMZ7OH X-Message-ID-Hash: ZYBMHC5PKSOSE3ZIWC6PK6XTGGEMZ7OH 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 28/42] video: Track whether the cursor is enabled 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 The cursor should only be enabled if the user is entering something. This can be at the CLI or in an expo. Provide a flag to track it, which we can (later) use to determine whether or not to draw the cursor. Signed-off-by: Simon Glass --- drivers/video/vidconsole-uclass.c | 10 +++++++++- include/video_console.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 9d161f4688e..9ab331af68a 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -919,12 +919,20 @@ void vidconsole_readline_start(bool indent) struct vidconsole_priv *priv = dev_get_uclass_priv(dev); priv->curs.indent = indent; + priv->curs.enabled = true; vidconsole_mark_start(dev); } } void vidconsole_readline_end(void) { - /* TODO: mark the end */ + struct uclass *uc; + struct udevice *dev; + + uclass_id_foreach_dev(UCLASS_VIDEO_CONSOLE, dev, uc) { + struct vidconsole_priv *priv = dev_get_uclass_priv(dev); + + priv->curs.enabled = false; + } } #endif /* CURSOR */ diff --git a/include/video_console.h b/include/video_console.h index c5450f70c4d..af2b8499bb4 100644 --- a/include/video_console.h +++ b/include/video_console.h @@ -29,6 +29,7 @@ enum { * The cursor is set up and maintained by the vidconsole. It is a simple * vertical bar of width VIDCONSOLE_CURSOR_WIDTH shown in the foreground colour. * + * @enabled: cursor is active (e.g. during readline) * @visible: cursor is currently visible * @indent: indent subsequent lines to the same position as the first line * @x: cursor left X position in pixels @@ -37,6 +38,7 @@ enum { * @index: cursor index within the CLI or field being edited */ struct vidconsole_cursor { + bool enabled; bool visible; bool indent;