projects
/
platform
/
kernel
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'u-boot-imx-next-20230404' of https://gitlab.denx.de/u-boot/custodians...
[platform/kernel/u-boot.git]
/
cmd
/
bmp.c
diff --git
a/cmd/bmp.c
b/cmd/bmp.c
index
d2a39f6
..
46d0d91
100644
(file)
--- a/
cmd/bmp.c
+++ b/
cmd/bmp.c
@@
-13,7
+13,8
@@
#include <command.h>
#include <dm.h>
#include <gzip.h>
#include <command.h>
#include <dm.h>
#include <gzip.h>
-#include <lcd.h>
+#include <image.h>
+#include <log.h>
#include <malloc.h>
#include <mapmem.h>
#include <splash.h>
#include <malloc.h>
#include <mapmem.h>
#include <splash.h>
@@
-46,27
+47,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);
- if (
dst == NULL
) {
+ dst = malloc(CONFIG_VIDEO_LOGO_MAX_SIZE + 3);
+ if (
!dst
) {
puts("Error: malloc in gunzip failed!\n");
return NULL;
}
puts("Error: malloc in gunzip failed!\n");
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),
- &len)
!= 0
) {
+ if (gunzip(bmp, CONFIG_VIDEO_LOGO_MAX_SIZE, map_sysmem(addr, 0),
+ &len)) {
free(dst);
return NULL;
}
free(dst);
return NULL;
}
- if (len == CONFIG_SYS_VIDEO_LOGO_MAX_SIZE)
- puts("Image could be truncated"
- " (increase CONFIG_SYS_VIDEO_LOGO_MAX_SIZE)!\n");
+ if (len == CONFIG_VIDEO_LOGO_MAX_SIZE)
+ puts("Image could be truncated (increase CONFIG_VIDEO_LOGO_MAX_SIZE)!\n");
/*
* Check for bmp mark 'BM'
/*
* Check for bmp mark 'BM'
@@
-90,16
+88,17
@@
struct bmp_image *gunzip_bmp(unsigned long addr, unsigned long *lenp,
}
#endif
}
#endif
-static int do_bmp_info(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+static int do_bmp_info(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong addr;
switch (argc) {
{
ulong addr;
switch (argc) {
- case 1: /* use load_addr as default address */
- addr = load_addr;
+ case 1: /* use
image_
load_addr as default address */
+ addr =
image_
load_addr;
break;
case 2: /* use argument */
break;
case 2: /* use argument */
- addr =
simple_strtoul(argv[1], NULL, 16
);
+ addr =
hextoul(argv[1], NULL
);
break;
default:
return CMD_RET_USAGE;
break;
default:
return CMD_RET_USAGE;
@@
-108,7
+107,8
@@
static int do_bmp_info(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[
return (bmp_info(addr));
}
return (bmp_info(addr));
}
-static int do_bmp_display(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
+static int do_bmp_display(struct cmd_tbl *cmdtp, int flag, int argc,
+ char *const argv[])
{
ulong addr;
int x = 0, y = 0;
{
ulong addr;
int x = 0, y = 0;
@@
-116,22
+116,22
@@
static int do_bmp_display(cmd_tbl_t * cmdtp, int flag, int argc, char * const ar
splash_get_pos(&x, &y);
switch (argc) {
splash_get_pos(&x, &y);
switch (argc) {
- case 1: /* use load_addr as default address */
- addr = load_addr;
+ case 1: /* use
image_
load_addr as default address */
+ addr =
image_
load_addr;
break;
case 2: /* use argument */
break;
case 2: /* use argument */
- addr =
simple_strtoul(argv[1], NULL, 16
);
+ addr =
hextoul(argv[1], NULL
);
break;
case 4:
break;
case 4:
- addr =
simple_strtoul(argv[1], NULL, 16
);
+ addr =
hextoul(argv[1], NULL
);
if (!strcmp(argv[2], "m"))
x = BMP_ALIGN_CENTER;
else
if (!strcmp(argv[2], "m"))
x = BMP_ALIGN_CENTER;
else
- x =
simple_strtoul(argv[2], NULL, 10
);
+ x =
dectoul(argv[2], NULL
);
if (!strcmp(argv[3], "m"))
y = BMP_ALIGN_CENTER;
else
if (!strcmp(argv[3], "m"))
y = BMP_ALIGN_CENTER;
else
- y =
simple_strtoul(argv[3], NULL, 10
);
+ y =
dectoul(argv[3], NULL
);
break;
default:
return CMD_RET_USAGE;
break;
default:
return CMD_RET_USAGE;
@@
-140,7
+140,7
@@
static int do_bmp_display(cmd_tbl_t * cmdtp, int flag, int argc, char * const ar
return (bmp_display(addr, x, y));
}
return (bmp_display(addr, x, y));
}
-static
cmd_tbl_t
cmd_bmp_sub[] = {
+static
struct cmd_tbl
cmd_bmp_sub[] = {
U_BOOT_CMD_MKENT(info, 3, 0, do_bmp_info, "", ""),
U_BOOT_CMD_MKENT(display, 5, 0, do_bmp_display, "", ""),
};
U_BOOT_CMD_MKENT(info, 3, 0, do_bmp_info, "", ""),
U_BOOT_CMD_MKENT(display, 5, 0, do_bmp_display, "", ""),
};
@@
-161,9
+161,9
@@
void bmp_reloc(void) {
* Return: None
*
*/
* Return: None
*
*/
-static int do_bmp(
cmd_tbl_t *cmdtp, int flag, int argc, char *
const argv[])
+static int do_bmp(
struct cmd_tbl *cmdtp, int flag, int argc, char *
const argv[])
{
{
-
cmd_tbl_t
*c;
+
struct cmd_tbl
*c;
/* Strip off leading 'bmp' command argument */
argc--;
/* Strip off leading 'bmp' command argument */
argc--;
@@
-220,21
+220,9
@@
static int bmp_info(ulong addr)
return(0);
}
return(0);
}
-/*
- * 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 bmp_display(ulong addr, int x, int y)
{
-#ifdef CONFIG_DM_VIDEO
struct udevice *dev;
struct udevice *dev;
-#endif
int ret;
struct bmp_image *bmp = map_sysmem(addr, 0);
void *bmp_alloc_addr = NULL;
int ret;
struct bmp_image *bmp = map_sysmem(addr, 0);
void *bmp_alloc_addr = NULL;
@@
-250,25
+238,15
@@
int bmp_display(ulong addr, int x, int y)
}
addr = map_to_sysmem(bmp);
}
addr = map_to_sysmem(bmp);
-#ifdef CONFIG_DM_VIDEO
ret = uclass_first_device_err(UCLASS_VIDEO, &dev);
if (!ret) {
bool align = false;
ret = uclass_first_device_err(UCLASS_VIDEO, &dev);
if (!ret) {
bool align = false;
- if (CONFIG_IS_ENABLED(SPLASH_SCREEN_ALIGN) ||
- x == BMP_ALIGN_CENTER ||
- y == BMP_ALIGN_CENTER)
+ if (x == BMP_ALIGN_CENTER || y == BMP_ALIGN_CENTER)
align = true;
ret = video_bmp_display(dev, addr, x, y, align);
}
align = true;
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);
if (bmp_alloc_addr)
free(bmp_alloc_addr);