mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: add enable flag for gpu emulate mode
Introduce enable flag NVGPU_SUPPORT_EMULATE_MODE, and bring emulate mode feature under this flag. At present, gpu emulate mode is only support on ga10b. Jira NVGPU-8120 Change-Id: I85269992926c3cf8f2d1dd70882979e1c4656984 Signed-off-by: Antony Clince Alex <aalex@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2681613 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
7df16ee9c4
commit
40231858a5
@@ -1994,6 +1994,7 @@ int ga10b_init_hal(struct gk20a *g)
|
||||
#ifdef CONFIG_NVGPU_HAL_NON_FUSA
|
||||
gops->mssnvlink = ga10b_ops_mssnvlink;
|
||||
#endif
|
||||
nvgpu_set_enabled(g, NVGPU_SUPPORT_EMULATE_MODE, true);
|
||||
g->name = "ga10b";
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -221,6 +221,8 @@ struct gk20a;
|
||||
DEFINE_FLAG(NVGPU_SUPPORT_NVS, "Domain scheduler support"), \
|
||||
DEFINE_FLAG(NVGPU_SUPPORT_TEGRA_RAW, \
|
||||
"TEGRA_RAW format support"), \
|
||||
DEFINE_FLAG(NVGPU_SUPPORT_EMULATE_MODE, \
|
||||
"Emulate mode support"), \
|
||||
DEFINE_FLAG(NVGPU_MAX_ENABLED_BITS, "Marks max number of flags"),
|
||||
|
||||
/**
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include <linux/fb.h>
|
||||
#include <linux/version.h>
|
||||
|
||||
#include <nvgpu/enabled.h>
|
||||
#include <nvgpu/errata.h>
|
||||
#include <nvgpu/kmem.h>
|
||||
#include <nvgpu/nvhost.h>
|
||||
@@ -1302,6 +1303,10 @@ static ssize_t emulate_mode_store(struct device *dev,
|
||||
if (kstrtoul(buf, 10, &val) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
if (!nvgpu_is_enabled(g, NVGPU_SUPPORT_EMULATE_MODE)) {
|
||||
nvgpu_err(g, "Emulate mode not supported");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (nvgpu_is_powered_on(g)) {
|
||||
nvgpu_err(g, "GPU is powered on already, emulate mode "
|
||||
"cannot be enabled");
|
||||
|
||||
Reference in New Issue
Block a user