diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/Makefile | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 7 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a_sysfs.c | 6 |
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 @@ | |||
1 | GCOV_PROFILE := y | 1 | GCOV_PROFILE := y |
2 | ccflags-y += -Idrivers/gpu/nvgpu | 2 | ccflags-y += -Idrivers/gpu/nvgpu |
3 | ccflags-y += -Idrivers/video/tegra/host | ||
3 | ccflags-y += -Idrivers/devfreq | 4 | ccflags-y += -Idrivers/devfreq |
4 | ccflags-y += -Wno-multichar | 5 | ccflags-y += -Wno-multichar |
5 | ccflags-y += -Werror | 6 | 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 @@ | |||
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 | ||
1693 | int gk20a_init_gpu_characteristics(struct gk20a *g) | 1700 | int 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 | ||
333 | static DEVICE_ATTR(elpg_enable, ROOTRW, elpg_enable_read, elpg_enable_store); | 333 | static DEVICE_ATTR(elpg_enable, ROOTRW, elpg_enable_read, elpg_enable_store); |
334 | 334 | ||
335 | #ifdef CONFIG_PM_RUNTIME | ||
335 | static ssize_t force_idle_store(struct device *device, | 336 | static 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 | ||
382 | static DEVICE_ATTR(force_idle, ROOTRW, force_idle_read, force_idle_store); | 383 | static DEVICE_ATTR(force_idle, ROOTRW, force_idle_read, force_idle_store); |
384 | #endif | ||
383 | 385 | ||
384 | void gk20a_remove_sysfs(struct device *dev) | 386 | void 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, |