From patchwork Mon Oct 1 18:22:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 977391 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=chromium.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 42PB4b0CD1z9s3l for ; Tue, 2 Oct 2018 04:43:26 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 6BE1EC21F7A; Mon, 1 Oct 2018 18:41:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=RCVD_IN_DNSWL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id EBEE1C22070; Mon, 1 Oct 2018 18:25:13 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id BB54AC2207A; Mon, 1 Oct 2018 18:24:25 +0000 (UTC) Received: from mail-it1-f202.google.com (mail-it1-f202.google.com [209.85.166.202]) by lists.denx.de (Postfix) with ESMTPS id 2685CC22008 for ; Mon, 1 Oct 2018 18:24:18 +0000 (UTC) Received: by mail-it1-f202.google.com with SMTP id y73-v6so12021597ita.2 for ; Mon, 01 Oct 2018 11:24:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=MRGhLzoYbt6pEvT1hEMPmkNN1ySFJ1NseSxb/Xx6oi0=; b=ku5MKafuZwgt9M6RNy0AlZmw4GwxxS3zOx9ey7FrVqBY4HgcDVvQU0TOEc1mc0hL8z 5iMYne9C/TaozHocq9E8f8KUdsfbqbbppZwjs/vtrJYpq44IXZLBreL5JlOol1cSMe/x BLQ00g7jXJV3l17Lk2GldWNmL+hCeuFtSXtLck6m/oLEbDjgYPD3bLOp8pn6COn4TKvW 42EJmacdx8aoTgfT1eIyRUFkOhHKZfWIhXVk23LB+XSxX3VSGFJ7mIjwhh6bgc+kzotU BdDBoN5gEbnjCJdDxirhjPATywtRiGsaKsvsr/zLWZya/pdAQZvnSnlRfo1jck4EzA5p 97tQ== X-Gm-Message-State: ABuFfogoj+PZEe9IuoQRQ6GCZLOxAqtEWAbYrgHxNbuKUDB6jFqU3qio NhuEW7eqFaMSlAhq2IRIupF+YWA= X-Google-Smtp-Source: ACcGV601bEuJSyQHUV4vHkYsY+1zQp2cEDOB4o9O7d+cduuJGU7cnv38nDShGiJewRr9TqjQILZmdeI= X-Received: by 2002:a24:2752:: with SMTP id g79-v6mr10887856ita.4.1538418257232; Mon, 01 Oct 2018 11:24:17 -0700 (PDT) Date: Mon, 1 Oct 2018 12:22:47 -0600 In-Reply-To: <20181001182249.129565-1-sjg@chromium.org> Message-Id: <20181001182249.129565-44-sjg@chromium.org> Mime-Version: 1.0 References: <20181001182249.129565-1-sjg@chromium.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog From: Simon Glass To: U-Boot Mailing List Subject: [U-Boot] [PATCH 43/45] video: at91: Adjust vidconsole_position_cursor() to use char pos X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 Reviewed-by: Anatolij Gustschin Tested-by: Eugen Hristev Tested-by: Eugen Hristev --- board/atmel/common/video_display.c | 5 ++++- drivers/video/vidconsole-uclass.c | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/board/atmel/common/video_display.c b/board/atmel/common/video_display.c index 7dd7b85556e..e02cb00f866 100644 --- a/board/atmel/common/video_display.c +++ b/board/atmel/common/video_display.c @@ -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 + + con->y_charsize - 1) / con->y_charsize); for (s = buf, i = 0; i < len; s++, i++) vidconsole_put_char(con, *s); diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index 89ac8b3cc8f..1874887f2f3 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -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); }