diff options
author | Alex Waterman <alexw@nvidia.com> | 2016-11-07 17:49:16 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2016-12-19 18:39:52 -0500 |
commit | ca2c4995278f42835d4667cc486172e38e0186d6 (patch) | |
tree | d4af243b0f567d7d4c01c3a721cd0acbe5358815 /drivers/gpu/nvgpu/gk20a/gk20a.h | |
parent | c1750f45f5239508e7a67db0627552f87943ec9f (diff) |
gpu: nvgpu: Add busy/idle ref counting
Add reference counting for gk20a_busy() and gk20a_idle() so that
the driver can keep track of whether the driver is active.
Bug 1816516
Bug 1807277
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1250019
(cherry picked from commit 7f558019735bb34cf00dd1ec17df1797501cff60)
Change-Id: I64c2ff1719673912ae127707e58ee557966c4d4d
Reviewed-on: http://git-master/r/1261922
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index f492801e..144cb37d 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -34,6 +34,7 @@ struct acr_desc; | |||
34 | #include <linux/irqreturn.h> | 34 | #include <linux/irqreturn.h> |
35 | #include <linux/tegra-soc.h> | 35 | #include <linux/tegra-soc.h> |
36 | #include <linux/version.h> | 36 | #include <linux/version.h> |
37 | #include <linux/atomic.h> | ||
37 | 38 | ||
38 | #include "../../../arch/arm/mach-tegra/iomap.h" | 39 | #include "../../../arch/arm/mach-tegra/iomap.h" |
39 | 40 | ||
@@ -784,6 +785,8 @@ struct gk20a { | |||
784 | struct device *dev; | 785 | struct device *dev; |
785 | struct platform_device *host1x_dev; | 786 | struct platform_device *host1x_dev; |
786 | 787 | ||
788 | atomic_t usage_count; | ||
789 | int driver_is_dying; | ||
787 | 790 | ||
788 | struct resource *reg_mem; | 791 | struct resource *reg_mem; |
789 | void __iomem *regs; | 792 | void __iomem *regs; |
@@ -1238,6 +1241,9 @@ int gk20a_do_unidle(void); | |||
1238 | int __gk20a_do_idle(struct device *dev, bool force_reset); | 1241 | int __gk20a_do_idle(struct device *dev, bool force_reset); |
1239 | int __gk20a_do_unidle(struct device *dev); | 1242 | int __gk20a_do_unidle(struct device *dev); |
1240 | 1243 | ||
1244 | void gk20a_driver_start_unload(struct gk20a *g); | ||
1245 | int gk20a_wait_for_idle(struct device *dev); | ||
1246 | |||
1241 | #define NVGPU_GPU_ARCHITECTURE_SHIFT 4 | 1247 | #define NVGPU_GPU_ARCHITECTURE_SHIFT 4 |
1242 | 1248 | ||
1243 | /* constructs unique and compact GPUID from nvgpu_gpu_characteristics | 1249 | /* constructs unique and compact GPUID from nvgpu_gpu_characteristics |