From patchwork Wed Nov 20 10:44:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Patrice CHOTARD X-Patchwork-Id: 1198018 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) 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=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="wz+Qqc37"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 47HzqC6sZwz9sPL for ; Wed, 20 Nov 2019 21:45:11 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id A0CBEC21F94; Wed, 20 Nov 2019 10:44: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=T_DKIM_INVALID 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 CE076C21F49; Wed, 20 Nov 2019 10:44:45 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id F2F7BC21D8A; Wed, 20 Nov 2019 10:44:34 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by lists.denx.de (Postfix) with ESMTPS id 386F3C21EC9 for ; Wed, 20 Nov 2019 10:44:32 +0000 (UTC) Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xAKAR8Mo022813; Wed, 20 Nov 2019 11:44:27 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=TRV65jCWMdSNjAsPeZj/Hoy4I4w6DoeJVhjJdIG2dTo=; b=wz+Qqc37aBiL95LfGKPgdssHpTj4b2nBT4cpQ9Afh7ynXdZa6hqWU8prbC6lDHLuCzrK hKoEOw4bPbRDktm0wK2v7pVR2jnHob3F4iNrSEmjDYfHI/N2OBO/IlIJpAbP8y7PcjfI g1S+s3+X9NqV4UUPIyiZZRUGpnbH0gdUjpqTyGKJI/oLVJlO0MbnpOKREtuRO8KMPFXt ZnqwgLlyEG7oaj+XJO3XfnBtCRMiekVZEPaifLL5/dWNyKDsoDggYQU1KzyemYS7qRw/ WKyx25xsYliMszXdT7d+lCeV/YjiohxxlajztajFQcnWAXFobnI4T9Eul2V2SXR7Y6JE 2w== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2wa9usd71x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Nov 2019 11:44:27 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 0141510002A; Wed, 20 Nov 2019 11:44:27 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id E9E092BE235; Wed, 20 Nov 2019 11:44:26 +0100 (CET) Received: from localhost (10.75.127.48) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 20 Nov 2019 11:44:26 +0100 From: Patrice Chotard To: Date: Wed, 20 Nov 2019 11:44:17 +0100 Message-ID: <20191120104418.1179-2-patrice.chotard@st.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191120104418.1179-1-patrice.chotard@st.com> References: <20191120104418.1179-1-patrice.chotard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.48] X-ClientProxiedBy: SFHDAG2NODE1.st.com (10.75.127.4) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95, 18.0.572 definitions=2019-11-20_02:2019-11-15, 2019-11-20 signatures=0 Cc: U-Boot STM32 Subject: [U-Boot] [PATCH 1/2] video: bmp: Fix video_splash_align_axis() 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" In case the panel_size is smaller than picture_size, we must insure that panel_picture_delta stores the absolute value of difference between panel_size and picture_size. Signed-off-by: Patrice Chotard CC: Yannick Fertré --- drivers/video/video_bmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/video/video_bmp.c b/drivers/video/video_bmp.c index 193f37d275..dc6258ce78 100644 --- a/drivers/video/video_bmp.c +++ b/drivers/video/video_bmp.c @@ -157,7 +157,7 @@ __weak void fb_put_word(uchar **fb, uchar **from) static void video_splash_align_axis(int *axis, unsigned long panel_size, unsigned long picture_size) { - unsigned long panel_picture_delta = panel_size - picture_size; + unsigned long panel_picture_delta = abs(panel_size - picture_size); unsigned long axis_alignment; if (*axis == BMP_ALIGN_CENTER) From patchwork Wed Nov 20 10:44:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Patrice CHOTARD X-Patchwork-Id: 1198019 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) 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=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="T/pIJHIa"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 47Hzqr0wknz9sPL for ; Wed, 20 Nov 2019 21:45:43 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id AF4B4C21F87; Wed, 20 Nov 2019 10:44:42 +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=T_DKIM_INVALID 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 55822C21D8A; Wed, 20 Nov 2019 10:44:41 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 47ABFC21F58; Wed, 20 Nov 2019 10:44:34 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by lists.denx.de (Postfix) with ESMTPS id 59ACFC21ECF for ; Wed, 20 Nov 2019 10:44:32 +0000 (UTC) Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xAKAR6SI022777; Wed, 20 Nov 2019 11:44:28 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=STMicroelectronics; bh=2JB9pUvxV9YH6Mm0ztlYUtpItVMWXLj04flYZQc2x+Q=; b=T/pIJHIaahd9pj/GWcftWdjA3Bsuo7BAPnVEa4VpTKoC9tFdzmk/7+ANRT8W0W0FES3p F+52FTUJYWrFQyyvyhR6ZS52Tm4iwesXojVoHsqx1uvJ9jnmNqiuzGyRye6xFXoAeMGY 1qSjo0l38dSgZ4lL8ITaH7x2/mK4Hq72t4C4NAYKIOLSUjHlKtbouSt1FVRsNqTDnong cRs6Y440mklES6DITgz+wC1UduwjUHBD/pqUuF0/3tfGRl9X0mO52vChM+2t3ACtrYQK tYEeErtOV5WYD29tIswoLUeLyGf1WEOZK7QHPpncsz47u+Dg81fEL7RnZUhCRDvCSiVb iQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2wa9usd721-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 20 Nov 2019 11:44:28 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id CF30710002A; Wed, 20 Nov 2019 11:44:27 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id C5BB42BE235; Wed, 20 Nov 2019 11:44:27 +0100 (CET) Received: from localhost (10.75.127.48) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 20 Nov 2019 11:44:27 +0100 From: Patrice Chotard To: Date: Wed, 20 Nov 2019 11:44:18 +0100 Message-ID: <20191120104418.1179-3-patrice.chotard@st.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191120104418.1179-1-patrice.chotard@st.com> References: <20191120104418.1179-1-patrice.chotard@st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.48] X-ClientProxiedBy: SFHDAG4NODE3.st.com (10.75.127.12) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95, 18.0.572 definitions=2019-11-20_02:2019-11-15, 2019-11-20 signatures=0 Cc: U-Boot STM32 Subject: [U-Boot] [PATCH 2/2] video: bmp: Fix video_display_rle8_bitmap() 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" In case the BMP size is bigger than the frame buffer, don't use the BMP's width and height in video_display_rle8_bitmap, but the one's checked in video_bmp_display() as parameters to video_display_rle8_bitmap(). Signed-off-by: Patrice Chotard CC: Yannick Fertré --- drivers/video/video_bmp.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/video/video_bmp.c b/drivers/video/video_bmp.c index dc6258ce78..f3a6d04682 100644 --- a/drivers/video/video_bmp.c +++ b/drivers/video/video_bmp.c @@ -40,18 +40,16 @@ static void draw_encoded_bitmap(ushort **fbp, ushort col, int cnt) static void video_display_rle8_bitmap(struct udevice *dev, struct bmp_image *bmp, ushort *cmap, - uchar *fb, int x_off, int y_off) + uchar *fb, int x_off, int y_off, + ulong width, ulong height) { struct video_priv *priv = dev_get_uclass_priv(dev); uchar *bmap; - ulong width, height; ulong cnt, runlen; int x, y; int decode = 1; debug("%s\n", __func__); - width = get_unaligned_le32(&bmp->header.width); - height = get_unaligned_le32(&bmp->header.height); bmap = (uchar *)bmp + get_unaligned_le32(&bmp->header.data_offset); x = 0; @@ -277,7 +275,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y, return -EPROTONOSUPPORT; } video_display_rle8_bitmap(dev, bmp, cmap_base, fb, x, - y); + y, width, height); break; } #endif