From 05a6b54914fcd7f21ca30c32dbb851e6eecfc64c Mon Sep 17 00:00:00 2001 From: Yogesh Date: Mon, 17 Aug 2015 16:41:02 -0700 Subject: gpu: nvgpu: Inject function addresses Inject function addresses of gk20a_do_idle and gk20a_do_unidle once the nvgpu module loads. Bug 1476801 Change-Id: I67a8ae7fb654524616c2c2c710013cbc097a3f32 Signed-off-by: Yogesh Bhosale Reviewed-on: http://git-master/r/785047 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gk20a.c | 9 +++++++++ drivers/gpu/nvgpu/gk20a/gk20a.h | 2 ++ 2 files changed, 11 insertions(+) (limited to 'drivers/gpu') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index cdbe3c09..121e442c 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -39,6 +39,7 @@ #include #include #include +#include #include @@ -584,6 +585,10 @@ static void gk20a_remove_support(struct platform_device *dev) { struct gk20a *g = get_gk20a(dev); +#ifdef CONFIG_TEGRA_COMMON + tegra_unregister_idle_unidle(); +#endif + if (g->pmu.remove_support) g->pmu.remove_support(&g->pmu); @@ -618,6 +623,10 @@ static int gk20a_init_support(struct platform_device *dev) int err = 0; struct gk20a *g = get_gk20a(dev); +#ifdef CONFIG_TEGRA_COMMON + tegra_register_idle_unidle(gk20a_do_idle, gk20a_do_unidle); +#endif + g->regs = gk20a_ioremap_resource(dev, GK20A_BAR0_IORESOURCE_MEM, &g->reg_mem); if (IS_ERR(g->regs)) { diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 6454bbfc..ed209929 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -839,6 +839,8 @@ void gk20a_idle(struct platform_device *pdev); void gk20a_disable(struct gk20a *g, u32 units); void gk20a_enable(struct gk20a *g, u32 units); void gk20a_reset(struct gk20a *g, u32 units); +int gk20a_do_idle(void); +int gk20a_do_unidle(void); int __gk20a_do_idle(struct platform_device *pdev, bool force_reset); int __gk20a_do_unidle(struct platform_device *pdev); -- cgit v1.2.2