/* * Subroutine: bmp_display * * Description: Display bmp file located in memory * * Inputs: addr address of the bmp file * * Return: None * */ int bmp_display(ulong addr, int x, int y) { int ret; struct bmp_image *bmp = (struct bmp_image *)addr; void *bmp_alloc_addr = NULL; unsigned long len; if (!((bmp->header.signature[0]=='B') && (bmp->header.signature[1]=='M'))) bmp = gunzip_bmp(addr, &len, &bmp_alloc_addr); if (!bmp) { printf("There is no valid bmp file at the given address\n"); return 1; } #if defined(CONFIG_LCD) ret = lcd_display_bitmap((ulong)bmp, x, y); #elif defined(CONFIG_VIDEO) ret = video_display_bitmap((unsigned long)bmp, x, y); #else # error bmp_display() requires CONFIG_LCD or CONFIG_VIDEO #endif if (bmp_alloc_addr) free(bmp_alloc_addr); return ret; }
/* * Subroutine: bmp_display * * Description: Display bmp file located in memory * * Inputs: addr address of the bmp file * * Return: None * */ static int bmp_display(ulong addr, int x, int y) { int ret; bmp_image_t *bmp = (bmp_image_t *)addr; unsigned long len; if (!((bmp->header.signature[0]=='B') && (bmp->header.signature[1]=='M'))) bmp = gunzip_bmp(addr, &len); if (!bmp) { printf("There is no valid bmp file at the given address\n"); return 1; } #if defined(CONFIG_LCD) extern int lcd_display_bitmap (ulong, int, int); ret = lcd_display_bitmap ((unsigned long)bmp, x, y); #elif defined(CONFIG_VIDEO) extern int video_display_bitmap (ulong, int, int); ret = video_display_bitmap ((unsigned long)bmp, x, y); #else # error bmp_display() requires CONFIG_LCD or CONFIG_VIDEO #endif if ((unsigned long)bmp != addr) free(bmp); return ret; }
/* * Subroutine: bmp_display * * Description: Display bmp file located in memory * * Inputs: addr address of the bmp file * * Return: None * */ static int bmp_display(ulong addr, int x, int y) { int ret; bmp_image_t *bmp = (bmp_image_t *)addr; unsigned long len; if (!((bmp->header.signature[0]=='B') && (bmp->header.signature[1]=='M'))) bmp = gunzip_bmp(addr, &len); if (!bmp) { printf("There is no valid bmp file at the given address\n"); return 1; } #if defined(CONFIG_LCD) || defined(CONFIG_LCD_AML) extern int lcd_display_bitmap (ulong, int, int); ret = lcd_display_bitmap ((unsigned long)bmp, x, y); #elif defined(CONFIG_VIDEO) extern int video_display_bitmap (ulong, int, int); ret = video_display_bitmap ((unsigned long)bmp, x, y); #elif defined(CONFIG_AMLVIDEO) int i; int pitch; char *bmp_data, *out = FB_ADDR; int osd_w = 720; int osd_h = 576; #ifdef OSD_WIDTH osd_w = OSD_WIDTH; #endif #ifdef OSD_HEIGHT osd_h = OSD_HEIGHT; #endif pitch=bmp->header.width%4; bmp_data=(char*)((char*)bmp+bmp->header.data_offset+bmp->header.width*(bmp->header.height-1)*3); bmp_data+=(pitch*(bmp->header.height-1)); //out+=(y*OSD_WIDTH+x)*3; out+=(y*bmp->header.width+x)*3; printf("%d %d\n",bmp->header.width,bmp->header.height); for (i=0; i<bmp->header.height ; i++) { memcpy(out,bmp_data,bmp->header.width*3); //out+=OSD_WIDTH*3; out+=bmp->header.width*3; bmp_data-=(bmp->header.width*3+pitch); } flush_cache(FB_ADDR, osd_w*osd_h*3); #else # error bmp_display() requires CONFIG_LCD or CONFIG_VIDEO #endif if ((unsigned long)bmp != addr) free(bmp); return ret; }
/* * Subroutine: bmp_display * * Description: Display bmp file located in memory * * Inputs: addr address of the bmp file * * Return: None * */ static int bmp_display(ulong addr, int x, int y) { #if defined(CONFIG_LCD) extern int lcd_display_bitmap (ulong, int, int); return (lcd_display_bitmap (addr, x, y)); #elif defined(CONFIG_VIDEO) extern int video_display_bitmap (ulong, int, int); return (video_display_bitmap (addr, x, y)); #else # error bmp_display() requires CONFIG_LCD or CONFIG_VIDEO #endif }
/* * Subroutine: bmp_display * * Description: Display bmp file located in memory * * Inputs: addr address of the bmp file * * Return: None * */ int bmp_display(ulong addr, int x, int y) { #ifdef CONFIG_DM_VIDEO struct udevice *dev; #endif int ret; struct bmp_image *bmp = map_sysmem(addr, 0); void *bmp_alloc_addr = NULL; unsigned long len; if (!((bmp->header.signature[0]=='B') && (bmp->header.signature[1]=='M'))) bmp = gunzip_bmp(addr, &len, &bmp_alloc_addr); if (!bmp) { printf("There is no valid bmp file at the given address\n"); return 1; } addr = map_to_sysmem(bmp); #ifdef CONFIG_DM_VIDEO ret = uclass_first_device(UCLASS_VIDEO, &dev); if (!ret) { if (!dev) ret = -ENODEV; if (!ret) { bool align = false; # ifdef CONFIG_SPLASH_SCREEN_ALIGN align = true; # endif /* CONFIG_SPLASH_SCREEN_ALIGN */ ret = video_bmp_display(dev, addr, x, y, align); } } #elif defined(CONFIG_LCD) ret = lcd_display_bitmap(addr, x, y); #elif defined(CONFIG_VIDEO) ret = video_display_bitmap(addr, x, y); #else # error bmp_display() requires CONFIG_LCD or CONFIG_VIDEO #endif if (bmp_alloc_addr) free(bmp_alloc_addr); return ret ? CMD_RET_FAILURE : 0; }