From 15860d77a496772b06266f278476e339b82815e9 Mon Sep 17 00:00:00 2001 From: Seshendra Gadagottu Date: Thu, 29 May 2014 17:21:27 -0700 Subject: gpu: nvgpu: fix compilation issues with PM disable Fix gpu driver compilation issues with power mangement and runtime power management disable. Change-Id: I8e1873871d6f184013b2142dd0cbc32c67774177 Signed-off-by: Seshendra Gadagottu Reviewed-on: http://git-master/r/417925 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/Makefile | 1 + drivers/gpu/nvgpu/gk20a/gk20a.c | 7 +++++++ drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c | 6 ++++++ 3 files changed, 14 insertions(+) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/gk20a/Makefile b/drivers/gpu/nvgpu/gk20a/Makefile index 341f8418..a0fc9f60 100644 --- a/drivers/gpu/nvgpu/gk20a/Makefile +++ b/drivers/gpu/nvgpu/gk20a/Makefile @@ -1,5 +1,6 @@ GCOV_PROFILE := y ccflags-y += -Idrivers/gpu/nvgpu +ccflags-y += -Idrivers/video/tegra/host ccflags-y += -Idrivers/devfreq ccflags-y += -Wno-multichar ccflags-y += -Werror diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index f9b28156..b7872e73 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -56,6 +56,7 @@ #include "gk20a_scale.h" #include "dbg_gpu_gk20a.h" #include "hal.h" +#include "nvhost_acm.h" #define CREATE_TRACE_POINTS #include @@ -1229,8 +1230,10 @@ static int gk20a_pm_suspend(struct device *dev) struct gk20a_platform *platform = dev_get_drvdata(dev); int ret = 0; +#ifdef CONFIG_PM_RUNTIME if (atomic_read(&dev->power.usage_count) > 1) return -EBUSY; +#endif ret = gk20a_pm_prepare_poweroff(dev); if (ret) @@ -1256,8 +1259,10 @@ static int gk20a_pm_initialise_domain(struct platform_device *pdev) domain->name = "gpu"; +#ifdef CONFIG_PM_RUNTIME if (!platform->can_railgate) pm_domain_gov = &pm_domain_always_on_gov; +#endif pm_genpd_init(domain, pm_domain_gov, true); @@ -1606,6 +1611,7 @@ void gk20a_reset(struct gk20a *g, u32 units) gk20a_enable(g, units); } +#ifdef CONFIG_PM_RUNTIME /** * gk20a_do_idle() - force the GPU to idle and railgate * @@ -1689,6 +1695,7 @@ int gk20a_do_unidle(void) return 0; } +#endif int gk20a_init_gpu_characteristics(struct gk20a *g) { diff --git a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c index a9e7274e..eb0aa5d1 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c @@ -332,6 +332,7 @@ static ssize_t elpg_enable_read(struct device *device, static DEVICE_ATTR(elpg_enable, ROOTRW, elpg_enable_read, elpg_enable_store); +#ifdef CONFIG_PM_RUNTIME static ssize_t force_idle_store(struct device *device, struct device_attribute *attr, const char *buf, size_t count) { @@ -380,6 +381,7 @@ static ssize_t force_idle_read(struct device *device, } static DEVICE_ATTR(force_idle, ROOTRW, force_idle_read, force_idle_store); +#endif void gk20a_remove_sysfs(struct device *dev) { @@ -395,7 +397,9 @@ void gk20a_remove_sysfs(struct device *dev) device_remove_file(dev, &dev_attr_load); device_remove_file(dev, &dev_attr_railgate_delay); device_remove_file(dev, &dev_attr_clockgate_delay); +#ifdef CONFIG_PM_RUNTIME device_remove_file(dev, &dev_attr_force_idle); +#endif if (g->host1x_dev && (dev->parent != &g->host1x_dev->dev)) sysfs_remove_link(&dev->kobj, dev_name(dev)); @@ -416,7 +420,9 @@ void gk20a_create_sysfs(struct platform_device *dev) error |= device_create_file(&dev->dev, &dev_attr_load); error |= device_create_file(&dev->dev, &dev_attr_railgate_delay); error |= device_create_file(&dev->dev, &dev_attr_clockgate_delay); +#ifdef CONFIG_PM_RUNTIME error |= device_create_file(&dev->dev, &dev_attr_force_idle); +#endif if (g->host1x_dev && (dev->dev.parent != &g->host1x_dev->dev)) error |= sysfs_create_link(&g->host1x_dev->dev.kobj, -- cgit v1.2.2