From 24e1c7e0a729158be36d63b821550d206a8a0436 Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Wed, 8 Mar 2017 17:08:50 -0800 Subject: 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 Reviewed-on: http://git-master/r/1318323 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/tegra') 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 @@ #include +#include + #include "gk20a/gk20a.h" #include "gk20a/hal_gk20a.h" #include "gk20a/platform_gk20a.h" @@ -162,7 +164,7 @@ int gk20a_tegra_secure_alloc(struct device *dev, if (dma_mapping_error(&tegra_vpr_dev, iova)) return -ENOMEM; - sgt = kzalloc(sizeof(*sgt), GFP_KERNEL); + sgt = nvgpu_kzalloc(platform->g, sizeof(*sgt)); if (!sgt) { gk20a_err(dev, "failed to allocate memory\n"); goto fail; @@ -186,7 +188,7 @@ int gk20a_tegra_secure_alloc(struct device *dev, return err; fail_sgt: - kfree(sgt); + nvgpu_kfree(platform->g, sgt); fail: dma_free_attrs(&tegra_vpr_dev, desc->mem.size, (void *)(uintptr_t)iova, iova, __DMA_ATTR(attrs)); @@ -809,7 +811,7 @@ static void gk20a_tegra_scale_init(struct device *dev) if (!profile) return; - emc_params = kzalloc(sizeof(*emc_params), GFP_KERNEL); + emc_params = nvgpu_kzalloc(platform->g, sizeof(*emc_params)); if (!emc_params) return; @@ -841,7 +843,7 @@ static void gk20a_tegra_scale_exit(struct device *dev) tegra_bwmgr_unregister(emc_params->bwmgr_cl); #endif - kfree(profile->private_data); + nvgpu_kfree(platform->g, profile->private_data); } void gk20a_tegra_debug_dump(struct device *dev) -- cgit v1.2.2