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)