summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2015-05-18 16:37:54 -0400
committerTerje Bergstrom <tbergstrom@nvidia.com>2015-06-06 10:24:11 -0400
commit0dc66952e4df80b45c77bdbb31ce2a32f216328f (patch)
treed15940a8c50ebdb30886bcdc64155270fc0828bc /drivers/gpu/nvgpu/gk20a/channel_gk20a.c
parentd5fd0689c23683c161128cf9b51077d3b8c1c2bc (diff)
gpu: nvgpu: Use vmalloc only when size >4K
When allocation size is 4k or below, we should use kmalloc. vmalloc should be used only for larged allocations. Introduce nvgpu_alloc, which checks the size, and decides the API to use. Change-Id: I593110467cd319851b27e57d1bfe8d228d3f2909 Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/743974 (cherry picked from commit 7f56aa1f0ecafbfde7286353b60e25e494674d26) Reviewed-on: http://git-master/r/753276 Reviewed-by: Automatic_Commit_Validation_User
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
index 643adca5..c12f196d 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
@@ -2155,7 +2155,7 @@ static int gk20a_ioctl_channel_submit_gpfifo(
2155 * synchronization; we might still wait and do an increment */ 2155 * synchronization; we might still wait and do an increment */
2156 size = args->num_entries * sizeof(struct nvgpu_gpfifo); 2156 size = args->num_entries * sizeof(struct nvgpu_gpfifo);
2157 if (size) { 2157 if (size) {
2158 gpfifo = vmalloc(size); 2158 gpfifo = nvgpu_alloc(size, false);
2159 if (!gpfifo) 2159 if (!gpfifo)
2160 return -ENOMEM; 2160 return -ENOMEM;
2161 2161
@@ -2190,7 +2190,7 @@ static int gk20a_ioctl_channel_submit_gpfifo(
2190 gk20a_fence_put(fence_out); 2190 gk20a_fence_put(fence_out);
2191 2191
2192clean_up: 2192clean_up:
2193 vfree(gpfifo); 2193 nvgpu_free(gpfifo);
2194 return ret; 2194 return ret;
2195} 2195}
2196 2196