From: Piotr Wilczek
Date: Fri, 19 Oct 2012 05:34:06 +0000 (+0000)
Subject: drivers: video: fix image position
X-Git-Tag: v2013.01-rc3~9^2~44
X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=28c9e34827372a0d243e04c7d4859cd7e8dd51d7;p=platform%2Fkernel%2Fu-boot.git
drivers: video: fix image position
This patch fixes image position on screen when images's height or width is biger then the lcd's.
Signed-off-by: Piotr Wilczek
Signed-off-by: Kyungmin Park
CC: Minkyu Kang
Signed-off-by: Minkyu Kang
---
diff --git a/drivers/video/exynos_fb.c b/drivers/video/exynos_fb.c
index e31a0fd500..d9a3f9ab18 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);