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:
Antony Clince Alex
2022-03-15 03:03:59 +00:00
committed by mobile promotions
parent 7df16ee9c4
commit 40231858a5
3 changed files with 8 additions and 0 deletions

View File

@@ -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");