video: Rename CONFIG_SYS_VIDEO_LOGO_MAX_SIZE

This option should not have the SYS_ in it. Drop it so it fits in with the
other video options.

Also simplify the alignment code in gunzip_bmp(), since malloc() always
returns a 32-bit-aligned pointer.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2022-10-18 06:46:08 -06:00 committed by Anatolij Gustschin
parent 4adc28ebc6
commit e655003384
11 changed files with 22 additions and 22 deletions

View File

@ -358,7 +358,7 @@ int board_late_init(void)
return 0; return 0;
addr = hextoul(s, NULL); addr = hextoul(s, NULL);
dst = malloc(CONFIG_SYS_VIDEO_LOGO_MAX_SIZE); dst = malloc(CONFIG_VIDEO_LOGO_MAX_SIZE);
if (!dst) if (!dst)
return -ENOMEM; return -ENOMEM;
@ -366,8 +366,8 @@ int board_late_init(void)
if (ret < 0) if (ret < 0)
goto splasherr; goto splasherr;
len = CONFIG_SYS_VIDEO_LOGO_MAX_SIZE; len = CONFIG_VIDEO_LOGO_MAX_SIZE;
ret = gunzip(dst + 2, CONFIG_SYS_VIDEO_LOGO_MAX_SIZE - 2, ret = gunzip(dst + 2, CONFIG_VIDEO_LOGO_MAX_SIZE - 2,
(uchar *)addr, &len); (uchar *)addr, &len);
if (ret) { if (ret) {
printf("Error: no valid bmp or bmp.gz image at %lx\n", addr); printf("Error: no valid bmp or bmp.gz image at %lx\n", addr);

View File

@ -48,27 +48,24 @@ struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp,
/* /*
* Decompress bmp image * Decompress bmp image
*/ */
len = CONFIG_SYS_VIDEO_LOGO_MAX_SIZE; len = CONFIG_VIDEO_LOGO_MAX_SIZE;
/* allocate extra 3 bytes for 32-bit-aligned-address + 2 alignment */ /* allocate extra 3 bytes for 32-bit-aligned-address + 2 alignment */
dst = malloc(CONFIG_SYS_VIDEO_LOGO_MAX_SIZE + 3); dst = malloc(CONFIG_VIDEO_LOGO_MAX_SIZE + 3);
if (dst == NULL) { if (!dst) {
puts("Error: malloc in gunzip failed!\n"); puts("Error: malloc in gunzip failed!\n");
return NULL; return NULL;
} }
bmp = dst;
/* align to 32-bit-aligned-address + 2 */ /* align to 32-bit-aligned-address + 2 */
bmp = (struct bmp_image *)((((uintptr_t)dst + 1) & ~3) + 2); bmp = dst + 2;
if (gunzip(bmp, CONFIG_SYS_VIDEO_LOGO_MAX_SIZE, map_sysmem(addr, 0), if (gunzip(bmp, CONFIG_VIDEO_LOGO_MAX_SIZE, map_sysmem(addr, 0),
&len) != 0) { &len)) {
free(dst); free(dst);
return NULL; return NULL;
} }
if (len == CONFIG_SYS_VIDEO_LOGO_MAX_SIZE) if (len == CONFIG_VIDEO_LOGO_MAX_SIZE)
puts("Image could be truncated" puts("Image could be truncated (increase CONFIG_VIDEO_LOGO_MAX_SIZE)!\n");
" (increase CONFIG_SYS_VIDEO_LOGO_MAX_SIZE)!\n");
/* /*
* Check for bmp mark 'BM' * Check for bmp mark 'BM'

View File

@ -925,6 +925,9 @@ config VIDEO_BMP_GZIP
images, gzipped BMP images can be displayed via the images, gzipped BMP images can be displayed via the
splashscreen support or the bmp command. splashscreen support or the bmp command.
config VIDEO_LOGO_MAX_SIZE
bool "Maximum size of the bitmap logo in bytes"
config VIDEO_BMP_RLE8 config VIDEO_BMP_RLE8
bool "Run length encoded BMP image (RLE8) support" bool "Run length encoded BMP image (RLE8) support"
depends on DM_VIDEO depends on DM_VIDEO

View File

@ -81,7 +81,7 @@
/* /*
* LCD * LCD
*/ */
#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (2 << 20) #define CONFIG_VIDEO_LOGO_MAX_SIZE (2 << 20)
/* LVDS display */ /* LVDS display */
#define CONFIG_SYS_LDB_CLOCK 33260000 #define CONFIG_SYS_LDB_CLOCK 33260000

View File

@ -23,7 +23,7 @@
/* Framebuffer support */ /* Framebuffer support */
#ifdef CONFIG_DM_VIDEO #ifdef CONFIG_DM_VIDEO
#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (512 << 10) #define CONFIG_VIDEO_LOGO_MAX_SIZE (512 << 10)
#endif #endif
/* Extra Environments */ /* Extra Environments */

View File

@ -26,7 +26,7 @@
/* Framebuffer support */ /* Framebuffer support */
#ifdef CONFIG_DM_VIDEO #ifdef CONFIG_DM_VIDEO
#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (512 << 10) #define CONFIG_VIDEO_LOGO_MAX_SIZE (512 << 10)
#endif #endif
/* Extra Environment */ /* Extra Environment */

View File

@ -27,7 +27,7 @@
#define CONFIG_MXC_USB_FLAGS 0 #define CONFIG_MXC_USB_FLAGS 0
/* Framebuffer and LCD */ /* Framebuffer and LCD */
#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (6 * 1024 * 1024) #define CONFIG_VIDEO_LOGO_MAX_SIZE (6 * 1024 * 1024)
#define CONFIG_IMX_HDMI #define CONFIG_IMX_HDMI
#define CONFIG_IMX_VIDEO_SKIP #define CONFIG_IMX_VIDEO_SKIP

View File

@ -121,6 +121,6 @@ int universal_spi_read(void);
* LCD Settings * LCD Settings
*/ */
#define CONFIG_LD9040 #define CONFIG_LD9040
#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE ((500 * 160 * 4) + 54) #define CONFIG_VIDEO_LOGO_MAX_SIZE ((500 * 160 * 4) + 54)
#endif /* __CONFIG_H */ #endif /* __CONFIG_H */

View File

@ -148,6 +148,6 @@
#define LCD_BPP LCD_COLOR16 #define LCD_BPP LCD_COLOR16
/* LCD */ /* LCD */
#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE ((500 * 160 * 4) + 54) #define CONFIG_VIDEO_LOGO_MAX_SIZE ((500 * 160 * 4) + 54)
#endif /* __CONFIG_H */ #endif /* __CONFIG_H */

View File

@ -138,6 +138,6 @@
#define LCD_BPP LCD_COLOR16 #define LCD_BPP LCD_COLOR16
/* LCD */ /* LCD */
#define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE ((500 * 160 * 4) + 54) #define CONFIG_VIDEO_LOGO_MAX_SIZE ((500 * 160 * 4) + 54)
#endif /* __CONFIG_H */ #endif /* __CONFIG_H */

View File

@ -1279,7 +1279,6 @@ CONFIG_SYS_VCXK_INVERT_PORT
CONFIG_SYS_VCXK_REQUEST_DDR CONFIG_SYS_VCXK_REQUEST_DDR
CONFIG_SYS_VCXK_REQUEST_PIN CONFIG_SYS_VCXK_REQUEST_PIN
CONFIG_SYS_VCXK_REQUEST_PORT CONFIG_SYS_VCXK_REQUEST_PORT
CONFIG_SYS_VIDEO_LOGO_MAX_SIZE
CONFIG_SYS_VSC7385_BASE CONFIG_SYS_VSC7385_BASE
CONFIG_SYS_VSC7385_BASE_PHYS CONFIG_SYS_VSC7385_BASE_PHYS
CONFIG_SYS_VSC7385_BR_PRELIM CONFIG_SYS_VSC7385_BR_PRELIM
@ -1347,6 +1346,7 @@ CONFIG_USB_TTY
CONFIG_U_BOOT_HDR_SIZE CONFIG_U_BOOT_HDR_SIZE
CONFIG_VAR_SIZE_SPL CONFIG_VAR_SIZE_SPL
CONFIG_VERY_BIG_RAM CONFIG_VERY_BIG_RAM
CONFIG_VIDEO_LOGO_MAX_SIZE
CONFIG_VSC7385_ENET CONFIG_VSC7385_ENET
CONFIG_VSC7385_IMAGE CONFIG_VSC7385_IMAGE
CONFIG_VSC7385_IMAGE_SIZE CONFIG_VSC7385_IMAGE_SIZE