* by the caller after use.
*
* Returns NULL if decompression failed, or if the decompressed data
- * didn't contain a valid BMP signature.
+ * didn't contain a valid BMP signature or decompression is not enabled in
+ * Kconfig.
*/
-#if CONFIG_IS_ENABLED(VIDEO_BMP_GZIP)
struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp,
void **alloc_addr)
{
unsigned long len;
struct bmp_image *bmp;
+ if (!CONFIG_IS_ENABLED(VIDEO_BMP_GZIP))
+ return NULL;
+
/*
* Decompress bmp image
*/
*alloc_addr = dst;
return bmp;
}
-#else
-struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp,
- void **alloc_addr)
-{
- return NULL;
-}
-#endif
#ifdef CONFIG_NEEDS_MANUAL_RELOC
void bmp_reloc(void)
return splash_video_logo_load();
}
-#if CONFIG_IS_ENABLED(SPLASH_SCREEN_ALIGN)
void splash_get_pos(int *x, int *y)
{
char *s = env_get("splashpos");
- if (!s)
+ if (!CONFIG_IS_ENABLED(SPLASH_SCREEN_ALIGN) || !s)
return;
if (s[0] == 'm')
*y = simple_strtol(s + 1, NULL, 0);
}
}
-#endif /* CONFIG_SPLASH_SCREEN_ALIGN */
#if CONFIG_IS_ENABLED(VIDEO) && !CONFIG_IS_ENABLED(HIDE_LOGO_VERSION)
* Common function to show a splash image if env("splashimage") is set.
* For additional details please refer to doc/README.splashprepare.
*/
-#if CONFIG_IS_ENABLED(SPLASH_SCREEN) && CONFIG_IS_ENABLED(BMP)
int splash_display(void)
{
ulong addr;
char *s;
int x = 0, y = 0, ret;
-
+ if (!CONFIG_IS_ENABLED(SPLASH_SCREEN))
+ return -ENOSYS;
s = env_get("splashimage");
if (!s)
return -EINVAL;
splash_get_pos(&x, &y);
- ret = bmp_display(addr, x, y);
+ if (CONFIG_IS_ENABLED(BMP))
+ ret = bmp_display(addr, x, y);
+ else
+ return -ENOSYS;
/* Skip banner output on video console if the logo is not at 0,0 */
if (x || y)
end:
return ret;
}
-#endif
#endif
int splash_screen_prepare(void);
-
-#if CONFIG_IS_ENABLED(SPLASH_SCREEN_ALIGN)
void splash_get_pos(int *x, int *y);
-#else
-static inline void splash_get_pos(int *x, int *y) { }
-#endif
-
-#if CONFIG_IS_ENABLED(SPLASH_SCREEN) && CONFIG_IS_ENABLED(BMP)
int splash_display(void);
-#else
-static inline int splash_display(void)
-{
- return -ENOSYS;
-}
-#endif
#define BMP_ALIGN_CENTER 0x7FFF