From ca2c4995278f42835d4667cc486172e38e0186d6 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Mon, 7 Nov 2016 14:49:16 -0800 Subject: 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 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 Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.h') 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; #include #include #include +#include #include "../../../arch/arm/mach-tegra/iomap.h" @@ -784,6 +785,8 @@ struct gk20a { struct device *dev; struct platform_device *host1x_dev; + atomic_t usage_count; + int driver_is_dying; struct resource *reg_mem; void __iomem *regs; @@ -1238,6 +1241,9 @@ int gk20a_do_unidle(void); int __gk20a_do_idle(struct device *dev, bool force_reset); int __gk20a_do_unidle(struct device *dev); +void gk20a_driver_start_unload(struct gk20a *g); +int gk20a_wait_for_idle(struct device *dev); + #define NVGPU_GPU_ARCHITECTURE_SHIFT 4 /* constructs unique and compact GPUID from nvgpu_gpu_characteristics -- cgit v1.2.2