diff options
author | seshendra Gadagottu <sgadagottu@nvidia.com> | 2017-07-06 01:47:20 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-10-13 18:19:16 -0400 |
commit | a9ce91f910ca730a3abadb9e7491e3504af30d86 (patch) | |
tree | d79e70c782672e6d6281db57a1053e515ee7914a /drivers/gpu/nvgpu/common/linux | |
parent | 017a9f57756f120cb492fc6c66d8588a2c1626d8 (diff) |
gpu: nvgpu: add syncpoint read map
For sync-point read map:
1. Added nvgpu_mem memory allocator in gk20a struct and
allocated memory for this in gk20a_finalize_poweron()
and freed this memory in gk20a_remove().
2. Added "u64 syncpt_ro_map_gpu_va" in vm_gk20a struct
for read map in vm.
Added nvgpu_quiesce() in nvgpu_remove() before freeing
syncpoint read map to ensure that nvgpu is idle.
JIRA GPUT19X-2
Change-Id: I7cbfec57f0992682dd833a1b0d92d694bcaf1eb3
Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1514338
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux')
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/module.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/module.c b/drivers/gpu/nvgpu/common/linux/module.c index ac64041e..52f987b2 100644 --- a/drivers/gpu/nvgpu/common/linux/module.c +++ b/drivers/gpu/nvgpu/common/linux/module.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/reset.h> | 25 | #include <linux/reset.h> |
26 | #include <linux/platform/tegra/common.h> | 26 | #include <linux/platform/tegra/common.h> |
27 | 27 | ||
28 | #include <nvgpu/dma.h> | ||
28 | #include <nvgpu/kmem.h> | 29 | #include <nvgpu/kmem.h> |
29 | #include <nvgpu/nvgpu_common.h> | 30 | #include <nvgpu/nvgpu_common.h> |
30 | #include <nvgpu/soc.h> | 31 | #include <nvgpu/soc.h> |
@@ -1026,9 +1027,16 @@ int nvgpu_remove(struct device *dev, struct class *class) | |||
1026 | struct gk20a *g = get_gk20a(dev); | 1027 | struct gk20a *g = get_gk20a(dev); |
1027 | struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); | 1028 | struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); |
1028 | struct gk20a_platform *platform = gk20a_get_platform(dev); | 1029 | struct gk20a_platform *platform = gk20a_get_platform(dev); |
1030 | int err; | ||
1029 | 1031 | ||
1030 | gk20a_dbg_fn(""); | 1032 | gk20a_dbg_fn(""); |
1031 | 1033 | ||
1034 | err = nvgpu_quiesce(g); | ||
1035 | WARN(err, "gpu failed to idle during driver removal"); | ||
1036 | |||
1037 | if (nvgpu_mem_is_valid(&g->syncpt_mem)) | ||
1038 | nvgpu_dma_free(g, &g->syncpt_mem); | ||
1039 | |||
1032 | if (platform->has_cde) | 1040 | if (platform->has_cde) |
1033 | gk20a_cde_destroy(l); | 1041 | gk20a_cde_destroy(l); |
1034 | 1042 | ||
@@ -1061,7 +1069,7 @@ int nvgpu_remove(struct device *dev, struct class *class) | |||
1061 | 1069 | ||
1062 | gk20a_dbg_fn("removed"); | 1070 | gk20a_dbg_fn("removed"); |
1063 | 1071 | ||
1064 | return 0; | 1072 | return err; |
1065 | } | 1073 | } |
1066 | 1074 | ||
1067 | static int __exit gk20a_remove(struct platform_device *pdev) | 1075 | static int __exit gk20a_remove(struct platform_device *pdev) |