From: Tom Rini <trini@konsulko.com>
To: Julien Stephan <jstephan@baylibre.com>
Cc: u-boot@lists.u-boot-project.org, Simon Glass <sjg@chromium.org>,
GSS_MTK_Uboot_upstream <GSS_MTK_Uboot_upstream@mediatek.com>,
Anatolij Gustschin <ag.dev.uboot@gmail.com>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Quentin Schulz <quentin.schulz@cherry.de>,
dlechner@baylibre.com
Subject: Re: [PATCH 2/2] video: fix build with CONFIG_VIDEO && !CONFIG_VIDEO_LOGO
Date: Tue, 1 Sep 2026 10:42:45 -0600 [thread overview]
Message-ID: <20260901164245.GE1145425@bill-the-cat> (raw)
In-Reply-To: <20260901-fix-build-with-config-video-but-config-video-logo-disabled-v1-2-9dc80d307790@baylibre.com>
[-- Attachment #1: Type: text/plain, Size: 3675 bytes --]
On Tue, Sep 01, 2026 at 10:52:43AM +0200, Julien Stephan wrote:
> Building with CONFIG_VIDEO enabled but CONFIG_VIDEO_LOGO disabled fails
> at link time:
>
> video-uclass.o: in function `video_get_u_boot_logo':
> video-uclass.c:593: undefined reference to `__splash_u_boot_logo_begin'
>
> The __splash_u_boot_logo_begin/_end symbols are provided by
> u_boot_logo.bmp.o, which is only built when CONFIG_VIDEO_LOGO is set:
>
> obj-$(CONFIG_VIDEO_LOGO) += u_boot_logo.bmp.o
>
> video_get_u_boot_logo() and show_splash() reference those symbols
> unconditionally, so with the logo disabled the reference is left
> dangling. show_splash() alone would be dead-code eliminated (it is
> static and only reached under a CONFIG_IS_ENABLED(VIDEO_LOGO) guard),
> but video_get_u_boot_logo() is an exported function and is always
> emitted.
>
> Guard the splash helpers and their symbol references with
> CONFIG_IS_ENABLED(VIDEO_LOGO), and provide a static inline
> video_get_u_boot_logo() stub returning NULL for the disabled case in
> video.h. Callers already handle a NULL logo pointer (e.g.
> bootflow_menu.c), so no caller changes are needed.
>
> Reproduce with any board that enables VIDEO without VIDEO_LOGO or
> enabling SPLASH_SCREEN (it disables automatically VIDEO_LOGO).
>
> Fixes: 0d3890188d6b ("video: Add function to obtain the U-Boot logo")
> Signed-off-by: Julien Stephan <jstephan@baylibre.com>
> ---
> drivers/video/video-uclass.c | 7 +++++--
> include/video.h | 9 ++++++++-
> 2 files changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c
> index de161054d52..4c959a57619 100644
> --- a/drivers/video/video-uclass.c
> +++ b/drivers/video/video-uclass.c
> @@ -579,6 +579,7 @@ int video_get_ysize(struct udevice *dev)
> return priv->ysize;
> }
>
> +#if CONFIG_IS_ENABLED(VIDEO_LOGO)
> #define SPLASH_DECL(_name) \
> extern u8 __splash_ ## _name ## _begin[]; \
> extern u8 __splash_ ## _name ## _end[]
> @@ -598,6 +599,7 @@ static int show_splash(struct udevice *dev)
>
> return video_bmp_display(dev, map_to_sysmem(data), -4, 4, true);
> }
> +#endif
>
> int video_default_font_height(struct udevice *dev)
> {
> @@ -716,14 +718,15 @@ static int video_post_probe(struct udevice *dev)
> return ret;
> }
>
> - if (CONFIG_IS_ENABLED(VIDEO_LOGO) &&
> - !CONFIG_IS_ENABLED(SPLASH_SCREEN) && !plat->hide_logo) {
> +#if CONFIG_IS_ENABLED(VIDEO_LOGO)
> + if (!CONFIG_IS_ENABLED(SPLASH_SCREEN) && !plat->hide_logo) {
> ret = show_splash(dev);
> if (ret) {
> log_debug("Cannot show splash screen\n");
> return ret;
> }
> }
> +#endif
Is this hunk really needed? I can see getting here as part of debugging
the problem, but before the change it should evaluate to 'if (0 && ...)'
and be link-time eliminated.
>
> /* register cyclic as soon as the first video device is probed */
> if (CONFIG_IS_ENABLED(CYCLIC) && (gd->flags && GD_FLG_RELOC) &&
> diff --git a/include/video.h b/include/video.h
> index 9ea6b676463..8e4c1544e56 100644
> --- a/include/video.h
> +++ b/include/video.h
> @@ -418,9 +418,16 @@ bool video_is_active(void);
> /**
> * video_get_u_boot_logo() - Get a pointer to the U-Boot logo
> *
> - * Returns: Pointer to logo
> + * Returns: Pointer to logo, or NULL if CONFIG_VIDEO_LOGO is disabled
> */
> +#if CONFIG_IS_ENABLED(VIDEO_LOGO)
> void *video_get_u_boot_logo(void);
> +#else
> +static inline void *video_get_u_boot_logo(void)
> +{
> + return NULL;
> +}
> +#endif
This part does make sense.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
next prev parent reply other threads:[~2026-09-01 16:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260901-fix-build-with-config-video-but-config-video-logo-disabled-v1-0-9dc80d307790@baylibre.com>
2026-09-01 9:16 ` [PATCH 0/2] video: fix build with VIDEO && !VIDEO_LOGO Julien Stephan
[not found] ` <20260901-fix-build-with-config-video-but-config-video-logo-disabled-v1-1-9dc80d307790@baylibre.com>
2026-09-01 9:16 ` [PATCH 1/2] video: propagate show_splash() return value Julien Stephan
[not found] ` <20260901-fix-build-with-config-video-but-config-video-logo-disabled-v1-2-9dc80d307790@baylibre.com>
2026-09-01 9:16 ` [PATCH 2/2] video: fix build with CONFIG_VIDEO && !CONFIG_VIDEO_LOGO Julien Stephan
2026-09-01 16:42 ` Tom Rini [this message]
2026-09-02 8:48 ` Julien Stephan
2026-09-02 14:26 ` Tom Rini
2026-09-18 20:49 ` Simon Glass
2026-09-18 21:41 ` Tom Rini
2026-09-18 22:39 ` Simon Glass
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=20260901164245.GE1145425@bill-the-cat \
--to=trini@konsulko.com \
--cc=GSS_MTK_Uboot_upstream@mediatek.com \
--cc=ag.dev.uboot@gmail.com \
--cc=dlechner@baylibre.com \
--cc=jstephan@baylibre.com \
--cc=quentin.schulz@cherry.de \
--cc=sjg@chromium.org \
--cc=u-boot@lists.u-boot-project.org \
--cc=xypron.glpk@gmx.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 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.