public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] sandbox: video: Fix building without SDL
@ 2023-02-17 22:45 Simon Glass
  2023-04-07 19:58 ` Anatolij Gustschin
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Glass @ 2023-02-17 22:45 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Simon Glass, Anatolij Gustschin, Heinrich Schuchardt,
	Pali Rohár, Stefan Roese

This is currently broken. If SDL is not installed, SANDBOX_SDL becomes
false and build errors are generated, e.g.:

   test/dm/video.c:424: undefined reference to `sandbox_sdl_set_bpp'

Fix it by making the function return an error in this case.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 arch/sandbox/include/asm/test.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/sandbox/include/asm/test.h b/arch/sandbox/include/asm/test.h
index 4853dc948f3..e482271fe97 100644
--- a/arch/sandbox/include/asm/test.h
+++ b/arch/sandbox/include/asm/test.h
@@ -300,6 +300,7 @@ void sandbox_cros_ec_set_test_flags(struct udevice *dev, uint flags);
  */
 int sandbox_cros_ec_get_pwm_duty(struct udevice *dev, uint index, uint *duty);
 
+#if IS_ENABLED(CONFIG_SANDBOX_SDL)
 /**
  * sandbox_sdl_set_bpp() - Set the depth of the sandbox display
  *
@@ -315,6 +316,13 @@ int sandbox_cros_ec_get_pwm_duty(struct udevice *dev, uint index, uint *duty);
  * after the change
  */
 int sandbox_sdl_set_bpp(struct udevice *dev, enum video_log2_bpp l2bpp);
+#else
+static inline int sandbox_sdl_set_bpp(struct udevice *dev,
+				      enum video_log2_bpp l2bpp)
+{
+	return -ENOSYS;
+}
+#endif
 
 /**
  * sandbox_set_fake_efi_mgr_dev() - Control EFI bootmgr producing valid bootflow
-- 
2.39.2.637.g21b0678d19-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] sandbox: video: Fix building without SDL
  2023-02-17 22:45 [PATCH] sandbox: video: Fix building without SDL Simon Glass
@ 2023-04-07 19:58 ` Anatolij Gustschin
  0 siblings, 0 replies; 2+ messages in thread
From: Anatolij Gustschin @ 2023-04-07 19:58 UTC (permalink / raw)
  To: Simon Glass
  Cc: U-Boot Mailing List, Heinrich Schuchardt, Pali Rohár,
	Stefan Roese

On Fri, 17 Feb 2023 15:45:47 -0700
Simon Glass sjg@chromium.org wrote:

> This is currently broken. If SDL is not installed, SANDBOX_SDL becomes
> false and build errors are generated, e.g.:
> 
>    test/dm/video.c:424: undefined reference to `sandbox_sdl_set_bpp'
> 
> Fix it by making the function return an error in this case.
> 
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
> 
>  arch/sandbox/include/asm/test.h | 8 ++++++++
>  1 file changed, 8 insertions(+)

Applied to u-boot-video/master, thanks!

--
Anatolij

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-07 19:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-17 22:45 [PATCH] sandbox: video: Fix building without SDL Simon Glass
2023-04-07 19:58 ` Anatolij Gustschin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox