video: at91: Adjust vidconsole_position_cursor() to use char pos
authorSimon Glass <sjg@chromium.org>
Mon, 1 Oct 2018 18:22:47 +0000 (12:22 -0600)
committerSimon Glass <sjg@chromium.org>
Tue, 9 Oct 2018 10:40:27 +0000 (04:40 -0600)
At present this function uses pixels but it seems more useful for it to
position in terms of characters on the screen. This also matches the
comment to the function. Update this.

Unfortunately there is one user of this function (at91). Have a crack at
fixing this, since I cannot test it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
board/atmel/common/video_display.c
drivers/video/vidconsole-uclass.c

index 7dd7b85556ee6a2b356d5eacd18255aa8c70c3ce..c7d3f8addca17a7fb1db75f24bb68d1628ba8300 100644 (file)
@@ -18,6 +18,7 @@ DECLARE_GLOBAL_DATA_PTR;
 
 int at91_video_show_board_info(void)
 {
+       struct vidconsole_priv *priv;
        ulong dram_size, nand_size;
        int i;
        u32 len = 0;
@@ -63,7 +64,9 @@ int at91_video_show_board_info(void)
        if (ret)
                return ret;
 
-       vidconsole_position_cursor(con, 0, logo_info.logo_height);
+       priv = dev_get_uclass_priv(con);
+       vidconsole_position_cursor(con, 0, (logo_info.logo_height +
+                                  priv->y_charsize - 1) / priv->y_charsize);
        for (s = buf, i = 0; i < len; s++, i++)
                vidconsole_put_char(con, *s);
 
index 89ac8b3cc8fc1d80e345a96fc9cc5114c954b7db..1874887f2f3a63a9d257e95ccfac3277c3d73917 100644 (file)
@@ -511,6 +511,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);
 }