From 1dd65f0a167f45524c8518cfead5bee8a3d75f18 Mon Sep 17 00:00:00 2001 From: Sagar Kamble Date: Tue, 26 Mar 2019 21:03:21 +0530 Subject: [PATCH] gpu: nvgpu: fix Makefile.sources and userspace build for vgpu common/vgpu sources compilation need to be gated by IGPU_VIRT_SUPPORT config flag. And userspace build should define this flag only for normal builds. JIRA NVGPU-1807 Change-Id: I7e5f6030250ad8a7d6ae5699422699a7abac4acc Signed-off-by: Sagar Kamble Reviewed-on: https://git-master.nvidia.com/r/2081959 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/Makefile.sources | 49 ++++++++++++++++-------------- drivers/gpu/nvgpu/Makefile.tmk | 3 ++ 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/nvgpu/Makefile.sources b/drivers/gpu/nvgpu/Makefile.sources index 22ef51505..c2af4ed8e 100644 --- a/drivers/gpu/nvgpu/Makefile.sources +++ b/drivers/gpu/nvgpu/Makefile.sources @@ -294,29 +294,6 @@ srcs += common/sim.c \ tu104/hal_tu104.c \ tu104/sec2_tu104.c \ tu104/func_tu104.c \ - common/vgpu/vgpu.c \ - common/vgpu/fifo/fifo_vgpu.c \ - common/vgpu/fifo/runlist_vgpu.c \ - common/vgpu/fifo/vgpu_fifo_gv11b.c \ - common/vgpu/fifo/userd_vgpu.c \ - common/vgpu/tsg_vgpu.c \ - common/vgpu/perf/cyclestats_snapshot_vgpu.c \ - common/vgpu/perf/perf_vgpu.c \ - common/vgpu/gr/fecs_trace_vgpu.c \ - common/vgpu/mm/mm_vgpu.c \ - common/vgpu/mm/vm_vgpu.c \ - common/vgpu/gr/gr_vgpu.c \ - common/vgpu/gr/ctx_vgpu.c \ - common/vgpu/gr/subctx_vgpu.c \ - common/vgpu/clk_vgpu.c \ - common/vgpu/debugger_vgpu.c \ - common/vgpu/ltc/ltc_vgpu.c \ - common/vgpu/cbc/cbc_vgpu.c \ - common/vgpu/ce_vgpu.c \ - common/vgpu/gv11b/vgpu_gv11b.c \ - common/vgpu/gv11b/vgpu_hal_gv11b.c \ - common/vgpu/gv11b/vgpu_tsg_gv11b.c \ - common/vgpu/gp10b/vgpu_hal_gp10b.c \ hal/bus/bus_gk20a.c \ hal/bus/bus_gm20b.c \ hal/bus/bus_gp10b.c \ @@ -406,3 +383,29 @@ ifeq ($(NVGPU_LS_PMU),1) # TBD: currently LS PMU unit files are dependent on another unit, files can be # added once refactored & removed dependency endif + +ifeq ($(IGPU_VIRT_SUPPORT), 1) +srcs += common/vgpu/vgpu.c \ + common/vgpu/fifo/fifo_vgpu.c \ + common/vgpu/fifo/runlist_vgpu.c \ + common/vgpu/fifo/vgpu_fifo_gv11b.c \ + common/vgpu/fifo/userd_vgpu.c \ + common/vgpu/tsg_vgpu.c \ + common/vgpu/perf/cyclestats_snapshot_vgpu.c \ + common/vgpu/perf/perf_vgpu.c \ + common/vgpu/gr/fecs_trace_vgpu.c \ + common/vgpu/mm/mm_vgpu.c \ + common/vgpu/mm/vm_vgpu.c \ + common/vgpu/gr/gr_vgpu.c \ + common/vgpu/gr/ctx_vgpu.c \ + common/vgpu/gr/subctx_vgpu.c \ + common/vgpu/clk_vgpu.c \ + common/vgpu/debugger_vgpu.c \ + common/vgpu/ltc/ltc_vgpu.c \ + common/vgpu/cbc/cbc_vgpu.c \ + common/vgpu/ce_vgpu.c \ + common/vgpu/gv11b/vgpu_gv11b.c \ + common/vgpu/gv11b/vgpu_hal_gv11b.c \ + common/vgpu/gv11b/vgpu_tsg_gv11b.c \ + common/vgpu/gp10b/vgpu_hal_gp10b.c +endif diff --git a/drivers/gpu/nvgpu/Makefile.tmk b/drivers/gpu/nvgpu/Makefile.tmk index 3bf4ebbb3..6e318dc20 100644 --- a/drivers/gpu/nvgpu/Makefile.tmk +++ b/drivers/gpu/nvgpu/Makefile.tmk @@ -69,6 +69,9 @@ 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 endif _NV_TOOLCHAIN_CFLAGS += -rdynamic -g