From patchwork Fri Sep 28 10:34:37 2012
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [U-Boot,v4,3/4] drivers: video: fix image position
Date: Fri, 28 Sep 2012 00:34:37 -0000
From: Piotr Wilczek
X-Patchwork-Id: 187764
Message-Id: <1348828478-31298-4-git-send-email-p.wilczek@samsung.com>
To: u-boot@lists.denx.de
Cc: Piotr Wilczek ,
Kyungmin Park ,
Donghwa Lee
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);