diff options
author | Alex Waterman <alexw@nvidia.com> | 2017-03-08 20:08:50 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-03-30 15:36:09 -0400 |
commit | 24e1c7e0a729158be36d63b821550d206a8a0436 (patch) | |
tree | cf26c850cc63957f63f3e8f97914268839d8e0de /drivers/gpu/nvgpu/tegra/linux | |
parent | 7010bf88399ea81b2b35844f738baac19dc5a441 (diff) |
gpu: nvgpu: Use new kmem API functions (misc)
Use the new kmem API functions in misc gk20a code. Some additional
modifications were also made:
o Add a struct gk20a pointer to gk20a_fence to enable proper
kmem free usage.
o Add gk20a pointer to alloc_session() in dbg_gpu_gk20a.c to
use kmem API for allocating a session.
o Plumb a gk20a pointer through the fence creation and deletion.
o Use statically allocated buffers for names in file creation.
Bug 1799159
Bug 1823380
Change-Id: I3678080e3ffa1f9bcf6934e3f4819a1bc531689b
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: http://git-master/r/1318323
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/tegra/linux')
-rw-r--r-- | drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c index d051c0e3..5b2958ec 100644 --- a/drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c | |||
@@ -47,6 +47,8 @@ | |||
47 | 47 | ||
48 | #include <linux/platform/tegra/tegra_emc.h> | 48 | #include <linux/platform/tegra/tegra_emc.h> |
49 | 49 | ||
50 | #include <nvgpu/kmem.h> | ||
51 | |||
50 | #include "gk20a/gk20a.h" | 52 | #include "gk20a/gk20a.h" |
51 | #include "gk20a/hal_gk20a.h" | 53 | #include "gk20a/hal_gk20a.h" |
52 | #include "gk20a/platform_gk20a.h" | 54 | #include "gk20a/platform_gk20a.h" |
@@ -162,7 +164,7 @@ int gk20a_tegra_secure_alloc(struct device *dev, | |||
162 | if (dma_mapping_error(&tegra_vpr_dev, iova)) | 164 | if (dma_mapping_error(&tegra_vpr_dev, iova)) |
163 | return -ENOMEM; | 165 | return -ENOMEM; |
164 | 166 | ||
165 | sgt = kzalloc(sizeof(*sgt), GFP_KERNEL); | 167 | sgt = nvgpu_kzalloc(platform->g, sizeof(*sgt)); |
166 | if (!sgt) { | 168 | if (!sgt) { |
167 | gk20a_err(dev, "failed to allocate memory\n"); | 169 | gk20a_err(dev, "failed to allocate memory\n"); |
168 | goto fail; | 170 | goto fail; |
@@ -186,7 +188,7 @@ int gk20a_tegra_secure_alloc(struct device *dev, | |||
186 | return err; | 188 | return err; |
187 | 189 | ||
188 | fail_sgt: | 190 | fail_sgt: |
189 | kfree(sgt); | 191 | nvgpu_kfree(platform->g, sgt); |
190 | fail: | 192 | fail: |
191 | dma_free_attrs(&tegra_vpr_dev, desc->mem.size, | 193 | dma_free_attrs(&tegra_vpr_dev, desc->mem.size, |
192 | (void *)(uintptr_t)iova, iova, __DMA_ATTR(attrs)); | 194 | (void *)(uintptr_t)iova, iova, __DMA_ATTR(attrs)); |
@@ -809,7 +811,7 @@ static void gk20a_tegra_scale_init(struct device *dev) | |||
809 | if (!profile) | 811 | if (!profile) |
810 | return; | 812 | return; |
811 | 813 | ||
812 | emc_params = kzalloc(sizeof(*emc_params), GFP_KERNEL); | 814 | emc_params = nvgpu_kzalloc(platform->g, sizeof(*emc_params)); |
813 | if (!emc_params) | 815 | if (!emc_params) |
814 | return; | 816 | return; |
815 | 817 | ||
@@ -841,7 +843,7 @@ static void gk20a_tegra_scale_exit(struct device *dev) | |||
841 | tegra_bwmgr_unregister(emc_params->bwmgr_cl); | 843 | tegra_bwmgr_unregister(emc_params->bwmgr_cl); |
842 | #endif | 844 | #endif |
843 | 845 | ||
844 | kfree(profile->private_data); | 846 | nvgpu_kfree(platform->g, profile->private_data); |
845 | } | 847 | } |
846 | 848 | ||
847 | void gk20a_tegra_debug_dump(struct device *dev) | 849 | void gk20a_tegra_debug_dump(struct device *dev) |