While enabling a splash screen I enabled SPLASH_SCREEN which
automatically disable CONFIG_VIDEO_LOGO (while keeping CONFIG_VIDEO))
and hit a link failure:

  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 come from u_boot_logo.bmp.o,
which is only built when CONFIG_VIDEO_LOGO is set, but
video_get_u_boot_logo() references them unconditionally.

Downstream just worked around this by unsetting EXPO, which is the only
caller of video_get_u_boot_logo, but that's not a real fix, so patch 2
guards video_get_u_boot_logo() (and adds a NULL-returning stub) so VIDEO
without VIDEO_LOGO builds.

While at it, patch 1 also fixes show_splash(), which computed the
video_bmp_display() return value but never propagated it. It is a single
video_bmp_display() call with a single caller, so patch 1 simply drops
the helper and inlines it into video_post_probe(), taking the logo from
video_get_u_boot_logo(). This has the nice side effect of leaving
video_get_u_boot_logo() as the only remaining user of the logo symbols.
Since the return value was discarded, failing to draw the logo never
aborted the boot: patch 1 keeps that behaviour and only adds a debug
message.

Signed-off-by: Julien Stephan <[email protected]>
---
Changes in v2:
- patch 1: instead of propagating the video_bmp_display() return value,
  remove show_splash() altogether and call video_bmp_display() directly
  from video_post_probe(), keeping the previous behaviour on failure and
  only logging a debug message
- patch 2: only guard the splash symbol declaration and
  video_get_u_boot_logo(), and keep the runtime
  if (CONFIG_IS_ENABLED(VIDEO_LOGO)) check in video_post_probe() instead
  of turning it into a #if
- Link to v1: 
https://patch.msgid.link/20260901-fix-build-with-config-video-but-config-video-logo-disabled-v1-0-9dc80d307...@baylibre.com

To: [email protected]
To: Simon Glass <[email protected]>
Cc: GSS_MTK_Uboot_upstream <[email protected]>
Cc: Anatolij Gustschin <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: Julien Stephan <[email protected]>

---
Julien Stephan (2):
      video: remove show_splash()
      video: fix build with CONFIG_VIDEO && !CONFIG_VIDEO_LOGO

 drivers/video/video-uclass.c | 22 +++++++---------------
 include/video.h              |  9 ++++++++-
 2 files changed, 15 insertions(+), 16 deletions(-)
---
base-commit: cd5bd0cb98ececd1e2eb69d0093e4940b25c9941
change-id: 
20260901-fix-build-with-config-video-but-config-video-logo-disabled-f56fffc664eb

Best regards,
--  
Julien Stephan <[email protected]>

Reply via email to