diff options
author | Piotr Wilczek <p.wilczek@samsung.com> | 2012-10-19 05:34:06 +0000 |
---|---|---|
committer | Minkyu Kang <mk7.kang@samsung.com> | 2012-11-15 21:08:20 +0900 |
commit | 28c9e34827372a0d243e04c7d4859cd7e8dd51d7 (patch) | |
tree | 2d7870eb9ded6b7476ea12105f733d2221d89460 | |
parent | eed29742183b5a462f2e8fd56efb004f317b4fa7 (diff) | |
download | u-boot-imx-28c9e34827372a0d243e04c7d4859cd7e8dd51d7.zip u-boot-imx-28c9e34827372a0d243e04c7d4859cd7e8dd51d7.tar.gz u-boot-imx-28c9e34827372a0d243e04c7d4859cd7e8dd51d7.tar.bz2 |
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 <p.wilczek@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Minkyu Kang <mk7.kang@samsung.com>
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
-rw-r--r-- | 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); |