diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/cde_gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/cde_gk20a.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c index 5b8ee642..02636206 100644 --- a/drivers/gpu/nvgpu/gk20a/cde_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/cde_gk20a.c | |||
@@ -26,6 +26,7 @@ | |||
26 | 26 | ||
27 | #include <nvgpu/timers.h> | 27 | #include <nvgpu/timers.h> |
28 | #include <nvgpu/nvgpu_common.h> | 28 | #include <nvgpu/nvgpu_common.h> |
29 | #include <nvgpu/kmem.h> | ||
29 | 30 | ||
30 | #include "gk20a.h" | 31 | #include "gk20a.h" |
31 | #include "channel_gk20a.h" | 32 | #include "channel_gk20a.h" |
@@ -55,7 +56,7 @@ static void gk20a_deinit_cde_img(struct gk20a_cde_ctx *cde_ctx) | |||
55 | gk20a_gmmu_unmap_free(cde_ctx->vm, mem); | 56 | gk20a_gmmu_unmap_free(cde_ctx->vm, mem); |
56 | } | 57 | } |
57 | 58 | ||
58 | kfree(cde_ctx->init_convert_cmd); | 59 | nvgpu_kfree(cde_ctx->g, cde_ctx->init_convert_cmd); |
59 | 60 | ||
60 | cde_ctx->convert_cmd = NULL; | 61 | cde_ctx->convert_cmd = NULL; |
61 | cde_ctx->init_convert_cmd = NULL; | 62 | cde_ctx->init_convert_cmd = NULL; |
@@ -86,7 +87,7 @@ __must_hold(&cde_app->mutex) | |||
86 | /* housekeeping on app */ | 87 | /* housekeeping on app */ |
87 | list_del(&cde_ctx->list); | 88 | list_del(&cde_ctx->list); |
88 | cde_ctx->g->cde_app.ctx_count--; | 89 | cde_ctx->g->cde_app.ctx_count--; |
89 | kfree(cde_ctx); | 90 | nvgpu_kfree(g, cde_ctx); |
90 | } | 91 | } |
91 | 92 | ||
92 | static void gk20a_cde_cancel_deleter(struct gk20a_cde_ctx *cde_ctx, | 93 | static void gk20a_cde_cancel_deleter(struct gk20a_cde_ctx *cde_ctx, |
@@ -535,8 +536,8 @@ static int gk20a_init_cde_command(struct gk20a_cde_ctx *cde_ctx, | |||
535 | } | 536 | } |
536 | 537 | ||
537 | /* allocate gpfifo entries to be pushed */ | 538 | /* allocate gpfifo entries to be pushed */ |
538 | *gpfifo = kzalloc(sizeof(struct nvgpu_gpfifo) * num_elems, | 539 | *gpfifo = nvgpu_kzalloc(cde_ctx->g, |
539 | GFP_KERNEL); | 540 | sizeof(struct nvgpu_gpfifo) * num_elems); |
540 | if (!*gpfifo) { | 541 | if (!*gpfifo) { |
541 | gk20a_warn(cde_ctx->dev, "cde: could not allocate memory for gpfifo entries"); | 542 | gk20a_warn(cde_ctx->dev, "cde: could not allocate memory for gpfifo entries"); |
542 | return -ENOMEM; | 543 | return -ENOMEM; |
@@ -588,7 +589,7 @@ static int gk20a_cde_pack_cmdbufs(struct gk20a_cde_ctx *cde_ctx) | |||
588 | struct nvgpu_gpfifo *combined_cmd; | 589 | struct nvgpu_gpfifo *combined_cmd; |
589 | 590 | ||
590 | /* allocate buffer that has space for both */ | 591 | /* allocate buffer that has space for both */ |
591 | combined_cmd = kzalloc(total_bytes, GFP_KERNEL); | 592 | combined_cmd = nvgpu_kzalloc(cde_ctx->g, total_bytes); |
592 | if (!combined_cmd) { | 593 | if (!combined_cmd) { |
593 | gk20a_warn(cde_ctx->dev, | 594 | gk20a_warn(cde_ctx->dev, |
594 | "cde: could not allocate memory for gpfifo entries"); | 595 | "cde: could not allocate memory for gpfifo entries"); |
@@ -600,8 +601,8 @@ static int gk20a_cde_pack_cmdbufs(struct gk20a_cde_ctx *cde_ctx) | |||
600 | memcpy(combined_cmd + cde_ctx->init_cmd_num_entries, | 601 | memcpy(combined_cmd + cde_ctx->init_cmd_num_entries, |
601 | cde_ctx->convert_cmd, conv_bytes); | 602 | cde_ctx->convert_cmd, conv_bytes); |
602 | 603 | ||
603 | kfree(cde_ctx->init_convert_cmd); | 604 | nvgpu_kfree(cde_ctx->g, cde_ctx->init_convert_cmd); |
604 | kfree(cde_ctx->convert_cmd); | 605 | nvgpu_kfree(cde_ctx->g, cde_ctx->convert_cmd); |
605 | 606 | ||
606 | cde_ctx->init_convert_cmd = combined_cmd; | 607 | cde_ctx->init_convert_cmd = combined_cmd; |
607 | cde_ctx->convert_cmd = combined_cmd | 608 | cde_ctx->convert_cmd = combined_cmd |
@@ -893,7 +894,7 @@ static struct gk20a_cde_ctx *gk20a_cde_allocate_context(struct gk20a *g) | |||
893 | struct gk20a_cde_ctx *cde_ctx; | 894 | struct gk20a_cde_ctx *cde_ctx; |
894 | int ret; | 895 | int ret; |
895 | 896 | ||
896 | cde_ctx = kzalloc(sizeof(*cde_ctx), GFP_KERNEL); | 897 | cde_ctx = nvgpu_kzalloc(g, sizeof(*cde_ctx)); |
897 | if (!cde_ctx) | 898 | if (!cde_ctx) |
898 | return ERR_PTR(-ENOMEM); | 899 | return ERR_PTR(-ENOMEM); |
899 | 900 | ||
@@ -902,7 +903,7 @@ static struct gk20a_cde_ctx *gk20a_cde_allocate_context(struct gk20a *g) | |||
902 | 903 | ||
903 | ret = gk20a_cde_load(cde_ctx); | 904 | ret = gk20a_cde_load(cde_ctx); |
904 | if (ret) { | 905 | if (ret) { |
905 | kfree(cde_ctx); | 906 | nvgpu_kfree(g, cde_ctx); |
906 | return ERR_PTR(ret); | 907 | return ERR_PTR(ret); |
907 | } | 908 | } |
908 | 909 | ||