All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Simon Glass <sjg@chromium.org>
Cc: jstephan@baylibre.com, u-boot@lists.denx.de,
	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, u-boot@lists.u-boot-project.org
Subject: Re: [PATCH 2/2] video: fix build with CONFIG_VIDEO && !CONFIG_VIDEO_LOGO
Date: Fri, 18 Sep 2026 15:41:54 -0600	[thread overview]
Message-ID: <20260918214154.GV858934@bill-the-cat> (raw)
In-Reply-To: <CAFLszTgGNjf2TLT3joC2P2b3c-iA-affy5SrbjXyM-FA_c89UA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3379 bytes --]

On Fri, Sep 18, 2026 at 03:49:44PM -0500, Simon Glass wrote:
> Hi Julien,
> 
> On 2026-09-01T08:52:42, Julien Stephan <jstephan@baylibre.com> wrote:
> > video: fix build with CONFIG_VIDEO && !CONFIG_VIDEO_LOGO
> >
> > 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).
> 
> I won't comment on the word order / mixed tenses.
> 
> > [...]
> >
> > 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
> > @@ -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[]
> 
> We try to avoid #ifdef in .c files and prefer if
> (CONFIG_IS_ENABLED(...)) so both branches are compile-checked. The
> SPLASH_DECL externs do need the preprocessor guard since the linker
> symbols don't exist, but the guard around show_splash() and its call
> site in video_post_probe() could be avoided by keeping show_splash()
> defined and providing an #else stub that returns 0. The existing if
> (CONFIG_IS_ENABLED(VIDEO_LOGO) && ...) at the caller can then stay.
> 
> > diff --git 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
> >   */
> 
> The stub is guarded with CONFIG_IS_ENABLED(VIDEO_LOGO), so the doc
> should refer to VIDEO_LOGO in general terms - SPL may have it disabled
> while proper enables it. Something like 'Returns: Pointer to logo, or
> NULL if VIDEO_LOGO is not enabled in this phase'.

Simon, can you please make sure you're looking at both the current
version, and previous feedback, when commenting on older patches?
There's been a v2 for about 2 weeks. Thanks.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2026-09-18 21: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
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 [this message]
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=20260918214154.GV858934@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.denx.de \
    --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.