diff options
author | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2018-11-10 21:55:48 +0300 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2018-11-17 13:35:39 +0300 |
commit | 118f020d9a6d84b52cd533cfe5b02feae7e5bdde (patch) | |
tree | 892af3a970d4d1449a78539945d9aea449cca600 /drivers/video/vidconsole-uclass.c | |
parent | 1d6edcbfed2af33c748f2beb399810a0441888da (diff) | |
download | u-boot-118f020d9a6d84b52cd533cfe5b02feae7e5bdde.tar.xz |
dm: video: correctly set the cursor position
The terminal escape sequence ESC [ <x> ; <y> H is used to set the cursor
position. According to the ECMA 48 standard the upper left corner in the
escape sequences is [1, 1]. The video uclass uses [0, 0] as upper left
corner.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/video/vidconsole-uclass.c')
-rw-r--r-- | drivers/video/vidconsole-uclass.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 1874887f2f..db40a1396b 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -272,6 +272,14 @@ static void vidconsole_escape_char(struct udevice *dev, char ch) s++; /* ; */ s = parsenum(s, &col); + /* + * Video origin is [0, 0], terminal origin is [1, 1]. + */ + if (row) + --row; + if (col) + --col; + set_cursor_position(priv, row, col); break; |