summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/nvgpu_common.c
diff options
context:
space:
mode:
authorAlex Waterman <alexw@nvidia.com>2017-03-08 19:51:33 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-03-26 12:55:10 -0400
commitc11228d48be1825e1ec84afd38c6938504fa4100 (patch)
treeea8bb9c874ba14b7c06a4de11d6619f88e2a4104 /drivers/gpu/nvgpu/common/nvgpu_common.c
parente0f2afe5eb43fb32490ccabd504879c3e3e54623 (diff)
gpu: nvgpu: Use new kmem API functions (common/*)
Use the new kmem API functions in common/* and common/mm/*. Add a struct gk20a pointer to struct nvgpu_allocator in order to store the gk20a pointer used for allocating memory. Bug 1799159 Bug 1823380 Change-Id: I881ea9545e8a8f0b75d77a1e35dd1812e0bb654e Signed-off-by: Alex Waterman <alexw@nvidia.com> Reviewed-on: http://git-master/r/1318315 Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/nvgpu_common.c')
-rw-r--r--drivers/gpu/nvgpu/common/nvgpu_common.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/common/nvgpu_common.c b/drivers/gpu/nvgpu/common/nvgpu_common.c
index d7ff4841..771d4121 100644
--- a/drivers/gpu/nvgpu/common/nvgpu_common.c
+++ b/drivers/gpu/nvgpu/common/nvgpu_common.c
@@ -17,11 +17,12 @@
17#include <linux/dma-mapping.h> 17#include <linux/dma-mapping.h>
18#include <linux/firmware.h> 18#include <linux/firmware.h>
19 19
20#include <nvgpu/kmem.h>
21#include <nvgpu/nvgpu_common.h>
22
20#include "gk20a/gk20a_scale.h" 23#include "gk20a/gk20a_scale.h"
21#include "gk20a/gk20a.h" 24#include "gk20a/gk20a.h"
22 25
23#include <nvgpu/nvgpu_common.h>
24
25#define EMC3D_DEFAULT_RATIO 750 26#define EMC3D_DEFAULT_RATIO 750
26 27
27static void nvgpu_init_vars(struct gk20a *g) 28static void nvgpu_init_vars(struct gk20a *g)
@@ -164,7 +165,7 @@ int nvgpu_probe(struct gk20a *g,
164 gk20a_create_sysfs(g->dev); 165 gk20a_create_sysfs(g->dev);
165 gk20a_debug_init(g->dev, debugfs_symlink); 166 gk20a_debug_init(g->dev, debugfs_symlink);
166 167
167 g->dbg_regops_tmp_buf = kzalloc(SZ_4K, GFP_KERNEL); 168 g->dbg_regops_tmp_buf = nvgpu_kzalloc(g, SZ_4K);
168 if (!g->dbg_regops_tmp_buf) { 169 if (!g->dbg_regops_tmp_buf) {
169 dev_err(g->dev, "couldn't allocate regops tmp buf"); 170 dev_err(g->dev, "couldn't allocate regops tmp buf");
170 return -ENOMEM; 171 return -ENOMEM;
@@ -190,7 +191,8 @@ static const struct firmware *do_request_firmware(struct device *dev,
190 path_len = strlen(prefix) + strlen(fw_name); 191 path_len = strlen(prefix) + strlen(fw_name);
191 path_len += 2; /* for the path separator and zero terminator*/ 192 path_len += 2; /* for the path separator and zero terminator*/
192 193
193 fw_path = kzalloc(sizeof(*fw_path) * path_len, GFP_KERNEL); 194 fw_path = nvgpu_kzalloc(get_gk20a(dev),
195 sizeof(*fw_path) * path_len);
194 if (!fw_path) 196 if (!fw_path)
195 return NULL; 197 return NULL;
196 198
@@ -207,7 +209,7 @@ static const struct firmware *do_request_firmware(struct device *dev,
207 err = request_firmware(&fw, fw_name, dev); 209 err = request_firmware(&fw, fw_name, dev);
208#endif 210#endif
209 211
210 kfree(fw_path); 212 nvgpu_kfree(get_gk20a(dev), fw_path);
211 if (err) 213 if (err)
212 return NULL; 214 return NULL;
213 return fw; 215 return fw;