From 76e160761777ae9e93b209a73ed6c417ddb68cc9 Mon Sep 17 00:00:00 2001 From: Sergei Antonov Date: Tue, 13 Jun 2023 00:19:04 +0300 Subject: sandbox: fix a compilation error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With sandbox and sandbox64 configurations: In file included from .../u-boot/include/test/test.h:156, from .../u-boot/include/test/lib.h:9, from .../u-boot/test/lib/test_crc8.c:8: .../u-boot/arch/sandbox/include/asm/test.h: In function ‘sandbox_sdl_set_bpp’: .../u-boot/arch/sandbox/include/asm/test.h:323:17: error: ‘ENOSYS’ undeclared (first use in this function) 323 | return -ENOSYS; | ^~~~~~ Per Tom Rini's suggestion: move that function prototype over to arch/sandbox/include/asm/sdl.h and make test/dm/video.c include Cc: Simon Glass Suggested-by: Tom Rini Signed-off-by: Sergei Antonov Reviewed-by: Simon Glass --- arch/sandbox/include/asm/sdl.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'arch/sandbox/include/asm/sdl.h') diff --git a/arch/sandbox/include/asm/sdl.h b/arch/sandbox/include/asm/sdl.h index 56dcb84803..ee4991f7c2 100644 --- a/arch/sandbox/include/asm/sdl.h +++ b/arch/sandbox/include/asm/sdl.h @@ -7,6 +7,7 @@ #define __SANDBOX_SDL_H #include +#include #ifdef CONFIG_SANDBOX_SDL @@ -87,6 +88,22 @@ int sandbox_sdl_sound_stop(void); */ int sandbox_sdl_sound_init(int rate, int channels); +/** + * sandbox_sdl_set_bpp() - Set the depth of the sandbox display + * + * The device must not be active when this function is called. It activiates it + * before returning. + * + * This updates the depth value and adjusts a few other settings accordingly. + * It must be called before the display is probed. + * + * @dev: Device to adjust + * @l2bpp: depth to set + * Return: 0 if the device was already active, other error if it fails to probe + * after the change + */ +int sandbox_sdl_set_bpp(struct udevice *dev, enum video_log2_bpp l2bpp); + #else static inline int sandbox_sdl_init_display(int width, int height, int log2_bpp, bool double_size) @@ -134,6 +151,12 @@ static inline int sandbox_sdl_sound_init(int rate, int channels) return -ENODEV; } +static inline int sandbox_sdl_set_bpp(struct udevice *dev, + enum video_log2_bpp l2bpp) +{ + return -ENOSYS; +} + #endif #endif -- cgit v1.2.3