Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 71939C7EE2E for ; Mon, 12 Jun 2023 21:22:44 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B97AF8624E; Mon, 12 Jun 2023 23:19:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="mPZx3fn2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 64864861C7; Mon, 12 Jun 2023 23:19:19 +0200 (CEST) Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D6192861C7 for ; Mon, 12 Jun 2023 23:19:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=saproj@gmail.com Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-4f629ccb8ebso5739611e87.1 for ; Mon, 12 Jun 2023 14:19:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1686604756; x=1689196756; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=pPOrgxgmdu1jf4bmZVlgYJbPqB6WybIe0uUZ7PrtwzM=; b=mPZx3fn2Pr5dLvbWEtczZ2zLAgLdtOqvAwRDo2H1qaA1FvMXu5zcBy5WsinJsM4NFt e8J0B5caSzx16deCaMI2tSxX0fKmfxkzvtYCE5yCfOYbhL4AZWJTyHe2+rskjQ9PbRmW r5nGr3XPjNaZpMUG1TMgDe/rP70EaKqc3JMCLz16wiJLFzoe0oenxdzi79vsjU81aErD 4aSlP4pIPWxYcZegL4llKJI3jN7V87gCZLXjUZpSr0iyb2xBcHpubzxBM1ryr0g52+aT 8DRw7/4OvtDhVL4AlHdKZhCqHXUErqnB4lNELn61hkgm4DY5TkIiYkUl7icvhkrCLuj1 UB+g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686604756; x=1689196756; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=pPOrgxgmdu1jf4bmZVlgYJbPqB6WybIe0uUZ7PrtwzM=; b=b+d4R9BGYymfdA/PmzirsstkJfYlerPGZ7QUfWIrPXdfDjOSVEnsK8V/43UZ0At284 HTJBbc/T6pjPm1GMn0TCyH9VobqhlkmxFC0zufAhLeYhZJwcExE1iet6Tz5Lwzcil2dJ cdXXIWZ6MvYpj0Z4LgZuRqgMJXQHQS/vqCewGTe9uNtGIb61DHikIBjKkTqeWF3D7uJV zDCujzzzaXhC93+TXLhWqzWnxEYdKfMNdJz0k3bTNRbQESQkmx0riyg5rZ1t0EmRaJef X2nACSclvJDbhJIELpBiTNCQGqYybQ2SbK1GFynTE3j4xkJa76o8PFKqIwdwUQkZScht gYEQ== X-Gm-Message-State: AC+VfDx1tGr/VmDluo5sjuvD6a+oZYhZi1UoLwl5YnfLAfm4YIm4uOl+ N8Pzf1zSFeB9IxoHCeohOjc5re7efQ8= X-Google-Smtp-Source: ACHHUZ4HuC9qAmfcHbw66Msw3Kxi84B76m4VH6ZvS5jmcXjbeo1vkFbqFmr10oSuzwWLh+EoF0Pcrw== X-Received: by 2002:a05:6512:411:b0:4f6:2020:7c24 with SMTP id u17-20020a056512041100b004f620207c24mr4323687lfk.5.1686604755913; Mon, 12 Jun 2023 14:19:15 -0700 (PDT) Received: from saproj-Latitude-5501.lan ([83.217.200.210]) by smtp.gmail.com with ESMTPSA id b24-20020ac247f8000000b004edc3f06f5csm1557282lfp.296.2023.06.12.14.19.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jun 2023 14:19:15 -0700 (PDT) From: Sergei Antonov To: u-boot@lists.denx.de Cc: Sergei Antonov , Simon Glass , Tom Rini Subject: [PATCH v2] sandbox: fix a compilation error Date: Tue, 13 Jun 2023 00:19:04 +0300 Message-Id: <20230612211904.131477-1-saproj@gmail.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean 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 --- v2: * move the function to another file instead of including arch/sandbox/include/asm/sdl.h | 23 +++++++++++++++++++++++ arch/sandbox/include/asm/test.h | 25 ------------------------- test/dm/video.c | 1 + 3 files changed, 24 insertions(+), 25 deletions(-) diff --git a/arch/sandbox/include/asm/sdl.h b/arch/sandbox/include/asm/sdl.h index 56dcb84803d3..ee4991f7c24a 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 diff --git a/arch/sandbox/include/asm/test.h b/arch/sandbox/include/asm/test.h index e482271fe975..17159f8d674a 100644 --- a/arch/sandbox/include/asm/test.h +++ b/arch/sandbox/include/asm/test.h @@ -8,7 +8,6 @@ #ifndef __ASM_TEST_H #define __ASM_TEST_H -#include #include struct unit_test_state; @@ -300,30 +299,6 @@ 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 - * - * 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_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 * diff --git a/test/dm/video.c b/test/dm/video.c index 30778157d940..1c63d16bd28b 100644 --- a/test/dm/video.c +++ b/test/dm/video.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include -- 2.37.2