| Message ID | 20250919201507.4024144-26-sjg@u-boot.org |
|---|---|
| State | New |
| Headers |
Return-Path: <concept-bounces+u-boot-concept=u-boot.org@u-boot.org> 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=1758313010; bh=iQJU1YNuDBLojNiU5Xxb68C1wdr4tXzAOdBN2NtMzQs=; 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=Oiolv8fRJcUqWO0jJl45IwL0f3SpO3+M4C4P/pxDnKgaQV53pQGisZ/IsgJe+AvYs js94hgo6Yg5mdM2WcZST3MRMrt+RH1MUo3e59pTAolfE8sSPHW6ZP9x6sb279uZ0Li TC47iupSwDLkg1ddUlFqL4r+6ND1ijpZZ7l9ojQmxWvYdVoNcfIjwbDp2HKlDOXfdu 48MGVg3smMExmFqouv1AamhydtHsZJMlYW6JbjfHBrP2QMsLVXbNHbTWBo6k/p2voD RbHsBzrgPxFD/VhDmSxwGg43bkgyqU6uvZeWr4hQr8Sx0YDrXreKpSvGAvaVDkpWnO FcIjCunqv7M3g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 8B0C367C83 for <u-boot-concept@u-boot.org>; Fri, 19 Sep 2025 14:16:50 -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 gBmoRpePHmRY for <u-boot-concept@u-boot.org>; Fri, 19 Sep 2025 14:16:50 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758313010; bh=iQJU1YNuDBLojNiU5Xxb68C1wdr4tXzAOdBN2NtMzQs=; 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=Oiolv8fRJcUqWO0jJl45IwL0f3SpO3+M4C4P/pxDnKgaQV53pQGisZ/IsgJe+AvYs js94hgo6Yg5mdM2WcZST3MRMrt+RH1MUo3e59pTAolfE8sSPHW6ZP9x6sb279uZ0Li TC47iupSwDLkg1ddUlFqL4r+6ND1ijpZZ7l9ojQmxWvYdVoNcfIjwbDp2HKlDOXfdu 48MGVg3smMExmFqouv1AamhydtHsZJMlYW6JbjfHBrP2QMsLVXbNHbTWBo6k/p2voD RbHsBzrgPxFD/VhDmSxwGg43bkgyqU6uvZeWr4hQr8Sx0YDrXreKpSvGAvaVDkpWnO FcIjCunqv7M3g== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 7B50767A99 for <u-boot-concept@u-boot.org>; Fri, 19 Sep 2025 14:16:50 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758313008; bh=tPf2MNZS5X/vg7bFil1VPHzhz75Y+qEKaE1cpmbXUVY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xl2Gd/TUrKXL8DPtj1vym2HA6GV6nhFCP+MeIdySxY36/RgXJSM4iIONwRdw7KJ0n Jf9HL39cVf3A94g7PxRewTyYl6kDxIPJEkhWNEW2ncCxaCVV1YSpDCWQlz/YlP72aT yoJBA8nyQj97hN5KCrIZPCzRaab3t/29P4hPpyImxsVXqIKtr2A17ppRk0BQSqylOk dk9tOYwaiHQPeQT3iE9QmbR1QJemCx/WA/DieM9S5C3Nfl4LCqVqyB68wBk/fcej+4 5FvQB5tevD8yhwqFpBHWQ/WKIsPmqpBplC7bHSAmZ8QrSpFM7TW9zI97F/LZlMdOQP lEmNQ9/kdlyhg== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 745F867BB6; Fri, 19 Sep 2025 14:16:48 -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 hKLGXZ9GABE3; Fri, 19 Sep 2025 14:16:48 -0600 (MDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1758313006; bh=ahOdrxpZF3yazTXkHzK0+sDZqTQn4AJOhlTBULAkEWw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XeacLPKHyYHr3v4/jCkG5qMk1MtNxMNjzkQiJzoW/OpHtOLgwDPDA4+iFWDwk9VWs E3QcPmaYGkGH9I2J+2iV4Zmt2S0vs/JJGnuEyQi+OsZ1QEJXaPaxV2a0H9U+hKKSZG F4ka8kpSaqbv1/LpC96hpcIhCVsoY9ZNr/97mbo6tXlm3JVFAP0u2Knm9aiY5gRCQc fuPJnTJ/I7on/olB4EQq6V7nE5QHMp8/76JPv/dJr/XYpX6EQEsrljYzVXQZsLSMKD xo02u0yr82su3SmhStQEwX3FVG+XXkEkZq9sc/Yla1TZAZMWjVaKRmgg2mwKGRqgTh kUofyzaIrckTA== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 0665B67A99; Fri, 19 Sep 2025 14:16:45 -0600 (MDT) From: Simon Glass <sjg@u-boot.org> To: U-Boot Concept <concept@u-boot.org> Date: Fri, 19 Sep 2025 14:14:32 -0600 Message-ID: <20250919201507.4024144-26-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: IIC4QG42WEZZS6XD4VQNEIDH5ADIINBV X-Message-ID-Hash: IIC4QG42WEZZS6XD4VQNEIDH5ADIINBV 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 <xypron.glpk@gmx.de>, Simon Glass <sjg@chromium.org> X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 25/42] video: truetype: Record the position where CLI entry starts List-Id: Discussion and patches related to U-Boot Concept <concept.u-boot.org> Archived-At: <https://lists.u-boot.org/archives/list/concept@u-boot.org/message/IIC4QG42WEZZS6XD4VQNEIDH5ADIINBV/> List-Archive: <https://lists.u-boot.org/archives/list/concept@u-boot.org/> List-Help: <mailto:concept-request@u-boot.org?subject=help> List-Owner: <mailto:concept-owner@u-boot.org> List-Post: <mailto:concept@u-boot.org> List-Subscribe: <mailto:concept-join@u-boot.org> List-Unsubscribe: <mailto:concept-leave@u-boot.org> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit |
| Series |
video: Support a cursor more generally
|
|
Commit Message
Simon Glass
Sept. 19, 2025, 8:14 p.m. UTC
From: Simon Glass <sjg@chromium.org> Implement the mark_start() method for the truetype console by recording which pos[] record corresponds to this event. We can be sure that the user will not be able to backspace past this point. Signed-off-by: Simon Glass <sjg@chromium.org> --- drivers/video/console_truetype.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c index d87b3828bb0..edd2eb0a309 100644 --- a/drivers/video/console_truetype.c +++ b/drivers/video/console_truetype.c @@ -173,6 +173,8 @@ struct console_tt_metrics { * start of the current command line. * @pos_ptr: Current position in the position history * @cur_fontdata: Current fixed font data (NULL if using TrueType) + * @pos_start: Value of pos_ptr when the cursor is at the start of the text + * being entered by the user */ struct console_tt_priv { struct console_tt_metrics *cur_met; @@ -181,6 +183,7 @@ struct console_tt_priv { struct pos_info pos[POS_HISTORY_SIZE]; int pos_ptr; struct video_fontdata *cur_fontdata; + int pos_start; }; /** @@ -1060,6 +1063,15 @@ const char *console_truetype_get_font_size(struct udevice *dev, uint *sizep) } } +static int truetype_mark_start(struct udevice *dev) +{ + struct console_tt_priv *priv = dev_get_priv(dev); + + priv->pos_start = priv->pos_ptr; + + return 0; +} + static int console_truetype_probe(struct udevice *dev) { struct console_tt_priv *priv = dev_get_priv(dev); @@ -1106,6 +1118,7 @@ struct vidconsole_ops console_truetype_ops = { .entry_save = truetype_entry_save, .entry_restore = truetype_entry_restore, .get_cursor_info = truetype_get_cursor_info, + .mark_start = truetype_mark_start, }; U_BOOT_DRIVER(vidconsole_truetype) = {