gpu: nvgpu: consolidate the makefile config setup

Since the safety build config options for qnx build are to be adhered
by posix userspace build as well, let us create shared configs file.
Add these config options to unit tests makefile as we would need to
control the tests based on these options and tests also access the
common nvgpu functions.

JIRA NVGPU-3062

Change-Id: I292eca9ac3160eed93485afddf7c30e993e0461c
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2116401
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Sagar Kamble
2019-05-10 14:11:26 +05:30
committed by mobile promotions
parent 84393def8b
commit 94a8f3ce28
4 changed files with 49 additions and 17 deletions

View File

@@ -0,0 +1,41 @@
#
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
#
ifeq ($(NVGPU_REDUCED), 0)
# Enable debugger APIs for normal builds
NVGPU_DEBUGGER := 1
# Enable iGPU LS PMU for normal builds
NVGPU_LS_PMU := 1
NV_COMPONENT_CFLAGS += -DNVGPU_DEBUGGER
NV_COMPONENT_CFLAGS += -DNVGPU_LS_PMU
NV_COMPONENT_CFLAGS += -DNVGPU_ENGINE
NV_COMPONENT_CFLAGS += -DNVGPU_USERD
# Support iGPU Virt for normal builds
IGPU_VIRT_SUPPORT := 1
NV_COMPONENT_CFLAGS += -DIGPU_VIRT_SUPPORT
# Enable dgpu support for normal builds
NVGPU_DGPU_SUPPORT := 1
NV_COMPONENT_CFLAGS += -DNVGPU_DGPU_SUPPORT
else
# Enable USERD until we switch to user mode submit only
NV_COMPONENT_CFLAGS += -DNVGPU_USERD
endif

View File

@@ -60,22 +60,7 @@ NV_COMPONENT_CFLAGS += \
-DCONFIG_PCI_MSI \
-DCONFIG_TEGRA_NVLINK
ifeq ($(NVGPU_REDUCED), 0)
# Enable debugger APIs for normal builds
NVGPU_DEBUGGER := 1
# Enable iGPU LS PMU for normal builds
NVGPU_LS_PMU := 1
NV_COMPONENT_CFLAGS += -DNVGPU_DEBUGGER
NV_COMPONENT_CFLAGS += -DNVGPU_LS_PMU
NV_COMPONENT_CFLAGS += -DNVGPU_ENGINE
NV_COMPONENT_CFLAGS += -DNVGPU_USERD
# Support iGPU Virt for normal builds
IGPU_VIRT_SUPPORT := 1
NV_COMPONENT_CFLAGS += -DIGPU_VIRT_SUPPORT
else
# Enable USERD until we switch to user mode submit only
NV_COMPONENT_CFLAGS += -DNVGPU_USERD
endif
-include $(NV_COMPONENT_DIR)/Makefile.shared.configs
NVGPU_FAULT_INJECTION_ENABLEMENT := 1
NV_COMPONENT_CFLAGS += -DNVGPU_UNITTEST_FAULT_INJECTION_ENABLEMENT

View File

@@ -56,7 +56,6 @@ NV_COMPONENT_SYSTEM_SHARED_LIBRARIES += dl
NV_COMPONENT_SYSTEM_SHARED_LIBRARIES += gcov
endif
NV_COMPONENT_CFLAGS += -D__NVGPU_POSIX__
_NV_TOOLCHAIN_CFLAGS += -rdynamic
NV_UNIT_SH=unit.sh
@@ -109,6 +108,7 @@ NV_COMPONENT_SYSTEM_SHARED_LIBRARIES += dl
endif
NV_COMPONENT_CFLAGS += -D__NVGPU_POSIX__
NVGPU_REDUCED := 1
NV_COMPONENT_CFLAGS += \
-DCONFIG_TEGRA_19x_GPU \
@@ -128,6 +128,8 @@ NV_COMPONENT_CFLAGS += \
-DCONFIG_TEGRA_NVLINK \
-DNVGPU_UNITTEST_FAULT_INJECTION_ENABLEMENT
-include ../drivers/gpu/nvgpu/Makefile.shared.configs
NV_COMPONENT_SYSTEMIMAGE_DIR := $(NV_SYSTEMIMAGE_TEST_EXECUTABLE_DIR)/nvgpu_unit/
systemimage:: $(NV_COMPONENT_SYSTEMIMAGE_DIR)
$(NV_COMPONENT_SYSTEMIMAGE_DIR) : $(NV_SYSTEMIMAGE_TEST_EXECUTABLE_DIR)

View File

@@ -53,6 +53,8 @@ else
NV_COMPONENT_CFLAGS += -D__NVGPU_POSIX__
endif
NVGPU_REDUCED := 1
NV_COMPONENT_CFLAGS += \
-DCONFIG_TEGRA_19x_GPU \
-DCONFIG_TEGRA_GK20A_NVHOST \
@@ -70,6 +72,8 @@ NV_COMPONENT_CFLAGS += \
-DCONFIG_SUPPORT_PMU_PSTATE \
-DCONFIG_TEGRA_NVLINK
-include $(NV_SOURCE)/kernel/nvgpu/drivers/gpu/nvgpu/Makefile.shared.configs
NV_COMPONENT_NEEDED_INTERFACE_DIRS := \
$(NV_SOURCE)/kernel/nvgpu/userspace