From patchwork Fri Sep 28 10:34:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Piotr Wilczek X-Patchwork-Id: 187764 X-Patchwork-Delegate: promsoft@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id D26B32C00C0 for ; Fri, 28 Sep 2012 20:35:47 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 60573280C9; Fri, 28 Sep 2012 12:35:46 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3eBxLvJhyovj; Fri, 28 Sep 2012 12:35:46 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EE5D4280D6; Fri, 28 Sep 2012 12:35:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1FC4A280B5 for ; Fri, 28 Sep 2012 12:35:12 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id duD3BGGlQANf for ; Fri, 28 Sep 2012 12:35:11 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by theia.denx.de (Postfix) with ESMTP id 4B33D2807F for ; Fri, 28 Sep 2012 12:35:10 +0200 (CEST) Received: from epcpsbgm1.samsung.com (epcpsbgm1 [203.254.230.26]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MB2008JV2QDKCY0@mailout4.samsung.com> for u-boot@lists.denx.de; Fri, 28 Sep 2012 19:35:07 +0900 (KST) X-AuditID: cbfee61a-b7f726d000000ec7-54-50657d5b6ebc Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 96.B3.03783.B5D75605; Fri, 28 Sep 2012 19:35:07 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MB2005R62PTBP30@mmp1.samsung.com> for u-boot@lists.denx.de; Fri, 28 Sep 2012 19:35:07 +0900 (KST) From: Piotr Wilczek To: u-boot@lists.denx.de Date: Fri, 28 Sep 2012 12:34:37 +0200 Message-id: <1348828478-31298-4-git-send-email-p.wilczek@samsung.com> X-Mailer: git-send-email 1.7.10 In-reply-to: <1348828478-31298-1-git-send-email-p.wilczek@samsung.com> References: <1348491860-19224-3-git-send-email-p.wilczek@samsung.com> <1348828478-31298-1-git-send-email-p.wilczek@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrKJMWRmVeSWpSXmKPExsVy+t9jAd3o2tQAg46DYhZv93ayOzB6nL2z gzGAMYrLJiU1J7MstUjfLoEr4/O+RsaCv5wVV0+8YWlgbOfoYuTkkBAwkfj0YD0zhC0mceHe erYuRi4OIYFFjBLnlr1ghHAWM0ksmPSLFaSKTUBbYvmbN4wgtoiAhMSv/qtgRcwCpxgl3rXf BBslLGAlMaF1N5jNIqAqsevuWSYQm1fAVeJK+yQ2iHXyEk/v94HZnAJuEmvPvmWF2NbIKNF3 ahXrBEbeBYwMqxhFUwuSC4qT0nMN9YoTc4tL89L1kvNzNzGCPf9MagfjygaLQ4wCHIxKPLwW K1MChFgTy4orcw8xSnAwK4nwZhSnBgjxpiRWVqUW5ccXleakFh9ilOZgURLnbfYAqhZITyxJ zU5NLUgtgskycXBKNTDK7UzbeMU6PGz9nSlL3IrPW69ZMPPDbM2pmrmCEYIz+my8vFMYVrLY lzoos1r+XZ//nlvv2KLjyatCf6RPiPfVOLBtgX3aspe/VRQCntmaX5geFv1vibN6Tuw39kUi vv4cmhkRJhslzOrchB/1cdVs4lx+4Y1wYfCGmuOrPY9bhDklpb77qKHEUpyRaKjFXFScCACN UEPQ+AEAAA== Cc: Piotr Wilczek , Kyungmin Park , Donghwa Lee Subject: [U-Boot] [PATCH v4 3/4] drivers: video: fix image position X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de This patch fixes image position on screen when images's height or width is biger than the lcd's. Signed-off-by: Piotr Wilczek Signed-off-by: Kyungmin Park CC: Minkyu Kang --- Changes in v2: - none. Changes in v3: - none Changes in v4: - none drivers/video/exynos_fb.c | 15 +++++++++++++-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c index e31a0fd..d9a3f9a 100644 --- a/drivers/video/exynos_fb.c +++ b/drivers/video/exynos_fb.c @@ -70,8 +70,19 @@ static void draw_logo(void) int x, y; ulong addr; - x = ((panel_width - panel_info.logo_width) >> 1); - y = ((panel_height - panel_info.logo_height) >> 1) - 4; + if (panel_width >= panel_info.logo_width) { + x = ((panel_width - panel_info.logo_width) >> 1); + } else { + x = 0; + printf("Warning: image width is bigger than display width\n"); + } + + if (panel_height >= panel_info.logo_height) { + y = ((panel_height - panel_info.logo_height) >> 1) - 4; + } else { + y = 0; + printf("Warning: image height is bigger than display height\n"); + } addr = panel_info.logo_addr; bmp_display(addr, x, y);