]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
drivers: video: fix image position
authorPiotr Wilczek <p.wilczek@samsung.com>
Fri, 19 Oct 2012 05:34:06 +0000 (05:34 +0000)
committerMinkyu Kang <mk7.kang@samsung.com>
Thu, 15 Nov 2012 12:08:20 +0000 (21:08 +0900)
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>
drivers/video/exynos_fb.c

index e31a0fd500abef1bc46c9e0518e7bc2e8639db3d..d9a3f9ab18976ba597d779ec9e0fab6ffcc70414 100644 (file)
@@ -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);