diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index afe1447e..ca6a8ae0 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -713,15 +713,21 @@ enum { | |||
713 | KEPLER_CHANNEL_GPFIFO_C = 0xA26F, | 713 | KEPLER_CHANNEL_GPFIFO_C = 0xA26F, |
714 | }; | 714 | }; |
715 | 715 | ||
716 | static inline bool gk20a_gpu_is_virtual(struct platform_device *dev) | ||
717 | { | ||
718 | struct gk20a_platform *platform = gk20a_get_platform(dev); | ||
719 | |||
720 | return platform->virtual_dev; | ||
721 | } | ||
722 | |||
716 | static inline int support_gk20a_pmu(struct platform_device *dev) | 723 | static inline int support_gk20a_pmu(struct platform_device *dev) |
717 | { | 724 | { |
718 | if (IS_ENABLED(CONFIG_GK20A_PMU)) { | 725 | if (IS_ENABLED(CONFIG_GK20A_PMU)) { |
719 | struct gk20a_platform *platform = gk20a_get_platform(dev); | 726 | /* gPMU is not supported for vgpu */ |
727 | return !gk20a_gpu_is_virtual(dev); | ||
728 | } | ||
720 | 729 | ||
721 | /* we have not supported GPU PMU for virtualization now */ | 730 | return 0; |
722 | return !platform->virtual_dev; | ||
723 | } else | ||
724 | return 0; | ||
725 | } | 731 | } |
726 | 732 | ||
727 | void gk20a_create_sysfs(struct platform_device *dev); | 733 | void gk20a_create_sysfs(struct platform_device *dev); |