From 3e11a4fbb23732955ea06aa025803d818c8352da Mon Sep 17 00:00:00 2001 From: Haley Teng Date: Mon, 6 Oct 2014 11:45:12 +0800 Subject: 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 Reviewed-on: http://git-master/r/553653 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gk20a.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h') 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 { 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); -- cgit v1.2.2