From patchwork Fri Sep 19 20:14:48 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 383 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=1758313057; bh=RotGBFDH+tSXJlsI4fbNi/5Pwu7x+QQrXok3LgwiTHI=; 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=AbF1Jba8gdx8dNGWtpdWTGm+US3PSJFV0AD7jYnAI8Uw2QE5hmXbcUTauyStEQ39h Xi+Zu2Fwt7LzAAmSCRUtW4FT0hFoUnXm98QhID3NF+cfpd3YdxR5TN9aaQnnV9IeS2 l5xABUm/EHTMvRzjZccAIfvg+mg/a5Af3KnCwWo7MZaXkDFZZlDNVPyEpJnPK4PvyL 2E/+h0MZLDCMVCL4sPDkbGWLTlEC9rIEkFmFMiuGFQfblN1Vvi0RAfG/MnecYCRKfU fNYgyLke891TKFhN+9bDbZxAFcnsvtE5OvXpdaDPMzWF0HEA3ZHAnZrgPTw/WVzh9S AKvrFjHWQai6Q== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id BC39767C8A for ; Fri, 19 Sep 2025 14:17:37 -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 yJ75RrW2HfLS for ; Fri, 19 Sep 2025 14:17:37 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758313055; bh=RotGBFDH+tSXJlsI4fbNi/5Pwu7x+QQrXok3LgwiTHI=; 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=T/z2Oj3lmkIWRFz2ZmGPA1gFJUx2oDHiDUM9au+yCN1DFZ2Dd3jFaddXz6NsL6y1m ZkUeL+euAJyqNyX+rH/ldpICm9T8DkL55PkIXlZiQNVqTt+CL1kYitZbjH/blNQqZ3 31+pqEEkb7aqboazVPzNMxscddxNkdHso4UWKER6wgzVAvtO8EYlQbKh15xcplQJdI MjJ0BO4D4mAx+GCaJr0OThCAxZBu9ddR84Xnjr6XIl7YbqR1mbMA8MkR7wBkySHlPJ pWBGx3WWJM/n2CGuCHNSkJPRvZAmkjTgpanfqH08vtYF6cmHeKX8oX5PAxrTtt+u5U C+wRFfU8a1NPw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id B0D2867B3B for ; Fri, 19 Sep 2025 14:17:35 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758313054; bh=oKvockTPcfY/E5dEWla6GBWaXTy4BPA92f1WAXe4kgU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KlsWLTSqbBY/dFO6lJV0TnYfAhwzlbUe8SKKkPyfDMEzfBspjGzomxMGX92ILwq9k GJbSwwXUELIWdzkleO3qBDTsFltsQFvN9OVoeNVu+nf+dg9oBdOrvIUSbSnnBwPOk4 3IJHFSE4+HoejGu2K5MEYzGlB2RJtREKq+Xp2yFN9BAqSAIluUoU5nc3OJCMt0FyVQ o0K1rQtDE/QP1OJy9cqzF/WTNIionVK1zEFr91L+XZMMkhaB8RVU7LDjZqiTz0yh3C fvP8B6KjQlnBPIis/hd3VK4c8WskzWalx8MyCvsT0IzHOPqSx52SQqV8Qmtag11QFr DJSXUDhDNVksA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 1496467B3B; Fri, 19 Sep 2025 14:17: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 ZMQv_3keoTzK; Fri, 19 Sep 2025 14:17:34 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758313053; bh=jn6EHuxjkdZssVuMQGwJ1FiFZqNdH06Hcw6iw7I48Pc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=urf+Tg81gbeJB2KDnxHjYk4z7RVD6I5DsABEum9jkaGAai32QQGyADAyfJqHoB8Lf DxqfSLM4Jk5aCbVchl/c9kssqe3G5adFjSsJxseuiWmOgNPFjY9oSeozQcMOy5DoEu me65udBd+HcFPYsCZhU4hV3JfFpN0aE1uGS1VaLXgcYLDHclayZqi383Uyo9U6cNmz 04P3Wk5J2PAfBLsyGDgAizM5BAo/f/8v5fFNRIhydEnACBsYG+ZBoY3TAJBwUx7SId TC/+QSzQQ0ZlrzXmzdybbwi7za1u+O2sWPY/zXz76U4RzoWbyGf7msfNPPpzwOwrnK 3Pta404gSBxIg== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 7896D67C0E; Fri, 19 Sep 2025 14:17:33 -0600 (MDT) From: Simon Glass To: U-Boot Concept Date: Fri, 19 Sep 2025 14:14:48 -0600 Message-ID: <20250919201507.4024144-42-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: 2TZOUASW2MIVACTUJXA2EP6S3664JFBE X-Message-ID-Hash: 2TZOUASW2MIVACTUJXA2EP6S3664JFBE 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 41/42] video: Add some notes about the cursor 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 Provide a few notes about how the cursor works in the video console. Signed-off-by: Simon Glass --- include/video_console.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/video_console.h b/include/video_console.h index 9005e9f4442..ac04aeb3aef 100644 --- a/include/video_console.h +++ b/include/video_console.h @@ -29,6 +29,26 @@ 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. * + * No cursor processing is done unless @enabled is true. + * + * To figure out where to draw the cursor, the vidconsole's get_cursor_info() is + * called. It fills in the @x, @y, @height and @index information below. That + * information remains valid while the cursor is shown, so it can be used to + * hide the cursor. + * + * The cursor is drawn only when idle (by vidconsole_show_cursor() called from + * vidconsole_idle()). It is erased as soon as any output needs to be written to + * the display - vidconsole_hide_cursor() is called from a few places in the + * vidconsole uclass. + * + * Under the hood, vidconsole_show_cursor() calls cursor_show() which saves the + * pixels under the cursor as it draws it. Once finished it sets @visible to + * true, so that we know we must erase the cursor before drawing anything else. + * + * The old pixels end up in @save_data and are used by cursor_hide() (called + * from vidconsole_hide_cursor()) to restore the display contents to what they + * were. Once that is done, @visible is set back to false. + * * @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