summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorHaley Teng <hteng@nvidia.com>2014-10-05 23:45:12 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:11:41 -0400
commit3e11a4fbb23732955ea06aa025803d818c8352da (patch)
treeef5cace89c9beac814134d4ed359ab254e2ae9f8 /drivers
parentf56d50ddac2ea70c7d50f22b9cd74408b1042da3 (diff)
gpu: nvgpu: vgpu: disable GK20A PMU support
GK20A PMU is not supported in GPU client for virtualization. However, to make native case and virtualization case can share same defconfig and kernel image, we need to enable CONFIG_GK20A_PMU and CONFIG_GK20A_DEVFREQ in defconfig. This commit changes to detect if we should disable GK20A PMU support in run time. Bug 200041597 Change-Id: I292c647303ed57af6faa1c5671037ca27b48e31e Signed-off-by: Haley Teng <hteng@nvidia.com> Reviewed-on: http://git-master/r/553653 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h14
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.c2
-rw-r--r--drivers/gpu/nvgpu/gk20a/gr_gk20a.h4
-rw-r--r--drivers/gpu/nvgpu/gk20a/pmu_gk20a.c4
4 files changed, 13 insertions, 11 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index 38322c87..979b4cb0 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -687,14 +687,16 @@ enum {
687 KEPLER_DMA_COPY_A = 0xA0B5, /*not sure about this one*/ 687 KEPLER_DMA_COPY_A = 0xA0B5, /*not sure about this one*/
688}; 688};
689 689
690#if defined(CONFIG_GK20A_PMU) 690static inline int support_gk20a_pmu(struct platform_device *dev)
691static inline int support_gk20a_pmu(void)
692{ 691{
693 return 1; 692 if (IS_ENABLED(CONFIG_GK20A_PMU)) {
693 struct gk20a_platform *platform = gk20a_get_platform(dev);
694
695 /* we have not supported GPU PMU for virtualization now */
696 return !platform->virtual_dev;
697 } else
698 return 0;
694} 699}
695#else
696static inline int support_gk20a_pmu(void){return 0;}
697#endif
698 700
699void gk20a_create_sysfs(struct platform_device *dev); 701void gk20a_create_sysfs(struct platform_device *dev);
700 702
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
index 93649675..1dc5603f 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c
@@ -2110,7 +2110,7 @@ static int gr_gk20a_wait_ctxsw_ready(struct gk20a *g)
2110 return ret; 2110 return ret;
2111 } 2111 }
2112 2112
2113 if (support_gk20a_pmu()) 2113 if (support_gk20a_pmu(g->dev))
2114 gk20a_writel(g, gr_fecs_current_ctx_r(), 2114 gk20a_writel(g, gr_fecs_current_ctx_r(),
2115 gr_fecs_current_ctx_valid_false_f()); 2115 gr_fecs_current_ctx_valid_false_f());
2116 2116
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
index e9bf4505..e09cfbfa 100644
--- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h
@@ -373,11 +373,11 @@ bool gk20a_gr_sm_debugger_attached(struct gk20a *g);
373#define gr_gk20a_elpg_protected_call(g, func) \ 373#define gr_gk20a_elpg_protected_call(g, func) \
374 ({ \ 374 ({ \
375 int err = 0; \ 375 int err = 0; \
376 if (support_gk20a_pmu()) \ 376 if (support_gk20a_pmu(g->dev)) \
377 err = gk20a_pmu_disable_elpg(g); \ 377 err = gk20a_pmu_disable_elpg(g); \
378 if (err) return err; \ 378 if (err) return err; \
379 err = func; \ 379 err = func; \
380 if (support_gk20a_pmu()) \ 380 if (support_gk20a_pmu(g->dev)) \
381 gk20a_pmu_enable_elpg(g); \ 381 gk20a_pmu_enable_elpg(g); \
382 err; \ 382 err; \
383 }) 383 })
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
index 7a62f05c..7878e1e2 100644
--- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
@@ -2345,7 +2345,7 @@ int gk20a_init_pmu_support(struct gk20a *g)
2345 if (err) 2345 if (err)
2346 return err; 2346 return err;
2347 2347
2348 if (support_gk20a_pmu()) { 2348 if (support_gk20a_pmu(g->dev)) {
2349 err = gk20a_init_pmu_setup_sw(g); 2349 err = gk20a_init_pmu_setup_sw(g);
2350 if (err) 2350 if (err)
2351 return err; 2351 return err;
@@ -3665,7 +3665,7 @@ int gk20a_pmu_destroy(struct gk20a *g)
3665 3665
3666 gk20a_dbg_fn(""); 3666 gk20a_dbg_fn("");
3667 3667
3668 if (!support_gk20a_pmu()) 3668 if (!support_gk20a_pmu(g->dev))
3669 return 0; 3669 return 0;
3670 3670
3671 /* make sure the pending operations are finished before we continue */ 3671 /* make sure the pending operations are finished before we continue */