summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeshendra Gadagottu <sgadagottu@nvidia.com>2014-05-29 20:21:27 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:10:10 -0400
commit15860d77a496772b06266f278476e339b82815e9 (patch)
tree6025bb77ff5572d90b8aa9cc155f4ae5e374c12f
parentf575bc667649ff1a09aac8ecbe626fde8ea5f2f4 (diff)
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 <sgadagottu@nvidia.com> Reviewed-on: http://git-master/r/417925 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/gk20a/Makefile1
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c7
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c6
3 files changed, 14 insertions, 0 deletions
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 @@
1GCOV_PROFILE := y 1GCOV_PROFILE := y
2ccflags-y += -Idrivers/gpu/nvgpu 2ccflags-y += -Idrivers/gpu/nvgpu
3ccflags-y += -Idrivers/video/tegra/host
3ccflags-y += -Idrivers/devfreq 4ccflags-y += -Idrivers/devfreq
4ccflags-y += -Wno-multichar 5ccflags-y += -Wno-multichar
5ccflags-y += -Werror 6ccflags-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 @@
56#include "gk20a_scale.h" 56#include "gk20a_scale.h"
57#include "dbg_gpu_gk20a.h" 57#include "dbg_gpu_gk20a.h"
58#include "hal.h" 58#include "hal.h"
59#include "nvhost_acm.h"
59 60
60#define CREATE_TRACE_POINTS 61#define CREATE_TRACE_POINTS
61#include <trace/events/gk20a.h> 62#include <trace/events/gk20a.h>
@@ -1229,8 +1230,10 @@ static int gk20a_pm_suspend(struct device *dev)
1229 struct gk20a_platform *platform = dev_get_drvdata(dev); 1230 struct gk20a_platform *platform = dev_get_drvdata(dev);
1230 int ret = 0; 1231 int ret = 0;
1231 1232
1233#ifdef CONFIG_PM_RUNTIME
1232 if (atomic_read(&dev->power.usage_count) > 1) 1234 if (atomic_read(&dev->power.usage_count) > 1)
1233 return -EBUSY; 1235 return -EBUSY;
1236#endif
1234 1237
1235 ret = gk20a_pm_prepare_poweroff(dev); 1238 ret = gk20a_pm_prepare_poweroff(dev);
1236 if (ret) 1239 if (ret)
@@ -1256,8 +1259,10 @@ static int gk20a_pm_initialise_domain(struct platform_device *pdev)
1256 1259
1257 domain->name = "gpu"; 1260 domain->name = "gpu";
1258 1261
1262#ifdef CONFIG_PM_RUNTIME
1259 if (!platform->can_railgate) 1263 if (!platform->can_railgate)
1260 pm_domain_gov = &pm_domain_always_on_gov; 1264 pm_domain_gov = &pm_domain_always_on_gov;
1265#endif
1261 1266
1262 pm_genpd_init(domain, pm_domain_gov, true); 1267 pm_genpd_init(domain, pm_domain_gov, true);
1263 1268
@@ -1606,6 +1611,7 @@ void gk20a_reset(struct gk20a *g, u32 units)
1606 gk20a_enable(g, units); 1611 gk20a_enable(g, units);
1607} 1612}
1608 1613
1614#ifdef CONFIG_PM_RUNTIME
1609/** 1615/**
1610 * gk20a_do_idle() - force the GPU to idle and railgate 1616 * gk20a_do_idle() - force the GPU to idle and railgate
1611 * 1617 *
@@ -1689,6 +1695,7 @@ int gk20a_do_unidle(void)
1689 1695
1690 return 0; 1696 return 0;
1691} 1697}
1698#endif
1692 1699
1693int gk20a_init_gpu_characteristics(struct gk20a *g) 1700int gk20a_init_gpu_characteristics(struct gk20a *g)
1694{ 1701{
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,
332 332
333static DEVICE_ATTR(elpg_enable, ROOTRW, elpg_enable_read, elpg_enable_store); 333static DEVICE_ATTR(elpg_enable, ROOTRW, elpg_enable_read, elpg_enable_store);
334 334
335#ifdef CONFIG_PM_RUNTIME
335static ssize_t force_idle_store(struct device *device, 336static ssize_t force_idle_store(struct device *device,
336 struct device_attribute *attr, const char *buf, size_t count) 337 struct device_attribute *attr, const char *buf, size_t count)
337{ 338{
@@ -380,6 +381,7 @@ static ssize_t force_idle_read(struct device *device,
380} 381}
381 382
382static DEVICE_ATTR(force_idle, ROOTRW, force_idle_read, force_idle_store); 383static DEVICE_ATTR(force_idle, ROOTRW, force_idle_read, force_idle_store);
384#endif
383 385
384void gk20a_remove_sysfs(struct device *dev) 386void gk20a_remove_sysfs(struct device *dev)
385{ 387{
@@ -395,7 +397,9 @@ void gk20a_remove_sysfs(struct device *dev)
395 device_remove_file(dev, &dev_attr_load); 397 device_remove_file(dev, &dev_attr_load);
396 device_remove_file(dev, &dev_attr_railgate_delay); 398 device_remove_file(dev, &dev_attr_railgate_delay);
397 device_remove_file(dev, &dev_attr_clockgate_delay); 399 device_remove_file(dev, &dev_attr_clockgate_delay);
400#ifdef CONFIG_PM_RUNTIME
398 device_remove_file(dev, &dev_attr_force_idle); 401 device_remove_file(dev, &dev_attr_force_idle);
402#endif
399 403
400 if (g->host1x_dev && (dev->parent != &g->host1x_dev->dev)) 404 if (g->host1x_dev && (dev->parent != &g->host1x_dev->dev))
401 sysfs_remove_link(&dev->kobj, dev_name(dev)); 405 sysfs_remove_link(&dev->kobj, dev_name(dev));
@@ -416,7 +420,9 @@ void gk20a_create_sysfs(struct platform_device *dev)
416 error |= device_create_file(&dev->dev, &dev_attr_load); 420 error |= device_create_file(&dev->dev, &dev_attr_load);
417 error |= device_create_file(&dev->dev, &dev_attr_railgate_delay); 421 error |= device_create_file(&dev->dev, &dev_attr_railgate_delay);
418 error |= device_create_file(&dev->dev, &dev_attr_clockgate_delay); 422 error |= device_create_file(&dev->dev, &dev_attr_clockgate_delay);
423#ifdef CONFIG_PM_RUNTIME
419 error |= device_create_file(&dev->dev, &dev_attr_force_idle); 424 error |= device_create_file(&dev->dev, &dev_attr_force_idle);
425#endif
420 426
421 if (g->host1x_dev && (dev->dev.parent != &g->host1x_dev->dev)) 427 if (g->host1x_dev && (dev->dev.parent != &g->host1x_dev->dev))
422 error |= sysfs_create_link(&g->host1x_dev->dev.kobj, 428 error |= sysfs_create_link(&g->host1x_dev->dev.kobj,