diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/fifo_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 49 |
1 files changed, 18 insertions, 31 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index 78f777ae..6d89940a 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | |||
@@ -45,6 +45,8 @@ | |||
45 | #include <nvgpu/utils.h> | 45 | #include <nvgpu/utils.h> |
46 | #include <nvgpu/channel.h> | 46 | #include <nvgpu/channel.h> |
47 | #include <nvgpu/unit.h> | 47 | #include <nvgpu/unit.h> |
48 | #include <nvgpu/power_features/power_features.h> | ||
49 | #include <nvgpu/power_features/cg.h> | ||
48 | 50 | ||
49 | #include "gk20a.h" | 51 | #include "gk20a.h" |
50 | #include "mm_gk20a.h" | 52 | #include "mm_gk20a.h" |
@@ -824,14 +826,9 @@ int gk20a_init_fifo_reset_enable_hw(struct gk20a *g) | |||
824 | /* enable pmc pfifo */ | 826 | /* enable pmc pfifo */ |
825 | g->ops.mc.reset(g, g->ops.mc.reset_mask(g, NVGPU_UNIT_FIFO)); | 827 | g->ops.mc.reset(g, g->ops.mc.reset_mask(g, NVGPU_UNIT_FIFO)); |
826 | 828 | ||
827 | if (g->ops.clock_gating.slcg_fifo_load_gating_prod) { | 829 | nvgpu_cg_slcg_fifo_load_enable(g); |
828 | g->ops.clock_gating.slcg_fifo_load_gating_prod(g, | 830 | |
829 | g->slcg_enabled); | 831 | nvgpu_cg_blcg_fifo_load_enable(g); |
830 | } | ||
831 | if (g->ops.clock_gating.blcg_fifo_load_gating_prod) { | ||
832 | g->ops.clock_gating.blcg_fifo_load_gating_prod(g, | ||
833 | g->blcg_enabled); | ||
834 | } | ||
835 | 832 | ||
836 | timeout = gk20a_readl(g, fifo_fb_timeout_r()); | 833 | timeout = gk20a_readl(g, fifo_fb_timeout_r()); |
837 | timeout = set_field(timeout, fifo_fb_timeout_period_m(), | 834 | timeout = set_field(timeout, fifo_fb_timeout_period_m(), |
@@ -1361,8 +1358,8 @@ void gk20a_fifo_reset_engine(struct gk20a *g, u32 engine_id) | |||
1361 | } | 1358 | } |
1362 | 1359 | ||
1363 | if (engine_enum == ENGINE_GR_GK20A) { | 1360 | if (engine_enum == ENGINE_GR_GK20A) { |
1364 | if (g->support_pmu && g->can_elpg) { | 1361 | if (g->support_pmu) { |
1365 | if (nvgpu_pmu_disable_elpg(g)) { | 1362 | if (nvgpu_pg_elpg_disable(g) != 0 ) { |
1366 | nvgpu_err(g, "failed to set disable elpg"); | 1363 | nvgpu_err(g, "failed to set disable elpg"); |
1367 | } | 1364 | } |
1368 | } | 1365 | } |
@@ -1391,8 +1388,10 @@ void gk20a_fifo_reset_engine(struct gk20a *g, u32 engine_id) | |||
1391 | "HALT gr pipe not supported and " | 1388 | "HALT gr pipe not supported and " |
1392 | "gr cannot be reset without halting gr pipe"); | 1389 | "gr cannot be reset without halting gr pipe"); |
1393 | } | 1390 | } |
1394 | if (g->support_pmu && g->can_elpg) { | 1391 | if (g->support_pmu) { |
1395 | nvgpu_pmu_enable_elpg(g); | 1392 | if (nvgpu_pg_elpg_enable(g) != 0 ) { |
1393 | nvgpu_err(g, "failed to set enable elpg"); | ||
1394 | } | ||
1396 | } | 1395 | } |
1397 | } | 1396 | } |
1398 | if ((engine_enum == ENGINE_GRCE_GK20A) || | 1397 | if ((engine_enum == ENGINE_GRCE_GK20A) || |
@@ -1638,25 +1637,11 @@ static bool gk20a_fifo_handle_mmu_fault_locked( | |||
1638 | g->fifo.deferred_reset_pending = false; | 1637 | g->fifo.deferred_reset_pending = false; |
1639 | 1638 | ||
1640 | /* Disable power management */ | 1639 | /* Disable power management */ |
1641 | if (g->support_pmu && g->can_elpg) { | 1640 | if (g->support_pmu) { |
1642 | if (nvgpu_pmu_disable_elpg(g)) { | 1641 | if (nvgpu_cg_pg_disable(g) != 0) { |
1643 | nvgpu_err(g, "failed to set disable elpg"); | 1642 | nvgpu_warn(g, "fail to disable power mgmt"); |
1644 | } | 1643 | } |
1645 | } | 1644 | } |
1646 | if (g->ops.clock_gating.slcg_gr_load_gating_prod) { | ||
1647 | g->ops.clock_gating.slcg_gr_load_gating_prod(g, | ||
1648 | false); | ||
1649 | } | ||
1650 | if (g->ops.clock_gating.slcg_perf_load_gating_prod) { | ||
1651 | g->ops.clock_gating.slcg_perf_load_gating_prod(g, | ||
1652 | false); | ||
1653 | } | ||
1654 | if (g->ops.clock_gating.slcg_ltc_load_gating_prod) { | ||
1655 | g->ops.clock_gating.slcg_ltc_load_gating_prod(g, | ||
1656 | false); | ||
1657 | } | ||
1658 | |||
1659 | gr_gk20a_init_cg_mode(g, ELCG_MODE, ELCG_RUN); | ||
1660 | 1645 | ||
1661 | /* Disable fifo access */ | 1646 | /* Disable fifo access */ |
1662 | grfifo_ctl = gk20a_readl(g, gr_gpfifo_ctl_r()); | 1647 | grfifo_ctl = gk20a_readl(g, gr_gpfifo_ctl_r()); |
@@ -1842,8 +1827,10 @@ static bool gk20a_fifo_handle_mmu_fault_locked( | |||
1842 | gr_gpfifo_ctl_semaphore_access_enabled_f()); | 1827 | gr_gpfifo_ctl_semaphore_access_enabled_f()); |
1843 | 1828 | ||
1844 | /* It is safe to enable ELPG again. */ | 1829 | /* It is safe to enable ELPG again. */ |
1845 | if (g->support_pmu && g->can_elpg) { | 1830 | if (g->support_pmu) { |
1846 | nvgpu_pmu_enable_elpg(g); | 1831 | if (nvgpu_cg_pg_enable(g) != 0) { |
1832 | nvgpu_warn(g, "fail to enable power mgmt"); | ||
1833 | } | ||
1847 | } | 1834 | } |
1848 | 1835 | ||
1849 | return verbose; | 1836 | return verbose; |