From: Simon Glass Date: Tue, 1 Apr 2025 17:29:44 +0000 (+1300) Subject: vidconsole: Avoid kerning against an unrelated character X-Git-Tag: v2025.07-rc2~43^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7703cfe025cbbb2277498483304b4db958521d9e;p=pandora-u-boot.git vidconsole: Avoid kerning against an unrelated character When the cursor position changes, kerning should not be used for the next character, since it can make the first displayed character shuffle left or right a bit. Clear the kern character when setting the position. Signed-off-by: Simon Glass --- diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c index 2e3e6f07112..6d2c2c2e177 100644 --- a/drivers/video/console_truetype.c +++ b/drivers/video/console_truetype.c @@ -490,10 +490,12 @@ static int console_truetype_backspace(struct udevice *dev) static int console_truetype_entry_start(struct udevice *dev) { + struct vidconsole_priv *vc_priv = dev_get_uclass_priv(dev); struct console_tt_priv *priv = dev_get_priv(dev); /* A new input line has start, so clear our history */ priv->pos_ptr = 0; + vc_priv->last_ch = 0; return 0; } diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 6ba62ec348e..f1b2d61bd8f 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -127,6 +127,9 @@ void vidconsole_set_cursor_pos(struct udevice *dev, int x, int y) priv->xcur_frac = VID_TO_POS(x); priv->xstart_frac = priv->xcur_frac; priv->ycur = y; + + /* make sure not to kern against the previous character */ + priv->last_ch = 0; vidconsole_entry_start(dev); }