public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Anatolij Gustschin <agust@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/7] splash: fix logo drawing if CONFIG_VIDEO_LOGO enabled
Date: Thu, 19 Sep 2019 19:30:09 +0200	[thread overview]
Message-ID: <20190919173015.18692-2-agust@denx.de> (raw)
In-Reply-To: <20190919173015.18692-1-agust@denx.de>

After mxc_ipuv3 DM_VIDEO conversion board configs with enabled
CONFIG_VIDEO_LOGO do not show splash screen (previosly drawing
splash screen worked via cfb_console driver with CONFIG_VIDEO_LOGO
enabled). Use splash_source library for loading splash images
when CONFIG_SPLASH_SOURCE is selected, otherwise prepare built-in
video logo for drawing.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
---
 common/splash.c | 35 +++++++++++++++++++++++++++++++++--
 1 file changed, 33 insertions(+), 2 deletions(-)

diff --git a/common/splash.c b/common/splash.c
index e15cc847b6..1a5db69a7e 100644
--- a/common/splash.c
+++ b/common/splash.c
@@ -52,10 +52,41 @@ static struct splash_location default_splash_locations[] = {
 	},
 };
 
+#if defined(CONFIG_DM_VIDEO) && defined(CONFIG_VIDEO_LOGO)
+
+#include <bmp_logo_data.h>
+
+static int splash_video_logo_load(void)
+{
+	char *splashimage;
+	u32 bmp_load_addr;
+
+	splashimage = env_get("splashimage");
+	if (!splashimage)
+		return -ENOENT;
+
+	bmp_load_addr = simple_strtoul(splashimage, 0, 16);
+	if (!bmp_load_addr) {
+		printf("Error: bad 'splashimage' address\n");
+		return -EFAULT;
+	}
+
+	memcpy((void *)bmp_load_addr, bmp_logo_bitmap,
+	       ARRAY_SIZE(bmp_logo_bitmap));
+
+	return 0;
+}
+#else
+static inline int splash_video_logo_load(void) { return -ENOSYS; }
+#endif
+
 __weak int splash_screen_prepare(void)
 {
-	return splash_source_load(default_splash_locations,
-				  ARRAY_SIZE(default_splash_locations));
+	if (CONFIG_IS_ENABLED(SPLASH_SOURCE))
+		return splash_source_load(default_splash_locations,
+					  ARRAY_SIZE(default_splash_locations));
+
+	return splash_video_logo_load();
 }
 
 #ifdef CONFIG_SPLASH_SCREEN_ALIGN
-- 
2.17.1

  reply	other threads:[~2019-09-19 17:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-19 17:30 [U-Boot] [PATCH 0/7] Fix splash logo for imx6 boards Anatolij Gustschin
2019-09-19 17:30 ` Anatolij Gustschin [this message]
2019-09-19 17:30 ` [U-Boot] [PATCH 2/7] imx: wandboard: fix splash logo drawing Anatolij Gustschin
2019-09-19 17:30 ` [U-Boot] [PATCH 3/7] imx: mx6sabresd: " Anatolij Gustschin
2019-09-19 18:26   ` Fabio Estevam
2019-09-19 18:30     ` Fabio Estevam
2019-09-20 15:46       ` Anatolij Gustschin
2019-09-19 17:30 ` [U-Boot] [PATCH 4/7] imx: apalis_imx6: " Anatolij Gustschin
2019-09-19 17:30 ` [U-Boot] [PATCH 5/7] imx: icore: " Anatolij Gustschin
2019-09-19 17:30 ` [U-Boot] [PATCH 6/7] imx: colibri_imx6: " Anatolij Gustschin
2019-09-19 17:30 ` [U-Boot] [PATCH 7/7] imx: mx6sabreauto: " Anatolij Gustschin
2019-09-23 19:01 ` [U-Boot] [PATCH 0/7] Fix splash logo for imx6 boards 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=20190919173015.18692-2-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