diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 14 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.h | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/pmu_gk20a.c | 4 |
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) | 690 | static inline int support_gk20a_pmu(struct platform_device *dev) |
691 | static 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 | ||
696 | static inline int support_gk20a_pmu(void){return 0;} | ||
697 | #endif | ||
698 | 700 | ||
699 | void gk20a_create_sysfs(struct platform_device *dev); | 701 | void 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 */ |