gpu: nvgpu: Move is_fmodel to struct gk20a

Copy is_fmodel to struct gk20a at probe time, and access it from
gk20a instead of platform_gk20a.

JIRA NVGPU-16

Change-Id: Ib8d793ea2b02b62da3bfdbb6372d9927658b7ec6
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1463540
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Terje Bergstrom
2017-04-14 13:11:18 -07:00
committed by mobile promotions
parent 15e9b433f3
commit 6df49a63ca
17 changed files with 34 additions and 56 deletions

View File

@@ -112,12 +112,13 @@ static void gk20a_tegra_secure_page_destroy(struct device *dev,
int gk20a_tegra_secure_page_alloc(struct device *dev)
{
struct gk20a_platform *platform = dev_get_drvdata(dev);
struct gk20a *g = get_gk20a(dev);
struct secure_page_buffer *secure_buffer = &platform->secure_buffer;
DEFINE_DMA_ATTRS(attrs);
dma_addr_t iova;
size_t size = PAGE_SIZE;
if (platform->is_fmodel)
if (g->is_fmodel)
return -EINVAL;
(void)dma_alloc_attrs(&tegra_vpr_dev, size, &iova,
@@ -389,10 +390,11 @@ done:
static int gk20a_tegra_railgate(struct device *dev)
{
struct gk20a *g = get_gk20a(dev);
struct gk20a_platform *platform = dev_get_drvdata(dev);
int ret = 0;
if (platform->is_fmodel ||
if (g->is_fmodel ||
!tegra_dvfs_is_rail_up(platform->gpu_rail))
return 0;
@@ -442,11 +444,12 @@ err_power_off:
static int gk20a_tegra_unrailgate(struct device *dev)
{
struct gk20a *g = get_gk20a(dev);
struct gk20a_platform *platform = dev_get_drvdata(dev);
int ret = 0;
bool first = false;
if (platform->is_fmodel)
if (g->is_fmodel)
return 0;
if (!platform->gpu_rail) {
@@ -517,10 +520,11 @@ err_clk_on:
static bool gk20a_tegra_is_railgated(struct device *dev)
{
struct gk20a *g = get_gk20a(dev);
struct gk20a_platform *platform = dev_get_drvdata(dev);
bool ret = false;
if (!platform->is_fmodel)
if (!g->is_fmodel)
ret = !tegra_dvfs_is_rail_up(platform->gpu_rail);
return ret;
@@ -534,10 +538,11 @@ static bool gk20a_tegra_is_railgated(struct device *dev)
static int gm20b_tegra_railgate(struct device *dev)
{
struct gk20a *g = get_gk20a(dev);
struct gk20a_platform *platform = dev_get_drvdata(dev);
int ret = 0;
if (platform->is_fmodel ||
if (g->is_fmodel ||
!tegra_dvfs_is_rail_up(platform->gpu_rail))
return 0;
@@ -601,7 +606,7 @@ static int gm20b_tegra_unrailgate(struct device *dev)
int ret = 0;
bool first = false;
if (platform->is_fmodel)
if (g->is_fmodel)
return 0;
#ifdef CONFIG_TEGRA_CLK_FRAMEWORK

View File

@@ -72,10 +72,11 @@ static void gr_gp10b_remove_sysfs(struct device *dev);
int gp10b_tegra_get_clocks(struct device *dev)
{
struct gk20a *g = get_gk20a(dev);
struct gk20a_platform *platform = dev_get_drvdata(dev);
unsigned int i;
if (platform->is_fmodel)
if (g->is_fmodel)
return 0;
platform->num_clks = 0;