From mboxrd@z Thu Jan 1 00:00:00 1970 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 798AAC433FE for ; Sat, 19 Nov 2022 23:52:56 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E62CD852D2; Sun, 20 Nov 2022 00:47:04 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="Sx5F+clt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id BCA03852A1; Sun, 20 Nov 2022 00:46:36 +0100 (CET) Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) (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 33DF48528A for ; Sun, 20 Nov 2022 00:46:33 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qt1-x82c.google.com with SMTP id w9so5363679qtv.13 for ; Sat, 19 Nov 2022 15:46:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rt4QR7bCeMGsFkof1ZsAfkr61vSIvklLZuilxLqKD8s=; b=Sx5F+clthoLKDyP4Chc1QRtNH/GvlHsBsYQkd3KfN8bRARV+m7rcUAP2KapG0S56MD ES5WTFm37hNq1tBQ1dnMZaCD0xdRDeK9CdDgtUVXzsJMFkF8gEhiMomoL9s4Cr0KEUrQ 9OzcrY8G5c7QSkoDCK8SueF7ZO5Adnl7swIEY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rt4QR7bCeMGsFkof1ZsAfkr61vSIvklLZuilxLqKD8s=; b=zWXKuFDuSuPe8emEgeJCl/eAKSQW5IypQ2l07DQhVfJlI3ykJb8rPTgSUPdn1ipWs6 zYT2eHIrUQYzKzR+pHlP02iWZOUPOEwpnfiEo5bap2tVGHrme/hcvZy8zYPw2MbR0lnQ BEDU9jWIzNpW1P7BAtySYgXXyCE8R50WGGGMCPnC3vfiHEUmoJYu5ZyUMHvOK8qjZIok HtpoMl2a2RA2fOj18zDopECbDhhO8Q0sMQwM63BwLA3taxEnnsz+2pKJxOUOSizbhjM2 WVjRI/p/NMjAUsaI68XP9q+tfA/6HtyP36SPSLbC+iv6X/5tr/r28kisvbAC26PKugyB 0MXg== X-Gm-Message-State: ANoB5pl6k4y5UUiNSLeN+YMe86n3PTPoX4i9Ki3aq0SNdRKSiYPdPf7x 6W+hgrErZVEM6ZUuy4Dqu6+XDW2yV2ikDA== X-Google-Smtp-Source: AA0mqf7mPV3CPIIRMjcxqEwzImlzFTNx9oA+tYb5YRI7uCjYNawlRffwbWqCK/yK4IQkTRVtPdcZKA== X-Received: by 2002:ac8:1483:0:b0:39c:bf89:65f0 with SMTP id l3-20020ac81483000000b0039cbf8965f0mr12412568qtj.35.1668901567257; Sat, 19 Nov 2022 15:46:07 -0800 (PST) Received: from bill-the-cat.lan (2603-6081-7b00-6400-55ec-b699-c19f-3363.res6.spectrum.com. [2603:6081:7b00:6400:55ec:b699:c19f:3363]) by smtp.gmail.com with ESMTPSA id y11-20020a37f60b000000b006ce1bfbd603sm5169743qkj.124.2022.11.19.15.46.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Nov 2022 15:46:07 -0800 (PST) From: Tom Rini To: u-boot@lists.denx.de Cc: Simon Glass Subject: [PATCH 36/38] sandbox: Rework how SDL is enabled / disabled Date: Sat, 19 Nov 2022 18:45:43 -0500 Message-Id: <20221119234545.404563-36-trini@konsulko.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221119234545.404563-1-trini@konsulko.com> References: <20221119234545.404563-1-trini@konsulko.com> MIME-Version: 1.0 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.6 at phobos.denx.de X-Virus-Status: Clean Given that we can use Kconfig logic directly to see if we have a program available on the host or not, change from passing NO_SDL to instead controlling CONFIG_SANDBOX_SDL in Kconfig directly. Introduce CONFIG_HOST_HAS_SDL as the way to test for sdl2-config and default CONFIG_SANDBOX_SDL on if we have that, or not. Cc: Simon Glass Signed-off-by: Tom Rini --- .azure-pipelines.yml | 4 ++-- arch/sandbox/Kconfig | 7 +++++++ arch/sandbox/config.mk | 4 +--- doc/arch/sandbox/sandbox.rst | 9 +++------ doc/build/tools.rst | 2 +- drivers/video/Kconfig | 2 +- include/configs/sandbox.h | 4 ---- 7 files changed, 15 insertions(+), 17 deletions(-) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index bda762451fd0..a767fb1008c2 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -30,7 +30,7 @@ stages: %CD:~0,2%\msys64\usr\bin\bash -lc "pacman --noconfirm --needed -Sy make gcc bison flex diffutils openssl-devel libgnutls-devel libutil-linux-devel" displayName: 'Install Toolchain' - script: | - echo make tools-only_defconfig tools-only NO_SDL=1 > build-tools.sh + echo make tools-only_defconfig tools-only > build-tools.sh %CD:~0,2%\msys64\usr\bin\bash -lc "bash build-tools.sh" displayName: 'Build Host Tools' env: @@ -47,7 +47,7 @@ stages: - script: brew install make ossp-uuid displayName: Brew install dependencies - script: | - gmake tools-only_config tools-only NO_SDL=1 \ + gmake tools-only_config tools-only \ HOSTCFLAGS="-I/usr/local/opt/openssl@1.1/include" \ HOSTLDFLAGS="-L/usr/local/opt/openssl@1.1/lib" \ -j$(sysctl -n hw.logicalcpu) diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig index 96b3402b47c1..0ce77de2fcb4 100644 --- a/arch/sandbox/Kconfig +++ b/arch/sandbox/Kconfig @@ -47,6 +47,13 @@ config HOST_32BIT config HOST_64BIT def_bool $(cc-define,_LP64) +config HOST_HAS_SDL + def_bool $(success,sdl2-config --version) + +config SANDBOX_SDL + bool "Enable SDL2 support in sandbox" + default HOST_HAS_SDL + config SANDBOX_CRASH_RESET bool "Reset on crash" help diff --git a/arch/sandbox/config.mk b/arch/sandbox/config.mk index 3e2c7f9ebe55..1284ef390b51 100644 --- a/arch/sandbox/config.mk +++ b/arch/sandbox/config.mk @@ -8,9 +8,7 @@ SDL_CONFIG ?= sdl2-config # Define this to avoid linking with SDL, which requires SDL libraries # This can solve 'sdl-config: Command not found' errors -ifneq ($(NO_SDL),) -PLATFORM_CPPFLAGS += -DSANDBOX_NO_SDL -else +ifeq ($(CONFIG_SANDBOX_SDL),y) PLATFORM_LIBS += $(shell $(SDL_CONFIG) --libs) PLATFORM_CPPFLAGS += $(shell $(SDL_CONFIG) --cflags) endif diff --git a/doc/arch/sandbox/sandbox.rst b/doc/arch/sandbox/sandbox.rst index 34c4e06d9b8d..e6d840365166 100644 --- a/doc/arch/sandbox/sandbox.rst +++ b/doc/arch/sandbox/sandbox.rst @@ -56,11 +56,8 @@ To run sandbox U-Boot use something like:: Note: If you get errors about 'sdl-config: Command not found' you may need to install libsdl2.0-dev or similar to get SDL support. Alternatively you can -build sandbox without SDL (i.e. no display/keyboard support) by removing -the CONFIG_SANDBOX_SDL line in include/configs/sandbox.h or using:: - - make sandbox_defconfig all NO_SDL=1 - ./u-boot +build sandbox without SDL (i.e. no display/keyboard support) by disabling +CONFIG_SANDBOX_SDL in the .config file. U-Boot will start on your computer, showing a sandbox emulation of the serial console:: @@ -84,7 +81,7 @@ To exit, type 'poweroff' or press Ctrl-C. Console / LCD support --------------------- -Assuming that CONFIG_SANDBOX_SDL is defined when building, you can run the +Assuming that CONFIG_SANDBOX_SDL is enabled when building, you can run the sandbox with LCD and keyboard emulation, using something like:: ./u-boot -d u-boot.dtb -l diff --git a/doc/build/tools.rst b/doc/build/tools.rst index c06f91527417..ec0172292585 100644 --- a/doc/build/tools.rst +++ b/doc/build/tools.rst @@ -44,4 +44,4 @@ applications using a linux toolchain (gcc, bash, etc), targeting respectively Launch the MSYS2 shell of the MSYS2 environment, and do the following:: $ make tools-only_defconfig - $ make tools-only NO_SDL=1 + $ make tools-only diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index c841b99bb30d..f539977d9b73 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -622,7 +622,7 @@ config VIDEO_ARM_MALIDP config VIDEO_SANDBOX_SDL bool "Enable sandbox video console using SDL" - depends on SANDBOX + depends on SANDBOX_SDL help When using sandbox you can enable an emulated LCD display which appears as an SDL (Simple DirectMedia Layer) window. This is a diff --git a/include/configs/sandbox.h b/include/configs/sandbox.h index 3a5af4b3b609..c9e57da0160a 100644 --- a/include/configs/sandbox.h +++ b/include/configs/sandbox.h @@ -31,8 +31,4 @@ #define CFG_SYS_BAUDRATE_TABLE {4800, 9600, 19200, 38400, 57600,\ 115200} -#ifndef SANDBOX_NO_SDL -#define CONFIG_SANDBOX_SDL -#endif - #endif -- 2.25.1