From e33cdf8ee7ea55ead2836811ded448f4dddafee7 Mon Sep 17 00:00:00 2001 From: Sagar Kamble Date: Wed, 15 May 2019 10:48:34 +0530 Subject: [PATCH] gpu: nvgpu: include nvgpu common build configs in host Makefile nvgpu userspace and test builds are prepared for both host/x86 and target/aarch64. nvgpu common cflags file was included in the Makefile of target builds. Include it in the host build Makefile as well. This makes sure we run the same config of qnx and nvgpu userspace and test builds for MISRA, Coverage. nvgpu shared config file defines the make variables and cflags app- licable to nvgpu common shared by qnx, nvgpu userspace, test builds. Note that cflags are added to variable NVGPU_COMMON_CFLAGS that need to be used by the parent Makefile to update corresponding cflags variable. JIRA NVGPU-3062 Change-Id: Ia7a879698220f3b73aae3f02416cab28432531e0 Signed-off-by: Sagar Kamble Reviewed-on: https://git-master.nvidia.com/r/2119319 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/Makefile.shared.configs | 17 +++++++++++------ drivers/gpu/nvgpu/Makefile.tmk | 1 + userspace/Makefile | 5 ++++- userspace/Makefile.tmk | 1 + userspace/units/Makefile.units.common.tmk | 1 + 5 files changed, 18 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/nvgpu/Makefile.shared.configs b/drivers/gpu/nvgpu/Makefile.shared.configs index b7349db68..4038e7c31 100644 --- a/drivers/gpu/nvgpu/Makefile.shared.configs +++ b/drivers/gpu/nvgpu/Makefile.shared.configs @@ -20,29 +20,34 @@ # DEALINGS IN THE SOFTWARE. # +# This file defines the make variables and cflags applicable to nvgpu common +# shared by qnx, nvgpu userspace, test builds. Note that cflags are added to +# variable NVGPU_COMMON_CFLAGS that needs to be used by the parent Makefile +# to update corresponding cflags variable. + # Support iGPU Virt for safety build until rmserver dependency is resolved IGPU_VIRT_SUPPORT := 1 -NV_COMPONENT_CFLAGS += -DIGPU_VIRT_SUPPORT +NVGPU_COMMON_CFLAGS := -DIGPU_VIRT_SUPPORT # Enable debugger APIs for safety build until devctl whitelisting is done NVGPU_DEBUGGER := 1 -NV_COMPONENT_CFLAGS += -DNVGPU_DEBUGGER +NVGPU_COMMON_CFLAGS += -DNVGPU_DEBUGGER # Enable USERD for safety build until we switch to user mode submits only -NV_COMPONENT_CFLAGS += -DNVGPU_USERD +NVGPU_COMMON_CFLAGS += -DNVGPU_USERD # Enable Channel WDT for safety build until we switch to user mode submits only NV_COMPONENT_CFLAGS += -DNVGPU_CHANNEL_WDT # Enable iGPU LS PMU for safety build until devctl whitelisting is done NVGPU_LS_PMU := 1 -NV_COMPONENT_CFLAGS += -DNVGPU_LS_PMU +NVGPU_COMMON_CFLAGS += -DNVGPU_LS_PMU -NV_COMPONENT_CFLAGS += -DNVGPU_ENGINE +NVGPU_COMMON_CFLAGS += -DNVGPU_ENGINE # Enable dgpu support for safety build for now. To be removed. NVGPU_DGPU_SUPPORT := 1 -NV_COMPONENT_CFLAGS += -DNVGPU_DGPU_SUPPORT +NVGPU_COMMON_CFLAGS += -DNVGPU_DGPU_SUPPORT ifeq ($(NV_BUILD_CONFIGURATION_IS_SAFETY),0) endif diff --git a/drivers/gpu/nvgpu/Makefile.tmk b/drivers/gpu/nvgpu/Makefile.tmk index cf25c4259..1e92f7ea5 100644 --- a/drivers/gpu/nvgpu/Makefile.tmk +++ b/drivers/gpu/nvgpu/Makefile.tmk @@ -60,6 +60,7 @@ NV_COMPONENT_CFLAGS += \ -DCONFIG_TEGRA_NVLINK -include $(NV_COMPONENT_DIR)/Makefile.shared.configs +NV_COMPONENT_CFLAGS += $(NVGPU_COMMON_CFLAGS) NVGPU_FAULT_INJECTION_ENABLEMENT := 1 NV_COMPONENT_CFLAGS += -DNVGPU_UNITTEST_FAULT_INJECTION_ENABLEMENT diff --git a/userspace/Makefile b/userspace/Makefile index fc120d5d5..90aabe8e5 100644 --- a/userspace/Makefile +++ b/userspace/Makefile @@ -56,10 +56,13 @@ NVGPU_POSIX=1 # Enable fault injection for unit tests NVGPU_FAULT_INJECTION_ENABLEMENT=1 -# Linuxy configs. We want these so that we can mirror builds from the actual +# Linux configs. We want these so that we can mirror builds from the actual # Linux kernel. include Makefile.configs +include $(NVGPU_SRC)/Makefile.shared.configs +CONFIGS+=$(NVGPU_COMMON_CFLAGS) + # Compiler, c-flags, etc. # CC = clang diff --git a/userspace/Makefile.tmk b/userspace/Makefile.tmk index 976c592b4..de8c792ab 100644 --- a/userspace/Makefile.tmk +++ b/userspace/Makefile.tmk @@ -128,6 +128,7 @@ NV_COMPONENT_CFLAGS += \ -DNVGPU_UNITTEST_FAULT_INJECTION_ENABLEMENT -include ../drivers/gpu/nvgpu/Makefile.shared.configs +NV_COMPONENT_CFLAGS += $(NVGPU_COMMON_CFLAGS) NV_COMPONENT_SYSTEMIMAGE_DIR := $(NV_SYSTEMIMAGE_TEST_EXECUTABLE_DIR)/nvgpu_unit/ systemimage:: $(NV_COMPONENT_SYSTEMIMAGE_DIR) diff --git a/userspace/units/Makefile.units.common.tmk b/userspace/units/Makefile.units.common.tmk index 1708d885c..3ecbce675 100644 --- a/userspace/units/Makefile.units.common.tmk +++ b/userspace/units/Makefile.units.common.tmk @@ -71,6 +71,7 @@ NV_COMPONENT_CFLAGS += \ -DCONFIG_TEGRA_NVLINK -include $(NV_SOURCE)/kernel/nvgpu/drivers/gpu/nvgpu/Makefile.shared.configs +NV_COMPONENT_CFLAGS += $(NVGPU_COMMON_CFLAGS) NV_COMPONENT_NEEDED_INTERFACE_DIRS := \ $(NV_SOURCE)/kernel/nvgpu/userspace