aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-02-17 15:45:47 -0700
committerAnatolij Gustschin <agust@denx.de>2023-04-07 17:43:36 +0200
commit67a36465216a292240b8b0ae088dd1ee7223029a (patch)
treea3a1e86dd843c2f8ca64e95d44a58f3c85395130
parent340bebf9c799793affefd166875d5776744988bd (diff)
sandbox: video: Fix building without SDL
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>
-rw-r--r--arch/sandbox/include/asm/test.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/sandbox/include/asm/test.h b/arch/sandbox/include/asm/test.h
index 4853dc948f..e482271fe9 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