mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 09:12:24 +03:00
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>
This commit is contained in:
committed by
Dan Willemsen
parent
f575bc6676
commit
15860d77a4
@@ -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
|
||||
|
||||
@@ -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 <trace/events/gk20a.h>
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user