summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/gk20a.c
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2014-10-02 08:09:20 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:11:36 -0400
commit2870a4bcecf93133141aee9f4d9007f0df22cfa8 (patch)
tree4494762e8b0710dc37b318b8d3915f547a0d10af /drivers/gpu/nvgpu/gk20a/gk20a.c
parent17e4b7ff3f48aca2d258f246a1eef4ed32dd53a2 (diff)
gpu: nvgpu: Add no-op stubs for vgpu
Implement empty or -ENOSYS functions for vgpu if CONFIG_TEGRA_GR_VIRTUALIZATION is not enabled, and remove ifdefs around the calling code. Change-Id: Idc75c9bc486d661786bc222bd9e0380aa7766e78 Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: http://git-master/r/552898 Reviewed-by: Aingara Paramakuru <aparamakuru@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c39
1 files changed, 13 insertions, 26 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index ae108875..b0e8b476 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -59,9 +59,7 @@
59#include "gk20a_scale.h" 59#include "gk20a_scale.h"
60#include "dbg_gpu_gk20a.h" 60#include "dbg_gpu_gk20a.h"
61#include "hal.h" 61#include "hal.h"
62#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION
63#include "vgpu/vgpu.h" 62#include "vgpu/vgpu.h"
64#endif
65 63
66#define CREATE_TRACE_POINTS 64#define CREATE_TRACE_POINTS
67#include <trace/events/gk20a.h> 65#include <trace/events/gk20a.h>
@@ -739,21 +737,17 @@ static int gk20a_init_support(struct platform_device *dev)
739static int gk20a_init_client(struct platform_device *dev) 737static int gk20a_init_client(struct platform_device *dev)
740{ 738{
741 struct gk20a *g = get_gk20a(dev); 739 struct gk20a *g = get_gk20a(dev);
740 struct gk20a_platform *platform = gk20a_get_platform(dev);
742 int err; 741 int err;
743 742
744 gk20a_dbg_fn(""); 743 gk20a_dbg_fn("");
745 744
746#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION 745 if (platform->virtual_dev) {
747 { 746 err = vgpu_pm_finalize_poweron(&dev->dev);
748 struct gk20a_platform *platform = gk20a_get_platform(dev); 747 if (err)
749 748 return err;
750 if (platform->virtual_dev) {
751 err = vgpu_pm_finalize_poweron(&dev->dev);
752 if (err)
753 return err;
754 }
755 } 749 }
756#endif 750
757#ifndef CONFIG_PM_RUNTIME 751#ifndef CONFIG_PM_RUNTIME
758 gk20a_pm_finalize_poweron(&dev->dev); 752 gk20a_pm_finalize_poweron(&dev->dev);
759#endif 753#endif
@@ -769,17 +763,15 @@ static int gk20a_init_client(struct platform_device *dev)
769 763
770static void gk20a_deinit_client(struct platform_device *dev) 764static void gk20a_deinit_client(struct platform_device *dev)
771{ 765{
766 struct gk20a_platform *platform = gk20a_get_platform(dev);
767
772 gk20a_dbg_fn(""); 768 gk20a_dbg_fn("");
773#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION
774 {
775 struct gk20a_platform *platform = gk20a_get_platform(dev);
776 769
777 if (platform->virtual_dev) { 770 if (platform->virtual_dev) {
778 vgpu_pm_prepare_poweroff(&dev->dev); 771 vgpu_pm_prepare_poweroff(&dev->dev);
779 return; 772 return;
780 }
781 } 773 }
782#endif 774
783#ifndef CONFIG_PM_RUNTIME 775#ifndef CONFIG_PM_RUNTIME
784 gk20a_pm_prepare_poweroff(&dev->dev); 776 gk20a_pm_prepare_poweroff(&dev->dev);
785#endif 777#endif
@@ -1442,10 +1434,8 @@ static int gk20a_probe(struct platform_device *dev)
1442 1434
1443 platform_set_drvdata(dev, platform); 1435 platform_set_drvdata(dev, platform);
1444 1436
1445#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION
1446 if (platform->virtual_dev) 1437 if (platform->virtual_dev)
1447 return vgpu_probe(dev); 1438 return vgpu_probe(dev);
1448#endif
1449 1439
1450 gk20a = kzalloc(sizeof(struct gk20a), GFP_KERNEL); 1440 gk20a = kzalloc(sizeof(struct gk20a), GFP_KERNEL);
1451 if (!gk20a) { 1441 if (!gk20a) {
@@ -1590,15 +1580,12 @@ static int gk20a_probe(struct platform_device *dev)
1590static int __exit gk20a_remove(struct platform_device *dev) 1580static int __exit gk20a_remove(struct platform_device *dev)
1591{ 1581{
1592 struct gk20a *g = get_gk20a(dev); 1582 struct gk20a *g = get_gk20a(dev);
1593#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION
1594 struct gk20a_platform *platform = gk20a_get_platform(dev); 1583 struct gk20a_platform *platform = gk20a_get_platform(dev);
1595#endif 1584
1596 gk20a_dbg_fn(""); 1585 gk20a_dbg_fn("");
1597 1586
1598#ifdef CONFIG_TEGRA_GR_VIRTUALIZATION
1599 if (platform->virtual_dev) 1587 if (platform->virtual_dev)
1600 return vgpu_remove(dev); 1588 return vgpu_remove(dev);
1601#endif
1602 1589
1603#ifdef CONFIG_INPUT_CFBOOST 1590#ifdef CONFIG_INPUT_CFBOOST
1604 if (g->boost_added) 1591 if (g->boost_added)