[Concept,13/14] video: Move xmark_frac and ymark into vidconsole_ctx
Commit Message
From: Simon Glass <simon.glass@canonical.com>
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 <noreply@anthropic.com>
Signed-off-by: Simon Glass <simon.glass@canonical.com>
---
drivers/video/console_normal.c | 4 ++--
drivers/video/vidconsole-uclass.c | 4 ++--
include/video_console.h | 8 ++++----
3 files changed, 8 insertions(+), 8 deletions(-)
@@ -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 */
@@ -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;
@@ -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;