From: Anatolij Gustschin <agust@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] cmd: bmp: manage centered display
Date: Sat, 1 Dec 2018 14:41:07 +0100 [thread overview]
Message-ID: <20181201134107.6947-1-agust@denx.de> (raw)
From: Patrick Delaunay <patrick.delaunay@st.com>
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>
---
Changes in v2:
- drop BMP_ALIGN_CENTER define since it is already included
with splash.h
cmd/bmp.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
diff --git a/cmd/bmp.c b/cmd/bmp.c
index 02bdf48b4d..b8af784590 100644
--- a/cmd/bmp.c
+++ b/cmd/bmp.c
@@ -124,8 +124,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 +255,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.17.1
next reply other threads:[~2018-12-01 13:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-01 13:41 Anatolij Gustschin [this message]
2018-12-04 18:53 ` [U-Boot] [PATCH v2] cmd: bmp: manage centered display Anatolij Gustschin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181201134107.6947-1-agust@denx.de \
--to=agust@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox