From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Sat, 1 Apr 2017 12:05:41 -0600 Subject: [U-Boot] [PATCH v5 04/19] dm: video: Correct line clearing code In-Reply-To: <20170401180556.2416-1-sjg@chromium.org> References: <20170401180556.2416-1-sjg@chromium.org> Message-ID: <20170401180556.2416-5-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de At present we clear many more bytes than we should on 16bpp and 32bpp displays. The number of pixels to clear is currently calculated as the line length (in bytes) multiplied by the number of lines to clear. This is only correct for 8bpp displays. Correct the calculation to use the number of text columns multiplied by the width of each character multiplied by the number of lines to clear. Signed-off-by: Simon Glass Acked-by: Anatolij Gustschin --- Changes in v5: None Changes in v4: None Changes in v3: None drivers/video/console_normal.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/video/console_normal.c b/drivers/video/console_normal.c index 89a55dd11d..744345d58e 100644 --- a/drivers/video/console_normal.c +++ b/drivers/video/console_normal.c @@ -16,9 +16,10 @@ static int console_normal_set_row(struct udevice *dev, uint row, int clr) { + struct vidconsole_priv *vc_priv = dev_get_uclass_priv(dev); struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent); void *line; - int pixels = VIDEO_FONT_HEIGHT * vid_priv->line_length; + int pixels = VIDEO_FONT_HEIGHT * vc_priv->cols * VIDEO_FONT_WIDTH; int i; line = vid_priv->fb + row * VIDEO_FONT_HEIGHT * vid_priv->line_length; -- 2.12.2.564.g063fe858b8-goog