mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 09:57:08 +03:00
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 <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1331565 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
1a4647272f
commit
19fdb429c2
31
drivers/gpu/nvgpu/common/linux/soc.c
Normal file
31
drivers/gpu/nvgpu/common/linux/soc.c
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms and conditions of the GNU General Public License,
|
||||
* version 2, as published by the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*/
|
||||
|
||||
#include <soc/tegra/chip-id.h>
|
||||
|
||||
#include <nvgpu/soc.h>
|
||||
|
||||
bool nvgpu_platform_is_silicon(struct gk20a *g)
|
||||
{
|
||||
return tegra_platform_is_silicon();
|
||||
}
|
||||
|
||||
bool nvgpu_platform_is_simulation(struct gk20a *g)
|
||||
{
|
||||
return tegra_platform_is_linsim() || tegra_platform_is_vdk();
|
||||
}
|
||||
|
||||
bool nvgpu_is_hypervisor_mode(struct gk20a *g)
|
||||
{
|
||||
return is_tegra_hypervisor_mode();
|
||||
}
|
||||
Reference in New Issue
Block a user