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>
This commit is contained in:
Haley Teng
2014-10-06 11:45:12 +08:00
committed by Dan Willemsen
parent f56d50ddac
commit 3e11a4fbb2
4 changed files with 13 additions and 11 deletions

View File

@@ -687,14 +687,16 @@ enum {
KEPLER_DMA_COPY_A = 0xA0B5, /*not sure about this one*/
};
#if defined(CONFIG_GK20A_PMU)
static inline int support_gk20a_pmu(void)
static inline int support_gk20a_pmu(struct platform_device *dev)
{
return 1;
if (IS_ENABLED(CONFIG_GK20A_PMU)) {
struct gk20a_platform *platform = gk20a_get_platform(dev);
/* we have not supported GPU PMU for virtualization now */
return !platform->virtual_dev;
} else
return 0;
}
#else
static inline int support_gk20a_pmu(void){return 0;}
#endif
void gk20a_create_sysfs(struct platform_device *dev);

View File

@@ -2110,7 +2110,7 @@ static int gr_gk20a_wait_ctxsw_ready(struct gk20a *g)
return ret;
}
if (support_gk20a_pmu())
if (support_gk20a_pmu(g->dev))
gk20a_writel(g, gr_fecs_current_ctx_r(),
gr_fecs_current_ctx_valid_false_f());

View File

@@ -373,11 +373,11 @@ bool gk20a_gr_sm_debugger_attached(struct gk20a *g);
#define gr_gk20a_elpg_protected_call(g, func) \
({ \
int err = 0; \
if (support_gk20a_pmu()) \
if (support_gk20a_pmu(g->dev)) \
err = gk20a_pmu_disable_elpg(g); \
if (err) return err; \
err = func; \
if (support_gk20a_pmu()) \
if (support_gk20a_pmu(g->dev)) \
gk20a_pmu_enable_elpg(g); \
err; \
})

View File

@@ -2345,7 +2345,7 @@ int gk20a_init_pmu_support(struct gk20a *g)
if (err)
return err;
if (support_gk20a_pmu()) {
if (support_gk20a_pmu(g->dev)) {
err = gk20a_init_pmu_setup_sw(g);
if (err)
return err;
@@ -3665,7 +3665,7 @@ int gk20a_pmu_destroy(struct gk20a *g)
gk20a_dbg_fn("");
if (!support_gk20a_pmu())
if (!support_gk20a_pmu(g->dev))
return 0;
/* make sure the pending operations are finished before we continue */