From patchwork Fri Jan 16 17:14:15 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1541 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=1768583739; bh=0G3P3szNtK4pufNNXBZn1+S/+jqLfVGcUtEZa5jfHNU=; 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=pwVgPeqrslOsE7YVCfPH/wS3/Dj912ZwhMZNTB1ZvR8JrYCj/tAYUL/6eWHN65gIV TeAOA13V66KCkvqf2Ha3kcw4u63JgsdARzmKoaWOCllgZqgX51Q6eBtQw0A359cAne U533H4PMlEKSWfSWFJ7ygiX88hPrfmtf3V0LyxvwuANITxISMz+O4iMveULcDq953k ynR/5Zq49CTpYB5ltDHy+rrQsFeeVIpYSI81YPLeRowWXxLwFUrXSyhiuQ+rTFaWDl tGTRRgE2j+OZSbs6jDYT7eZQ/U2XusWuJpZOD0QoDDFuAW/G6DJ/hOiunnHUuqmoLe tJxDAAZ2KrZJw== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 74BF56932E for ; Fri, 16 Jan 2026 10:15:39 -0700 (MST) 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 MXSAodJqzI_L for ; Fri, 16 Jan 2026 10:15:39 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768583739; bh=0G3P3szNtK4pufNNXBZn1+S/+jqLfVGcUtEZa5jfHNU=; 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=pwVgPeqrslOsE7YVCfPH/wS3/Dj912ZwhMZNTB1ZvR8JrYCj/tAYUL/6eWHN65gIV TeAOA13V66KCkvqf2Ha3kcw4u63JgsdARzmKoaWOCllgZqgX51Q6eBtQw0A359cAne U533H4PMlEKSWfSWFJ7ygiX88hPrfmtf3V0LyxvwuANITxISMz+O4iMveULcDq953k ynR/5Zq49CTpYB5ltDHy+rrQsFeeVIpYSI81YPLeRowWXxLwFUrXSyhiuQ+rTFaWDl tGTRRgE2j+OZSbs6jDYT7eZQ/U2XusWuJpZOD0QoDDFuAW/G6DJ/hOiunnHUuqmoLe tJxDAAZ2KrZJw== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 0F545693B1 for ; Fri, 16 Jan 2026 10:15:39 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768583736; bh=PO8NrOX+qQGJgZFLBtJkoA4pdAh9Xq9d7cvx2vnVcDY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sv4N0nQsLYDHorzm3Q1KNTonYi3OKa7jKXTZErqVVooZbVEolomEWH3Xo2k0hZY/T 4K6ZCLGPVLbZ2gWzknqz1+bWOFa2Zi0Pv6WdmSW4m+aolvFwU+gY0lon6psb4THgJc 6ipBZRfSl3WdfwI2f96dyp4z65na8LjxjUE0d4a9TE4UbWoZyO0MsMDjQyGdsaAdGv 4COb/iIe62D0NvJmZvF0KB1W9coJaNA+YUTyNIsdlTxqGqrSwpaYzs36Re5ZJE0Lir 4brWDMpYTh1Cs8jld3P95ZVFYrHiUFEzKIGqN9ZSjxK8euC4y13HfTJPSmM/2f8Wep 3/zcngNfFw05g== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 14F196932E; Fri, 16 Jan 2026 10:15:36 -0700 (MST) 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 5RgR0aHcV1eN; Fri, 16 Jan 2026 10:15:36 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768583735; bh=aYI/9gc96jSq4dg9pCkyCnSrlmRObMhoiq6l9SsCaA0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W7UfZN6u9qfy1kneJQAPqMo3HboO49D319aqxN+VzHfnuviXGzh437zwI9eTUBNQ8 7oKFAXHQEHhG/hYD2gj9AJ6/7K5+uKa75E2sC/ZB9HoIqYMHIYnZ9I0u23b3nzKjcJ YZnkyFLX1WQgRwe8EfTLtnZNLBh8tDq46WIPpfQBg7bny9gtHt8auEVSinyia8Oarg EIcPOeDH+MVOV6uofEoWW8T96VPNrX/7U8vIPlMZqNjKYwhQW/X1PnDEilGNXRve2/ cTs/yJ6gwXDdYCYMgAtlUPwCysdSWlBEdwgfF9wdm8ezCa1JvUncqDyv0U9PWPSzMn odGQcrEMOsWnQ== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 84E1A6913F; Fri, 16 Jan 2026 10:15:35 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Fri, 16 Jan 2026 10:14:15 -0700 Message-ID: <20260116171424.398597-14-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260116171424.398597-1-sjg@u-boot.org> References: <20260116171424.398597-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: JDXCCJEV65JV3RGM3AY6DHE4SCH7474W X-Message-ID-Hash: JDXCCJEV65JV3RGM3AY6DHE4SCH7474W 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: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 13/14] video: Move xmark_frac and ymark into vidconsole_ctx 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 Move the xmark_frac and ymark fields from vidconsole_priv into vidconsole_ctx as part of the per-client context refactoring. These fields track the start position of CLI text entry, allowing each client to have its own entry point. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- drivers/video/console_normal.c | 4 ++-- drivers/video/vidconsole-uclass.c | 4 ++-- include/video_console.h | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/video/console_normal.c b/drivers/video/console_normal.c index 283bbdff681..73bf3a7ebe8 100644 --- a/drivers/video/console_normal.c +++ b/drivers/video/console_normal.c @@ -105,8 +105,8 @@ static __maybe_unused int console_get_cursor_info(struct udevice *dev) if (!IS_ENABLED(CONFIG_EXPO)) return -ENOSYS; - x = VID_TO_PIXEL(vc_priv->xmark_frac); - y = vc_priv->ymark; + x = VID_TO_PIXEL(ctx->xmark_frac); + y = ctx->ymark; index = ctx->cli_index; /* rounded up character position in this line */ diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 4570c9fe60d..182505d1056 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -839,8 +839,8 @@ int vidconsole_mark_start(struct udevice *dev) struct vidconsole_ctx *ctx = vidconsole_ctx_from_priv(priv); struct vidconsole_ops *ops = vidconsole_get_ops(dev); - priv->xmark_frac = ctx->xcur_frac; - priv->ymark = ctx->ycur; + ctx->xmark_frac = ctx->xcur_frac; + ctx->ymark = ctx->ycur; ctx->cli_index = 0; if (ops->mark_start) { int ret; diff --git a/include/video_console.h b/include/video_console.h index 559263e214b..73c4f54f62c 100644 --- a/include/video_console.h +++ b/include/video_console.h @@ -87,6 +87,8 @@ struct vidconsole_cursor { * @ycur: Current Y position in pixels (0=top) * @last_ch: Last character written to the text console on this line * @cli_index: Character index into the CLI text (0=start) + * @xmark_frac: X position of start of CLI text entry, in fractional units + * @ymark: Y position of start of CLI text */ struct vidconsole_ctx { int rows; @@ -97,6 +99,8 @@ struct vidconsole_ctx { int ycur; int last_ch; int cli_index; + int xmark_frac; + int ymark; }; /** @@ -139,8 +143,6 @@ struct vidconsole_ansi { * @tab_width_frac: Tab width in fractional units * @xsize_frac: Width of the display in fractional units * @xstart_frac: Left margin for the text console in fractional units - * @xmark_frac: X position of start of CLI text entry, in fractional units - * @ymark: Y position of start of CLI text * @ansi: ANSI escape-sequence state * @utf8_buf: Buffer to accumulate UTF-8 byte sequence * @quiet: Suppress all output from stdio @@ -152,8 +154,6 @@ struct vidconsole_priv { int tab_width_frac; int xsize_frac; int xstart_frac; - int xmark_frac; - int ymark; struct vidconsole_ansi ansi; char utf8_buf[5]; bool quiet;