* [U-Boot] [PATCH] cmd: bmp: manage centered display
@ 2018-11-14 9:18 Patrick Delaunay
2018-12-01 14:06 ` Anatolij Gustschin
0 siblings, 1 reply; 4+ messages in thread
From: Patrick Delaunay @ 2018-11-14 9:18 UTC (permalink / raw)
To: u-boot
Allow to display BMP at the middle of the screen.
'm' means "middle" as it is done for the splashscreen variable:
splashpos=m,m
Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
---
Example for command
load mmc 0:4 ${splashimage} splash.bmp
bmp display ${splashimage} m m
or function can be used directly
bmp_display(0xC0000000, BMP_ALIGN_CENTER, BMP_ALIGN_CENTER)
cmd/bmp.c | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/cmd/bmp.c b/cmd/bmp.c
index 02bdf48..1ace8a8 100644
--- a/cmd/bmp.c
+++ b/cmd/bmp.c
@@ -108,6 +108,7 @@ static int do_bmp_info(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[
return (bmp_info(addr));
}
+#define BMP_ALIGN_CENTER 0x7FFF
static int do_bmp_display(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
{
ulong addr;
@@ -124,8 +125,14 @@ static int do_bmp_display(cmd_tbl_t * cmdtp, int flag, int argc, char * const ar
break;
case 4:
addr = simple_strtoul(argv[1], NULL, 16);
- x = simple_strtoul(argv[2], NULL, 10);
- y = simple_strtoul(argv[3], NULL, 10);
+ if (!strcmp(argv[2], "m"))
+ x = BMP_ALIGN_CENTER;
+ else
+ x = simple_strtoul(argv[2], NULL, 10);
+ if (!strcmp(argv[3], "m"))
+ y = BMP_ALIGN_CENTER;
+ else
+ y = simple_strtoul(argv[3], NULL, 10);
break;
default:
return CMD_RET_USAGE;
@@ -249,9 +256,11 @@ int bmp_display(ulong addr, int x, int y)
if (!ret) {
bool align = false;
-# ifdef CONFIG_SPLASH_SCREEN_ALIGN
- align = true;
-# endif /* CONFIG_SPLASH_SCREEN_ALIGN */
+ if (CONFIG_IS_ENABLED(SPLASH_SCREEN_ALIGN) ||
+ x == BMP_ALIGN_CENTER ||
+ y == BMP_ALIGN_CENTER)
+ align = true;
+
ret = video_bmp_display(dev, addr, x, y, align);
}
#elif defined(CONFIG_LCD)
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] cmd: bmp: manage centered display
2018-11-14 9:18 [U-Boot] [PATCH] cmd: bmp: manage centered display Patrick Delaunay
@ 2018-12-01 14:06 ` Anatolij Gustschin
2018-12-03 8:45 ` Patrick DELAUNAY
0 siblings, 1 reply; 4+ messages in thread
From: Anatolij Gustschin @ 2018-12-01 14:06 UTC (permalink / raw)
To: u-boot
Hi Patrick,
On Wed, 14 Nov 2018 10:18:22 +0100
Patrick Delaunay patrick.delaunay at st.com wrote:
...
> diff --git a/cmd/bmp.c b/cmd/bmp.c
> index 02bdf48..1ace8a8 100644
> --- a/cmd/bmp.c
> +++ b/cmd/bmp.c
> @@ -108,6 +108,7 @@ static int do_bmp_info(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[
> return (bmp_info(addr));
> }
>
> +#define BMP_ALIGN_CENTER 0x7FFF
this already exists when including splash.h, I dropped it in v2.
--
Anatolij
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] cmd: bmp: manage centered display
2018-12-01 14:06 ` Anatolij Gustschin
@ 2018-12-03 8:45 ` Patrick DELAUNAY
2018-12-03 9:21 ` Anatolij Gustschin
0 siblings, 1 reply; 4+ messages in thread
From: Patrick DELAUNAY @ 2018-12-03 8:45 UTC (permalink / raw)
To: u-boot
Hi Anatolij,
> From: Anatolij Gustschin <agust@denx.de>
> Sent: samedi 1 décembre 2018 15:06
>
> Hi Patrick,
>
> On Wed, 14 Nov 2018 10:18:22 +0100
> Patrick Delaunay patrick.delaunay at st.com wrote:
> ...
> >
> > +#define BMP_ALIGN_CENTER 0x7FFF
>
> this already exists when including splash.h, I dropped it in v2.
Ok, I don't see that splash.h is included in cmd/bmp.c.
In fact I hesitate to move this define in commun bmp include (in include/lcd.h with bmp_display prototype for exmaple)
to avoid a other double definition:
common/lcd.c:392 #define BMP_ALIGN_CENTER 0x7FFF
drivers/video/video_bmp.c:143:#define BMP_ALIGN_CENTER 0x7fff
include/splash.h:78:#define BMP_ALIGN_CENTER 0x7FFF
> --
> Anatolij
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] [PATCH] cmd: bmp: manage centered display
2018-12-03 8:45 ` Patrick DELAUNAY
@ 2018-12-03 9:21 ` Anatolij Gustschin
0 siblings, 0 replies; 4+ messages in thread
From: Anatolij Gustschin @ 2018-12-03 9:21 UTC (permalink / raw)
To: u-boot
Hi Patrick,
On Mon, 3 Dec 2018 08:45:57 +0000
Patrick DELAUNAY patrick.delaunay at st.com wrote:
...
> > > +#define BMP_ALIGN_CENTER 0x7FFF
> >
> > this already exists when including splash.h, I dropped it in v2.
>
> Ok, I don't see that splash.h is included in cmd/bmp.c.
In mainline U-Boot it is included, please see [1].
> In fact I hesitate to move this define in commun bmp include
> (in include/lcd.h with bmp_display prototype for exmaple)
> to avoid a other double definition:
>
> common/lcd.c:392 #define BMP_ALIGN_CENTER 0x7FFF
> drivers/video/video_bmp.c:143:#define BMP_ALIGN_CENTER 0x7fff
> include/splash.h:78:#define BMP_ALIGN_CENTER 0x7FFF
I've sent a patch cleaning up multiple defines, please see [2].
[1] http://git.denx.de/?p=u-boot.git;a=blob;f=cmd/bmp.c;h=02bdf48b4d422ced97dea7587f07d74c0aee6d6e;hb=HEAD#l20
[2] http://patchwork.ozlabs.org/patch/1006354
--
Anatolij
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-12-03 9:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-14 9:18 [U-Boot] [PATCH] cmd: bmp: manage centered display Patrick Delaunay
2018-12-01 14:06 ` Anatolij Gustschin
2018-12-03 8:45 ` Patrick DELAUNAY
2018-12-03 9:21 ` Anatolij Gustschin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.