Merge branch 'master' of git://git.denx.de/u-boot-spi
[platform/kernel/u-boot.git] / drivers / video / vidconsole-uclass.c
index 89ac8b3..2ca19d4 100644 (file)
@@ -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;
@@ -344,7 +352,7 @@ static void vidconsole_escape_char(struct udevice *dev, char ch)
                        switch (val) {
                        case 0:
                                /* all attributes off */
-                               video_set_default_colors(vid_priv);
+                               video_set_default_colors(dev->parent, false);
                                break;
                        case 1:
                                /* bold */
@@ -511,6 +519,8 @@ void vidconsole_position_cursor(struct udevice *dev, unsigned col, unsigned row)
        struct udevice *vid_dev = dev->parent;
        struct video_priv *vid_priv = dev_get_uclass_priv(vid_dev);
 
+       col *= priv->x_charsize;
+       row *= priv->y_charsize;
        priv->xcur_frac = VID_TO_POS(min_t(short, col, vid_priv->xsize - 1));
        priv->ycur = min_t(short, row, vid_priv->ysize - 1);
 }