amend size of bmp logo and zoom out display
authorywj <ywj@rock-chips.com>
Wed, 22 Aug 2012 04:44:13 +0000 (12:44 +0800)
committerywj <ywj@rock-chips.com>
Wed, 22 Aug 2012 04:44:13 +0000 (12:44 +0800)
drivers/video/logo/logo_bmp.bmp
drivers/video/rockchip/rk_fb.c

index df5298e35b05decfae43132ee563afe69e453f30..0af3b87d0f1eb7b2cd5f48e9e2d8eac6aa745ec5 100644 (file)
Binary files a/drivers/video/logo/logo_bmp.bmp and b/drivers/video/logo/logo_bmp.bmp differ
index 902192ffd2d669dadc9c6c71453d8d6b4fa29e74..6ef24eb62a18f17892ffef80a38b7643f09d03c2 100644 (file)
@@ -884,9 +884,9 @@ static int init_lcdc_device_driver(struct rk_lcdc_device_driver *dev_drv,
        
        return 0;
 }
-
 #ifdef CONFIG_LOGO_LINUX_BMP
-static const struct linux_logo *bmp_logo;
+static struct linux_logo *bmp_logo;
 static int fb_prepare_bmp_logo(struct fb_info *info, int rotate)
 {
        bmp_logo = fb_find_logo(24);
@@ -899,7 +899,19 @@ static int fb_prepare_bmp_logo(struct fb_info *info, int rotate)
 
 static void fb_show_bmp_logo(struct fb_info *info, int rotate)
 {
-       memcpy(info->screen_base, bmp_logo->data, bmp_logo->width * bmp_logo->height * 4);
+       unsigned char *src=bmp_logo->data;
+       unsigned char *dst=info->screen_base;
+       int i;
+
+       if(bmp_logo->width>info->var.xres)
+               bmp_logo->width=info->var.xres;
+
+       if(bmp_logo->height>info->var.yres)
+               bmp_logo->height=info->var.yres;
+
+       for(i=0;i<bmp_logo->height;i++)
+               memcpy(dst+info->var.xres*i*4, src+bmp_logo->width*i*4, bmp_logo->width*4);
+       
 }
 #endif