From 2c822a63885ec79ac2d860e13438c6154e23e5d0 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Fri, 12 May 2017 10:32:11 -0700 Subject: gpu: nvgpu: Remove uses of platform->can_elpg Remove newly introduced uses of gk20a_platform->can_elpg. Rename the field to can_elpg_init and replace all uses with gk20a->can_elpg. Change-Id: Id6e84d4c16159b5da80c583a8a94a9c5cc2423ec Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1480955 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/driver_common.c | 2 +- drivers/gpu/nvgpu/common/linux/pci.c | 8 ++++---- drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 11 ++++------- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 3 +-- drivers/gpu/nvgpu/gk20a/platform_gk20a.h | 2 +- drivers/gpu/nvgpu/gk20a/platform_vgpu_tegra.c | 2 +- drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 5 ++--- drivers/gpu/nvgpu/lpwr/lpwr.c | 3 +-- drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c | 4 ++-- drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c | 2 +- 10 files changed, 18 insertions(+), 24 deletions(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/common/linux/driver_common.c b/drivers/gpu/nvgpu/common/linux/driver_common.c index c2f31afc..8855ce1f 100644 --- a/drivers/gpu/nvgpu/common/linux/driver_common.c +++ b/drivers/gpu/nvgpu/common/linux/driver_common.c @@ -106,7 +106,7 @@ static void nvgpu_init_pm_vars(struct gk20a *g) g->mscg_enabled = nvgpu_platform_is_silicon(g) ? platform->enable_mscg : false; g->can_elpg = - nvgpu_platform_is_silicon(g) ? platform->can_elpg : false; + nvgpu_platform_is_silicon(g) ? platform->can_elpg_init : false; g->default_pri_timeout = platform->default_pri_timeout; g->aggressive_sync_destroy = platform->aggressive_sync_destroy; g->aggressive_sync_destroy_thresh = platform->aggressive_sync_destroy_thresh; diff --git a/drivers/gpu/nvgpu/common/linux/pci.c b/drivers/gpu/nvgpu/common/linux/pci.c index a603135f..37673f5e 100644 --- a/drivers/gpu/nvgpu/common/linux/pci.c +++ b/drivers/gpu/nvgpu/common/linux/pci.c @@ -66,7 +66,7 @@ static struct gk20a_platform nvgpu_pci_device[] = { /* power management configuration */ .railgate_delay_init = 500, .can_railgate_init = false, - .can_elpg = true, + .can_elpg_init = true, .enable_elpg = true, .enable_elcg = false, .enable_slcg = true, @@ -100,7 +100,7 @@ static struct gk20a_platform nvgpu_pci_device[] = { /* power management configuration */ .railgate_delay_init = 500, .can_railgate_init = false, - .can_elpg = true, + .can_elpg_init = true, .enable_elpg = true, .enable_elcg = false, .enable_slcg = true, @@ -134,7 +134,7 @@ static struct gk20a_platform nvgpu_pci_device[] = { /* power management configuration */ .railgate_delay_init = 500, .can_railgate_init = false, - .can_elpg = true, + .can_elpg_init = true, .enable_elpg = true, .enable_elcg = false, .enable_slcg = true, @@ -168,7 +168,7 @@ static struct gk20a_platform nvgpu_pci_device[] = { /* power management configuration */ .railgate_delay_init = 500, .can_railgate_init = false, - .can_elpg = true, + .can_elpg_init = true, .enable_elpg = true, .enable_elcg = false, .enable_slcg = true, diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index f212e55b..d6043df2 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c @@ -1206,7 +1206,6 @@ static inline void get_exception_mmu_fault_info( void gk20a_fifo_reset_engine(struct gk20a *g, u32 engine_id) { struct fifo_gk20a *f = NULL; - struct gk20a_platform *platform; u32 engine_enum = ENGINE_INVAL_GK20A; u32 inst_id = 0; struct fifo_engine_info_gk20a *engine_info; @@ -1217,7 +1216,6 @@ void gk20a_fifo_reset_engine(struct gk20a *g, u32 engine_id) return; f = &g->fifo; - platform = dev_get_drvdata(g->dev); engine_info = gk20a_fifo_get_engine_info(g, engine_id); @@ -1230,7 +1228,7 @@ void gk20a_fifo_reset_engine(struct gk20a *g, u32 engine_id) nvgpu_err(g, "unsupported engine_id %d", engine_id); if (engine_enum == ENGINE_GR_GK20A) { - if (g->support_pmu && platform->can_elpg) + if (g->support_pmu && g->can_elpg) gk20a_pmu_disable_elpg(g); /* resetting engine will alter read/write index. * need to flush circular buffer before re-enabling FECS. @@ -1243,7 +1241,7 @@ void gk20a_fifo_reset_engine(struct gk20a *g, u32 engine_id) /* resetting engine using mc_enable_r() is not enough, we do full init sequence */ gk20a_gr_reset(g); - if (g->support_pmu && platform->can_elpg) + if (g->support_pmu && g->can_elpg) gk20a_pmu_enable_elpg(g); } if ((engine_enum == ENGINE_GRCE_GK20A) || @@ -1468,7 +1466,6 @@ static bool gk20a_fifo_handle_mmu_fault( bool id_is_tsg) { bool fake_fault; - struct gk20a_platform *platform = dev_get_drvdata(g->dev); unsigned long fault_id; unsigned long engine_mmu_fault_id; bool verbose = true; @@ -1479,7 +1476,7 @@ static bool gk20a_fifo_handle_mmu_fault( g->fifo.deferred_reset_pending = false; /* Disable power management */ - if (g->support_pmu && platform->can_elpg) + if (g->support_pmu && g->can_elpg) gk20a_pmu_disable_elpg(g); if (g->ops.clock_gating.slcg_gr_load_gating_prod) g->ops.clock_gating.slcg_gr_load_gating_prod(g, @@ -1678,7 +1675,7 @@ static bool gk20a_fifo_handle_mmu_fault( gr_gpfifo_ctl_semaphore_access_enabled_f()); /* It is safe to enable ELPG again. */ - if (g->support_pmu && platform->can_elpg) + if (g->support_pmu && g->can_elpg) gk20a_pmu_enable_elpg(g); return verbose; diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 25636bbd..8217a8bf 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -3126,7 +3126,6 @@ int gk20a_alloc_obj_ctx(struct channel_gk20a *c, struct nvgpu_alloc_obj_ctx_args *args) { struct gk20a *g = c->g; - struct gk20a_platform *platform = dev_get_drvdata(g->dev); struct fifo_gk20a *f = &g->fifo; struct channel_ctx_gk20a *ch_ctx = &c->ch_ctx; struct tsg_gk20a *tsg = NULL; @@ -3281,7 +3280,7 @@ int gk20a_alloc_obj_ctx(struct channel_gk20a *c, args->flags |= NVGPU_ALLOC_OBJ_FLAGS_LOCKBOOST_ZERO; - if (g->support_pmu && platform->can_elpg) + if (g->support_pmu && g->can_elpg) gk20a_pmu_enable_elpg(g); } diff --git a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h index 2cbc1056..5dc55b18 100644 --- a/drivers/gpu/nvgpu/gk20a/platform_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/platform_gk20a.h @@ -42,7 +42,7 @@ struct gk20a_platform { bool can_railgate_init; /* Should be populated at probe. */ - bool can_elpg; + bool can_elpg_init; /* Should be populated at probe. */ bool has_syncpoints; diff --git a/drivers/gpu/nvgpu/gk20a/platform_vgpu_tegra.c b/drivers/gpu/nvgpu/gk20a/platform_vgpu_tegra.c index e38ad506..049d394e 100644 --- a/drivers/gpu/nvgpu/gk20a/platform_vgpu_tegra.c +++ b/drivers/gpu/nvgpu/gk20a/platform_vgpu_tegra.c @@ -53,7 +53,7 @@ struct gk20a_platform vgpu_tegra_platform = { /* power management configuration */ .can_railgate_init = false, - .can_elpg = false, + .can_elpg_init = false, .enable_slcg = false, .enable_blcg = false, .enable_elcg = false, diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c index af22b13f..fa0911ab 100644 --- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c @@ -4936,7 +4936,6 @@ clean_up: int gk20a_pmu_pg_global_enable(struct gk20a *g, u32 enable_pg) { u32 status = 0; - struct gk20a_platform *platform = dev_get_drvdata(g->dev); if (enable_pg == true) { if (g->ops.pmu.pmu_pg_engines_feature_list && @@ -4946,7 +4945,7 @@ int gk20a_pmu_pg_global_enable(struct gk20a *g, u32 enable_pg) if (g->ops.pmu.pmu_lpwr_enable_pg) status = g->ops.pmu.pmu_lpwr_enable_pg(g, true); - } else if (g->support_pmu && platform->can_elpg) + } else if (g->support_pmu && g->can_elpg) status = gk20a_pmu_enable_elpg(g); } else if (enable_pg == false) { if (g->ops.pmu.pmu_pg_engines_feature_list && @@ -4956,7 +4955,7 @@ int gk20a_pmu_pg_global_enable(struct gk20a *g, u32 enable_pg) if (g->ops.pmu.pmu_lpwr_disable_pg) status = g->ops.pmu.pmu_lpwr_disable_pg(g, true); - } else if (g->support_pmu && platform->can_elpg) + } else if (g->support_pmu && g->can_elpg) status = gk20a_pmu_disable_elpg(g); } diff --git a/drivers/gpu/nvgpu/lpwr/lpwr.c b/drivers/gpu/nvgpu/lpwr/lpwr.c index 8fa92b62..099c81d6 100644 --- a/drivers/gpu/nvgpu/lpwr/lpwr.c +++ b/drivers/gpu/nvgpu/lpwr/lpwr.c @@ -337,7 +337,6 @@ u32 nvgpu_lpwr_is_rppg_supported(struct gk20a *g, u32 pstate_num) int nvgpu_lpwr_enable_pg(struct gk20a *g, bool pstate_lock) { struct pmu_gk20a *pmu = &g->pmu; - struct gk20a_platform *platform = dev_get_drvdata(g->dev); u32 status = 0; u32 is_mscg_supported = 0; u32 is_rppg_supported = 0; @@ -364,7 +363,7 @@ int nvgpu_lpwr_enable_pg(struct gk20a *g, bool pstate_lock) is_rppg_supported = nvgpu_lpwr_is_rppg_supported(g, present_pstate); if (is_rppg_supported) { - if (g->support_pmu && platform->can_elpg) + if (g->support_pmu && g->can_elpg) status = gk20a_pmu_enable_elpg(g); } diff --git a/drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c index 4ff4804f..1ca85117 100644 --- a/drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c @@ -1053,7 +1053,7 @@ struct gk20a_platform gk20a_tegra_platform = { /* power management configuration */ .railgate_delay_init = 500, .can_railgate_init = true, - .can_elpg = true, + .can_elpg_init = true, .enable_slcg = true, .enable_blcg = true, .enable_elcg = true, @@ -1110,7 +1110,7 @@ struct gk20a_platform gm20b_tegra_platform = { /* power management configuration */ .railgate_delay_init = 500, .can_railgate_init = true, - .can_elpg = true, + .can_elpg_init = true, .enable_slcg = true, .enable_blcg = true, .enable_elcg = true, diff --git a/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c index 2587d5fa..32cc80d9 100644 --- a/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c +++ b/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c @@ -387,7 +387,7 @@ struct gk20a_platform gp10b_tegra_platform = { /* power management configuration */ .can_railgate_init = true, .enable_elpg = true, - .can_elpg = true, + .can_elpg_init = true, .enable_blcg = true, .enable_slcg = true, .enable_elcg = true, -- cgit v1.2.2