From 19fdb429c2b04d13faecad8b2e5466e9f3c7b8c7 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 29 Mar 2017 15:00:24 -0700 Subject: gpu: nvgpu: Wrappers for checking platform type Add nvgpu_* wrappers for determining if we're running in simulation or silicon, and if we're running in hypervisor. The new wrappers require struct gk20a pointer, and gk20a_fence_wait() did not have access to one. Add struct gk20a pointer as the first parameter. JIRA NVGPU-16 Change-Id: I73b2b8f091ca29fb1827054abd2adaf583710331 Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1331565 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 5fc57494..339656c7 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -43,6 +43,7 @@ #include #include #include +#include #include "gk20a.h" #include "debug_gk20a.h" @@ -295,7 +296,7 @@ static int gk20a_init_support(struct platform_device *dev) goto fail; } - if (tegra_cpu_is_asim()) { + if (nvgpu_platform_is_simulation(g)) { err = gk20a_init_sim_support(dev); if (err) goto fail; @@ -954,9 +955,6 @@ static int gk20a_probe(struct platform_device *dev) return -ENODATA; } - if (tegra_platform_is_linsim() || tegra_platform_is_vdk()) - platform->is_fmodel = true; - gk20a_dbg_fn(""); platform_set_drvdata(dev, platform); @@ -973,6 +971,9 @@ static int gk20a_probe(struct platform_device *dev) set_gk20a(dev, gk20a); gk20a->dev = &dev->dev; + if (nvgpu_platform_is_simulation(gk20a)) + platform->is_fmodel = true; + nvgpu_kmem_init(gk20a); gk20a->irq_stall = platform_get_irq(dev, 0); @@ -1030,7 +1031,7 @@ static int gk20a_probe(struct platform_device *dev) return err; } - gk20a->mm.has_physical_mode = !is_tegra_hypervisor_mode(); + gk20a->mm.has_physical_mode = !nvgpu_is_hypervisor_mode(gk20a); return 0; } -- cgit v1.2.2